01: package newprocess.diagram.edit.policies;
02:
03: import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
04: import org.eclipse.gmf.runtime.notation.View;
05: import java.util.Iterator;
06: import java.util.LinkedList;
07: import java.util.List;
08:
09: import newprocess.Globals;
10:
11: import newprocess.diagram.edit.parts.ConditionEditPart;
12:
13: import newprocess.diagram.part.New_processVisualIDRegistry;
14:
15: import org.eclipse.emf.ecore.EObject;
16:
17: /**
18: * @generated
19: */
20: public class GlobalsGlobalsConditionCompartmentCanonicalEditPolicy
21: extends CanonicalEditPolicy {
22:
23: /**
24: * @generated
25: */
26: protected List getSemanticChildrenList() {
27: List result = new LinkedList();
28: EObject modelObject = ((View) getHost().getModel())
29: .getElement();
30: View viewObject = (View) getHost().getModel();
31: EObject nextValue;
32: int nodeVID;
33: for (Iterator values = ((Globals) modelObject)
34: .getHasCondition().iterator(); values.hasNext();) {
35: nextValue = (EObject) values.next();
36: nodeVID = New_processVisualIDRegistry.getNodeVisualID(
37: viewObject, nextValue);
38: if (ConditionEditPart.VISUAL_ID == nodeVID) {
39: result.add(nextValue);
40: }
41: }
42: return result;
43: }
44:
45: /**
46: * @generated
47: */
48: protected boolean shouldDeleteView(View view) {
49: return view.isSetElement() && view.getElement() != null
50: && view.getElement().eIsProxy();
51: }
52:
53: /**
54: * @generated
55: */
56: protected String getDefaultFactoryHint() {
57: return null;
58: }
59:
60: }
|