Changeset 1977

Show
Ignore:
Timestamp:
03/06/08 08:41:19 (9 months ago)
Author:
dsugar
Message:

Added quick fix for errors about MLS constraint failures.
visitor for edit parts

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/BaseDomain.java

    r1963 r1977  
    2424import com.tresys.framework.compiler.dictionary.NameValuePair; 
    2525import com.tresys.framework.compiler.linkage.Linkage; 
     26import com.tresys.framework.compiler.linkage.flnkage.Ability; 
    2627import com.tresys.framework.compiler.linkage.flnkage.ILinkageItem; 
    2728 
     
    4142        private String m_sRole; 
    4243 
     44        private final Map/*<String, Ability>*/abilities; 
     45 
     46         
    4347        public BaseDomain (BaseDomain i_copyMe) 
    4448        { 
     
    4953                NameValuePairs = new TreeMap/*<String, NameValuePair<?>>*/(); 
    5054                NameValuePairs.putAll(i_copyMe.NameValuePairs); 
     55 
     56                abilities = new TreeMap(); 
     57                abilities.putAll (i_copyMe.abilities); 
    5158        } 
    5259 
     
    5663                entries = new Vector/*<Enter>*/(); 
    5764                NameValuePairs = new TreeMap/*<String, NameValuePair<?>>*/(); 
     65                abilities = new TreeMap(); 
    5866        } 
    5967         
     
    215223        { 
    216224                i_visitor.Visit(this); 
     225 
     226                for (Iterator itr = abilities.values ().iterator (); itr.hasNext (); ) 
     227                { 
     228                        Ability ability = (Ability) itr.next (); 
     229                        ability.Accept (i_visitor); 
     230                } 
    217231        } 
    218232         
     233        public void Add(Ability ability)  
     234        { 
     235                abilities.put(ability.getName(), ability); 
     236        } 
     237 
     238        public void Remove(Ability i_ability)  
     239        { 
     240                abilities.remove(i_ability.getName()); 
     241        } 
     242 
     243        public boolean contains(Ability i_ability)  
     244        { 
     245                return abilities.containsKey(i_ability.getName()); 
     246        } 
     247 
     248        public Map getAbilities()  
     249        { 
     250                return abilities; 
     251        } 
     252 
    219253        public boolean Contains(Enter enter)  
    220254        { 
  • branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/IDomain.java

    r1973 r1977  
    1919import com.tresys.framework.compiler.AbstractToken; 
    2020import com.tresys.framework.compiler.linkage.Linkage; 
     21import com.tresys.framework.compiler.linkage.flnkage.Ability; 
    2122 
    2223public interface IDomain  
     
    120121         
    121122        public boolean Contains(Enter ent); 
     123         
     124        public void Add(Ability ability);  
     125 
     126        public void Remove(Ability i_ability); 
     127 
     128        public boolean contains(Ability i_ability); 
     129 
     130        public Map getAbilities(); 
     131         
     132 
    122133} 
  • branches/mls/framework-plugin/src/com/tresys/framework/compiler/translator/TranslatorSELinux.java

    r1963 r1977  
    242242                printStreamBuffer.print("type " + i_domain.getType() + ";\n"); 
    243243                m_linkage.MakeDomain (i_domain.getType (), printStreamBuffer); 
    244                  
    245                 Iterator itr = i_domain.getAbilities().values().iterator(); 
    246                 while(itr.hasNext())  
    247                 { 
    248                         Ability ability = (Ability) itr.next(); 
    249                         printStreamBuffer.print("#Framework ability: " + ability.getName() + "\n"); 
    250                         makeAllowsOnSelf(i_domain, ability.GetPermVectors(), printStreamBuffer); 
    251                         callInterfaces(i_domain, ability.getAllInterfaces().values(), printStreamBuffer); 
    252                         printStreamBuffer.print("#End of Framework ability: " + ability.getName() + "\n"); 
    253                 } 
     244 
     245                OutputAbilities (i_domain, printStreamBuffer); 
    254246         
    255247                if(i_domain.GetChildren().isEmpty())  
     
    553545                        "\t')\n" + "\n')\n"); 
    554546                 
     547                OutputAbilities (domain, printStreamBuffer); 
     548 
    555549                printStreamBuffer.flush (); 
    556550                printStreamBuffer.close (); 
     
    576570                m_linkage.MakeUserDomain (dom.getName (), printStreamBuffer); 
    577571                 
     572                OutputAbilities (dom, printStreamBuffer); 
     573 
    578574                printStreamBuffer.flush (); 
    579575                printStreamBuffer.close (); 
     
    598594        { 
    599595        } 
    600  
     596         
     597        private void OutputAbilities (IDomain i_domain, PrintStream printStreamBuffer) 
     598        { 
     599                for (Iterator itr = i_domain.getAbilities().values().iterator(); itr.hasNext(); )  
     600                { 
     601                        Ability ability = (Ability) itr.next(); 
     602                        printStreamBuffer.print("#Framework ability: " + ability.getName() + "\n"); 
     603                        makeAllowsOnSelf(i_domain, ability.GetPermVectors(), printStreamBuffer); 
     604                        callInterfaces(i_domain, ability.getAllInterfaces().values(), printStreamBuffer); 
     605                        printStreamBuffer.print("#End of Framework ability: " + ability.getName() + "\n"); 
     606                } 
     607        } 
     608         
    601609        private void callInterfaces(IDomain domain, Collection interfaces, PrintStream stream)  
    602610        { 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java

    r1974 r1977  
    2727import org.eclipse.core.runtime.CoreException; 
    2828import org.eclipse.core.runtime.IProgressMonitor; 
     29import org.eclipse.osgi.util.NLS; 
    2930 
    3031import com.tresys.framework.compiler.ErrorHandler; 
     
    6970        extends IncrementalProjectBuilder 
    7071{ 
    71         public static final String BUILDER_ID = SEFramework_Plugin.PLUGIN_ID + ".AccessCheckBuilder";    
    72  
    73         protected static final boolean DEBUG = SEFramework_Plugin.getDefault ().isDebugging ("debug/accesschecks"); 
     72        public static final String BUILDER_ID = SEFramework_Plugin.PLUGIN_ID + ".AccessCheckBuilder";    //$NON-NLS-1$ 
     73 
     74        protected static final boolean DEBUG = SEFramework_Plugin.getDefault ().isDebugging ("debug/accesschecks"); //$NON-NLS-1$ 
    7475 
    7576        /** 
     
    237238                         
    238239                        if (DEBUG) 
    239                                 System.out.println ("Access: " + i_access.toString ()); 
     240                                System.out.println ("Access: " + i_access.toString ()); //$NON-NLS-1$ 
    240241                        Map rdefs = res.GetRdefs (); 
    241242 
     
    244245                                Rdef rdef = (Rdef) itr.next (); 
    245246                                 
    246                                 String sType = res.getName () + "_" + rdef.GetName () + "_t"; 
     247                                String sType = res.getName () + "_" + rdef.GetName () + "_t"; //$NON-NLS-1$ //$NON-NLS-2$ 
    247248                                sepol_security_id_t ssid = new sepol_security_id_t (dom.getFullContext ()); 
    248249                                if (DEBUG) 
    249                                         System.out.println ("Source SID: " + ssid.toString ()); 
     250                                        System.out.println ("Source SID: " + ssid.toString ()); //$NON-NLS-1$ 
    250251 
    251252                                String sSensitivity = res.getSensitivity (); 
     
    253254                                        sSensitivity = ':' + sSensitivity;                       
    254255 
    255                                 sepol_security_id_t tsid = new sepol_security_id_t (res.getUser () + ":" + res.getRole () + ":" + sType + sSensitivity); 
     256                                sepol_security_id_t tsid = new sepol_security_id_t (res.getUser () + ":" + res.getRole () + ":" + sType + sSensitivity); //$NON-NLS-1$ //$NON-NLS-2$ 
    256257                                if (DEBUG) 
    257                                         System.out.println ("Target SID: " + tsid.toString ()); 
     258                                        System.out.println ("Target SID: " + tsid.toString ()); //$NON-NLS-1$ 
    258259                                         
    259260                                 
     
    272273                                                sepol_access_vector auditDenyVec = accessDecision.getAuditDenyed (); 
    273274 
    274                                                 System.out.println("Allowed (" + allowedVec.intValue () + "): " + allowedVec.toString ()); 
    275                                                 System.out.println("Denyed (" + denyVec.intValue () + "): " + denyVec.toString ()); 
    276                                                 System.out.println("Audit Allowed (" + auditAllowVec.intValue () + "): " + auditAllowVec.toString ()); 
    277                                                 System.out.println("Audit Denyed (" + auditDenyVec.intValue () + "): " + auditDenyVec.toString ()); 
    278  
    279                                                 System.out.println ("Reason: " + lReason); 
     275                                                System.out.println("Allowed (" + allowedVec.intValue () + "): " + allowedVec.toString ()); //$NON-NLS-1$ //$NON-NLS-2$ 
     276                                                System.out.println("Denyed (" + denyVec.intValue () + "): " + denyVec.toString ()); //$NON-NLS-1$ //$NON-NLS-2$ 
     277                                                System.out.println("Audit Allowed (" + auditAllowVec.intValue () + "): " + auditAllowVec.toString ()); //$NON-NLS-1$ //$NON-NLS-2$ 
     278                                                System.out.println("Audit Denyed (" + auditDenyVec.intValue () + "): " + auditDenyVec.toString ()); //$NON-NLS-1$ //$NON-NLS-2$ 
     279 
     280                                                System.out.println ("Reason: " + lReason); //$NON-NLS-1$ 
    280281                                        } 
    281282                                         
     
    283284                                        { 
    284285                                                if ((lReason & selinuxConstants.SEPOL_ACCESS_DECISION_DENIED_CONS) != 0) 
    285                                                         m_errorHandler.Error ("Access denied due to additional constraints in the policy", i_access.GetNameToken (), ErrorHandler.ERROR_CONSTRAINT_ACCESS_DENIED, i_access.toString ()); 
     286                                                { 
     287                                                        String [] bindins = new String []  
     288                                                        { 
     289                                                                i_access.getVerb (), 
     290                                                                dom.getName (), 
     291                                                                res.getName () 
     292                                                        }; 
     293                                                         
     294                                                        String sErrMsg = NLS.bind (Messages.AccessCheckBuilder_constraint_denial, bindins); 
     295                                                         
     296                                                        m_errorHandler.Error (sErrMsg, i_access.GetNameToken (), ErrorHandler.ERROR_CONSTRAINT_ACCESS_DENIED, i_access.toString ()); 
     297                                                } 
    286298                                                if ((lReason & selinuxConstants.SEPOL_ACCESS_DECISION_DENIED_RBAC) != 0) 
    287                                                         m_errorHandler.Error ("Access deined due to additional Role Based access controles in the policy", i_access.GetNameToken (), ErrorHandler.ERROR_RBAC_ACCESS_DENIED, i_access.toString ()); 
     299                                                { 
     300                                                        String [] bindins = new String []  
     301                                                        { 
     302                                                                i_access.getVerb (), 
     303                                                                dom.getName (), 
     304                                                                res.getName () 
     305                                                        }; 
     306 
     307                                                        String sErrMsg = NLS.bind (Messages.AccessCheckBuilder_rbac_denial, bindins); 
     308                                                        m_errorHandler.Error (sErrMsg, i_access.GetNameToken (), ErrorHandler.ERROR_RBAC_ACCESS_DENIED, i_access.toString ()); 
     309                                                } 
    288310                                                if ((lReason & selinuxConstants.SEPOL_ACCESS_DECISION_DENIED_TE) != 0) 
    289                                                         m_errorHandler.Error ("Access deinue due to additional Type Enforcemtns rules in the policy", i_access.GetNameToken (), ErrorHandler.ERROR_TE_ACCESS_DENIED, i_access.toString ()); 
     311                                                { 
     312                                                        String [] bindins = new String []  
     313                                                        { 
     314                                                                i_access.getVerb (), 
     315                                                                dom.getName (), 
     316                                                                res.getName () 
     317                                                        }; 
     318 
     319                                                        String sErrMsg = NLS.bind (Messages.AccessCheckBuilder_te_denial, bindins); 
     320                                                        m_errorHandler.Error (sErrMsg, i_access.GetNameToken (), ErrorHandler.ERROR_TE_ACCESS_DENIED, i_access.toString ()); 
     321                                                } 
    290322                                        } 
    291323                                } 
     
    323355 
    324356                                                if (DEBUG) 
    325                                                         System.out.println ("Final Perms (" + finalPerms.intValue () + "): " + finalPerms.toString ()); 
     357                                                        System.out.println ("Final Perms (" + finalPerms.intValue () + "): " + finalPerms.toString ()); //$NON-NLS-1$ //$NON-NLS-2$ 
    326358                                                 
    327359                                                result.add (finalPerms); 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditor.java

    r1825 r1977  
    1414import java.io.InputStreamReader; 
    1515import java.util.ArrayList; 
     16import java.util.Collection; 
    1617import java.util.EventObject; 
    1718import java.util.Iterator; 
     
    9394import com.tresys.framework.plugin.editor.policy.graphic.palette.PolicyPalette; 
    9495import com.tresys.framework.plugin.editor.policy.graphic.palette.PolicyPaletteProvider; 
    95 import com.tresys.framework.plugin.editor.policy.graphic.parts.DomainEditPart
     96import com.tresys.framework.plugin.editor.policy.graphic.parts.EditPartLocator
    9697import com.tresys.framework.plugin.editor.policy.graphic.parts.GraphicPolicyFactory; 
    9798import com.tresys.framework.plugin.editor.policy.graphic.parts.PolicyContainerEditPart; 
     
    724725                if (selection instanceof IStructuredSelection) 
    725726                { 
    726                         ArrayList result = new ArrayList (); 
     727                        Collection source = new ArrayList (); 
     728 
     729                        ShapeCollector shapes = new ShapeCollector (); 
     730                        getModel().Accept(shapes); 
    727731                         
    728732                        for (Iterator itr = ((IStructuredSelection) selection).iterator(); itr.hasNext(); ) 
     
    731735                                if (o instanceof IMarker) 
    732736                                { 
    733                                         ShapeCollector shapes = new ShapeCollector (); 
    734                                         getModel().Accept(shapes); 
    735  
    736  
    737737                                        IMarker marker = (IMarker) o; 
    738738                                        String sKey = marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); 
    739739                                        ModelElement shape = (ModelElement) shapes.get(sKey); 
    740740 
    741                                         PolicyEditPart editpart = m_diagramEditPart.getModelEditPart (shape); 
    742  
    743                                         if (editpart != null) 
    744                                         { 
    745                                                 result.add (editpart); 
    746                                         } 
     741                                        source.add (shape); 
    747742                                } 
    748743                        } 
    749744                         
    750                         if (result.size () > 0) 
    751                         { 
    752                                 getViewer().setSelection(new StructuredSelection (result)); 
    753                                 getViewer().reveal((EditPart) result.get(0)); 
     745                        if (source.size () > 0) 
     746                        { 
     747                                EditPartLocator locator = new EditPartLocator (source); 
     748                                m_diagramEditPart.Accept (locator); 
     749                                 
     750                                 
     751                                Collection matches = locator.getMatches ();  
     752                                if (matches.size () > 0) 
     753                                { 
     754                                        getViewer().setSelection(new StructuredSelection (new ArrayList (matches))); 
     755                                        EditPart first = (EditPart) matches.iterator ().next (); 
     756                                        getViewer().reveal (first); 
     757                                } 
    754758                        } 
    755759                } 
     
    817821        public void filterDisplay (PolicyDiagram i_model) 
    818822        { 
    819                 PolicyEditPart part = m_diagramEditPart.getModelEditPart (i_model); 
     823/* 
     824                AbstractGraphicalEditPart part = m_diagramEditPart.getModelEditPart (i_model); 
    820825                m_diagramEditPart.setFilterEditPart(part); 
    821826                 
    822827                ((PolicyPalette) getPaletteRoot()).showOnlyTopLevel (!(part instanceof DomainEditPart)); 
     828*/ 
    823829        } 
    824830         
     
    826832        { 
    827833                GraphicalViewer viewer = getGraphicalViewer(); 
     834 
     835                //first set the viewer to show the right data 
     836                EditPart part = viewer.getContents();  //get policyDiagramEditPart 
    828837 
    829838                ISelection selection = event.getSelection(); 
     
    835844                        { 
    836845                                Object ob = itr.next(); 
    837                                 EditPart part = viewer.getContents();  //get policyDiagramEditPart 
    838846                                 
    839847                                if (ob instanceof Component) 
    840848                                { 
    841                                         //first set the viewer to show the right data 
    842849                                         
    843850                                        //first select this part in the Viewer 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AbstractConnectionEditPart.java

    r1825 r1977  
    9595                        targetEditPart; 
    9696 
     97        public abstract void Accept (IEditPartVisitor i_visitor); 
     98         
    9799        /** 
    98100         * Activates the Figure representing this, by setting up 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AccessEditPart.java

    r1825 r1977  
    4949        } 
    5050         
     51        public void Accept (IEditPartVisitor i_visitor) 
     52        { 
     53                i_visitor.Visit (this); 
     54        } 
     55 
    5156        /** 
    5257         * Upon activation, attach to the model element as a property change listener. 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ControlResourceEditPart.java

    r1825 r1977  
    2727        } 
    2828 
    29          
     29        public void Accept (IEditPartVisitor i_visitor) 
     30        { 
     31                i_visitor.Visit (this); 
     32        } 
     33 
    3034        public void propertyChange (PropertyChangeEvent evt) 
    3135        { 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java

    r1974 r1977  
    5757        { 
    5858                super (); 
     59        } 
     60 
     61        public void Accept (IEditPartVisitor i_visitor) 
     62        { 
     63                i_visitor.Visit (this); 
     64                super.Accept (i_visitor); 
    5965        } 
    6066 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EntryEditPart.java

    r1825 r1977  
    3737        } 
    3838         
     39        public void Accept (IEditPartVisitor i_visitor) 
     40        { 
     41                i_visitor.Visit (this); 
     42        } 
     43 
    3944        /** 
    4045         * Upon activation, attach to the model element as a property change listener. 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerEditPart.java

    r1825 r1977  
    1515import java.util.List; 
    1616 
    17 import org.eclipse.core.runtime.Assert; 
    1817import org.eclipse.gef.EditPart; 
    1918import org.eclipse.swt.widgets.Display; 
    2019 
    21 import com.tresys.framework.plugin.editor.policy.graphic.model.ModelElement; 
    2220import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 
    2321import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; 
     
    9593        } 
    9694 
    97         /** 
    98          * get edit part for specific model element 
     95        /* (non-Javadoc) 
     96         * @see com.tresys.framework.plugin.editor.policy.graphic.parts.PolicyEditPart#Accept(com.tresys.framework.plugin.editor.policy.graphic.parts.IEditPartVisitor) 
    9997         */ 
    100         public PolicyEditPart getModelEditPart (ModelElement i_shape
     98        public void Accept (IEditPartVisitor i_visitor
    10199        { 
    102                 Assert.isNotNull(i_shape); 
    103                 if (i_shape.equals (getCastedModel())) 
    104                         return this; 
    105                  
    106                 Iterator itr = getChildren().iterator(); 
    107                 while (itr.hasNext ()) 
     100                for (Iterator itr = getChildren ().iterator (); itr.hasNext (); ) 
    108101                { 
    109                         PolicyEditPart part = (PolicyEditPart) itr.next(); 
    110                         PolicyEditPart match = part.getModelEditPart(i_shape);  
    111                         if (match != null) 
    112                                 return match; 
     102                        PolicyEditPart part = (PolicyEditPart) itr.next (); 
     103                        part.Accept (i_visitor); 
    113104                } 
    114105                 
    115                 return null; 
     106                for (Iterator itr = getSourceConnections ().iterator (); itr.hasNext (); ) 
     107                { 
     108                        AbstractConnectionEditPart part = (AbstractConnectionEditPart) itr.next (); 
     109                        part.Accept (i_visitor); 
     110                } 
     111 
     112                for (Iterator itr = getTargetConnections ().iterator (); itr.hasNext (); ) 
     113                { 
     114                        AbstractConnectionEditPart part = (AbstractConnectionEditPart) itr.next (); 
     115                        part.Accept (i_visitor); 
     116                } 
    116117        } 
    117  
    118118} 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyDiagramEditPart.java

    r1878 r1977  
    2424import org.eclipse.gef.EditPolicy; 
    2525import org.eclipse.gef.LayerConstants; 
     26import org.eclipse.gef.editparts.AbstractGraphicalEditPart; 
    2627import org.eclipse.gef.editpolicies.RootComponentEditPolicy; 
    2728 
     
    3233        extends PolicyContainerEditPart 
    3334{ 
    34         private PolicyEditPart m_filterEditPart = null; 
     35        private AbstractGraphicalEditPart m_filterEditPart = null; 
    3536         
    3637        public PolicyDiagramEditPart ()  
     
    3940        } 
    4041 
     42        public void Accept (IEditPartVisitor i_visitor) 
     43        { 
     44                i_visitor.Visit (this); 
     45                super.Accept (i_visitor); 
     46        } 
    4147 
    4248        /* (non-Javadoc) 
     
    7581        } 
    7682 
    77         public void setFilterEditPart (PolicyEditPart i_filterPart) 
     83        public void setFilterEditPart (AbstractGraphicalEditPart i_filterPart) 
    7884        { 
    7985                m_filterEditPart = i_filterPart; 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java

    r1975 r1977  
    5757        } 
    5858         
     59        public abstract void Accept (IEditPartVisitor i_visitor); 
     60 
    5961        /* 
    6062         * (non-Javadoc) 
     
    106108        { 
    107109                return (Shape) getModel (); 
    108         } 
    109          
    110         public PolicyEditPart getModelEditPart (ModelElement i_shape) 
    111         { 
    112                 if (getCastedModel().equals(i_shape)) 
    113                         return this; 
    114                 return null; 
    115110        } 
    116111 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ShapeEditPart.java

    r1974 r1977  
    5656        } 
    5757         
     58        public void Accept (IEditPartVisitor i_visitor) 
     59        { 
     60                i_visitor.Visit (this); 
     61        } 
     62 
    5863         
    5964        /* (non-Javadoc) 
  • branches/mls/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/PolicyMarkerResolutionGenerator.java

    r1825 r1977  
    44|*| Author:     David Sugar <dsugar@tresys.com> 
    55|*|   
    6 |*| Version: @version@ 
     6|*| $Rev$ 
     7|*| $Date$ 
    78\*/ 
    89 
     
    2425import com.tresys.framework.compiler.dictionary.Dictionary; 
    2526import com.tresys.framework.compiler.dictionary.Rdef; 
     27import com.tresys.framework.compiler.linkage.Linkage; 
     28import com.tresys.framework.compiler.linkage.flnkage.Ability; 
    2629import com.tresys.framework.compiler.policy.Component; 
    2730import com.tresys.framework.compiler.policy.ComponentWithDictObjects; 
     
    3235import com.tresys.framework.plugin.editor.policy.graphic.ShapeCollector; 
    3336import com.tresys.framework.plugin.editor.policy.graphic.commands.ShapeCreateCommand; 
     37import com.tresys.framework.plugin.editor.policy.graphic.model.AccessConnection; 
    3438import com.tresys.framework.plugin.editor.policy.graphic.model.Connection; 
    3539import com.tresys.framework.plugin.editor.policy.graphic.model.DomainShape; 
    3640import com.tresys.framework.plugin.editor.policy.graphic.model.EntryPointShape; 
     41import com.tresys.framework.plugin.editor.policy.graphic.model.IDomainShape; 
    3742import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 
    3843import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; 
     
    4752        } 
    4853 
     54        /* 
     55         * (non-Javadoc) 
     56         * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker) 
     57         */ 
    4958        public boolean hasResolutions (IMarker marker) 
    5059        { 
     
    6069                        if (obj instanceof Integer) 
    6170                        { 
    62                                 return ((Integer) obj).intValue() != ErrorHandler.ERROR_TYPE_UNKNOWN;  
     71                                int errorType = ((Integer) obj).intValue (); 
     72                                 
     73                                // known error types 
     74                                switch (errorType) 
     75                                { 
     76                                        case ErrorHandler.ERROR_TYPE_UNKNOWN: 
     77                                                return false; 
     78 
     79                                                // add additional errors here! 
     80                                        case ErrorHandler.ERROR_TYPE_NO_RDEF_ASSIGNED: 
     81                                        case ErrorHandler.ERROR_TYPE_PARENT_MISSING_CONSTRAINT: 
     82                                        case ErrorHandler.ERROR_TYPE_DECOMPOSED_DOMAIN_NO_CHILD: 
     83                                        case ErrorHandler.ERROR_MISSING_DIRECTORY: 
     84                                        case ErrorHandler.ERROR_ENTRYPOINT_MISSING_FILE: 
     85                                        case ErrorHandler.ERROR_NO_PARENT_PATH: 
     86                                        case ErrorHandler.ERROR_MISSING_BOOLEAN: 
     87                                        case ErrorHandler.ERROR_CONSTRAINT_ACCESS_DENIED: 
     88                                                 
     89                                                return true; 
     90                                                 
     91                                } 
    6392                        } 
    64                          
    65                                  
    6693                } 
    6794                catch (CoreException ce) 
     
    7198        } 
    7299 
     100        /* 
     101         * (non-Javadoc) 
     102         * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker) 
     103         */ 
    73104        public IMarkerResolution[] getResolutions (IMarker i_marker) 
    74105        { 
     
    119150                                        Vector missingRdefs = new Vector (); 
    120151 
    121                                         String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$ 
     152                                        String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 
    122153                                        Component comp = system.getPolicy().GetComponent(sKey); 
    123154                                        if (comp != null && comp instanceof Domain) 
     
    158189                                case ErrorHandler.ERROR_TYPE_DECOMPOSED_DOMAIN_NO_CHILD: 
    159190                                { 
    160                                         String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$ 
     191                                        String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 
    161192                                         
    162193                                        PolicyDiagram diagram = system.getDiagram(); 
     
    178209                                case ErrorHandler.ERROR_MISSING_DIRECTORY: 
    179210                                { 
    180                                         String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$ 
     211                                        String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 
    181212                                         
    182213                                        PolicyDiagram diagram = system.getDiagram(); 
     
    193224  &