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.Expression;
10:
11: import newprocess.diagram.edit.parts.AndOperatorEditPart;
12: import newprocess.diagram.edit.parts.OrOperatorEditPart;
13:
14: import newprocess.diagram.part.New_processVisualIDRegistry;
15:
16: import org.eclipse.emf.ecore.EObject;
17:
18: /**
19: * @generated
20: */
21: public class ExpressionExpressionCompartment7CanonicalEditPolicy extends
22: CanonicalEditPolicy {
23:
24: /**
25: * @generated
26: */
27: protected List getSemanticChildrenList() {
28: List result = new LinkedList();
29: EObject modelObject = ((View) getHost().getModel())
30: .getElement();
31: View viewObject = (View) getHost().getModel();
32: EObject nextValue;
33: int nodeVID;
34: for (Iterator values = ((Expression) modelObject).getHasTerms()
35: .iterator(); values.hasNext();) {
36: nextValue = (EObject) values.next();
37: nodeVID = New_processVisualIDRegistry.getNodeVisualID(
38: viewObject, nextValue);
39: switch (nodeVID) {
40: case OrOperatorEditPart.VISUAL_ID: {
41: result.add(nextValue);
42: break;
43: }
44: case AndOperatorEditPart.VISUAL_ID: {
45: result.add(nextValue);
46: break;
47: }
48: }
49: }
50: return result;
51: }
52:
53: /**
54: * @generated
55: */
56: protected boolean shouldDeleteView(View view) {
57: return view.isSetElement() && view.getElement() != null
58: && view.getElement().eIsProxy();
59: }
60:
61: /**
62: * @generated
63: */
64: protected String getDefaultFactoryHint() {
65: return null;
66: }
67:
68: }
|