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.ConditionTermEditPart;
12: import newprocess.diagram.edit.parts.RootEditPart;
13:
14: import newprocess.diagram.part.New_processVisualIDRegistry;
15:
16: import org.eclipse.emf.ecore.EObject;
17:
18: /**
19: * @generated
20: */
21: public class Expression6CanonicalEditPolicy 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: nextValue = ((Expression) modelObject).getHasRoot();
34: nodeVID = New_processVisualIDRegistry.getNodeVisualID(
35: viewObject, nextValue);
36: if (RootEditPart.VISUAL_ID == nodeVID) {
37: result.add(nextValue);
38: }
39: for (Iterator values = ((Expression) modelObject).getHasTerms()
40: .iterator(); values.hasNext();) {
41: nextValue = (EObject) values.next();
42: nodeVID = New_processVisualIDRegistry.getNodeVisualID(
43: viewObject, nextValue);
44: if (ConditionTermEditPart.VISUAL_ID == nodeVID) {
45: result.add(nextValue);
46: }
47: }
48: return result;
49: }
50:
51: /**
52: * @generated
53: */
54: protected boolean shouldDeleteView(View view) {
55: return view.isSetElement() && view.getElement() != null
56: && view.getElement().eIsProxy();
57: }
58:
59: /**
60: * @generated
61: */
62: protected String getDefaultFactoryHint() {
63: return null;
64: }
65:
66: }
|