Changeset 1977
- Timestamp:
- 03/06/08 08:41:19 (9 months ago)
- Files:
-
- branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/BaseDomain.java (modified) (5 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/IDomain.java (modified) (2 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/compiler/translator/TranslatorSELinux.java (modified) (4 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java (modified) (8 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/builder/Messages.java (added)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/builder/messages.properties (added)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditor.java (modified) (7 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AbstractConnectionEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AccessEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ControlResourceEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EditPartLocator.java (added)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EntryEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/IEditPartVisitor.java (added)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyContainerEditPart.java (modified) (2 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyDiagramEditPart.java (modified) (4 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java (modified) (2 diffs)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ShapeEditPart.java (modified) (1 diff)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/AddAbilityResolution.java (added)
- branches/mls/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/PolicyMarkerResolutionGenerator.java (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/BaseDomain.java
r1963 r1977 24 24 import com.tresys.framework.compiler.dictionary.NameValuePair; 25 25 import com.tresys.framework.compiler.linkage.Linkage; 26 import com.tresys.framework.compiler.linkage.flnkage.Ability; 26 27 import com.tresys.framework.compiler.linkage.flnkage.ILinkageItem; 27 28 … … 41 42 private String m_sRole; 42 43 44 private final Map/*<String, Ability>*/abilities; 45 46 43 47 public BaseDomain (BaseDomain i_copyMe) 44 48 { … … 49 53 NameValuePairs = new TreeMap/*<String, NameValuePair<?>>*/(); 50 54 NameValuePairs.putAll(i_copyMe.NameValuePairs); 55 56 abilities = new TreeMap(); 57 abilities.putAll (i_copyMe.abilities); 51 58 } 52 59 … … 56 63 entries = new Vector/*<Enter>*/(); 57 64 NameValuePairs = new TreeMap/*<String, NameValuePair<?>>*/(); 65 abilities = new TreeMap(); 58 66 } 59 67 … … 215 223 { 216 224 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 } 217 231 } 218 232 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 219 253 public boolean Contains(Enter enter) 220 254 { branches/mls/framework-plugin/src/com/tresys/framework/compiler/policy/IDomain.java
r1973 r1977 19 19 import com.tresys.framework.compiler.AbstractToken; 20 20 import com.tresys.framework.compiler.linkage.Linkage; 21 import com.tresys.framework.compiler.linkage.flnkage.Ability; 21 22 22 23 public interface IDomain … … 120 121 121 122 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 122 133 } branches/mls/framework-plugin/src/com/tresys/framework/compiler/translator/TranslatorSELinux.java
r1963 r1977 242 242 printStreamBuffer.print("type " + i_domain.getType() + ";\n"); 243 243 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); 254 246 255 247 if(i_domain.GetChildren().isEmpty()) … … 553 545 "\t')\n" + "\n')\n"); 554 546 547 OutputAbilities (domain, printStreamBuffer); 548 555 549 printStreamBuffer.flush (); 556 550 printStreamBuffer.close (); … … 576 570 m_linkage.MakeUserDomain (dom.getName (), printStreamBuffer); 577 571 572 OutputAbilities (dom, printStreamBuffer); 573 578 574 printStreamBuffer.flush (); 579 575 printStreamBuffer.close (); … … 598 594 { 599 595 } 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 601 609 private void callInterfaces(IDomain domain, Collection interfaces, PrintStream stream) 602 610 { branches/mls/framework-plugin/src/com/tresys/framework/plugin/builder/AccessCheckBuilder.java
r1974 r1977 27 27 import org.eclipse.core.runtime.CoreException; 28 28 import org.eclipse.core.runtime.IProgressMonitor; 29 import org.eclipse.osgi.util.NLS; 29 30 30 31 import com.tresys.framework.compiler.ErrorHandler; … … 69 70 extends IncrementalProjectBuilder 70 71 { 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$ 74 75 75 76 /** … … 237 238 238 239 if (DEBUG) 239 System.out.println ("Access: " + i_access.toString ()); 240 System.out.println ("Access: " + i_access.toString ()); //$NON-NLS-1$ 240 241 Map rdefs = res.GetRdefs (); 241 242 … … 244 245 Rdef rdef = (Rdef) itr.next (); 245 246 246 String sType = res.getName () + "_" + rdef.GetName () + "_t"; 247 String sType = res.getName () + "_" + rdef.GetName () + "_t"; //$NON-NLS-1$ //$NON-NLS-2$ 247 248 sepol_security_id_t ssid = new sepol_security_id_t (dom.getFullContext ()); 248 249 if (DEBUG) 249 System.out.println ("Source SID: " + ssid.toString ()); 250 System.out.println ("Source SID: " + ssid.toString ()); //$NON-NLS-1$ 250 251 251 252 String sSensitivity = res.getSensitivity (); … … 253 254 sSensitivity = ':' + sSensitivity; 254 255 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$ 256 257 if (DEBUG) 257 System.out.println ("Target SID: " + tsid.toString ()); 258 System.out.println ("Target SID: " + tsid.toString ()); //$NON-NLS-1$ 258 259 259 260 … … 272 273 sepol_access_vector auditDenyVec = accessDecision.getAuditDenyed (); 273 274 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$ 280 281 } 281 282 … … 283 284 { 284 285 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 } 286 298 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 } 288 310 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 } 290 322 } 291 323 } … … 323 355 324 356 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$ 326 358 327 359 result.add (finalPerms); branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/GraphicPolicyEditor.java
r1825 r1977 14 14 import java.io.InputStreamReader; 15 15 import java.util.ArrayList; 16 import java.util.Collection; 16 17 import java.util.EventObject; 17 18 import java.util.Iterator; … … 93 94 import com.tresys.framework.plugin.editor.policy.graphic.palette.PolicyPalette; 94 95 import com.tresys.framework.plugin.editor.policy.graphic.palette.PolicyPaletteProvider; 95 import com.tresys.framework.plugin.editor.policy.graphic.parts. DomainEditPart;96 import com.tresys.framework.plugin.editor.policy.graphic.parts.EditPartLocator; 96 97 import com.tresys.framework.plugin.editor.policy.graphic.parts.GraphicPolicyFactory; 97 98 import com.tresys.framework.plugin.editor.policy.graphic.parts.PolicyContainerEditPart; … … 724 725 if (selection instanceof IStructuredSelection) 725 726 { 726 ArrayList result = new ArrayList (); 727 Collection source = new ArrayList (); 728 729 ShapeCollector shapes = new ShapeCollector (); 730 getModel().Accept(shapes); 727 731 728 732 for (Iterator itr = ((IStructuredSelection) selection).iterator(); itr.hasNext(); ) … … 731 735 if (o instanceof IMarker) 732 736 { 733 ShapeCollector shapes = new ShapeCollector ();734 getModel().Accept(shapes);735 736 737 737 IMarker marker = (IMarker) o; 738 738 String sKey = marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); 739 739 ModelElement shape = (ModelElement) shapes.get(sKey); 740 740 741 PolicyEditPart editpart = m_diagramEditPart.getModelEditPart (shape); 742 743 if (editpart != null) 744 { 745 result.add (editpart); 746 } 741 source.add (shape); 747 742 } 748 743 } 749 744 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 } 754 758 } 755 759 } … … 817 821 public void filterDisplay (PolicyDiagram i_model) 818 822 { 819 PolicyEditPart part = m_diagramEditPart.getModelEditPart (i_model); 823 /* 824 AbstractGraphicalEditPart part = m_diagramEditPart.getModelEditPart (i_model); 820 825 m_diagramEditPart.setFilterEditPart(part); 821 826 822 827 ((PolicyPalette) getPaletteRoot()).showOnlyTopLevel (!(part instanceof DomainEditPart)); 828 */ 823 829 } 824 830 … … 826 832 { 827 833 GraphicalViewer viewer = getGraphicalViewer(); 834 835 //first set the viewer to show the right data 836 EditPart part = viewer.getContents(); //get policyDiagramEditPart 828 837 829 838 ISelection selection = event.getSelection(); … … 835 844 { 836 845 Object ob = itr.next(); 837 EditPart part = viewer.getContents(); //get policyDiagramEditPart838 846 839 847 if (ob instanceof Component) 840 848 { 841 //first set the viewer to show the right data842 849 843 850 //first select this part in the Viewer branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/AbstractConnectionEditPart.java
r1825 r1977 95 95 targetEditPart; 96 96 97 public abstract void Accept (IEditPartVisitor i_visitor); 98 97 99 /** 98 100 * 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 49 49 } 50 50 51 public void Accept (IEditPartVisitor i_visitor) 52 { 53 i_visitor.Visit (this); 54 } 55 51 56 /** 52 57 * 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 27 27 } 28 28 29 29 public void Accept (IEditPartVisitor i_visitor) 30 { 31 i_visitor.Visit (this); 32 } 33 30 34 public void propertyChange (PropertyChangeEvent evt) 31 35 { branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/DomainEditPart.java
r1974 r1977 57 57 { 58 58 super (); 59 } 60 61 public void Accept (IEditPartVisitor i_visitor) 62 { 63 i_visitor.Visit (this); 64 super.Accept (i_visitor); 59 65 } 60 66 branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/EntryEditPart.java
r1825 r1977 37 37 } 38 38 39 public void Accept (IEditPartVisitor i_visitor) 40 { 41 i_visitor.Visit (this); 42 } 43 39 44 /** 40 45 * 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 15 15 import java.util.List; 16 16 17 import org.eclipse.core.runtime.Assert;18 17 import org.eclipse.gef.EditPart; 19 18 import org.eclipse.swt.widgets.Display; 20 19 21 import com.tresys.framework.plugin.editor.policy.graphic.model.ModelElement;22 20 import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 23 21 import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; … … 95 93 } 96 94 97 /* *98 * get edit part for specific model element95 /* (non-Javadoc) 96 * @see com.tresys.framework.plugin.editor.policy.graphic.parts.PolicyEditPart#Accept(com.tresys.framework.plugin.editor.policy.graphic.parts.IEditPartVisitor) 99 97 */ 100 public PolicyEditPart getModelEditPart (ModelElement i_shape)98 public void Accept (IEditPartVisitor i_visitor) 101 99 { 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 (); ) 108 101 { 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); 113 104 } 114 105 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 } 116 117 } 117 118 118 } branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyDiagramEditPart.java
r1878 r1977 24 24 import org.eclipse.gef.EditPolicy; 25 25 import org.eclipse.gef.LayerConstants; 26 import org.eclipse.gef.editparts.AbstractGraphicalEditPart; 26 27 import org.eclipse.gef.editpolicies.RootComponentEditPolicy; 27 28 … … 32 33 extends PolicyContainerEditPart 33 34 { 34 private PolicyEditPart m_filterEditPart = null;35 private AbstractGraphicalEditPart m_filterEditPart = null; 35 36 36 37 public PolicyDiagramEditPart () … … 39 40 } 40 41 42 public void Accept (IEditPartVisitor i_visitor) 43 { 44 i_visitor.Visit (this); 45 super.Accept (i_visitor); 46 } 41 47 42 48 /* (non-Javadoc) … … 75 81 } 76 82 77 public void setFilterEditPart ( PolicyEditPart i_filterPart)83 public void setFilterEditPart (AbstractGraphicalEditPart i_filterPart) 78 84 { 79 85 m_filterEditPart = i_filterPart; branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/PolicyEditPart.java
r1975 r1977 57 57 } 58 58 59 public abstract void Accept (IEditPartVisitor i_visitor); 60 59 61 /* 60 62 * (non-Javadoc) … … 106 108 { 107 109 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;115 110 } 116 111 branches/mls/framework-plugin/src/com/tresys/framework/plugin/editor/policy/graphic/parts/ShapeEditPart.java
r1974 r1977 56 56 } 57 57 58 public void Accept (IEditPartVisitor i_visitor) 59 { 60 i_visitor.Visit (this); 61 } 62 58 63 59 64 /* (non-Javadoc) branches/mls/framework-plugin/src/com/tresys/framework/plugin/marker/resolution/PolicyMarkerResolutionGenerator.java
r1825 r1977 4 4 |*| Author: David Sugar <dsugar@tresys.com> 5 5 |*| 6 |*| Version: @version@ 6 |*| $Rev$ 7 |*| $Date$ 7 8 \*/ 8 9 … … 24 25 import com.tresys.framework.compiler.dictionary.Dictionary; 25 26 import com.tresys.framework.compiler.dictionary.Rdef; 27 import com.tresys.framework.compiler.linkage.Linkage; 28 import com.tresys.framework.compiler.linkage.flnkage.Ability; 26 29 import com.tresys.framework.compiler.policy.Component; 27 30 import com.tresys.framework.compiler.policy.ComponentWithDictObjects; … … 32 35 import com.tresys.framework.plugin.editor.policy.graphic.ShapeCollector; 33 36 import com.tresys.framework.plugin.editor.policy.graphic.commands.ShapeCreateCommand; 37 import com.tresys.framework.plugin.editor.policy.graphic.model.AccessConnection; 34 38 import com.tresys.framework.plugin.editor.policy.graphic.model.Connection; 35 39 import com.tresys.framework.plugin.editor.policy.graphic.model.DomainShape; 36 40 import com.tresys.framework.plugin.editor.policy.graphic.model.EntryPointShape; 41 import com.tresys.framework.plugin.editor.policy.graphic.model.IDomainShape; 37 42 import com.tresys.framework.plugin.editor.policy.graphic.model.PolicyDiagram; 38 43 import com.tresys.framework.plugin.editor.policy.graphic.model.Shape; … … 47 52 } 48 53 54 /* 55 * (non-Javadoc) 56 * @see org.eclipse.ui.IMarkerResolutionGenerator2#hasResolutions(org.eclipse.core.resources.IMarker) 57 */ 49 58 public boolean hasResolutions (IMarker marker) 50 59 { … … 60 69 if (obj instanceof Integer) 61 70 { 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 } 63 92 } 64 65 66 93 } 67 94 catch (CoreException ce) … … 71 98 } 72 99 100 /* 101 * (non-Javadoc) 102 * @see org.eclipse.ui.IMarkerResolutionGenerator#getResolutions(org.eclipse.core.resources.IMarker) 103 */ 73 104 public IMarkerResolution[] getResolutions (IMarker i_marker) 74 105 { … … 119 150 Vector missingRdefs = new Vector (); 120 151 121 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$152 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 122 153 Component comp = system.getPolicy().GetComponent(sKey); 123 154 if (comp != null && comp instanceof Domain) … … 158 189 case ErrorHandler.ERROR_TYPE_DECOMPOSED_DOMAIN_NO_CHILD: 159 190 { 160 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$191 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 161 192 162 193 PolicyDiagram diagram = system.getDiagram(); … … 178 209 case ErrorHandler.ERROR_MISSING_DIRECTORY: 179 210 { 180 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, ""); //$NON-NLS-1$211 String sKey = i_marker.getAttribute(GUIErrorHandler.OBJ_KEY, new String ()); 181 212 182 213 PolicyDiagram diagram = system.getDiagram(); … … 193 224 &
