View | Details | Raw Unified | Return to bug 146009 | Differences between
and this patch

Collapse All | Expand All

(-)templates/providers/LinkViewFactory.javajet (-1 lines)
Lines 41-47 Link Here
41
	private static void create<%=label.getVisualID()%>Label(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view) {
41
	private static void create<%=label.getVisualID()%>Label(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view) {
42
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> label = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createNode();
42
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> label = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createNode();
43
		view.getPersistedChildren().add(label);
43
		view.getPersistedChildren().add(label);
44
		label.setElement(null);
45
		<%=importManager.getImportedName(label.getNotationViewFactoryQualifiedClassName())%>.decorateView(label);
44
		<%=importManager.getImportedName(label.getNotationViewFactoryQualifiedClassName())%>.decorateView(label);
46
	}
45
	}
47
<%
46
<%
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java (-285 / +301 lines)
Lines 32-198 Link Here
32
  protected final String TEXT_12 = " view) {" + NL + "\t\tassert view instanceof ";
32
  protected final String TEXT_12 = " view) {" + NL + "\t\tassert view instanceof ";
33
  protected final String TEXT_13 = ";" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
33
  protected final String TEXT_13 = ";" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
34
  protected final String TEXT_14 = " getDiagramEdge() {" + NL + "\t\treturn (";
34
  protected final String TEXT_14 = " getDiagramEdge() {" + NL + "\t\treturn (";
35
  protected final String TEXT_15 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!";
35
  protected final String TEXT_15 = ") getModel();" + NL + "\t}" + NL;
36
  protected final String TEXT_16 = NL;
36
  protected final String TEXT_16 = NL;
37
  protected final String TEXT_17 = "\t\tinstallEditPolicy(";
37
  protected final String TEXT_17 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
38
  protected final String TEXT_18 = ".COMPONENT_ROLE, new ";
38
  protected final String TEXT_18 = " view = (";
39
  protected final String TEXT_19 = "() {" + NL + "\t\t\tprotected ";
39
  protected final String TEXT_19 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
40
  protected final String TEXT_20 = " createDeleteCommand(";
40
  protected final String TEXT_20 = " view = (";
41
  protected final String TEXT_21 = " deleteRequest) {" + NL + "\t\t\t\tfinal Edge edgeToRemove = getDiagramEdge();" + NL + "\t\t\t\tfinal View source = edgeToRemove.getSource();" + NL + "\t\t\t\tfinal View target = edgeToRemove.getTarget();" + NL + "\t\t\t\t";
41
  protected final String TEXT_21 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!";
42
  protected final String TEXT_22 = " editingDomain = ";
42
  protected final String TEXT_22 = NL;
43
  protected final String TEXT_23 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t";
43
  protected final String TEXT_23 = "\t\tinstallEditPolicy(";
44
  protected final String TEXT_24 = " cc = new ";
44
  protected final String TEXT_24 = ".COMPONENT_ROLE, new ";
45
  protected final String TEXT_25 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new ";
45
  protected final String TEXT_25 = "() {" + NL + "\t\t\tprotected ";
46
  protected final String TEXT_26 = "() {" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tsource.getDiagram().insertEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(source);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(target);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tsource.getDiagram().removeEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(null);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(null);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}";
46
  protected final String TEXT_26 = " createDeleteCommand(";
47
  protected final String TEXT_27 = NL;
47
  protected final String TEXT_27 = " deleteRequest) {" + NL + "\t\t\t\tfinal Edge edgeToRemove = getDiagramEdge();" + NL + "\t\t\t\tfinal View source = edgeToRemove.getSource();" + NL + "\t\t\t\tfinal View target = edgeToRemove.getTarget();" + NL + "\t\t\t\t";
48
  protected final String TEXT_28 = NL + "\t\t\tprivate ";
48
  protected final String TEXT_28 = " editingDomain = ";
49
  protected final String TEXT_29 = " createDomainModelRemoveCommand(";
49
  protected final String TEXT_29 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t";
50
  protected final String TEXT_30 = " editingDomain) {";
50
  protected final String TEXT_30 = " cc = new ";
51
  protected final String TEXT_31 = NL + "\t\t\t\t";
51
  protected final String TEXT_31 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new ";
52
  protected final String TEXT_32 = " result = new ";
52
  protected final String TEXT_32 = "() {" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn source != null && edgeToRemove != null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tsource.getDiagram().insertEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(source);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(target);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tsource.getDiagram().removeEdge(edgeToRemove);" + NL + "\t\t\t\t\t\tedgeToRemove.setSource(null);" + NL + "\t\t\t\t\t\tedgeToRemove.setTarget(null);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}";
53
  protected final String TEXT_33 = "();";
53
  protected final String TEXT_33 = NL;
54
  protected final String TEXT_34 = NL + "\t\t\t\tresult.append(";
54
  protected final String TEXT_34 = NL + "\t\t\tprivate ";
55
  protected final String TEXT_35 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
55
  protected final String TEXT_35 = " createDomainModelRemoveCommand(";
56
  protected final String TEXT_36 = ".getElement().eContainer(), ";
56
  protected final String TEXT_36 = " editingDomain) {";
57
  protected final String TEXT_37 = ".getElement().eContainmentFeature(), ";
57
  protected final String TEXT_37 = NL + "\t\t\t\t";
58
  protected final String TEXT_38 = ".getElement()));";
58
  protected final String TEXT_38 = " result = new ";
59
  protected final String TEXT_39 = NL + "\t\t\t\tresult.append(";
59
  protected final String TEXT_39 = "();";
60
  protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
60
  protected final String TEXT_40 = NL + "\t\t\t\tresult.append(";
61
  protected final String TEXT_41 = ".getElement().eContainer(), ";
61
  protected final String TEXT_41 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
62
  protected final String TEXT_42 = ".getElement().eContainmentFeature(), ";
62
  protected final String TEXT_42 = ".getElement().eContainer(), ";
63
  protected final String TEXT_43 = ".UNSET_VALUE));";
63
  protected final String TEXT_43 = ".getElement().eContainmentFeature(), ";
64
  protected final String TEXT_44 = NL + "\t\t\t\treturn ";
64
  protected final String TEXT_44 = ".getElement()));";
65
  protected final String TEXT_45 = ".INSTANCE;";
65
  protected final String TEXT_45 = NL + "\t\t\t\tresult.append(";
66
  protected final String TEXT_46 = NL + "\t\t\t\tresult.append(";
66
  protected final String TEXT_46 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
67
  protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
67
  protected final String TEXT_47 = ".getElement().eContainer(), ";
68
  protected final String TEXT_48 = ".getElement().eContainer(), ";
68
  protected final String TEXT_48 = ".getElement().eContainmentFeature(), ";
69
  protected final String TEXT_49 = ".eINSTANCE.get";
69
  protected final String TEXT_49 = ".UNSET_VALUE));";
70
  protected final String TEXT_50 = "()," + NL + "\t\t\t\t\t";
70
  protected final String TEXT_50 = NL + "\t\t\t\treturn ";
71
  protected final String TEXT_51 = ".getElement()));";
71
  protected final String TEXT_51 = ".INSTANCE;";
72
  protected final String TEXT_52 = NL + "\t\t\t\tresult.append(";
72
  protected final String TEXT_52 = NL + "\t\t\t\tresult.append(";
73
  protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
73
  protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
74
  protected final String TEXT_54 = ".getElement().eContainer(), ";
74
  protected final String TEXT_54 = ".getElement().eContainer(), ";
75
  protected final String TEXT_55 = ".eINSTANCE.get";
75
  protected final String TEXT_55 = ".eINSTANCE.get";
76
  protected final String TEXT_56 = "()," + NL + "\t\t\t\t\t";
76
  protected final String TEXT_56 = "()," + NL + "\t\t\t\t\t";
77
  protected final String TEXT_57 = ".UNSET_VALUE));";
77
  protected final String TEXT_57 = ".getElement()));";
78
  protected final String TEXT_58 = NL + "\t\t\t\tresult.append(";
78
  protected final String TEXT_58 = NL + "\t\t\t\tresult.append(";
79
  protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
79
  protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
80
  protected final String TEXT_60 = ".getElement(), ";
80
  protected final String TEXT_60 = ".getElement().eContainer(), ";
81
  protected final String TEXT_61 = ".eINSTANCE.get";
81
  protected final String TEXT_61 = ".eINSTANCE.get";
82
  protected final String TEXT_62 = "(), ";
82
  protected final String TEXT_62 = "()," + NL + "\t\t\t\t\t";
83
  protected final String TEXT_63 = ".getSource().getElement()));";
83
  protected final String TEXT_63 = ".UNSET_VALUE));";
84
  protected final String TEXT_64 = NL + "\t\t\t\tresult.append(";
84
  protected final String TEXT_64 = NL + "\t\t\t\tresult.append(";
85
  protected final String TEXT_65 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
85
  protected final String TEXT_65 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
86
  protected final String TEXT_66 = ".getElement(), ";
86
  protected final String TEXT_66 = ".getElement(), ";
87
  protected final String TEXT_67 = ".eINSTANCE.get";
87
  protected final String TEXT_67 = ".eINSTANCE.get";
88
  protected final String TEXT_68 = "(), ";
88
  protected final String TEXT_68 = "(), ";
89
  protected final String TEXT_69 = ".UNSET_VALUE));";
89
  protected final String TEXT_69 = ".getSource().getElement()));";
90
  protected final String TEXT_70 = NL + "\t\t\t\tresult.append(";
90
  protected final String TEXT_70 = NL + "\t\t\t\tresult.append(";
91
  protected final String TEXT_71 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
91
  protected final String TEXT_71 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
92
  protected final String TEXT_72 = ".getElement(), ";
92
  protected final String TEXT_72 = ".getElement(), ";
93
  protected final String TEXT_73 = ".eINSTANCE.get";
93
  protected final String TEXT_73 = ".eINSTANCE.get";
94
  protected final String TEXT_74 = "(), ";
94
  protected final String TEXT_74 = "(), ";
95
  protected final String TEXT_75 = ".getTarget().getElement()));";
95
  protected final String TEXT_75 = ".UNSET_VALUE));";
96
  protected final String TEXT_76 = NL + "\t\t\t\tresult.append(";
96
  protected final String TEXT_76 = NL + "\t\t\t\tresult.append(";
97
  protected final String TEXT_77 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
97
  protected final String TEXT_77 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
98
  protected final String TEXT_78 = ".getElement(), ";
98
  protected final String TEXT_78 = ".getElement(), ";
99
  protected final String TEXT_79 = ".eINSTANCE.get";
99
  protected final String TEXT_79 = ".eINSTANCE.get";
100
  protected final String TEXT_80 = "(), ";
100
  protected final String TEXT_80 = "(), ";
101
  protected final String TEXT_81 = ".UNSET_VALUE));";
101
  protected final String TEXT_81 = ".getTarget().getElement()));";
102
  protected final String TEXT_82 = NL + "\t\t\t\treturn result;";
102
  protected final String TEXT_82 = NL + "\t\t\t\tresult.append(";
103
  protected final String TEXT_83 = NL + "\t\t\t\treturn ";
103
  protected final String TEXT_83 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
104
  protected final String TEXT_84 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
104
  protected final String TEXT_84 = ".getElement(), ";
105
  protected final String TEXT_85 = ".getSource().getElement(), ";
105
  protected final String TEXT_85 = ".eINSTANCE.get";
106
  protected final String TEXT_86 = ".eINSTANCE.get";
106
  protected final String TEXT_86 = "(), ";
107
  protected final String TEXT_87 = "(), ";
107
  protected final String TEXT_87 = ".UNSET_VALUE));";
108
  protected final String TEXT_88 = ".getTarget().getElement());";
108
  protected final String TEXT_88 = NL + "\t\t\t\treturn result;";
109
  protected final String TEXT_89 = NL + "\t\t\t\treturn ";
109
  protected final String TEXT_89 = NL + "\t\t\t\treturn ";
110
  protected final String TEXT_90 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
110
  protected final String TEXT_90 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
111
  protected final String TEXT_91 = ".getSource().getElement(), ";
111
  protected final String TEXT_91 = ".getSource().getElement(), ";
112
  protected final String TEXT_92 = ".eINSTANCE.get";
112
  protected final String TEXT_92 = ".eINSTANCE.get";
113
  protected final String TEXT_93 = "(), ";
113
  protected final String TEXT_93 = "(), ";
114
  protected final String TEXT_94 = ".UNSET_VALUE);";
114
  protected final String TEXT_94 = ".getTarget().getElement());";
115
  protected final String TEXT_95 = NL + "\t\t\t}";
115
  protected final String TEXT_95 = NL + "\t\t\t\treturn ";
116
  protected final String TEXT_96 = NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
116
  protected final String TEXT_96 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
117
  protected final String TEXT_97 = ".CONNECTION_ENDPOINTS_ROLE, new ";
117
  protected final String TEXT_97 = ".getSource().getElement(), ";
118
  protected final String TEXT_98 = "());" + NL + "\t\tinstallEditPolicy(";
118
  protected final String TEXT_98 = ".eINSTANCE.get";
119
  protected final String TEXT_99 = ".CONNECTION_BENDPOINTS_ROLE, new ";
119
  protected final String TEXT_99 = "(), ";
120
  protected final String TEXT_100 = "());" + NL + "\t}" + NL;
120
  protected final String TEXT_100 = ".UNSET_VALUE);";
121
  protected final String TEXT_101 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
121
  protected final String TEXT_101 = NL + "\t\t\t}";
122
  protected final String TEXT_102 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
122
  protected final String TEXT_102 = NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
123
  protected final String TEXT_103 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
123
  protected final String TEXT_103 = ".CONNECTION_ENDPOINTS_ROLE, new ";
124
  protected final String TEXT_104 = " nextChild = (";
124
  protected final String TEXT_104 = "());" + NL + "\t\tinstallEditPolicy(";
125
  protected final String TEXT_105 = ")it.next();" + NL + "\t\t\tif (";
125
  protected final String TEXT_105 = ".CONNECTION_BENDPOINTS_ROLE, new ";
126
  protected final String TEXT_106 = ".getVisualID(nextChild) == ";
126
  protected final String TEXT_106 = "());" + NL + "\t}" + NL;
127
  protected final String TEXT_107 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (EditPart) getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
127
  protected final String TEXT_107 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
128
  protected final String TEXT_108 = " req) {" + NL + "\t\tif (";
128
  protected final String TEXT_108 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
129
  protected final String TEXT_109 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
129
  protected final String TEXT_109 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
130
  protected final String TEXT_110 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
130
  protected final String TEXT_110 = " nextChild = (";
131
  protected final String TEXT_111 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
131
  protected final String TEXT_111 = ")it.next();" + NL + "\t\t\tif (";
132
  protected final String TEXT_112 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
132
  protected final String TEXT_112 = ".getVisualID(nextChild) == ";
133
  protected final String TEXT_113 = " getLabelEditPart(";
133
  protected final String TEXT_113 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (EditPart) getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
134
  protected final String TEXT_114 = " req) {" + NL + "\t\t";
134
  protected final String TEXT_114 = " req) {" + NL + "\t\tif (";
135
  protected final String TEXT_115 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
135
  protected final String TEXT_115 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
136
  protected final String TEXT_116 = " view = (";
136
  protected final String TEXT_116 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
137
  protected final String TEXT_117 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
137
  protected final String TEXT_117 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
138
  protected final String TEXT_118 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
138
  protected final String TEXT_118 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
139
  protected final String TEXT_119 = NL + "\t\t\t\tcase ";
139
  protected final String TEXT_119 = " getLabelEditPart(";
140
  protected final String TEXT_120 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
140
  protected final String TEXT_120 = " req) {" + NL + "\t\t";
141
  protected final String TEXT_121 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
141
  protected final String TEXT_121 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
142
  protected final String TEXT_122 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL;
142
  protected final String TEXT_122 = " view = (";
143
  protected final String TEXT_123 = NL;
143
  protected final String TEXT_123 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
144
  protected final String TEXT_124 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
144
  protected final String TEXT_124 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
145
  protected final String TEXT_125 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
145
  protected final String TEXT_125 = NL + "\t\t\t\tcase ";
146
  protected final String TEXT_126 = " feature, ";
146
  protected final String TEXT_126 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
147
  protected final String TEXT_127 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + NL;
147
  protected final String TEXT_127 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
148
  protected final String TEXT_128 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
148
  protected final String TEXT_128 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL;
149
  protected final String TEXT_129 = NL;
149
  protected final String TEXT_129 = NL;
150
  protected final String TEXT_130 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
150
  protected final String TEXT_130 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
151
  protected final String TEXT_131 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
151
  protected final String TEXT_131 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
152
  protected final String TEXT_132 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
152
  protected final String TEXT_132 = " feature, ";
153
  protected final String TEXT_133 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
153
  protected final String TEXT_133 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + NL;
154
  protected final String TEXT_134 = NL;
154
  protected final String TEXT_134 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
155
  protected final String TEXT_135 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
155
  protected final String TEXT_135 = NL;
156
  protected final String TEXT_136 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
156
  protected final String TEXT_136 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
157
  protected final String TEXT_137 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
157
  protected final String TEXT_137 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
158
  protected final String TEXT_138 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
158
  protected final String TEXT_138 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
159
  protected final String TEXT_139 = NL;
159
  protected final String TEXT_139 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
160
  protected final String TEXT_140 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
160
  protected final String TEXT_140 = NL;
161
  protected final String TEXT_141 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
161
  protected final String TEXT_141 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
162
  protected final String TEXT_142 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
162
  protected final String TEXT_142 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
163
  protected final String TEXT_143 = NL;
163
  protected final String TEXT_143 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
164
  protected final String TEXT_144 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
164
  protected final String TEXT_144 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
165
  protected final String TEXT_145 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
165
  protected final String TEXT_145 = NL;
166
  protected final String TEXT_146 = NL;
166
  protected final String TEXT_146 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
167
  protected final String TEXT_147 = "\t\tRefresher bendpointsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBendpoints();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
167
  protected final String TEXT_147 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
168
  protected final String TEXT_148 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
168
  protected final String TEXT_148 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
169
  protected final String TEXT_149 = ".eINSTANCE.getRelativeBendpoints_Points(), bendpointsRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t\trefreshBendpoints();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBendpoints() {" + NL + "\t\t";
169
  protected final String TEXT_149 = NL;
170
  protected final String TEXT_150 = " bendpoints = (";
170
  protected final String TEXT_150 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
171
  protected final String TEXT_151 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint(";
171
  protected final String TEXT_151 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
172
  protected final String TEXT_152 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
172
  protected final String TEXT_152 = NL;
173
  protected final String TEXT_153 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t";
173
  protected final String TEXT_153 = "\t\tRefresher bendpointsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBendpoints();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
174
  protected final String TEXT_154 = " figureConstraint = new ";
174
  protected final String TEXT_154 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
175
  protected final String TEXT_155 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t";
175
  protected final String TEXT_155 = ".eINSTANCE.getRelativeBendpoints_Points(), bendpointsRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t\trefreshBendpoints();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBendpoints() {" + NL + "\t\t";
176
  protected final String TEXT_156 = " wbp = (";
176
  protected final String TEXT_156 = " bendpoints = (";
177
  protected final String TEXT_157 = ") modelConstraint.get(i);" + NL + "\t\t\t";
177
  protected final String TEXT_157 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint(";
178
  protected final String TEXT_158 = " rbp = new ";
178
  protected final String TEXT_158 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
179
  protected final String TEXT_159 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new ";
179
  protected final String TEXT_159 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t";
180
  protected final String TEXT_160 = "(wbp.getSourceX(), wbp.getSourceY()), new ";
180
  protected final String TEXT_160 = " figureConstraint = new ";
181
  protected final String TEXT_161 = "(wbp.getTargetX(), wbp.getTargetY()));" + NL + "\t\t\trbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));" + NL + "\t\t\tfigureConstraint.add(rbp);" + NL + "\t\t}" + NL + "\t\tgetConnectionFigure().setRoutingConstraint(figureConstraint);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetConnectionFigure().setConnectionRouter(new ";
181
  protected final String TEXT_161 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t";
182
  protected final String TEXT_162 = "());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove <i>generated</i> tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
182
  protected final String TEXT_162 = " wbp = (";
183
  protected final String TEXT_163 = " createFigure() {";
183
  protected final String TEXT_163 = ") modelConstraint.get(i);" + NL + "\t\t\t";
184
  protected final String TEXT_164 = NL + "\t\treturn new ";
184
  protected final String TEXT_164 = " rbp = new ";
185
  protected final String TEXT_165 = "();";
185
  protected final String TEXT_165 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new ";
186
  protected final String TEXT_166 = NL + "\t\treturn ";
186
  protected final String TEXT_166 = "(wbp.getSourceX(), wbp.getSourceY()), new ";
187
  protected final String TEXT_167 = ";";
187
  protected final String TEXT_167 = "(wbp.getTargetX(), wbp.getTargetY()));" + NL + "\t\t\trbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));" + NL + "\t\t\tfigureConstraint.add(rbp);" + NL + "\t\t}" + NL + "\t\tgetConnectionFigure().setRoutingConstraint(figureConstraint);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetConnectionFigure().setConnectionRouter(new ";
188
  protected final String TEXT_168 = NL + " \t\treturn new ";
188
  protected final String TEXT_168 = "());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove <i>generated</i> tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
189
  protected final String TEXT_169 = "();";
189
  protected final String TEXT_169 = " createFigure() {";
190
  protected final String TEXT_170 = NL + "\t}" + NL;
190
  protected final String TEXT_170 = NL + "\t\treturn new ";
191
  protected final String TEXT_171 = NL;
191
  protected final String TEXT_171 = "();";
192
  protected final String TEXT_172 = NL;
192
  protected final String TEXT_172 = NL + "\t\treturn ";
193
  protected final String TEXT_173 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
193
  protected final String TEXT_173 = ";";
194
  protected final String TEXT_174 = NL + "}";
194
  protected final String TEXT_174 = NL + " \t\treturn new ";
195
  protected final String TEXT_175 = NL;
195
  protected final String TEXT_175 = "();";
196
  protected final String TEXT_176 = NL + "\t}" + NL;
197
  protected final String TEXT_177 = NL;
198
  protected final String TEXT_178 = NL;
199
  protected final String TEXT_179 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
200
  protected final String TEXT_180 = NL + "}";
201
  protected final String TEXT_181 = NL;
196
202
197
  public String generate(Object argument)
203
  public String generate(Object argument)
198
  {
204
  {
Lines 241-277 Link Here
241
    stringBuffer.append(TEXT_15);
247
    stringBuffer.append(TEXT_15);
242
    stringBuffer.append(TEXT_16);
248
    stringBuffer.append(TEXT_16);
243
    stringBuffer.append(TEXT_17);
249
    stringBuffer.append(TEXT_17);
244
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
250
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
245
    stringBuffer.append(TEXT_18);
251
    stringBuffer.append(TEXT_18);
246
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
252
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
247
    stringBuffer.append(TEXT_19);
253
    stringBuffer.append(TEXT_19);
248
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
254
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
249
    stringBuffer.append(TEXT_20);
255
    stringBuffer.append(TEXT_20);
250
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
256
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
251
    stringBuffer.append(TEXT_21);
257
    stringBuffer.append(TEXT_21);
252
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
253
    stringBuffer.append(TEXT_22);
258
    stringBuffer.append(TEXT_22);
254
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
255
    stringBuffer.append(TEXT_23);
259
    stringBuffer.append(TEXT_23);
256
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
260
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
257
    stringBuffer.append(TEXT_24);
261
    stringBuffer.append(TEXT_24);
258
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
262
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
259
    stringBuffer.append(TEXT_25);
263
    stringBuffer.append(TEXT_25);
260
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
264
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
261
    stringBuffer.append(TEXT_26);
265
    stringBuffer.append(TEXT_26);
266
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
267
    stringBuffer.append(TEXT_27);
268
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
269
    stringBuffer.append(TEXT_28);
270
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
271
    stringBuffer.append(TEXT_29);
272
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
273
    stringBuffer.append(TEXT_30);
274
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
275
    stringBuffer.append(TEXT_31);
276
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
277
    stringBuffer.append(TEXT_32);
262
    
278
    
263
{
279
{
264
	String _edge = "getDiagramEdge()";
280
	String _edge = "getDiagramEdge()";
265
281
266
    stringBuffer.append(TEXT_27);
282
    stringBuffer.append(TEXT_33);
267
    
283
    
268
	//input: _edge : String
284
	//input: _edge : String
269
285
270
    stringBuffer.append(TEXT_28);
286
    stringBuffer.append(TEXT_34);
271
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
272
    stringBuffer.append(TEXT_29);
288
    stringBuffer.append(TEXT_35);
273
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
289
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
274
    stringBuffer.append(TEXT_30);
290
    stringBuffer.append(TEXT_36);
275
    
291
    
276
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
292
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
277
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
293
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 298-485 Link Here
298
				}
314
				}
299
			}
315
			}
300
316
301
    stringBuffer.append(TEXT_31);
317
    stringBuffer.append(TEXT_37);
302
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
318
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
303
    stringBuffer.append(TEXT_32);
319
    stringBuffer.append(TEXT_38);
304
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
320
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
305
    stringBuffer.append(TEXT_33);
321
    stringBuffer.append(TEXT_39);
306
    
322
    
307
			if (containmentFeature.getEcoreFeature().isMany()) {
323
			if (containmentFeature.getEcoreFeature().isMany()) {
308
324
309
    stringBuffer.append(TEXT_34);
325
    stringBuffer.append(TEXT_40);
310
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
326
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
311
    stringBuffer.append(TEXT_35);
327
    stringBuffer.append(TEXT_41);
312
    stringBuffer.append(_edge);
328
    stringBuffer.append(_edge);
313
    stringBuffer.append(TEXT_36);
329
    stringBuffer.append(TEXT_42);
314
    stringBuffer.append(_edge);
330
    stringBuffer.append(_edge);
315
    stringBuffer.append(TEXT_37);
331
    stringBuffer.append(TEXT_43);
316
    stringBuffer.append(_edge);
332
    stringBuffer.append(_edge);
317
    stringBuffer.append(TEXT_38);
333
    stringBuffer.append(TEXT_44);
318
    
334
    
319
			} else {
335
			} else {
320
336
321
    stringBuffer.append(TEXT_39);
337
    stringBuffer.append(TEXT_45);
322
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
323
    stringBuffer.append(TEXT_40);
339
    stringBuffer.append(TEXT_46);
324
    stringBuffer.append(_edge);
340
    stringBuffer.append(_edge);
325
    stringBuffer.append(TEXT_41);
341
    stringBuffer.append(TEXT_47);
326
    stringBuffer.append(_edge);
342
    stringBuffer.append(_edge);
327
    stringBuffer.append(TEXT_42);
343
    stringBuffer.append(TEXT_48);
328
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
344
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
329
    stringBuffer.append(TEXT_43);
345
    stringBuffer.append(TEXT_49);
330
    
346
    
331
			}
347
			}
332
		} else {
348
		} else {
333
349
334
    stringBuffer.append(TEXT_44);
350
    stringBuffer.append(TEXT_50);
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
336
    stringBuffer.append(TEXT_45);
352
    stringBuffer.append(TEXT_51);
337
    
353
    
338
		}
354
		}
339
		if (removeChild) {
355
		if (removeChild) {
340
			if (childFeature.getEcoreFeature().isMany()) {
356
			if (childFeature.getEcoreFeature().isMany()) {
341
357
342
    stringBuffer.append(TEXT_46);
358
    stringBuffer.append(TEXT_52);
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
344
    stringBuffer.append(TEXT_47);
360
    stringBuffer.append(TEXT_53);
345
    stringBuffer.append(_edge);
361
    stringBuffer.append(_edge);
346
    stringBuffer.append(TEXT_48);
362
    stringBuffer.append(TEXT_54);
347
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
363
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
348
    stringBuffer.append(TEXT_49);
364
    stringBuffer.append(TEXT_55);
349
    stringBuffer.append(childFeature.getFeatureAccessorName());
365
    stringBuffer.append(childFeature.getFeatureAccessorName());
350
    stringBuffer.append(TEXT_50);
366
    stringBuffer.append(TEXT_56);
351
    stringBuffer.append(_edge);
367
    stringBuffer.append(_edge);
352
    stringBuffer.append(TEXT_51);
368
    stringBuffer.append(TEXT_57);
353
    
369
    
354
			} else {
370
			} else {
355
371
356
    stringBuffer.append(TEXT_52);
372
    stringBuffer.append(TEXT_58);
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
358
    stringBuffer.append(TEXT_53);
374
    stringBuffer.append(TEXT_59);
359
    stringBuffer.append(_edge);
375
    stringBuffer.append(_edge);
360
    stringBuffer.append(TEXT_54);
376
    stringBuffer.append(TEXT_60);
361
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
377
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
362
    stringBuffer.append(TEXT_55);
378
    stringBuffer.append(TEXT_61);
363
    stringBuffer.append(childFeature.getFeatureAccessorName());
379
    stringBuffer.append(childFeature.getFeatureAccessorName());
364
    stringBuffer.append(TEXT_56);
380
    stringBuffer.append(TEXT_62);
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
366
    stringBuffer.append(TEXT_57);
382
    stringBuffer.append(TEXT_63);
367
    
383
    
368
			}
384
			}
369
		}
385
		}
370
		if (removeSource) {
386
		if (removeSource) {
371
			if (sourceFeature.getEcoreFeature().isMany()) {
387
			if (sourceFeature.getEcoreFeature().isMany()) {
372
388
373
    stringBuffer.append(TEXT_58);
389
    stringBuffer.append(TEXT_64);
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
390
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
375
    stringBuffer.append(TEXT_59);
391
    stringBuffer.append(TEXT_65);
376
    stringBuffer.append(_edge);
392
    stringBuffer.append(_edge);
377
    stringBuffer.append(TEXT_60);
393
    stringBuffer.append(TEXT_66);
378
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
394
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
379
    stringBuffer.append(TEXT_61);
395
    stringBuffer.append(TEXT_67);
380
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
396
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
381
    stringBuffer.append(TEXT_62);
397
    stringBuffer.append(TEXT_68);
382
    stringBuffer.append(_edge);
398
    stringBuffer.append(_edge);
383
    stringBuffer.append(TEXT_63);
399
    stringBuffer.append(TEXT_69);
384
    
400
    
385
			} else {
401
			} else {
386
402
387
    stringBuffer.append(TEXT_64);
403
    stringBuffer.append(TEXT_70);
388
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
389
    stringBuffer.append(TEXT_65);
405
    stringBuffer.append(TEXT_71);
390
    stringBuffer.append(_edge);
406
    stringBuffer.append(_edge);
391
    stringBuffer.append(TEXT_66);
407
    stringBuffer.append(TEXT_72);
392
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
408
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
393
    stringBuffer.append(TEXT_67);
409
    stringBuffer.append(TEXT_73);
394
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
410
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
395
    stringBuffer.append(TEXT_68);
411
    stringBuffer.append(TEXT_74);
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
412
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
397
    stringBuffer.append(TEXT_69);
413
    stringBuffer.append(TEXT_75);
398
    
414
    
399
			}
415
			}
400
		}
416
		}
401
		if (removeTarget) {
417
		if (removeTarget) {
402
			if (targetFeature.getEcoreFeature().isMany()) {
418
			if (targetFeature.getEcoreFeature().isMany()) {
403
419
404
    stringBuffer.append(TEXT_70);
420
    stringBuffer.append(TEXT_76);
405
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
421
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
406
    stringBuffer.append(TEXT_71);
422
    stringBuffer.append(TEXT_77);
407
    stringBuffer.append(_edge);
423
    stringBuffer.append(_edge);
408
    stringBuffer.append(TEXT_72);
424
    stringBuffer.append(TEXT_78);
409
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
425
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
410
    stringBuffer.append(TEXT_73);
426
    stringBuffer.append(TEXT_79);
411
    stringBuffer.append(targetFeature.getFeatureAccessorName());
427
    stringBuffer.append(targetFeature.getFeatureAccessorName());
412
    stringBuffer.append(TEXT_74);
428
    stringBuffer.append(TEXT_80);
413
    stringBuffer.append(_edge);
429
    stringBuffer.append(_edge);
414
    stringBuffer.append(TEXT_75);
430
    stringBuffer.append(TEXT_81);
415
    
431
    
416
			} else {
432
			} else {
417
433
418
    stringBuffer.append(TEXT_76);
434
    stringBuffer.append(TEXT_82);
419
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
435
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
420
    stringBuffer.append(TEXT_77);
436
    stringBuffer.append(TEXT_83);
421
    stringBuffer.append(_edge);
437
    stringBuffer.append(_edge);
422
    stringBuffer.append(TEXT_78);
438
    stringBuffer.append(TEXT_84);
423
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
439
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
424
    stringBuffer.append(TEXT_79);
440
    stringBuffer.append(TEXT_85);
425
    stringBuffer.append(targetFeature.getFeatureAccessorName());
441
    stringBuffer.append(targetFeature.getFeatureAccessorName());
426
    stringBuffer.append(TEXT_80);
442
    stringBuffer.append(TEXT_86);
427
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
443
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
428
    stringBuffer.append(TEXT_81);
444
    stringBuffer.append(TEXT_87);
429
    
445
    
430
			}
446
			}
431
		}
447
		}
432
448
433
    stringBuffer.append(TEXT_82);
449
    stringBuffer.append(TEXT_88);
434
    
450
    
435
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
451
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
436
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
452
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
437
		if (metaFeature.getEcoreFeature().isMany()) {
453
		if (metaFeature.getEcoreFeature().isMany()) {
438
454
439
    stringBuffer.append(TEXT_83);
455
    stringBuffer.append(TEXT_89);
440
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
441
    stringBuffer.append(TEXT_84);
457
    stringBuffer.append(TEXT_90);
442
    stringBuffer.append(_edge);
458
    stringBuffer.append(_edge);
443
    stringBuffer.append(TEXT_85);
459
    stringBuffer.append(TEXT_91);
444
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
460
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
445
    stringBuffer.append(TEXT_86);
461
    stringBuffer.append(TEXT_92);
446
    stringBuffer.append(metaFeature.getFeatureAccessorName());
462
    stringBuffer.append(metaFeature.getFeatureAccessorName());
447
    stringBuffer.append(TEXT_87);
463
    stringBuffer.append(TEXT_93);
448
    stringBuffer.append(_edge);
464
    stringBuffer.append(_edge);
449
    stringBuffer.append(TEXT_88);
465
    stringBuffer.append(TEXT_94);
450
    
466
    
451
		} else {
467
		} else {
452
468
453
    stringBuffer.append(TEXT_89);
469
    stringBuffer.append(TEXT_95);
454
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
470
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
455
    stringBuffer.append(TEXT_90);
471
    stringBuffer.append(TEXT_96);
456
    stringBuffer.append(_edge);
472
    stringBuffer.append(_edge);
457
    stringBuffer.append(TEXT_91);
473
    stringBuffer.append(TEXT_97);
458
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
474
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
459
    stringBuffer.append(TEXT_92);
475
    stringBuffer.append(TEXT_98);
460
    stringBuffer.append(metaFeature.getFeatureAccessorName());
476
    stringBuffer.append(metaFeature.getFeatureAccessorName());
461
    stringBuffer.append(TEXT_93);
477
    stringBuffer.append(TEXT_99);
462
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
478
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
463
    stringBuffer.append(TEXT_94);
479
    stringBuffer.append(TEXT_100);
464
    
480
    
465
		}
481
		}
466
482
467
    
483
    
468
	}
484
	}
469
485
470
    stringBuffer.append(TEXT_95);
486
    stringBuffer.append(TEXT_101);
471
    
487
    
472
}	//local declarations
488
}	//local declarations
473
489
474
    stringBuffer.append(TEXT_96);
490
    stringBuffer.append(TEXT_102);
475
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
491
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
476
    stringBuffer.append(TEXT_97);
492
    stringBuffer.append(TEXT_103);
477
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
478
    stringBuffer.append(TEXT_98);
494
    stringBuffer.append(TEXT_104);
479
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
495
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
480
    stringBuffer.append(TEXT_99);
496
    stringBuffer.append(TEXT_105);
481
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + ".BendpointEditPolicy"));
497
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + ".BendpointEditPolicy"));
482
    stringBuffer.append(TEXT_100);
498
    stringBuffer.append(TEXT_106);
483
    
499
    
484
GenLinkLabel primaryLabel = null;
500
GenLinkLabel primaryLabel = null;
485
for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
501
for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
Lines 491-531 Link Here
491
}
507
}
492
if (primaryLabel != null) {
508
if (primaryLabel != null) {
493
509
494
    stringBuffer.append(TEXT_101);
510
    stringBuffer.append(TEXT_107);
495
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
496
    stringBuffer.append(TEXT_102);
512
    stringBuffer.append(TEXT_108);
497
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
513
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
498
    stringBuffer.append(TEXT_103);
514
    stringBuffer.append(TEXT_109);
499
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
515
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
500
    stringBuffer.append(TEXT_104);
516
    stringBuffer.append(TEXT_110);
501
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
517
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
502
    stringBuffer.append(TEXT_105);
518
    stringBuffer.append(TEXT_111);
503
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
519
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
504
    stringBuffer.append(TEXT_106);
520
    stringBuffer.append(TEXT_112);
505
    stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
521
    stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
506
    stringBuffer.append(TEXT_107);
522
    stringBuffer.append(TEXT_113);
507
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
523
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
508
    stringBuffer.append(TEXT_108);
524
    stringBuffer.append(TEXT_114);
509
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
525
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
510
    stringBuffer.append(TEXT_109);
526
    stringBuffer.append(TEXT_115);
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
527
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
512
    stringBuffer.append(TEXT_110);
528
    stringBuffer.append(TEXT_116);
513
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
529
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
514
    stringBuffer.append(TEXT_111);
530
    stringBuffer.append(TEXT_117);
515
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
531
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
516
    stringBuffer.append(TEXT_112);
532
    stringBuffer.append(TEXT_118);
517
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
533
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
518
    stringBuffer.append(TEXT_113);
534
    stringBuffer.append(TEXT_119);
519
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
535
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
520
    stringBuffer.append(TEXT_114);
536
    stringBuffer.append(TEXT_120);
521
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
537
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
522
    stringBuffer.append(TEXT_115);
538
    stringBuffer.append(TEXT_121);
523
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
539
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
524
    stringBuffer.append(TEXT_116);
540
    stringBuffer.append(TEXT_122);
525
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
541
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
526
    stringBuffer.append(TEXT_117);
542
    stringBuffer.append(TEXT_123);
527
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
543
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
528
    stringBuffer.append(TEXT_118);
544
    stringBuffer.append(TEXT_124);
529
    
545
    
530
		for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
546
		for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
531
			GenLinkLabel genLabel = (GenLinkLabel) it.next();
547
			GenLinkLabel genLabel = (GenLinkLabel) it.next();
Lines 533-625 Link Here
533
				continue;
549
				continue;
534
			}
550
			}
535
551
536
    stringBuffer.append(TEXT_119);
552
    stringBuffer.append(TEXT_125);
537
    stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
553
    stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
538
    stringBuffer.append(TEXT_120);
554
    stringBuffer.append(TEXT_126);
539
    
555
    
540
		}
556
		}
541
557
542
    stringBuffer.append(TEXT_121);
543
    
544
}	//if (primaryLabel != null, i.e., there are editable labels)
545
546
    stringBuffer.append(TEXT_122);
547
    stringBuffer.append(TEXT_123);
548
    stringBuffer.append(TEXT_124);
549
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
550
    stringBuffer.append(TEXT_125);
551
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
552
    stringBuffer.append(TEXT_126);
553
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
554
    stringBuffer.append(TEXT_127);
558
    stringBuffer.append(TEXT_127);
555
    
559
    
556
if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
560
}	//if (primaryLabel != null, i.e., there are editable labels)
557
	//Otherwise, there's no element associated with the element
558
561
559
    stringBuffer.append(TEXT_128);
562
    stringBuffer.append(TEXT_128);
560
    stringBuffer.append(TEXT_129);
563
    stringBuffer.append(TEXT_129);
561
    stringBuffer.append(TEXT_130);
564
    stringBuffer.append(TEXT_130);
562
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
565
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
563
    stringBuffer.append(TEXT_131);
566
    stringBuffer.append(TEXT_131);
564
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
565
    stringBuffer.append(TEXT_132);
566
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
567
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
568
    stringBuffer.append(TEXT_132);
569
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
567
    stringBuffer.append(TEXT_133);
570
    stringBuffer.append(TEXT_133);
568
    
571
    
569
}
572
if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
573
	//Otherwise, there's no element associated with the element
570
574
571
    stringBuffer.append(TEXT_134);
575
    stringBuffer.append(TEXT_134);
572
    stringBuffer.append(TEXT_135);
576
    stringBuffer.append(TEXT_135);
573
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
574
    stringBuffer.append(TEXT_136);
577
    stringBuffer.append(TEXT_136);
575
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
576
    stringBuffer.append(TEXT_137);
579
    stringBuffer.append(TEXT_137);
577
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
580
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
578
    stringBuffer.append(TEXT_138);
581
    stringBuffer.append(TEXT_138);
582
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
579
    stringBuffer.append(TEXT_139);
583
    stringBuffer.append(TEXT_139);
584
    
585
}
586
580
    stringBuffer.append(TEXT_140);
587
    stringBuffer.append(TEXT_140);
581
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
582
    stringBuffer.append(TEXT_141);
588
    stringBuffer.append(TEXT_141);
583
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
589
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
584
    stringBuffer.append(TEXT_142);
590
    stringBuffer.append(TEXT_142);
591
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
585
    stringBuffer.append(TEXT_143);
592
    stringBuffer.append(TEXT_143);
593
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
586
    stringBuffer.append(TEXT_144);
594
    stringBuffer.append(TEXT_144);
587
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
588
    stringBuffer.append(TEXT_145);
595
    stringBuffer.append(TEXT_145);
589
    stringBuffer.append(TEXT_146);
596
    stringBuffer.append(TEXT_146);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
590
    stringBuffer.append(TEXT_147);
598
    stringBuffer.append(TEXT_147);
591
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
599
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
592
    stringBuffer.append(TEXT_148);
600
    stringBuffer.append(TEXT_148);
593
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
594
    stringBuffer.append(TEXT_149);
601
    stringBuffer.append(TEXT_149);
595
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
596
    stringBuffer.append(TEXT_150);
602
    stringBuffer.append(TEXT_150);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
603
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
598
    stringBuffer.append(TEXT_151);
604
    stringBuffer.append(TEXT_151);
599
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
600
    stringBuffer.append(TEXT_152);
605
    stringBuffer.append(TEXT_152);
601
    stringBuffer.append(importManager.getImportedName("java.util.List"));
602
    stringBuffer.append(TEXT_153);
606
    stringBuffer.append(TEXT_153);
603
    stringBuffer.append(importManager.getImportedName("java.util.List"));
607
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
604
    stringBuffer.append(TEXT_154);
608
    stringBuffer.append(TEXT_154);
605
    stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
606
    stringBuffer.append(TEXT_155);
610
    stringBuffer.append(TEXT_155);
607
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
611
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
608
    stringBuffer.append(TEXT_156);
612
    stringBuffer.append(TEXT_156);
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
613
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
610
    stringBuffer.append(TEXT_157);
614
    stringBuffer.append(TEXT_157);
611
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
615
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
612
    stringBuffer.append(TEXT_158);
616
    stringBuffer.append(TEXT_158);
613
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
617
    stringBuffer.append(importManager.getImportedName("java.util.List"));
614
    stringBuffer.append(TEXT_159);
618
    stringBuffer.append(TEXT_159);
615
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
619
    stringBuffer.append(importManager.getImportedName("java.util.List"));
616
    stringBuffer.append(TEXT_160);
620
    stringBuffer.append(TEXT_160);
617
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
621
    stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
618
    stringBuffer.append(TEXT_161);
622
    stringBuffer.append(TEXT_161);
619
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter"));
623
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
620
    stringBuffer.append(TEXT_162);
624
    stringBuffer.append(TEXT_162);
621
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
625
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
622
    stringBuffer.append(TEXT_163);
626
    stringBuffer.append(TEXT_163);
627
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
628
    stringBuffer.append(TEXT_164);
629
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
630
    stringBuffer.append(TEXT_165);
631
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
632
    stringBuffer.append(TEXT_166);
633
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
634
    stringBuffer.append(TEXT_167);
635
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter"));
636
    stringBuffer.append(TEXT_168);
637
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
638
    stringBuffer.append(TEXT_169);
623
    
639
    
624
Viewmap viewmap = genLink.getViewmap();
640
Viewmap viewmap = genLink.getViewmap();
625
if (viewmap instanceof FigureViewmap) {
641
if (viewmap instanceof FigureViewmap) {
Lines 629-669 Link Here
629
		figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
645
		figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
630
	}
646
	}
631
647
632
    stringBuffer.append(TEXT_164);
648
    stringBuffer.append(TEXT_170);
633
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
649
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
634
    stringBuffer.append(TEXT_165);
650
    stringBuffer.append(TEXT_171);
635
    } // instanceof FigureViewmap
651
    } // instanceof FigureViewmap
636
	else if (viewmap instanceof SnippetViewmap) {
652
	else if (viewmap instanceof SnippetViewmap) {
637
    stringBuffer.append(TEXT_166);
653
    stringBuffer.append(TEXT_172);
638
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
654
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
639
    stringBuffer.append(TEXT_167);
655
    stringBuffer.append(TEXT_173);
640
    } // instanceof SnippetViewmap 
656
    } // instanceof SnippetViewmap 
641
	else if (viewmap instanceof InnerClassViewmap) {
657
	else if (viewmap instanceof InnerClassViewmap) {
642
    stringBuffer.append(TEXT_168);
658
    stringBuffer.append(TEXT_174);
643
    stringBuffer.append(((InnerClassViewmap) viewmap).getClassName());
659
    stringBuffer.append(((InnerClassViewmap) viewmap).getClassName());
644
    stringBuffer.append(TEXT_169);
660
    stringBuffer.append(TEXT_175);
645
    }
661
    }
646
    stringBuffer.append(TEXT_170);
662
    stringBuffer.append(TEXT_176);
647
    
663
    
648
if (genLink.getViewmap() instanceof InnerClassViewmap) {
664
if (genLink.getViewmap() instanceof InnerClassViewmap) {
649
	String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
665
	String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
650
666
651
    stringBuffer.append(TEXT_171);
667
    stringBuffer.append(TEXT_177);
652
    stringBuffer.append(classBody);
668
    stringBuffer.append(classBody);
653
    stringBuffer.append(TEXT_172);
669
    stringBuffer.append(TEXT_178);
654
    
670
    
655
if (classBody.indexOf("DPtoLP") != -1) {
671
if (classBody.indexOf("DPtoLP") != -1) {
656
672
657
    stringBuffer.append(TEXT_173);
673
    stringBuffer.append(TEXT_179);
658
    
674
    
659
}
675
}
660
676
661
    
677
    
662
}
678
}
663
679
664
    stringBuffer.append(TEXT_174);
680
    stringBuffer.append(TEXT_180);
665
    importManager.emitSortedImports();
681
    importManager.emitSortedImports();
666
    stringBuffer.append(TEXT_175);
682
    stringBuffer.append(TEXT_181);
667
    return stringBuffer.toString();
683
    return stringBuffer.toString();
668
  }
684
  }
669
}
685
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java (-117 / +123 lines)
Lines 170-240 Link Here
170
  protected final String TEXT_150 = " imageDescriptor = ";
170
  protected final String TEXT_150 = " imageDescriptor = ";
171
  protected final String TEXT_151 = ".getInstance().getItemImageDescriptor(element);" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
171
  protected final String TEXT_151 = ".getInstance().getItemImageDescriptor(element);" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
172
  protected final String TEXT_152 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
172
  protected final String TEXT_152 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
173
  protected final String TEXT_153 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn (";
173
  protected final String TEXT_153 = " resolveSemanticElement() {" + NL + "\t\tView view = (View) getModel();" + NL + "\t\treturn (view.getElement() instanceof ";
174
  protected final String TEXT_154 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
174
  protected final String TEXT_154 = ") ? (";
175
  protected final String TEXT_155 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
175
  protected final String TEXT_155 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
176
  protected final String TEXT_156 = ") {" + NL + "\t\t\t\treturn (";
176
  protected final String TEXT_156 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
177
  protected final String TEXT_157 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
177
  protected final String TEXT_157 = ") {" + NL + "\t\t\t\treturn (";
178
  protected final String TEXT_158 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
178
  protected final String TEXT_158 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
179
  protected final String TEXT_159 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
179
  protected final String TEXT_159 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
180
  protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
180
  protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
181
  protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
181
  protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
182
  protected final String TEXT_162 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
182
  protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
183
  protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
183
  protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
184
  protected final String TEXT_164 = NL + "\t\t\tupdatableParent.addRefresher(";
184
  protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
185
  protected final String TEXT_165 = ".eINSTANCE.get";
185
  protected final String TEXT_165 = NL + "\t\t\tupdatableParent.addRefresher(";
186
  protected final String TEXT_166 = "(), labelRefresher);";
186
  protected final String TEXT_166 = ".eINSTANCE.get";
187
  protected final String TEXT_167 = NL + "\t\t\tupdatableParent.addRefresher(";
187
  protected final String TEXT_167 = "(), labelRefresher);";
188
  protected final String TEXT_168 = ".eINSTANCE.get";
188
  protected final String TEXT_168 = NL + "\t\t\tupdatableParent.addRefresher(";
189
  protected final String TEXT_169 = "(), labelRefresher);";
189
  protected final String TEXT_169 = ".eINSTANCE.get";
190
  protected final String TEXT_170 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
190
  protected final String TEXT_170 = "(), labelRefresher);";
191
  protected final String TEXT_171 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
191
  protected final String TEXT_171 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
192
  protected final String TEXT_172 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
192
  protected final String TEXT_172 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
193
  protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
193
  protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
194
  protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
194
  protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
195
  protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
195
  protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
196
  protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
196
  protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
197
  protected final String TEXT_177 = NL + "\t\t\tupdatableParent.removeRefresher(";
197
  protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
198
  protected final String TEXT_178 = ".eINSTANCE.get";
198
  protected final String TEXT_178 = NL + "\t\t\tupdatableParent.removeRefresher(";
199
  protected final String TEXT_179 = "(), labelRefresher);";
199
  protected final String TEXT_179 = ".eINSTANCE.get";
200
  protected final String TEXT_180 = NL + "\t\t\tupdatableParent.removeRefresher(";
200
  protected final String TEXT_180 = "(), labelRefresher);";
201
  protected final String TEXT_181 = ".eINSTANCE.get";
201
  protected final String TEXT_181 = NL + "\t\t\tupdatableParent.removeRefresher(";
202
  protected final String TEXT_182 = "(), labelRefresher);";
202
  protected final String TEXT_182 = ".eINSTANCE.get";
203
  protected final String TEXT_183 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};";
203
  protected final String TEXT_183 = "(), labelRefresher);";
204
  protected final String TEXT_184 = NL;
204
  protected final String TEXT_184 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};";
205
  protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
205
  protected final String TEXT_185 = NL;
206
  protected final String TEXT_186 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
206
  protected final String TEXT_186 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
207
  protected final String TEXT_187 = " method" + NL + "\t\treturn null;" + NL + "\t}";
207
  protected final String TEXT_187 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
208
  protected final String TEXT_188 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
208
  protected final String TEXT_188 = " method" + NL + "\t\treturn null;" + NL + "\t}";
209
  protected final String TEXT_189 = " createLabel() {";
209
  protected final String TEXT_189 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
210
  protected final String TEXT_190 = NL + "\t\treturn new ";
210
  protected final String TEXT_190 = " createLabel() {";
211
  protected final String TEXT_191 = "();";
211
  protected final String TEXT_191 = NL + "\t\treturn new ";
212
  protected final String TEXT_192 = NL + "\t\treturn ";
212
  protected final String TEXT_192 = "();";
213
  protected final String TEXT_193 = ";";
213
  protected final String TEXT_193 = NL + "\t\treturn ";
214
  protected final String TEXT_194 = NL + "\t\treturn new ";
214
  protected final String TEXT_194 = ";";
215
  protected final String TEXT_195 = "();";
215
  protected final String TEXT_195 = NL + "\t\treturn new ";
216
  protected final String TEXT_196 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
216
  protected final String TEXT_196 = "();";
217
  protected final String TEXT_197 = " createFigure() {" + NL + "\t\t";
217
  protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
218
  protected final String TEXT_198 = " label = createLabel();";
218
  protected final String TEXT_198 = " createFigure() {" + NL + "\t\t";
219
  protected final String TEXT_199 = NL + "\t\tdefaultText = label.getText();";
219
  protected final String TEXT_199 = " label = createLabel();";
220
  protected final String TEXT_200 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
220
  protected final String TEXT_200 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment(";
221
  protected final String TEXT_201 = NL + "\t\treturn label;" + NL + "\t}";
221
  protected final String TEXT_201 = ".LEFT);";
222
  protected final String TEXT_202 = NL + NL + "\t/**";
222
  protected final String TEXT_202 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
223
  protected final String TEXT_203 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
223
  protected final String TEXT_203 = NL + "\t\treturn label;" + NL + "\t}";
224
  protected final String TEXT_204 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
224
  protected final String TEXT_204 = NL + NL + "\t/**";
225
  protected final String TEXT_205 = " getLabel() {" + NL + "\t\treturn (";
225
  protected final String TEXT_205 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
226
  protected final String TEXT_206 = ") getFigure();" + NL + "\t}" + NL;
226
  protected final String TEXT_206 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
227
  protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
227
  protected final String TEXT_207 = " getLabel() {" + NL + "\t\treturn (";
228
  protected final String TEXT_208 = "(";
228
  protected final String TEXT_208 = ") getFigure();" + NL + "\t}" + NL;
229
  protected final String TEXT_209 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
229
  protected final String TEXT_209 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
230
  protected final String TEXT_210 = NL + "\t\tdefaultText = figure.getText();";
230
  protected final String TEXT_210 = "(";
231
  protected final String TEXT_211 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
231
  protected final String TEXT_211 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
232
  protected final String TEXT_212 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
232
  protected final String TEXT_212 = NL + "\t\tdefaultText = figure.getText();";
233
  protected final String TEXT_213 = NL;
233
  protected final String TEXT_213 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
234
  protected final String TEXT_214 = NL;
234
  protected final String TEXT_214 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
235
  protected final String TEXT_215 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
235
  protected final String TEXT_215 = NL;
236
  protected final String TEXT_216 = NL + "}";
236
  protected final String TEXT_216 = NL;
237
  protected final String TEXT_217 = NL;
237
  protected final String TEXT_217 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
238
  protected final String TEXT_218 = NL + "}";
239
  protected final String TEXT_219 = NL;
238
240
239
  public String generate(Object argument)
241
  public String generate(Object argument)
240
  {
242
  {
Lines 695-701 Link Here
695
    stringBuffer.append(TEXT_153);
697
    stringBuffer.append(TEXT_153);
696
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
698
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
697
    stringBuffer.append(TEXT_154);
699
    stringBuffer.append(TEXT_154);
698
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
700
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
699
    stringBuffer.append(TEXT_155);
701
    stringBuffer.append(TEXT_155);
700
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
702
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
701
    stringBuffer.append(TEXT_156);
703
    stringBuffer.append(TEXT_156);
Lines 703-709 Link Here
703
    stringBuffer.append(TEXT_157);
705
    stringBuffer.append(TEXT_157);
704
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
706
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
705
    stringBuffer.append(TEXT_158);
707
    stringBuffer.append(TEXT_158);
706
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
708
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
707
    stringBuffer.append(TEXT_159);
709
    stringBuffer.append(TEXT_159);
708
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
710
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
709
    stringBuffer.append(TEXT_160);
711
    stringBuffer.append(TEXT_160);
Lines 713-746 Link Here
713
    stringBuffer.append(TEXT_162);
715
    stringBuffer.append(TEXT_162);
714
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
716
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
715
    stringBuffer.append(TEXT_163);
717
    stringBuffer.append(TEXT_163);
718
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
719
    stringBuffer.append(TEXT_164);
716
    
720
    
717
if (labelModelFacet instanceof FeatureLabelModelFacet) {
721
if (labelModelFacet instanceof FeatureLabelModelFacet) {
718
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
722
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
719
723
720
    stringBuffer.append(TEXT_164);
721
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
722
    stringBuffer.append(TEXT_165);
724
    stringBuffer.append(TEXT_165);
723
    stringBuffer.append(feature.getFeatureAccessorName());
725
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
724
    stringBuffer.append(TEXT_166);
726
    stringBuffer.append(TEXT_166);
727
    stringBuffer.append(feature.getFeatureAccessorName());
728
    stringBuffer.append(TEXT_167);
725
    
729
    
726
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
730
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
727
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
731
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
728
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
732
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
729
		GenFeature next = (GenFeature) it.next();
733
		GenFeature next = (GenFeature) it.next();
730
734
731
    stringBuffer.append(TEXT_167);
732
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
733
    stringBuffer.append(TEXT_168);
735
    stringBuffer.append(TEXT_168);
734
    stringBuffer.append(next.getFeatureAccessorName());
736
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
735
    stringBuffer.append(TEXT_169);
737
    stringBuffer.append(TEXT_169);
738
    stringBuffer.append(next.getFeatureAccessorName());
739
    stringBuffer.append(TEXT_170);
736
    
740
    
737
	}
741
	}
738
}
742
}
739
743
740
    stringBuffer.append(TEXT_170);
741
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
742
    stringBuffer.append(TEXT_171);
744
    stringBuffer.append(TEXT_171);
743
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
745
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
744
    stringBuffer.append(TEXT_172);
746
    stringBuffer.append(TEXT_172);
745
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
747
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
746
    stringBuffer.append(TEXT_173);
748
    stringBuffer.append(TEXT_173);
Lines 750-784 Link Here
750
    stringBuffer.append(TEXT_175);
752
    stringBuffer.append(TEXT_175);
751
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
753
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
752
    stringBuffer.append(TEXT_176);
754
    stringBuffer.append(TEXT_176);
755
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
756
    stringBuffer.append(TEXT_177);
753
    
757
    
754
if (labelModelFacet instanceof FeatureLabelModelFacet) {
758
if (labelModelFacet instanceof FeatureLabelModelFacet) {
755
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
759
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
756
760
757
    stringBuffer.append(TEXT_177);
758
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
759
    stringBuffer.append(TEXT_178);
761
    stringBuffer.append(TEXT_178);
760
    stringBuffer.append(feature.getFeatureAccessorName());
762
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
761
    stringBuffer.append(TEXT_179);
763
    stringBuffer.append(TEXT_179);
764
    stringBuffer.append(feature.getFeatureAccessorName());
765
    stringBuffer.append(TEXT_180);
762
    
766
    
763
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
767
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
764
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
768
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
765
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
769
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
766
		GenFeature next = (GenFeature) it.next();
770
		GenFeature next = (GenFeature) it.next();
767
771
768
    stringBuffer.append(TEXT_180);
769
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
770
    stringBuffer.append(TEXT_181);
772
    stringBuffer.append(TEXT_181);
771
    stringBuffer.append(next.getFeatureAccessorName());
773
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
772
    stringBuffer.append(TEXT_182);
774
    stringBuffer.append(TEXT_182);
775
    stringBuffer.append(next.getFeatureAccessorName());
776
    stringBuffer.append(TEXT_183);
773
    
777
    
774
	}
778
	}
775
}
779
}
776
780
777
    stringBuffer.append(TEXT_183);
781
    stringBuffer.append(TEXT_184);
778
    
782
    
779
final Viewmap viewmap = genLabel.getViewmap();
783
final Viewmap viewmap = genLabel.getViewmap();
780
784
781
    stringBuffer.append(TEXT_184);
785
    stringBuffer.append(TEXT_185);
782
    
786
    
783
final String figureQualifiedClassName;
787
final String figureQualifiedClassName;
784
if (viewmap instanceof ParentAssignedViewmap) {
788
if (viewmap instanceof ParentAssignedViewmap) {
Lines 807-870 Link Here
807
if (viewmap instanceof ParentAssignedViewmap) {
811
if (viewmap instanceof ParentAssignedViewmap) {
808
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
812
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
809
813
810
    stringBuffer.append(TEXT_185);
811
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
812
    stringBuffer.append(TEXT_186);
814
    stringBuffer.append(TEXT_186);
813
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
814
    stringBuffer.append(TEXT_187);
816
    stringBuffer.append(TEXT_187);
815
    } else { 
817
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
816
    stringBuffer.append(TEXT_188);
818
    stringBuffer.append(TEXT_188);
817
    stringBuffer.append(figureImportedName);
819
    } else { 
818
    stringBuffer.append(TEXT_189);
820
    stringBuffer.append(TEXT_189);
821
    stringBuffer.append(figureImportedName);
822
    stringBuffer.append(TEXT_190);
819
    
823
    
820
if (viewmap instanceof FigureViewmap) {
824
if (viewmap instanceof FigureViewmap) {
821
825
822
    stringBuffer.append(TEXT_190);
823
    stringBuffer.append(figureImportedName);
824
    stringBuffer.append(TEXT_191);
826
    stringBuffer.append(TEXT_191);
827
    stringBuffer.append(figureImportedName);
828
    stringBuffer.append(TEXT_192);
825
    } // instanceof FigureViewmap
829
    } // instanceof FigureViewmap
826
 else if (viewmap instanceof SnippetViewmap) {
830
 else if (viewmap instanceof SnippetViewmap) {
827
    stringBuffer.append(TEXT_192);
828
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
829
    stringBuffer.append(TEXT_193);
831
    stringBuffer.append(TEXT_193);
832
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
833
    stringBuffer.append(TEXT_194);
830
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
834
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
831
 else if (viewmap instanceof InnerClassViewmap) {
835
 else if (viewmap instanceof InnerClassViewmap) {
832
836
833
    stringBuffer.append(TEXT_194);
834
    stringBuffer.append(figureImportedName);
835
    stringBuffer.append(TEXT_195);
837
    stringBuffer.append(TEXT_195);
836
    }
838
    stringBuffer.append(figureImportedName);
837
    stringBuffer.append(TEXT_196);
839
    stringBuffer.append(TEXT_196);
838
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
840
    }
839
    stringBuffer.append(TEXT_197);
841
    stringBuffer.append(TEXT_197);
840
    stringBuffer.append(figureImportedName);
842
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
841
    stringBuffer.append(TEXT_198);
843
    stringBuffer.append(TEXT_198);
844
    stringBuffer.append(figureImportedName);
845
    stringBuffer.append(TEXT_199);
842
    
846
    
843
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
847
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
844
848
845
    stringBuffer.append(TEXT_199);
849
    stringBuffer.append(TEXT_200);
850
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
851
    stringBuffer.append(TEXT_201);
846
    
852
    
847
} else {
853
} else {
848
854
849
    stringBuffer.append(TEXT_200);
855
    stringBuffer.append(TEXT_202);
850
    
856
    
851
}
857
}
852
858
853
    stringBuffer.append(TEXT_201);
859
    stringBuffer.append(TEXT_203);
854
    }	/*not parent-assigned*/
860
    }	/*not parent-assigned*/
855
    stringBuffer.append(TEXT_202);
861
    stringBuffer.append(TEXT_204);
856
    
862
    
857
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
863
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
858
864
859
    stringBuffer.append(TEXT_203);
865
    stringBuffer.append(TEXT_205);
860
    
866
    
861
}
867
}
862
868
863
    stringBuffer.append(TEXT_204);
869
    stringBuffer.append(TEXT_206);
864
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
870
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
865
    stringBuffer.append(TEXT_205);
871
    stringBuffer.append(TEXT_207);
866
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
872
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
867
    stringBuffer.append(TEXT_206);
873
    stringBuffer.append(TEXT_208);
868
    
874
    
869
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
875
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
870
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
876
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
Lines 878-920 Link Here
878
	}
884
	}
879
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
885
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
880
886
881
    stringBuffer.append(TEXT_207);
887
    stringBuffer.append(TEXT_209);
882
    stringBuffer.append(labelSetterName);
888
    stringBuffer.append(labelSetterName);
883
    stringBuffer.append(TEXT_208);
889
    stringBuffer.append(TEXT_210);
884
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
890
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
885
    stringBuffer.append(TEXT_209);
891
    stringBuffer.append(TEXT_211);
886
    
892
    
887
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
893
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
888
894
889
    stringBuffer.append(TEXT_210);
895
    stringBuffer.append(TEXT_212);
890
    
896
    
891
} else {
897
} else {
892
898
893
    stringBuffer.append(TEXT_211);
899
    stringBuffer.append(TEXT_213);
894
    
900
    
895
}
901
}
896
902
897
    stringBuffer.append(TEXT_212);
903
    stringBuffer.append(TEXT_214);
898
    
904
    
899
if (viewmap instanceof InnerClassViewmap) {
905
if (viewmap instanceof InnerClassViewmap) {
900
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
906
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
901
907
902
    stringBuffer.append(TEXT_213);
908
    stringBuffer.append(TEXT_215);
903
    stringBuffer.append(classBody);
909
    stringBuffer.append(classBody);
904
    stringBuffer.append(TEXT_214);
910
    stringBuffer.append(TEXT_216);
905
    
911
    
906
if (classBody.indexOf("DPtoLP") != -1) {
912
if (classBody.indexOf("DPtoLP") != -1) {
907
913
908
    stringBuffer.append(TEXT_215);
914
    stringBuffer.append(TEXT_217);
909
    
915
    
910
}
916
}
911
917
912
    
918
    
913
}
919
}
914
920
915
    stringBuffer.append(TEXT_216);
921
    stringBuffer.append(TEXT_218);
916
    importManager.emitSortedImports();
922
    importManager.emitSortedImports();
917
    stringBuffer.append(TEXT_217);
923
    stringBuffer.append(TEXT_219);
918
    return stringBuffer.toString();
924
    return stringBuffer.toString();
919
  }
925
  }
920
}
926
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java (-388 / +393 lines)
Lines 88-289 Link Here
88
  protected final String TEXT_69 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
88
  protected final String TEXT_69 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
89
  protected final String TEXT_70 = "());";
89
  protected final String TEXT_70 = "());";
90
  protected final String TEXT_71 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
90
  protected final String TEXT_71 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
91
  protected final String TEXT_72 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn (";
91
  protected final String TEXT_72 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof ";
92
  protected final String TEXT_73 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
92
  protected final String TEXT_73 = ") ? (";
93
  protected final String TEXT_74 = NL;
93
  protected final String TEXT_74 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
94
  protected final String TEXT_75 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
94
  protected final String TEXT_75 = NL;
95
  protected final String TEXT_76 = " domainModelEditDomain = ";
95
  protected final String TEXT_76 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
96
  protected final String TEXT_77 = ".getEditingDomain(";
96
  protected final String TEXT_77 = " domainModelEditDomain = ";
97
  protected final String TEXT_78 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
97
  protected final String TEXT_78 = ".getEditingDomain(";
98
  protected final String TEXT_79 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
98
  protected final String TEXT_79 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
99
  protected final String TEXT_80 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
99
  protected final String TEXT_80 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
100
  protected final String TEXT_81 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
100
  protected final String TEXT_81 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
101
  protected final String TEXT_82 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
101
  protected final String TEXT_82 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
102
  protected final String TEXT_83 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
102
  protected final String TEXT_83 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
103
  protected final String TEXT_84 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
103
  protected final String TEXT_84 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
104
  protected final String TEXT_85 = ".NOT_TOUCH;" + NL + "\t\t}";
104
  protected final String TEXT_85 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
105
  protected final String TEXT_86 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
105
  protected final String TEXT_86 = ".NOT_TOUCH;" + NL + "\t\t}";
106
  protected final String TEXT_87 = NL + "\t\t\tfilter = ";
106
  protected final String TEXT_87 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
107
  protected final String TEXT_88 = ".createFeatureFilter(";
107
  protected final String TEXT_88 = NL + "\t\t\tfilter = ";
108
  protected final String TEXT_89 = ".eINSTANCE.get";
108
  protected final String TEXT_89 = ".createFeatureFilter(";
109
  protected final String TEXT_90 = "());";
109
  protected final String TEXT_90 = ".eINSTANCE.get";
110
  protected final String TEXT_91 = NL + "\t\t\tfilter = filter.or(";
110
  protected final String TEXT_91 = "());";
111
  protected final String TEXT_92 = ".createFeatureFilter(";
111
  protected final String TEXT_92 = NL + "\t\t\tfilter = filter.or(";
112
  protected final String TEXT_93 = ".eINSTANCE.get";
112
  protected final String TEXT_93 = ".createFeatureFilter(";
113
  protected final String TEXT_94 = "()));";
113
  protected final String TEXT_94 = ".eINSTANCE.get";
114
  protected final String TEXT_95 = NL + "\t\t\tfilter = filter.and(";
114
  protected final String TEXT_95 = "()));";
115
  protected final String TEXT_96 = ".createNotifierFilter(";
115
  protected final String TEXT_96 = NL + "\t\t\tfilter = filter.and(";
116
  protected final String TEXT_97 = "));";
116
  protected final String TEXT_97 = ".createNotifierFilter(";
117
  protected final String TEXT_98 = NL + "\t\t\tfilter = ";
117
  protected final String TEXT_98 = "));";
118
  protected final String TEXT_99 = ".createNotifierFilter(";
118
  protected final String TEXT_99 = NL + "\t\t\tfilter = ";
119
  protected final String TEXT_100 = ");";
119
  protected final String TEXT_100 = ".createNotifierFilter(";
120
  protected final String TEXT_101 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
120
  protected final String TEXT_101 = ");";
121
  protected final String TEXT_102 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
121
  protected final String TEXT_102 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
122
  protected final String TEXT_103 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
122
  protected final String TEXT_103 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
123
  protected final String TEXT_104 = " transactionAboutToCommit(";
123
  protected final String TEXT_104 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
124
  protected final String TEXT_105 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
124
  protected final String TEXT_105 = " transactionAboutToCommit(";
125
  protected final String TEXT_106 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
125
  protected final String TEXT_106 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
126
  protected final String TEXT_107 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
126
  protected final String TEXT_107 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
127
  protected final String TEXT_108 = " domainModelEditDomain = ";
127
  protected final String TEXT_108 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
128
  protected final String TEXT_109 = ".getEditingDomain(";
128
  protected final String TEXT_109 = " domainModelEditDomain = ";
129
  protected final String TEXT_110 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
129
  protected final String TEXT_110 = ".getEditingDomain(";
130
  protected final String TEXT_111 = " getRefreshNotationModelCommand() {" + NL + "\t\t";
130
  protected final String TEXT_111 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
131
  protected final String TEXT_112 = " semanticChildren = getSemanticChildren();" + NL + "\t\t";
131
  protected final String TEXT_112 = " getRefreshNotationModelCommand() {" + NL + "\t\t";
132
  protected final String TEXT_113 = " notationalChildren = ";
132
  protected final String TEXT_113 = " semanticChildren = getSemanticChildren();" + NL + "\t\t";
133
  protected final String TEXT_114 = ".getChildren();" + NL + "\t\tfinal ";
133
  protected final String TEXT_114 = " notationalChildren = ";
134
  protected final String TEXT_115 = " semanticToNotational = new ";
134
  protected final String TEXT_115 = ".getChildren();" + NL + "\t\tfinal ";
135
  protected final String TEXT_116 = "();" + NL + "\t\tfor(";
135
  protected final String TEXT_116 = " semanticToNotational = new ";
136
  protected final String TEXT_117 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
136
  protected final String TEXT_117 = "();" + NL + "\t\tfor(";
137
  protected final String TEXT_118 = " next = (";
137
  protected final String TEXT_118 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
138
  protected final String TEXT_119 = ") it.next();" + NL + "\t\t\t";
138
  protected final String TEXT_119 = " next = (";
139
  protected final String TEXT_120 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
139
  protected final String TEXT_120 = ") it.next();" + NL + "\t\t\t";
140
  protected final String TEXT_121 = " parentView = ";
140
  protected final String TEXT_121 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
141
  protected final String TEXT_122 = ";" + NL + "\t\t";
141
  protected final String TEXT_122 = " parentView = ";
142
  protected final String TEXT_123 = " command = new ";
142
  protected final String TEXT_123 = ";" + NL + "\t\t";
143
  protected final String TEXT_124 = "();" + NL + "\t\tfor(";
143
  protected final String TEXT_124 = " command = new ";
144
  protected final String TEXT_125 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
144
  protected final String TEXT_125 = "();" + NL + "\t\tfor(";
145
  protected final String TEXT_126 = " next = (";
145
  protected final String TEXT_126 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
146
  protected final String TEXT_127 = ") it.next();" + NL + "\t\t\t";
146
  protected final String TEXT_127 = " next = (";
147
  protected final String TEXT_128 = " currentView = (";
147
  protected final String TEXT_128 = ") it.next();" + NL + "\t\t\t";
148
  protected final String TEXT_129 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = ";
148
  protected final String TEXT_129 = " currentView = (";
149
  protected final String TEXT_130 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != ";
149
  protected final String TEXT_130 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = ";
150
  protected final String TEXT_131 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t";
150
  protected final String TEXT_131 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != ";
151
  protected final String TEXT_132 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new ";
151
  protected final String TEXT_132 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t";
152
  protected final String TEXT_133 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
152
  protected final String TEXT_133 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new ";
153
  protected final String TEXT_134 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
153
  protected final String TEXT_134 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
154
  protected final String TEXT_135 = " obsoleteView = (";
154
  protected final String TEXT_135 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
155
  protected final String TEXT_136 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
155
  protected final String TEXT_136 = " obsoleteView = (";
156
  protected final String TEXT_137 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate ";
156
  protected final String TEXT_137 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
157
  protected final String TEXT_138 = " getCreateNotationalElementCommand(";
157
  protected final String TEXT_138 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate ";
158
  protected final String TEXT_139 = " parentView, ";
158
  protected final String TEXT_139 = " getCreateNotationalElementCommand(";
159
  protected final String TEXT_140 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {";
159
  protected final String TEXT_140 = " parentView, ";
160
  protected final String TEXT_141 = NL + "\t\tcase ";
160
  protected final String TEXT_141 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {";
161
  protected final String TEXT_142 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof ";
161
  protected final String TEXT_142 = NL + "\t\tcase ";
162
  protected final String TEXT_143 = ") {" + NL + "\t\t\t\treturn new Create";
162
  protected final String TEXT_143 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof ";
163
  protected final String TEXT_144 = "NotationCommand(parentView, domainElement";
163
  protected final String TEXT_144 = ") {" + NL + "\t\t\t\treturn new Create";
164
  protected final String TEXT_145 = ", new Rectangle(0, 0, 0, 0)";
164
  protected final String TEXT_145 = "NotationCommand(parentView, domainElement";
165
  protected final String TEXT_146 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;";
165
  protected final String TEXT_146 = ", new Rectangle(0, 0, 0, 0)";
166
  protected final String TEXT_147 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
166
  protected final String TEXT_147 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;";
167
  protected final String TEXT_148 = " getSemanticChildren() {";
167
  protected final String TEXT_148 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
168
  protected final String TEXT_149 = NL;
168
  protected final String TEXT_149 = " getSemanticChildren() {";
169
  protected final String TEXT_150 = NL + "\treturn ";
169
  protected final String TEXT_150 = NL;
170
  protected final String TEXT_151 = ".EMPTY_LIST;";
170
  protected final String TEXT_151 = NL + "\treturn ";
171
  protected final String TEXT_152 = NL + "\t";
171
  protected final String TEXT_152 = ".EMPTY_LIST;";
172
  protected final String TEXT_153 = " result = new ";
172
  protected final String TEXT_153 = NL + "\t";
173
  protected final String TEXT_154 = "();";
173
  protected final String TEXT_154 = " result = new ";
174
  protected final String TEXT_155 = NL + "\t";
174
  protected final String TEXT_155 = "();";
175
  protected final String TEXT_156 = " viewObject = ";
175
  protected final String TEXT_156 = NL + "\t";
176
  protected final String TEXT_157 = ";" + NL + "\t";
176
  protected final String TEXT_157 = " viewObject = ";
177
  protected final String TEXT_158 = " modelObject = ";
177
  protected final String TEXT_158 = ";" + NL + "\t";
178
  protected final String TEXT_159 = ";" + NL + "\t";
178
  protected final String TEXT_159 = " modelObject = ";
179
  protected final String TEXT_160 = " nextValue;" + NL + "\tint nodeVID;";
179
  protected final String TEXT_160 = ";" + NL + "\t";
180
  protected final String TEXT_161 = NL + "\tfor(";
180
  protected final String TEXT_161 = " nextValue;" + NL + "\tint nodeVID;";
181
  protected final String TEXT_162 = " it = ((";
181
  protected final String TEXT_162 = NL + "\tfor(";
182
  protected final String TEXT_163 = ")modelObject).";
182
  protected final String TEXT_163 = " it = ((";
183
  protected final String TEXT_164 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
183
  protected final String TEXT_164 = ")modelObject).";
184
  protected final String TEXT_165 = ") it.next();";
184
  protected final String TEXT_165 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
185
  protected final String TEXT_166 = NL + "\tnextValue = ((";
185
  protected final String TEXT_166 = ") it.next();";
186
  protected final String TEXT_167 = ")modelObject).";
186
  protected final String TEXT_167 = NL + "\tnextValue = ((";
187
  protected final String TEXT_168 = "();";
187
  protected final String TEXT_168 = ")modelObject).";
188
  protected final String TEXT_169 = NL + "\tnodeVID = ";
188
  protected final String TEXT_169 = "();";
189
  protected final String TEXT_170 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
189
  protected final String TEXT_170 = NL + "\tnodeVID = ";
190
  protected final String TEXT_171 = NL + "\tswitch (nodeVID) {";
190
  protected final String TEXT_171 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
191
  protected final String TEXT_172 = NL + "\tcase ";
191
  protected final String TEXT_172 = NL + "\tswitch (nodeVID) {";
192
  protected final String TEXT_173 = ".VISUAL_ID: {";
192
  protected final String TEXT_173 = NL + "\tcase ";
193
  protected final String TEXT_174 = NL + "\tif (";
193
  protected final String TEXT_174 = ".VISUAL_ID: {";
194
  protected final String TEXT_175 = ".VISUAL_ID == nodeVID) {";
194
  protected final String TEXT_175 = NL + "\tif (";
195
  protected final String TEXT_176 = NL + "\t\tresult.add(nextValue);";
195
  protected final String TEXT_176 = ".VISUAL_ID == nodeVID) {";
196
  protected final String TEXT_177 = NL + "\t\tbreak;" + NL + "\t\t}";
196
  protected final String TEXT_177 = NL + "\t\tresult.add(nextValue);";
197
  protected final String TEXT_178 = NL + "\t\t}";
197
  protected final String TEXT_178 = NL + "\t\tbreak;" + NL + "\t\t}";
198
  protected final String TEXT_179 = NL + "\t}";
198
  protected final String TEXT_179 = NL + "\t\t}";
199
  protected final String TEXT_180 = NL + "\t}";
199
  protected final String TEXT_180 = NL + "\t}";
200
  protected final String TEXT_181 = NL + "\treturn result;";
200
  protected final String TEXT_181 = NL + "\t}";
201
  protected final String TEXT_182 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns ";
201
  protected final String TEXT_182 = NL + "\treturn result;";
202
  protected final String TEXT_183 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn ";
202
  protected final String TEXT_183 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns ";
203
  protected final String TEXT_184 = ";" + NL + "\t}";
203
  protected final String TEXT_184 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn ";
204
  protected final String TEXT_185 = NL;
204
  protected final String TEXT_185 = ";" + NL + "\t}";
205
  protected final String TEXT_186 = NL;
205
  protected final String TEXT_186 = NL;
206
  protected final String TEXT_187 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
206
  protected final String TEXT_187 = NL;
207
  protected final String TEXT_188 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
207
  protected final String TEXT_188 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
208
  protected final String TEXT_189 = " feature, ";
208
  protected final String TEXT_189 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
209
  protected final String TEXT_190 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
209
  protected final String TEXT_190 = " feature, ";
210
  protected final String TEXT_191 = NL;
210
  protected final String TEXT_191 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
211
  protected final String TEXT_192 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
211
  protected final String TEXT_192 = NL;
212
  protected final String TEXT_193 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
212
  protected final String TEXT_193 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
213
  protected final String TEXT_194 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
213
  protected final String TEXT_194 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
214
  protected final String TEXT_195 = NL;
214
  protected final String TEXT_195 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
215
  protected final String TEXT_196 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
215
  protected final String TEXT_196 = NL;
216
  protected final String TEXT_197 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL;
216
  protected final String TEXT_197 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
217
  protected final String TEXT_198 = NL;
217
  protected final String TEXT_198 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL;
218
  protected final String TEXT_199 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
218
  protected final String TEXT_199 = NL;
219
  protected final String TEXT_200 = "static ";
219
  protected final String TEXT_200 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
220
  protected final String TEXT_201 = "class Create";
220
  protected final String TEXT_201 = "static ";
221
  protected final String TEXT_202 = "NotationCommand extends ";
221
  protected final String TEXT_202 = "class Create";
222
  protected final String TEXT_203 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create";
222
  protected final String TEXT_203 = "NotationCommand extends ";
223
  protected final String TEXT_204 = "NotationCommand(";
223
  protected final String TEXT_204 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create";
224
  protected final String TEXT_205 = " parent, " + NL + "\t\t\t\t";
224
  protected final String TEXT_205 = "NotationCommand(";
225
  protected final String TEXT_206 = " domainElement";
225
  protected final String TEXT_206 = " parent, " + NL + "\t\t\t\t";
226
  protected final String TEXT_207 = ", ";
226
  protected final String TEXT_207 = " domainElement";
227
  protected final String TEXT_208 = " constraint";
227
  protected final String TEXT_208 = ", ";
228
  protected final String TEXT_209 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = ";
228
  protected final String TEXT_209 = " constraint";
229
  protected final String TEXT_210 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t";
229
  protected final String TEXT_210 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = ";
230
  protected final String TEXT_211 = ".decorateView(createdNode);";
230
  protected final String TEXT_211 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t";
231
  protected final String TEXT_212 = NL + "\t\t\t";
231
  protected final String TEXT_212 = ".decorateView(createdNode);";
232
  protected final String TEXT_213 = " bounds = ";
232
  protected final String TEXT_213 = NL + "\t\t\t";
233
  protected final String TEXT_214 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
233
  protected final String TEXT_214 = " bounds = ";
234
  protected final String TEXT_215 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
234
  protected final String TEXT_215 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
235
  protected final String TEXT_216 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
235
  protected final String TEXT_216 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
236
  protected final String TEXT_217 = "));";
236
  protected final String TEXT_217 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
237
  protected final String TEXT_218 = NL + "\t\t}" + NL + "\t}" + NL;
237
  protected final String TEXT_218 = "));";
238
  protected final String TEXT_219 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
238
  protected final String TEXT_219 = NL + "\t\t}" + NL + "\t}" + NL;
239
  protected final String TEXT_220 = "static ";
239
  protected final String TEXT_220 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
240
  protected final String TEXT_221 = "class Create";
240
  protected final String TEXT_221 = "static ";
241
  protected final String TEXT_222 = "Command extends ";
241
  protected final String TEXT_222 = "class Create";
242
  protected final String TEXT_223 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create";
242
  protected final String TEXT_223 = "Command extends ";
243
  protected final String TEXT_224 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
243
  protected final String TEXT_224 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create";
244
  protected final String TEXT_225 = "Command(";
244
  protected final String TEXT_225 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
245
  protected final String TEXT_226 = " parent, ";
245
  protected final String TEXT_226 = "Command(";
246
  protected final String TEXT_227 = ".CreateRequestEx request";
246
  protected final String TEXT_227 = " parent, ";
247
  protected final String TEXT_228 = ", ";
247
  protected final String TEXT_228 = ".CreateRequestEx request";
248
  protected final String TEXT_229 = " constraint";
248
  protected final String TEXT_229 = ", ";
249
  protected final String TEXT_230 = ") {" + NL + "\t\t\t";
249
  protected final String TEXT_230 = " constraint";
250
  protected final String TEXT_231 = " domainModelEditDomain = ";
250
  protected final String TEXT_231 = ") {" + NL + "\t\t\t";
251
  protected final String TEXT_232 = ".getEditingDomain(parent.getDiagram().getElement());";
251
  protected final String TEXT_232 = " domainModelEditDomain = ";
252
  protected final String TEXT_233 = NL + "\t\t\t";
252
  protected final String TEXT_233 = ".getEditingDomain(parent.getDiagram().getElement());";
253
  protected final String TEXT_234 = " createdDomainElement = ";
253
  protected final String TEXT_234 = NL + "\t\t\t";
254
  protected final String TEXT_235 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
254
  protected final String TEXT_235 = " createdDomainElement = ";
255
  protected final String TEXT_236 = ".eINSTANCE.get";
255
  protected final String TEXT_236 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
256
  protected final String TEXT_237 = "());";
256
  protected final String TEXT_237 = ".eINSTANCE.get";
257
  protected final String TEXT_238 = NL + "\t\t\t";
257
  protected final String TEXT_238 = "());";
258
  protected final String TEXT_239 = " createdDomainElement = ";
258
  protected final String TEXT_239 = NL + "\t\t\t";
259
  protected final String TEXT_240 = ".eINSTANCE.create";
259
  protected final String TEXT_240 = " createdDomainElement = ";
260
  protected final String TEXT_241 = "();";
260
  protected final String TEXT_241 = ".eINSTANCE.create";
261
  protected final String TEXT_242 = NL + "\t\t\t";
261
  protected final String TEXT_242 = "();";
262
  protected final String TEXT_243 = NL + "\t\t\t";
262
  protected final String TEXT_243 = NL + "\t\t\t";
263
  protected final String TEXT_244 = ".";
263
  protected final String TEXT_244 = NL + "\t\t\t";
264
  protected final String TEXT_245 = ".initializeElement(createdDomainElement);";
264
  protected final String TEXT_245 = ".";
265
  protected final String TEXT_246 = NL + "\t\t\t";
265
  protected final String TEXT_246 = ".initializeElement(createdDomainElement);";
266
  protected final String TEXT_247 = " compoundCommand = new ";
266
  protected final String TEXT_247 = NL + "\t\t\t";
267
  protected final String TEXT_248 = "();" + NL + "\t\t\tcompoundCommand.append(";
267
  protected final String TEXT_248 = " compoundCommand = new ";
268
  protected final String TEXT_249 = ".create(domainModelEditDomain, ";
268
  protected final String TEXT_249 = "();" + NL + "\t\t\tcompoundCommand.append(";
269
  protected final String TEXT_250 = ", " + NL + "\t\t\t\t";
269
  protected final String TEXT_250 = ".create(domainModelEditDomain, ";
270
  protected final String TEXT_251 = ".eINSTANCE.get";
270
  protected final String TEXT_251 = ", " + NL + "\t\t\t\t";
271
  protected final String TEXT_252 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append(";
271
  protected final String TEXT_252 = ".eINSTANCE.get";
272
  protected final String TEXT_253 = ".create(domainModelEditDomain, ";
272
  protected final String TEXT_253 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append(";
273
  protected final String TEXT_254 = ", " + NL + "\t\t\t\t";
273
  protected final String TEXT_254 = ".create(domainModelEditDomain, ";
274
  protected final String TEXT_255 = ".eINSTANCE.get";
274
  protected final String TEXT_255 = ", " + NL + "\t\t\t\t";
275
  protected final String TEXT_256 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
275
  protected final String TEXT_256 = ".eINSTANCE.get";
276
  protected final String TEXT_257 = NL + "\t\t\tthis.domainModelAddCommand = ";
276
  protected final String TEXT_257 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
277
  protected final String TEXT_258 = ".create(domainModelEditDomain, ";
277
  protected final String TEXT_258 = NL + "\t\t\tthis.domainModelAddCommand = ";
278
  protected final String TEXT_259 = ", " + NL + "\t\t\t\t";
278
  protected final String TEXT_259 = ".create(domainModelEditDomain, ";
279
  protected final String TEXT_260 = ".eINSTANCE.get";
279
  protected final String TEXT_260 = ", " + NL + "\t\t\t\t";
280
  protected final String TEXT_261 = "(), createdDomainElement);";
280
  protected final String TEXT_261 = ".eINSTANCE.get";
281
  protected final String TEXT_262 = NL + "\t\t\tthis.notationAddCommand = new Create";
281
  protected final String TEXT_262 = "(), createdDomainElement);";
282
  protected final String TEXT_263 = "NotationCommand(parent, createdDomainElement";
282
  protected final String TEXT_263 = NL + "\t\t\tthis.notationAddCommand = new Create";
283
  protected final String TEXT_264 = ", constraint";
283
  protected final String TEXT_264 = "NotationCommand(parent, createdDomainElement";
284
  protected final String TEXT_265 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
284
  protected final String TEXT_265 = ", constraint";
285
  protected final String TEXT_266 = NL + "}" + NL;
285
  protected final String TEXT_266 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
286
  protected final String TEXT_267 = NL;
286
  protected final String TEXT_267 = NL + "}" + NL;
287
  protected final String TEXT_268 = NL;
287
288
288
  public String generate(Object argument)
289
  public String generate(Object argument)
289
  {
290
  {
Lines 460-465 Link Here
460
    stringBuffer.append(TEXT_72);
461
    stringBuffer.append(TEXT_72);
461
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
462
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
462
    stringBuffer.append(TEXT_73);
463
    stringBuffer.append(TEXT_73);
464
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
465
    stringBuffer.append(TEXT_74);
463
    
466
    
464
{
467
{
465
String _getViewCode = "getDiagramNode()";
468
String _getViewCode = "getDiagramNode()";
Lines 467-486 Link Here
467
String _getSemanticElementCode = "resolveSemanticElement()";
470
String _getSemanticElementCode = "resolveSemanticElement()";
468
boolean isListLayout = genCompartment.isListLayout();
471
boolean isListLayout = genCompartment.isListLayout();
469
472
470
    stringBuffer.append(TEXT_74);
471
    stringBuffer.append(TEXT_75);
473
    stringBuffer.append(TEXT_75);
472
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
473
    stringBuffer.append(TEXT_76);
474
    stringBuffer.append(TEXT_76);
474
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
475
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
475
    stringBuffer.append(TEXT_77);
476
    stringBuffer.append(TEXT_77);
476
    stringBuffer.append(_getDiagramCode);
477
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
477
    stringBuffer.append(TEXT_78);
478
    stringBuffer.append(TEXT_78);
478
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
479
    stringBuffer.append(_getDiagramCode);
479
    stringBuffer.append(TEXT_79);
480
    stringBuffer.append(TEXT_79);
480
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
481
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
481
    stringBuffer.append(TEXT_80);
482
    stringBuffer.append(TEXT_80);
482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
483
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
483
    stringBuffer.append(TEXT_81);
484
    stringBuffer.append(TEXT_81);
485
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
486
    stringBuffer.append(TEXT_82);
484
    
487
    
485
boolean hasConstraintsInChildren = false;
488
boolean hasConstraintsInChildren = false;
486
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
489
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
Lines 495-652 Link Here
495
    
498
    
496
if (hasConstraintsInChildren) {
499
if (hasConstraintsInChildren) {
497
500
498
    stringBuffer.append(TEXT_82);
499
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
500
    stringBuffer.append(TEXT_83);
501
    stringBuffer.append(TEXT_83);
501
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
502
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
502
    stringBuffer.append(TEXT_84);
503
    stringBuffer.append(TEXT_84);
503
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
504
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
504
    stringBuffer.append(TEXT_85);
505
    stringBuffer.append(TEXT_85);
506
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
507
    stringBuffer.append(TEXT_86);
505
    
508
    
506
}
509
}
507
510
508
    stringBuffer.append(TEXT_86);
511
    stringBuffer.append(TEXT_87);
509
    
512
    
510
boolean hasDeclaredFilter = false;
513
{
511
Set genChildFeatures = new LinkedHashSet();
514
	boolean hasDeclaredFilter = false;
512
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
515
	Set genChildFeatures = new LinkedHashSet();
513
	GenNode nextNode = (GenNode) it.next();
516
	for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
514
	TypeModelFacet typeModelFacet = nextNode.getModelFacet();
517
		GenNode nextNode = (GenNode) it.next();
515
	if (typeModelFacet == null) {
518
		TypeModelFacet typeModelFacet = nextNode.getModelFacet();
516
		continue;
519
		if (typeModelFacet == null) {
517
	}
520
			continue;
518
	GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
521
		}
519
	if (genChildFeatures.contains(childMetaFeature)) {
522
		GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
520
		continue;
523
		if (genChildFeatures.contains(childMetaFeature)) {
521
	}
524
			continue;
522
	genChildFeatures.add(childMetaFeature);
525
		}
523
	if (!hasDeclaredFilter) {
526
		genChildFeatures.add(childMetaFeature);
524
		hasDeclaredFilter = true;
527
		if (!hasDeclaredFilter) {
528
			hasDeclaredFilter = true;
525
529
526
    stringBuffer.append(TEXT_87);
527
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
528
    stringBuffer.append(TEXT_88);
530
    stringBuffer.append(TEXT_88);
529
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
531
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
530
    stringBuffer.append(TEXT_89);
532
    stringBuffer.append(TEXT_89);
531
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
533
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
532
    stringBuffer.append(TEXT_90);
534
    stringBuffer.append(TEXT_90);
535
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
536
    stringBuffer.append(TEXT_91);
533
    
537
    
534
	} else {
538
		} else {
535
539
536
    stringBuffer.append(TEXT_91);
537
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
538
    stringBuffer.append(TEXT_92);
540
    stringBuffer.append(TEXT_92);
539
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
541
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
540
    stringBuffer.append(TEXT_93);
542
    stringBuffer.append(TEXT_93);
541
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
543
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
542
    stringBuffer.append(TEXT_94);
544
    stringBuffer.append(TEXT_94);
545
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
546
    stringBuffer.append(TEXT_95);
543
    
547
    
544
	}
548
		}
545
}	//for
549
	}	//for
546
550
547
    
551
    
548
if (hasDeclaredFilter) {
552
	if (hasDeclaredFilter) {
549
553
550
    stringBuffer.append(TEXT_95);
551
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
552
    stringBuffer.append(TEXT_96);
554
    stringBuffer.append(TEXT_96);
553
    stringBuffer.append(_getSemanticElementCode);
555
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
554
    stringBuffer.append(TEXT_97);
556
    stringBuffer.append(TEXT_97);
557
    stringBuffer.append(_getSemanticElementCode);
558
    stringBuffer.append(TEXT_98);
555
    
559
    
556
} else {
560
	} else {
557
561
558
    stringBuffer.append(TEXT_98);
559
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
560
    stringBuffer.append(TEXT_99);
562
    stringBuffer.append(TEXT_99);
561
    stringBuffer.append(_getSemanticElementCode);
563
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
562
    stringBuffer.append(TEXT_100);
564
    stringBuffer.append(TEXT_100);
565
    stringBuffer.append(_getSemanticElementCode);
566
    stringBuffer.append(TEXT_101);
563
    
567
    
564
}
568
	}
569
}	//local declaration of hasDeclaredFilter
565
570
566
    
571
    
567
if (hasConstraintsInChildren) {
572
if (hasConstraintsInChildren) {
568
573
569
    stringBuffer.append(TEXT_101);
574
    stringBuffer.append(TEXT_102);
570
    
575
    
571
}
576
}
572
577
573
    stringBuffer.append(TEXT_102);
574
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
575
    stringBuffer.append(TEXT_103);
578
    stringBuffer.append(TEXT_103);
576
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
579
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
577
    stringBuffer.append(TEXT_104);
580
    stringBuffer.append(TEXT_104);
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
581
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
579
    stringBuffer.append(TEXT_105);
582
    stringBuffer.append(TEXT_105);
580
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
583
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
581
    stringBuffer.append(TEXT_106);
584
    stringBuffer.append(TEXT_106);
582
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
585
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
583
    stringBuffer.append(TEXT_107);
586
    stringBuffer.append(TEXT_107);
584
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
587
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
585
    stringBuffer.append(TEXT_108);
588
    stringBuffer.append(TEXT_108);
586
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
589
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
587
    stringBuffer.append(TEXT_109);
590
    stringBuffer.append(TEXT_109);
588
    stringBuffer.append(_getDiagramCode);
591
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
589
    stringBuffer.append(TEXT_110);
592
    stringBuffer.append(TEXT_110);
590
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
593
    stringBuffer.append(_getDiagramCode);
591
    stringBuffer.append(TEXT_111);
594
    stringBuffer.append(TEXT_111);
592
    stringBuffer.append(importManager.getImportedName("java.util.List"));
595
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
593
    stringBuffer.append(TEXT_112);
596
    stringBuffer.append(TEXT_112);
594
    stringBuffer.append(importManager.getImportedName("java.util.List"));
597
    stringBuffer.append(importManager.getImportedName("java.util.List"));
595
    stringBuffer.append(TEXT_113);
598
    stringBuffer.append(TEXT_113);
596
    stringBuffer.append(_getViewCode);
599
    stringBuffer.append(importManager.getImportedName("java.util.List"));
597
    stringBuffer.append(TEXT_114);
600
    stringBuffer.append(TEXT_114);
598
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
601
    stringBuffer.append(_getViewCode);
599
    stringBuffer.append(TEXT_115);
602
    stringBuffer.append(TEXT_115);
600
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
603
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
601
    stringBuffer.append(TEXT_116);
604
    stringBuffer.append(TEXT_116);
602
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
605
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
603
    stringBuffer.append(TEXT_117);
606
    stringBuffer.append(TEXT_117);
604
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
607
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
605
    stringBuffer.append(TEXT_118);
608
    stringBuffer.append(TEXT_118);
606
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
607
    stringBuffer.append(TEXT_119);
610
    stringBuffer.append(TEXT_119);
608
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
609
    stringBuffer.append(TEXT_120);
610
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
611
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
612
    stringBuffer.append(TEXT_120);
613
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
611
    stringBuffer.append(TEXT_121);
614
    stringBuffer.append(TEXT_121);
612
    stringBuffer.append(_getViewCode);
615
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
613
    stringBuffer.append(TEXT_122);
616
    stringBuffer.append(TEXT_122);
614
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
617
    stringBuffer.append(_getViewCode);
615
    stringBuffer.append(TEXT_123);
618
    stringBuffer.append(TEXT_123);
616
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
619
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
617
    stringBuffer.append(TEXT_124);
620
    stringBuffer.append(TEXT_124);
618
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
621
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
619
    stringBuffer.append(TEXT_125);
622
    stringBuffer.append(TEXT_125);
620
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
623
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
621
    stringBuffer.append(TEXT_126);
624
    stringBuffer.append(TEXT_126);
622
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
625
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
623
    stringBuffer.append(TEXT_127);
626
    stringBuffer.append(TEXT_127);
624
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
627
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
625
    stringBuffer.append(TEXT_128);
628
    stringBuffer.append(TEXT_128);
626
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
629
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
627
    stringBuffer.append(TEXT_129);
630
    stringBuffer.append(TEXT_129);
628
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
631
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
629
    stringBuffer.append(TEXT_130);
632
    stringBuffer.append(TEXT_130);
630
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
633
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
631
    stringBuffer.append(TEXT_131);
634
    stringBuffer.append(TEXT_131);
632
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
635
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
633
    stringBuffer.append(TEXT_132);
636
    stringBuffer.append(TEXT_132);
634
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
637
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
635
    stringBuffer.append(TEXT_133);
638
    stringBuffer.append(TEXT_133);
636
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
639
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
637
    stringBuffer.append(TEXT_134);
640
    stringBuffer.append(TEXT_134);
638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
641
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
639
    stringBuffer.append(TEXT_135);
642
    stringBuffer.append(TEXT_135);
640
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
643
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
641
    stringBuffer.append(TEXT_136);
644
    stringBuffer.append(TEXT_136);
642
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand"));
645
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
643
    stringBuffer.append(TEXT_137);
646
    stringBuffer.append(TEXT_137);
644
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
647
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand"));
645
    stringBuffer.append(TEXT_138);
648
    stringBuffer.append(TEXT_138);
646
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
649
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
647
    stringBuffer.append(TEXT_139);
650
    stringBuffer.append(TEXT_139);
648
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
649
    stringBuffer.append(TEXT_140);
652
    stringBuffer.append(TEXT_140);
653
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
654
    stringBuffer.append(TEXT_141);
650
    
655
    
651
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
656
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
652
	GenNode nextNode = (GenNode) it.next();
657
	GenNode nextNode = (GenNode) it.next();
Lines 656-694 Link Here
656
	}
661
	}
657
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
662
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
658
663
659
    stringBuffer.append(TEXT_141);
660
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
661
    stringBuffer.append(TEXT_142);
664
    stringBuffer.append(TEXT_142);
662
    stringBuffer.append(childNodeInterfaceName);
665
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
663
    stringBuffer.append(TEXT_143);
666
    stringBuffer.append(TEXT_143);
667
    stringBuffer.append(childNodeInterfaceName);
668
    stringBuffer.append(TEXT_144);
664
    stringBuffer.append(nextNode.getDomainMetaClass().getName());
669
    stringBuffer.append(nextNode.getDomainMetaClass().getName());
665
    stringBuffer.append(nextNode.getVisualID());
670
    stringBuffer.append(nextNode.getVisualID());
666
    stringBuffer.append(TEXT_144);
667
    if (!isListLayout) {
668
    stringBuffer.append(TEXT_145);
671
    stringBuffer.append(TEXT_145);
669
    }
672
    if (!isListLayout) {
670
    stringBuffer.append(TEXT_146);
673
    stringBuffer.append(TEXT_146);
674
    }
675
    stringBuffer.append(TEXT_147);
671
    
676
    
672
}
677
}
673
678
674
    stringBuffer.append(TEXT_147);
675
    stringBuffer.append(importManager.getImportedName("java.util.List"));
676
    stringBuffer.append(TEXT_148);
679
    stringBuffer.append(TEXT_148);
680
    stringBuffer.append(importManager.getImportedName("java.util.List"));
677
    stringBuffer.append(TEXT_149);
681
    stringBuffer.append(TEXT_149);
682
    stringBuffer.append(TEXT_150);
678
    
683
    
679
if (childNodes.size() == 0) {
684
if (childNodes.size() == 0) {
680
685
681
    stringBuffer.append(TEXT_150);
682
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
683
    stringBuffer.append(TEXT_151);
686
    stringBuffer.append(TEXT_151);
687
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
688
    stringBuffer.append(TEXT_152);
684
    
689
    
685
} else {
690
} else {
686
691
687
    stringBuffer.append(TEXT_152);
688
    stringBuffer.append(importManager.getImportedName("java.util.List"));
689
    stringBuffer.append(TEXT_153);
692
    stringBuffer.append(TEXT_153);
690
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
693
    stringBuffer.append(importManager.getImportedName("java.util.List"));
691
    stringBuffer.append(TEXT_154);
694
    stringBuffer.append(TEXT_154);
695
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
696
    stringBuffer.append(TEXT_155);
692
    
697
    
693
	Map genFeature2genNodeMap = new LinkedHashMap();
698
	Map genFeature2genNodeMap = new LinkedHashMap();
694
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
699
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
Lines 706-722 Link Here
706
	Set entrySet = genFeature2genNodeMap.entrySet();
711
	Set entrySet = genFeature2genNodeMap.entrySet();
707
	if (entrySet.size() > 0) {
712
	if (entrySet.size() > 0) {
708
713
709
    stringBuffer.append(TEXT_155);
710
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
711
    stringBuffer.append(TEXT_156);
714
    stringBuffer.append(TEXT_156);
712
    stringBuffer.append(_getViewCode);
715
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
713
    stringBuffer.append(TEXT_157);
716
    stringBuffer.append(TEXT_157);
714
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
717
    stringBuffer.append(_getViewCode);
715
    stringBuffer.append(TEXT_158);
718
    stringBuffer.append(TEXT_158);
716
    stringBuffer.append(_getSemanticElementCode);
717
    stringBuffer.append(TEXT_159);
718
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
719
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
720
    stringBuffer.append(TEXT_159);
721
    stringBuffer.append(_getSemanticElementCode);
719
    stringBuffer.append(TEXT_160);
722
    stringBuffer.append(TEXT_160);
723
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
724
    stringBuffer.append(TEXT_161);
720
    
725
    
721
	}
726
	}
722
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
727
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
Lines 725-831 Link Here
725
		Collection genNodesCollection = (Collection) nextEntry.getValue();
730
		Collection genNodesCollection = (Collection) nextEntry.getValue();
726
		if (childMetaFeature.isListType()) {
731
		if (childMetaFeature.isListType()) {
727
732
728
    stringBuffer.append(TEXT_161);
729
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
730
    stringBuffer.append(TEXT_162);
733
    stringBuffer.append(TEXT_162);
731
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
734
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
732
    stringBuffer.append(TEXT_163);
735
    stringBuffer.append(TEXT_163);
733
    stringBuffer.append(childMetaFeature.getGetAccessor());
736
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
734
    stringBuffer.append(TEXT_164);
737
    stringBuffer.append(TEXT_164);
735
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
738
    stringBuffer.append(childMetaFeature.getGetAccessor());
736
    stringBuffer.append(TEXT_165);
739
    stringBuffer.append(TEXT_165);
740
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
741
    stringBuffer.append(TEXT_166);
737
    
742
    
738
		} else {
743
		} else {
739
744
740
    stringBuffer.append(TEXT_166);
741
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
742
    stringBuffer.append(TEXT_167);
745
    stringBuffer.append(TEXT_167);
743
    stringBuffer.append(childMetaFeature.getGetAccessor());
746
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
744
    stringBuffer.append(TEXT_168);
747
    stringBuffer.append(TEXT_168);
748
    stringBuffer.append(childMetaFeature.getGetAccessor());
749
    stringBuffer.append(TEXT_169);
745
    
750
    
746
	}
751
	}
747
752
748
    stringBuffer.append(TEXT_169);
749
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
750
    stringBuffer.append(TEXT_170);
753
    stringBuffer.append(TEXT_170);
754
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
755
    stringBuffer.append(TEXT_171);
751
    
756
    
752
	boolean generateSwitch = genNodesCollection.size() != 1;
757
	boolean generateSwitch = genNodesCollection.size() != 1;
753
	if (generateSwitch) {
758
	if (generateSwitch) {
754
759
755
    stringBuffer.append(TEXT_171);
760
    stringBuffer.append(TEXT_172);
756
    
761
    
757
	}
762
	}
758
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
763
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
759
		GenNode nextNode = (GenNode) genNodesIterator.next();
764
		GenNode nextNode = (GenNode) genNodesIterator.next();
760
		if (generateSwitch) {
765
		if (generateSwitch) {
761
766
762
    stringBuffer.append(TEXT_172);
763
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
764
    stringBuffer.append(TEXT_173);
767
    stringBuffer.append(TEXT_173);
768
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
769
    stringBuffer.append(TEXT_174);
765
    
770
    
766
		} else {
771
		} else {
767
772
768
    stringBuffer.append(TEXT_174);
769
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
770
    stringBuffer.append(TEXT_175);
773
    stringBuffer.append(TEXT_175);
774
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
775
    stringBuffer.append(TEXT_176);
771
    
776
    
772
		}
777
		}
773
778
774
    stringBuffer.append(TEXT_176);
779
    stringBuffer.append(TEXT_177);
775
    
780
    
776
		if (generateSwitch) {
781
		if (generateSwitch) {
777
782
778
    stringBuffer.append(TEXT_177);
783
    stringBuffer.append(TEXT_178);
779
    
784
    
780
		} else {
785
		} else {
781
786
782
    stringBuffer.append(TEXT_178);
787
    stringBuffer.append(TEXT_179);
783
    
788
    
784
		}
789
		}
785
	}
790
	}
786
	if (generateSwitch) {
791
	if (generateSwitch) {
787
792
788
    stringBuffer.append(TEXT_179);
793
    stringBuffer.append(TEXT_180);
789
    
794
    
790
	}
795
	}
791
	if (childMetaFeature.isListType()) {
796
	if (childMetaFeature.isListType()) {
792
797
793
    stringBuffer.append(TEXT_180);
798
    stringBuffer.append(TEXT_181);
794
    
799
    
795
	}
800
	}
796
}
801
}
797
802
798
    stringBuffer.append(TEXT_181);
803
    stringBuffer.append(TEXT_182);
799
    
804
    
800
}
805
}
801
806
802
    stringBuffer.append(TEXT_182);
803
    stringBuffer.append(genDiagram.isSynchronized());
804
    stringBuffer.append(TEXT_183);
807
    stringBuffer.append(TEXT_183);
805
    stringBuffer.append(genDiagram.isSynchronized());
808
    stringBuffer.append(genDiagram.isSynchronized());
806
    stringBuffer.append(TEXT_184);
809
    stringBuffer.append(TEXT_184);
810
    stringBuffer.append(genDiagram.isSynchronized());
811
    stringBuffer.append(TEXT_185);
807
    
812
    
808
}
813
}
809
814
810
    stringBuffer.append(TEXT_185);
811
    stringBuffer.append(TEXT_186);
815
    stringBuffer.append(TEXT_186);
812
    stringBuffer.append(TEXT_187);
816
    stringBuffer.append(TEXT_187);
813
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
814
    stringBuffer.append(TEXT_188);
817
    stringBuffer.append(TEXT_188);
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
818
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
816
    stringBuffer.append(TEXT_189);
819
    stringBuffer.append(TEXT_189);
817
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
820
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
818
    stringBuffer.append(TEXT_190);
821
    stringBuffer.append(TEXT_190);
822
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
819
    stringBuffer.append(TEXT_191);
823
    stringBuffer.append(TEXT_191);
820
    stringBuffer.append(TEXT_192);
824
    stringBuffer.append(TEXT_192);
821
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
822
    stringBuffer.append(TEXT_193);
825
    stringBuffer.append(TEXT_193);
823
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
826
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
824
    stringBuffer.append(TEXT_194);
827
    stringBuffer.append(TEXT_194);
828
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
825
    stringBuffer.append(TEXT_195);
829
    stringBuffer.append(TEXT_195);
826
    stringBuffer.append(TEXT_196);
830
    stringBuffer.append(TEXT_196);
827
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
828
    stringBuffer.append(TEXT_197);
831
    stringBuffer.append(TEXT_197);
832
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
833
    stringBuffer.append(TEXT_198);
829
    
834
    
830
for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) {
835
for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) {
831
	GenChildNode next = (GenChildNode)it.next();
836
	GenChildNode next = (GenChildNode)it.next();
Lines 833-874 Link Here
833
	boolean isListLayout = genCompartment.isListLayout();
838
	boolean isListLayout = genCompartment.isListLayout();
834
	String resolvedSemanticElement = "resolveSemanticElement()";
839
	String resolvedSemanticElement = "resolveSemanticElement()";
835
840
836
    stringBuffer.append(TEXT_198);
837
    stringBuffer.append(TEXT_199);
841
    stringBuffer.append(TEXT_199);
838
    if (isStatic) {
839
    stringBuffer.append(TEXT_200);
842
    stringBuffer.append(TEXT_200);
840
    }
843
    if (isStatic) {
841
    stringBuffer.append(TEXT_201);
844
    stringBuffer.append(TEXT_201);
845
    }
846
    stringBuffer.append(TEXT_202);
842
    stringBuffer.append(next.getDomainMetaClass().getName());
847
    stringBuffer.append(next.getDomainMetaClass().getName());
843
    stringBuffer.append(next.getVisualID());
848
    stringBuffer.append(next.getVisualID());
844
    stringBuffer.append(TEXT_202);
845
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
846
    stringBuffer.append(TEXT_203);
849
    stringBuffer.append(TEXT_203);
850
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
851
    stringBuffer.append(TEXT_204);
847
    stringBuffer.append(next.getDomainMetaClass().getName());
852
    stringBuffer.append(next.getDomainMetaClass().getName());
848
    stringBuffer.append(next.getVisualID());
853
    stringBuffer.append(next.getVisualID());
849
    stringBuffer.append(TEXT_204);
850
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
851
    stringBuffer.append(TEXT_205);
854
    stringBuffer.append(TEXT_205);
852
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
855
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
853
    stringBuffer.append(TEXT_206);
856
    stringBuffer.append(TEXT_206);
854
    if (!isListLayout) {
857
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
855
    stringBuffer.append(TEXT_207);
858
    stringBuffer.append(TEXT_207);
856
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
859
    if (!isListLayout) {
857
    stringBuffer.append(TEXT_208);
860
    stringBuffer.append(TEXT_208);
858
    }
861
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
859
    stringBuffer.append(TEXT_209);
862
    stringBuffer.append(TEXT_209);
860
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
863
    }
861
    stringBuffer.append(TEXT_210);
864
    stringBuffer.append(TEXT_210);
862
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
865
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
863
    stringBuffer.append(TEXT_211);
866
    stringBuffer.append(TEXT_211);
867
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
868
    stringBuffer.append(TEXT_212);
864
    
869
    
865
	if (!isListLayout) {
870
	if (!isListLayout) {
866
871
867
    stringBuffer.append(TEXT_212);
868
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
869
    stringBuffer.append(TEXT_213);
872
    stringBuffer.append(TEXT_213);
870
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
873
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
871
    stringBuffer.append(TEXT_214);
874
    stringBuffer.append(TEXT_214);
875
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
876
    stringBuffer.append(TEXT_215);
872
    
877
    
873
		int defaultWidth = 40;
878
		int defaultWidth = 40;
874
		int defaultHeight = 40;
879
		int defaultHeight = 40;
Lines 878-1017 Link Here
878
			defaultHeight = defSizeAttrs.getHeight();
883
			defaultHeight = defSizeAttrs.getHeight();
879
		}
884
		}
880
885
881
    stringBuffer.append(TEXT_215);
882
    stringBuffer.append(defaultWidth);
883
    stringBuffer.append(TEXT_216);
886
    stringBuffer.append(TEXT_216);
884
    stringBuffer.append(defaultHeight);
887
    stringBuffer.append(defaultWidth);
885
    stringBuffer.append(TEXT_217);
888
    stringBuffer.append(TEXT_217);
889
    stringBuffer.append(defaultHeight);
890
    stringBuffer.append(TEXT_218);
886
    
891
    
887
	}
892
	}
888
893
889
    stringBuffer.append(TEXT_218);
894
    stringBuffer.append(TEXT_219);
890
    
895
    
891
if (genDiagram.getPalette() != null) {
896
if (genDiagram.getPalette() != null) {
892
897
893
    stringBuffer.append(TEXT_219);
894
    if (isStatic) {
895
    stringBuffer.append(TEXT_220);
898
    stringBuffer.append(TEXT_220);
896
    }
899
    if (isStatic) {
897
    stringBuffer.append(TEXT_221);
900
    stringBuffer.append(TEXT_221);
898
    stringBuffer.append(next.getDomainMetaClass().getName());
901
    }
899
    stringBuffer.append(next.getVisualID());
900
    stringBuffer.append(TEXT_222);
902
    stringBuffer.append(TEXT_222);
901
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
902
    stringBuffer.append(TEXT_223);
903
    stringBuffer.append(next.getDomainMetaClass().getName());
903
    stringBuffer.append(next.getDomainMetaClass().getName());
904
    stringBuffer.append(next.getVisualID());
904
    stringBuffer.append(next.getVisualID());
905
    stringBuffer.append(TEXT_223);
906
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
905
    stringBuffer.append(TEXT_224);
907
    stringBuffer.append(TEXT_224);
906
    stringBuffer.append(next.getDomainMetaClass().getName());
908
    stringBuffer.append(next.getDomainMetaClass().getName());
907
    stringBuffer.append(next.getVisualID());
909
    stringBuffer.append(next.getVisualID());
908
    stringBuffer.append(TEXT_225);
910
    stringBuffer.append(TEXT_225);
909
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
911
    stringBuffer.append(next.getDomainMetaClass().getName());
912
    stringBuffer.append(next.getVisualID());
910
    stringBuffer.append(TEXT_226);
913
    stringBuffer.append(TEXT_226);
911
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
914
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
912
    stringBuffer.append(TEXT_227);
915
    stringBuffer.append(TEXT_227);
913
    if (!isListLayout) {
916
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
914
    stringBuffer.append(TEXT_228);
917
    stringBuffer.append(TEXT_228);
915
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
918
    if (!isListLayout) {
916
    stringBuffer.append(TEXT_229);
919
    stringBuffer.append(TEXT_229);
917
    }
920
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
918
    stringBuffer.append(TEXT_230);
921
    stringBuffer.append(TEXT_230);
919
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
922
    }
920
    stringBuffer.append(TEXT_231);
923
    stringBuffer.append(TEXT_231);
921
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
924
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
922
    stringBuffer.append(TEXT_232);
925
    stringBuffer.append(TEXT_232);
926
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
927
    stringBuffer.append(TEXT_233);
923
    
928
    
924
	if (next.getDomainMetaClass().isMapEntry()) {
929
	if (next.getDomainMetaClass().isMapEntry()) {
925
	/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
930
	/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
926
931
927
    stringBuffer.append(TEXT_233);
928
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
929
    stringBuffer.append(TEXT_234);
932
    stringBuffer.append(TEXT_234);
930
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
933
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
931
    stringBuffer.append(TEXT_235);
934
    stringBuffer.append(TEXT_235);
932
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
935
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
933
    stringBuffer.append(TEXT_236);
936
    stringBuffer.append(TEXT_236);
934
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
937
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
935
    stringBuffer.append(TEXT_237);
938
    stringBuffer.append(TEXT_237);
939
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
940
    stringBuffer.append(TEXT_238);
936
    
941
    
937
	} else {
942
	} else {
938
943
939
    stringBuffer.append(TEXT_238);
940
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
941
    stringBuffer.append(TEXT_239);
944
    stringBuffer.append(TEXT_239);
942
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
945
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
943
    stringBuffer.append(TEXT_240);
946
    stringBuffer.append(TEXT_240);
944
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
947
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
945
    stringBuffer.append(TEXT_241);
948
    stringBuffer.append(TEXT_241);
949
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
950
    stringBuffer.append(TEXT_242);
946
    
951
    
947
	}
952
	}
948
953
949
    stringBuffer.append(TEXT_242);
950
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
951
    stringBuffer.append(TEXT_243);
954
    stringBuffer.append(TEXT_243);
952
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
955
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
953
    stringBuffer.append(TEXT_244);
956
    stringBuffer.append(TEXT_244);
954
    stringBuffer.append(next.getUniqueIdentifier());
957
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
955
    stringBuffer.append(TEXT_245);
958
    stringBuffer.append(TEXT_245);
959
    stringBuffer.append(next.getUniqueIdentifier());
960
    stringBuffer.append(TEXT_246);
956
    
961
    
957
	TypeModelFacet facet = next.getModelFacet();
962
	TypeModelFacet facet = next.getModelFacet();
958
	GenFeature childFeature = facet.getChildMetaFeature();
963
	GenFeature childFeature = facet.getChildMetaFeature();
959
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
964
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
960
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
965
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
961
966
962
    stringBuffer.append(TEXT_246);
963
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
964
    stringBuffer.append(TEXT_247);
967
    stringBuffer.append(TEXT_247);
965
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
968
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
966
    stringBuffer.append(TEXT_248);
969
    stringBuffer.append(TEXT_248);
967
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
970
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
968
    stringBuffer.append(TEXT_249);
971
    stringBuffer.append(TEXT_249);
969
    stringBuffer.append(resolvedSemanticElement);
972
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
970
    stringBuffer.append(TEXT_250);
973
    stringBuffer.append(TEXT_250);
971
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
974
    stringBuffer.append(resolvedSemanticElement);
972
    stringBuffer.append(TEXT_251);
975
    stringBuffer.append(TEXT_251);
973
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
976
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
974
    stringBuffer.append(TEXT_252);
977
    stringBuffer.append(TEXT_252);
975
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
978
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
976
    stringBuffer.append(TEXT_253);
979
    stringBuffer.append(TEXT_253);
977
    stringBuffer.append(resolvedSemanticElement);
980
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
978
    stringBuffer.append(TEXT_254);
981
    stringBuffer.append(TEXT_254);
979
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
982
    stringBuffer.append(resolvedSemanticElement);
980
    stringBuffer.append(TEXT_255);
983
    stringBuffer.append(TEXT_255);
981
    stringBuffer.append(childFeature.getFeatureAccessorName());
984
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
982
    stringBuffer.append(TEXT_256);
985
    stringBuffer.append(TEXT_256);
986
    stringBuffer.append(childFeature.getFeatureAccessorName());
987
    stringBuffer.append(TEXT_257);
983
    
988
    
984
	} else {
989
	} else {
985
990
986
    stringBuffer.append(TEXT_257);
987
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
988
    stringBuffer.append(TEXT_258);
991
    stringBuffer.append(TEXT_258);
989
    stringBuffer.append(resolvedSemanticElement);
992
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
990
    stringBuffer.append(TEXT_259);
993
    stringBuffer.append(TEXT_259);
991
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
994
    stringBuffer.append(resolvedSemanticElement);
992
    stringBuffer.append(TEXT_260);
995
    stringBuffer.append(TEXT_260);
993
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
996
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
994
    stringBuffer.append(TEXT_261);
997
    stringBuffer.append(TEXT_261);
998
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
999
    stringBuffer.append(TEXT_262);
995
    
1000
    
996
	}
1001
	}
997
1002
998
    stringBuffer.append(TEXT_262);
1003
    stringBuffer.append(TEXT_263);
999
    stringBuffer.append(next.getDomainMetaClass().getName());
1004
    stringBuffer.append(next.getDomainMetaClass().getName());
1000
    stringBuffer.append(next.getVisualID());
1005
    stringBuffer.append(next.getVisualID());
1001
    stringBuffer.append(TEXT_263);
1002
    if(!isListLayout) {
1003
    stringBuffer.append(TEXT_264);
1006
    stringBuffer.append(TEXT_264);
1004
    }
1007
    if(!isListLayout) {
1005
    stringBuffer.append(TEXT_265);
1008
    stringBuffer.append(TEXT_265);
1009
    }
1010
    stringBuffer.append(TEXT_266);
1006
    
1011
    
1007
}
1012
}
1008
1013
1009
    
1014
    
1010
}
1015
}
1011
1016
1012
    stringBuffer.append(TEXT_266);
1013
    importManager.emitSortedImports();
1014
    stringBuffer.append(TEXT_267);
1017
    stringBuffer.append(TEXT_267);
1018
    importManager.emitSortedImports();
1019
    stringBuffer.append(TEXT_268);
1015
    return stringBuffer.toString();
1020
    return stringBuffer.toString();
1016
  }
1021
  }
1017
}
1022
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java (-484 / +1625 lines)
Lines 28-265 Link Here
28
  protected final String TEXT_9 = "(";
28
  protected final String TEXT_9 = "(";
29
  protected final String TEXT_10 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
29
  protected final String TEXT_10 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
30
  protected final String TEXT_11 = " getDiagram() {" + NL + "\t\treturn (";
30
  protected final String TEXT_11 = " getDiagram() {" + NL + "\t\treturn (";
31
  protected final String TEXT_12 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {";
31
  protected final String TEXT_12 = ") getModel();" + NL + "\t}" + NL;
32
  protected final String TEXT_13 = NL + "\t\t\t\tif (request instanceof ";
32
  protected final String TEXT_13 = NL;
33
  protected final String TEXT_14 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
33
  protected final String TEXT_14 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
34
  protected final String TEXT_15 = ".CreateRequestEx requestEx = (";
34
  protected final String TEXT_15 = " view = (";
35
  protected final String TEXT_16 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
35
  protected final String TEXT_16 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
36
  protected final String TEXT_17 = " result = new ";
36
  protected final String TEXT_17 = " view = (";
37
  protected final String TEXT_18 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
37
  protected final String TEXT_18 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tsuper.addNotify();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {";
38
  protected final String TEXT_19 = NL + "\t\t\t\t\t\tcase ";
38
  protected final String TEXT_19 = NL + "\t\t\t\tif (request instanceof ";
39
  protected final String TEXT_20 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
39
  protected final String TEXT_20 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
40
  protected final String TEXT_21 = "Command(getDiagram(), requestEx, (";
40
  protected final String TEXT_21 = ".CreateRequestEx requestEx = (";
41
  protected final String TEXT_22 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;";
41
  protected final String TEXT_22 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
42
  protected final String TEXT_23 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
42
  protected final String TEXT_23 = " result = new ";
43
  protected final String TEXT_24 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
43
  protected final String TEXT_24 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
44
  protected final String TEXT_25 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t";
44
  protected final String TEXT_25 = NL + "\t\t\t\t\t\tcase ";
45
  protected final String TEXT_26 = " emfCommand = new ";
45
  protected final String TEXT_26 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
46
  protected final String TEXT_27 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t";
46
  protected final String TEXT_27 = "Command(getDiagram(), requestEx, (";
47
  protected final String TEXT_28 = " original = new ";
47
  protected final String TEXT_28 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;";
48
  protected final String TEXT_29 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t";
48
  protected final String TEXT_29 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
49
  protected final String TEXT_30 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand(";
49
  protected final String TEXT_30 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
50
  protected final String TEXT_31 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
50
  protected final String TEXT_31 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t";
51
  protected final String TEXT_32 = ".class == key) {" + NL + "\t\t\treturn new ";
51
  protected final String TEXT_32 = " emfCommand = new ";
52
  protected final String TEXT_33 = "(this);" + NL + "\t\t}";
52
  protected final String TEXT_33 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t";
53
  protected final String TEXT_34 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL;
53
  protected final String TEXT_34 = " original = new ";
54
  protected final String TEXT_35 = NL;
54
  protected final String TEXT_35 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t";
55
  protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
55
  protected final String TEXT_36 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand(";
56
  protected final String TEXT_37 = "static ";
56
  protected final String TEXT_37 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();";
57
  protected final String TEXT_38 = "class Create";
57
  protected final String TEXT_38 = NL + "\t\tinstallLinkNotationModelRefresher();";
58
  protected final String TEXT_39 = "NotationCommand extends ";
58
  protected final String TEXT_39 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
59
  protected final String TEXT_40 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create";
59
  protected final String TEXT_40 = ".class == key) {" + NL + "\t\t\treturn new ";
60
  protected final String TEXT_41 = "NotationCommand(";
60
  protected final String TEXT_41 = "(this);" + NL + "\t\t}";
61
  protected final String TEXT_42 = " parent, " + NL + "\t\t\t\t";
61
  protected final String TEXT_42 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL;
62
  protected final String TEXT_43 = " domainElement";
62
  protected final String TEXT_43 = NL;
63
  protected final String TEXT_44 = ", ";
63
  protected final String TEXT_44 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
64
  protected final String TEXT_45 = " constraint";
64
  protected final String TEXT_45 = "static ";
65
  protected final String TEXT_46 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = ";
65
  protected final String TEXT_46 = "class Create";
66
  protected final String TEXT_47 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t";
66
  protected final String TEXT_47 = "NotationCommand extends ";
67
  protected final String TEXT_48 = ".decorateView(createdNode);";
67
  protected final String TEXT_48 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create";
68
  protected final String TEXT_49 = NL + "\t\t\t";
68
  protected final String TEXT_49 = "NotationCommand(";
69
  protected final String TEXT_50 = " bounds = ";
69
  protected final String TEXT_50 = " parent, " + NL + "\t\t\t\t";
70
  protected final String TEXT_51 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
70
  protected final String TEXT_51 = " domainElement";
71
  protected final String TEXT_52 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
71
  protected final String TEXT_52 = ", ";
72
  protected final String TEXT_53 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
72
  protected final String TEXT_53 = " constraint";
73
  protected final String TEXT_54 = "));";
73
  protected final String TEXT_54 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = ";
74
  protected final String TEXT_55 = NL + "\t\t}" + NL + "\t}" + NL;
74
  protected final String TEXT_55 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t";
75
  protected final String TEXT_56 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
75
  protected final String TEXT_56 = ".decorateView(createdNode);";
76
  protected final String TEXT_57 = "static ";
76
  protected final String TEXT_57 = NL + "\t\t\t";
77
  protected final String TEXT_58 = "class Create";
77
  protected final String TEXT_58 = " bounds = ";
78
  protected final String TEXT_59 = "Command extends ";
78
  protected final String TEXT_59 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
79
  protected final String TEXT_60 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create";
79
  protected final String TEXT_60 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
80
  protected final String TEXT_61 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
80
  protected final String TEXT_61 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
81
  protected final String TEXT_62 = "Command(";
81
  protected final String TEXT_62 = "));";
82
  protected final String TEXT_63 = " parent, ";
82
  protected final String TEXT_63 = NL + "\t\t}" + NL + "\t}" + NL;
83
  protected final String TEXT_64 = ".CreateRequestEx request";
83
  protected final String TEXT_64 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
84
  protected final String TEXT_65 = ", ";
84
  protected final String TEXT_65 = "static ";
85
  protected final String TEXT_66 = " constraint";
85
  protected final String TEXT_66 = "class Create";
86
  protected final String TEXT_67 = ") {" + NL + "\t\t\t";
86
  protected final String TEXT_67 = "Command extends ";
87
  protected final String TEXT_68 = " domainModelEditDomain = ";
87
  protected final String TEXT_68 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create";
88
  protected final String TEXT_69 = ".getEditingDomain(parent.getDiagram().getElement());";
88
  protected final String TEXT_69 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
89
  protected final String TEXT_70 = NL + "\t\t\t";
89
  protected final String TEXT_70 = "Command(";
90
  protected final String TEXT_71 = " createdDomainElement = ";
90
  protected final String TEXT_71 = " parent, ";
91
  protected final String TEXT_72 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
91
  protected final String TEXT_72 = ".CreateRequestEx request";
92
  protected final String TEXT_73 = ".eINSTANCE.get";
92
  protected final String TEXT_73 = ", ";
93
  protected final String TEXT_74 = "());";
93
  protected final String TEXT_74 = " constraint";
94
  protected final String TEXT_75 = NL + "\t\t\t";
94
  protected final String TEXT_75 = ") {" + NL + "\t\t\t";
95
  protected final String TEXT_76 = " createdDomainElement = ";
95
  protected final String TEXT_76 = " domainModelEditDomain = ";
96
  protected final String TEXT_77 = ".eINSTANCE.create";
96
  protected final String TEXT_77 = ".getEditingDomain(parent.getDiagram().getElement());";
97
  protected final String TEXT_78 = "();";
97
  protected final String TEXT_78 = NL + "\t\t\t";
98
  protected final String TEXT_79 = NL + "\t\t\t";
98
  protected final String TEXT_79 = " createdDomainElement = ";
99
  protected final String TEXT_80 = NL + "\t\t\t";
99
  protected final String TEXT_80 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
100
  protected final String TEXT_81 = ".";
100
  protected final String TEXT_81 = ".eINSTANCE.get";
101
  protected final String TEXT_82 = ".initializeElement(createdDomainElement);";
101
  protected final String TEXT_82 = "());";
102
  protected final String TEXT_83 = NL + "\t\t\t";
102
  protected final String TEXT_83 = NL + "\t\t\t";
103
  protected final String TEXT_84 = " compoundCommand = new ";
103
  protected final String TEXT_84 = " createdDomainElement = ";
104
  protected final String TEXT_85 = "();" + NL + "\t\t\tcompoundCommand.append(";
104
  protected final String TEXT_85 = ".eINSTANCE.create";
105
  protected final String TEXT_86 = ".create(domainModelEditDomain, ";
105
  protected final String TEXT_86 = "();";
106
  protected final String TEXT_87 = ", " + NL + "\t\t\t\t";
106
  protected final String TEXT_87 = NL + "\t\t\t";
107
  protected final String TEXT_88 = ".eINSTANCE.get";
107
  protected final String TEXT_88 = NL + "\t\t\t";
108
  protected final String TEXT_89 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append(";
108
  protected final String TEXT_89 = ".";
109
  protected final String TEXT_90 = ".create(domainModelEditDomain, ";
109
  protected final String TEXT_90 = ".initializeElement(createdDomainElement);";
110
  protected final String TEXT_91 = ", " + NL + "\t\t\t\t";
110
  protected final String TEXT_91 = NL + "\t\t\t";
111
  protected final String TEXT_92 = ".eINSTANCE.get";
111
  protected final String TEXT_92 = " compoundCommand = new ";
112
  protected final String TEXT_93 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
112
  protected final String TEXT_93 = "();" + NL + "\t\t\tcompoundCommand.append(";
113
  protected final String TEXT_94 = NL + "\t\t\tthis.domainModelAddCommand = ";
113
  protected final String TEXT_94 = ".create(domainModelEditDomain, ";
114
  protected final String TEXT_95 = ".create(domainModelEditDomain, ";
114
  protected final String TEXT_95 = ", " + NL + "\t\t\t\t";
115
  protected final String TEXT_96 = ", " + NL + "\t\t\t\t";
115
  protected final String TEXT_96 = ".eINSTANCE.get";
116
  protected final String TEXT_97 = ".eINSTANCE.get";
116
  protected final String TEXT_97 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append(";
117
  protected final String TEXT_98 = "(), createdDomainElement);";
117
  protected final String TEXT_98 = ".create(domainModelEditDomain, ";
118
  protected final String TEXT_99 = NL + "\t\t\tthis.notationAddCommand = new Create";
118
  protected final String TEXT_99 = ", " + NL + "\t\t\t\t";
119
  protected final String TEXT_100 = "NotationCommand(parent, createdDomainElement";
119
  protected final String TEXT_100 = ".eINSTANCE.get";
120
  protected final String TEXT_101 = ", constraint";
120
  protected final String TEXT_101 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
121
  protected final String TEXT_102 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
121
  protected final String TEXT_102 = NL + "\t\t\tthis.domainModelAddCommand = ";
122
  protected final String TEXT_103 = NL;
122
  protected final String TEXT_103 = ".create(domainModelEditDomain, ";
123
  protected final String TEXT_104 = NL;
123
  protected final String TEXT_104 = ", " + NL + "\t\t\t\t";
124
  protected final String TEXT_105 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
124
  protected final String TEXT_105 = ".eINSTANCE.get";
125
  protected final String TEXT_106 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
125
  protected final String TEXT_106 = "(), createdDomainElement);";
126
  protected final String TEXT_107 = " feature, ";
126
  protected final String TEXT_107 = NL + "\t\t\tthis.notationAddCommand = new Create";
127
  protected final String TEXT_108 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
127
  protected final String TEXT_108 = "NotationCommand(parent, createdDomainElement";
128
  protected final String TEXT_109 = NL;
128
  protected final String TEXT_109 = ", constraint";
129
  protected final String TEXT_110 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
129
  protected final String TEXT_110 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
130
  protected final String TEXT_111 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
130
  protected final String TEXT_111 = NL;
131
  protected final String TEXT_112 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends ";
131
  protected final String TEXT_112 = NL;
132
  protected final String TEXT_113 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
132
  protected final String TEXT_113 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
133
  protected final String TEXT_114 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\t";
133
  protected final String TEXT_114 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
134
  protected final String TEXT_115 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor(";
134
  protected final String TEXT_115 = " feature, ";
135
  protected final String TEXT_116 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher((";
135
  protected final String TEXT_116 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
136
  protected final String TEXT_117 = ")msg.getFeature(), msg);" + NL + "\t\t\t\tif (refresher != null) {" + NL + "\t\t\t\t\trefresher.refresh();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
136
  protected final String TEXT_117 = NL;
137
  protected final String TEXT_118 = "/*<IUpdatableEditPart>*/ findAffectedParts(";
137
  protected final String TEXT_118 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
138
  protected final String TEXT_119 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof ";
138
  protected final String TEXT_119 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
139
  protected final String TEXT_120 = ") {" + NL + "\t\t\t\t";
139
  protected final String TEXT_120 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends ";
140
  protected final String TEXT_121 = " view = getView((EObject) notifier);" + NL + "\t\t\t\tif (view != null) {" + NL + "\t\t\t\t\tEditPart affectedEditPart = (EditPart) getViewer().getEditPartRegistry().get(view);" + NL + "\t\t\t\t\tif (affectedEditPart != null) {" + NL + "\t\t\t\t\t\treturn ";
140
  protected final String TEXT_121 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
141
  protected final String TEXT_122 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn ";
141
  protected final String TEXT_122 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\t";
142
  protected final String TEXT_123 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
142
  protected final String TEXT_123 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor(";
143
  protected final String TEXT_124 = " getView(EObject offspring) {" + NL + "\t\t\twhile (offspring != null && offspring instanceof View == false) {" + NL + "\t\t\t\toffspring = offspring.eContainer();" + NL + "\t\t\t}" + NL + "\t\t\treturn (";
143
  protected final String TEXT_124 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher((";
144
  protected final String TEXT_125 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
144
  protected final String TEXT_125 = ")msg.getFeature(), msg);" + NL + "\t\t\t\tif (refresher != null) {" + NL + "\t\t\t\t\trefresher.refresh();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
145
  protected final String TEXT_126 = NL;
145
  protected final String TEXT_126 = "/*<IUpdatableEditPart>*/ findAffectedParts(";
146
  protected final String TEXT_127 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
146
  protected final String TEXT_127 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof ";
147
  protected final String TEXT_128 = " domainModelEditDomain = ";
147
  protected final String TEXT_128 = ") {" + NL + "\t\t\t\t";
148
  protected final String TEXT_129 = ".getEditingDomain(";
148
  protected final String TEXT_129 = " view = getView((EObject) notifier);" + NL + "\t\t\t\tif (view != null) {" + NL + "\t\t\t\t\tEditPart affectedEditPart = (EditPart) getViewer().getEditPartRegistry().get(view);" + NL + "\t\t\t\t\tif (affectedEditPart != null) {" + NL + "\t\t\t\t\t\treturn ";
149
  protected final String TEXT_130 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
149
  protected final String TEXT_130 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn ";
150
  protected final String TEXT_131 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
150
  protected final String TEXT_131 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
151
  protected final String TEXT_132 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
151
  protected final String TEXT_132 = " getView(EObject offspring) {" + NL + "\t\t\twhile (offspring != null && offspring instanceof View == false) {" + NL + "\t\t\t\toffspring = offspring.eContainer();" + NL + "\t\t\t}" + NL + "\t\t\treturn (";
152
  protected final String TEXT_133 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
152
  protected final String TEXT_133 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(updateManager)) {" + NL + "\t\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();";
153
  protected final String TEXT_134 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
153
  protected final String TEXT_134 = NL + "\t\tinstallLinkNotationModelRefresher();";
154
  protected final String TEXT_135 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
154
  protected final String TEXT_135 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {";
155
  protected final String TEXT_136 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
155
  protected final String TEXT_136 = NL + "\t\tuninstallLinkNotationModelRefresher();";
156
  protected final String TEXT_137 = ".NOT_TOUCH;" + NL + "\t\t}";
156
  protected final String TEXT_137 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
157
  protected final String TEXT_138 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
157
  protected final String TEXT_138 = NL;
158
  protected final String TEXT_139 = NL + "\t\t\tfilter = ";
158
  protected final String TEXT_139 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
159
  protected final String TEXT_140 = ".createFeatureFilter(";
159
  protected final String TEXT_140 = " domainModelEditDomain = ";
160
  protected final String TEXT_141 = ".eINSTANCE.get";
160
  protected final String TEXT_141 = ".getEditingDomain(";
161
  protected final String TEXT_142 = "());";
161
  protected final String TEXT_142 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
162
  protected final String TEXT_143 = NL + "\t\t\tfilter = filter.or(";
162
  protected final String TEXT_143 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
163
  protected final String TEXT_144 = ".createFeatureFilter(";
163
  protected final String TEXT_144 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
164
  protected final String TEXT_145 = ".eINSTANCE.get";
164
  protected final String TEXT_145 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
165
  protected final String TEXT_146 = "()));";
165
  protected final String TEXT_146 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
166
  protected final String TEXT_147 = NL + "\t\t\tfilter = filter.and(";
166
  protected final String TEXT_147 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
167
  protected final String TEXT_148 = ".createNotifierFilter(";
167
  protected final String TEXT_148 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
168
  protected final String TEXT_149 = "));";
168
  protected final String TEXT_149 = ".NOT_TOUCH;" + NL + "\t\t}";
169
  protected final String TEXT_150 = NL + "\t\t\tfilter = ";
169
  protected final String TEXT_150 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
170
  protected final String TEXT_151 = ".createNotifierFilter(";
170
  protected final String TEXT_151 = NL + "\t\t\tfilter = ";
171
  protected final String TEXT_152 = ");";
171
  protected final String TEXT_152 = ".createFeatureFilter(";
172
  protected final String TEXT_153 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
172
  protected final String TEXT_153 = ".eINSTANCE.get";
173
  protected final String TEXT_154 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
173
  protected final String TEXT_154 = "());";
174
  protected final String TEXT_155 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
174
  protected final String TEXT_155 = NL + "\t\t\tfilter = filter.or(";
175
  protected final String TEXT_156 = " transactionAboutToCommit(";
175
  protected final String TEXT_156 = ".createFeatureFilter(";
176
  protected final String TEXT_157 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
176
  protected final String TEXT_157 = ".eINSTANCE.get";
177
  protected final String TEXT_158 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
177
  protected final String TEXT_158 = "()));";
178
  protected final String TEXT_159 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
178
  protected final String TEXT_159 = NL + "\t\t\tfilter = filter.and(";
179
  protected final String TEXT_160 = " domainModelEditDomain = ";
179
  protected final String TEXT_160 = ".createNotifierFilter(";
180
  protected final String TEXT_161 = ".getEditingDomain(";
180
  protected final String TEXT_161 = "));";
181
  protected final String TEXT_162 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
181
  protected final String TEXT_162 = NL + "\t\t\tfilter = ";
182
  protected final String TEXT_163 = " getRefreshNotationModelCommand() {" + NL + "\t\t";
182
  protected final String TEXT_163 = ".createNotifierFilter(";
183
  protected final String TEXT_164 = " semanticChildren = getSemanticChildren();" + NL + "\t\t";
183
  protected final String TEXT_164 = ");";
184
  protected final String TEXT_165 = " notationalChildren = ";
184
  protected final String TEXT_165 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
185
  protected final String TEXT_166 = ".getChildren();" + NL + "\t\tfinal ";
185
  protected final String TEXT_166 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
186
  protected final String TEXT_167 = " semanticToNotational = new ";
186
  protected final String TEXT_167 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
187
  protected final String TEXT_168 = "();" + NL + "\t\tfor(";
187
  protected final String TEXT_168 = " transactionAboutToCommit(";
188
  protected final String TEXT_169 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
188
  protected final String TEXT_169 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
189
  protected final String TEXT_170 = " next = (";
189
  protected final String TEXT_170 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
190
  protected final String TEXT_171 = ") it.next();" + NL + "\t\t\t";
190
  protected final String TEXT_171 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
191
  protected final String TEXT_172 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
191
  protected final String TEXT_172 = " domainModelEditDomain = ";
192
  protected final String TEXT_173 = " parentView = ";
192
  protected final String TEXT_173 = ".getEditingDomain(";
193
  protected final String TEXT_174 = ";" + NL + "\t\t";
193
  protected final String TEXT_174 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
194
  protected final String TEXT_175 = " command = new ";
194
  protected final String TEXT_175 = " getRefreshNotationModelCommand() {" + NL + "\t\t";
195
  protected final String TEXT_176 = "();" + NL + "\t\tfor(";
195
  protected final String TEXT_176 = " semanticChildren = getSemanticChildren();" + NL + "\t\t";
196
  protected final String TEXT_177 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
196
  protected final String TEXT_177 = " notationalChildren = ";
197
  protected final String TEXT_178 = " next = (";
197
  protected final String TEXT_178 = ".getChildren();" + NL + "\t\tfinal ";
198
  protected final String TEXT_179 = ") it.next();" + NL + "\t\t\t";
198
  protected final String TEXT_179 = " semanticToNotational = new ";
199
  protected final String TEXT_180 = " currentView = (";
199
  protected final String TEXT_180 = "();" + NL + "\t\tfor(";
200
  protected final String TEXT_181 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = ";
200
  protected final String TEXT_181 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
201
  protected final String TEXT_182 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != ";
201
  protected final String TEXT_182 = " next = (";
202
  protected final String TEXT_183 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t";
202
  protected final String TEXT_183 = ") it.next();" + NL + "\t\t\t";
203
  protected final String TEXT_184 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new ";
203
  protected final String TEXT_184 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
204
  protected final String TEXT_185 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
204
  protected final String TEXT_185 = " parentView = ";
205
  protected final String TEXT_186 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
205
  protected final String TEXT_186 = ";" + NL + "\t\t";
206
  protected final String TEXT_187 = " obsoleteView = (";
206
  protected final String TEXT_187 = " command = new ";
207
  protected final String TEXT_188 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
207
  protected final String TEXT_188 = "();" + NL + "\t\tfor(";
208
  protected final String TEXT_189 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate ";
208
  protected final String TEXT_189 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
209
  protected final String TEXT_190 = " getCreateNotationalElementCommand(";
209
  protected final String TEXT_190 = " next = (";
210
  protected final String TEXT_191 = " parentView, ";
210
  protected final String TEXT_191 = ") it.next();" + NL + "\t\t\t";
211
  protected final String TEXT_192 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {";
211
  protected final String TEXT_192 = " currentView = (";
212
  protected final String TEXT_193 = NL + "\t\tcase ";
212
  protected final String TEXT_193 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = ";
213
  protected final String TEXT_194 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof ";
213
  protected final String TEXT_194 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != ";
214
  protected final String TEXT_195 = ") {" + NL + "\t\t\t\treturn new Create";
214
  protected final String TEXT_195 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t";
215
  protected final String TEXT_196 = "NotationCommand(parentView, domainElement";
215
  protected final String TEXT_196 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new ";
216
  protected final String TEXT_197 = ", new Rectangle(0, 0, 0, 0)";
216
  protected final String TEXT_197 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
217
  protected final String TEXT_198 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;";
217
  protected final String TEXT_198 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
218
  protected final String TEXT_199 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
218
  protected final String TEXT_199 = " obsoleteView = (";
219
  protected final String TEXT_200 = " getSemanticChildren() {";
219
  protected final String TEXT_200 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
220
  protected final String TEXT_201 = NL;
220
  protected final String TEXT_201 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate ";
221
  protected final String TEXT_202 = NL + "\treturn ";
221
  protected final String TEXT_202 = " getCreateNotationalElementCommand(";
222
  protected final String TEXT_203 = ".EMPTY_LIST;";
222
  protected final String TEXT_203 = " parentView, ";
223
  protected final String TEXT_204 = NL + "\t";
223
  protected final String TEXT_204 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {";
224
  protected final String TEXT_205 = " result = new ";
224
  protected final String TEXT_205 = NL + "\t\tcase ";
225
  protected final String TEXT_206 = "();";
225
  protected final String TEXT_206 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof ";
226
  protected final String TEXT_207 = NL + "\t";
226
  protected final String TEXT_207 = ") {" + NL + "\t\t\t\treturn new Create";
227
  protected final String TEXT_208 = " viewObject = ";
227
  protected final String TEXT_208 = "NotationCommand(parentView, domainElement";
228
  protected final String TEXT_209 = ";" + NL + "\t";
228
  protected final String TEXT_209 = ", new Rectangle(0, 0, 0, 0)";
229
  protected final String TEXT_210 = " modelObject = ";
229
  protected final String TEXT_210 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;";
230
  protected final String TEXT_211 = ";" + NL + "\t";
230
  protected final String TEXT_211 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
231
  protected final String TEXT_212 = " nextValue;" + NL + "\tint nodeVID;";
231
  protected final String TEXT_212 = " getSemanticChildren() {";
232
  protected final String TEXT_213 = NL + "\tfor(";
232
  protected final String TEXT_213 = NL;
233
  protected final String TEXT_214 = " it = ((";
233
  protected final String TEXT_214 = NL + "\treturn ";
234
  protected final String TEXT_215 = ")modelObject).";
234
  protected final String TEXT_215 = ".EMPTY_LIST;";
235
  protected final String TEXT_216 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
235
  protected final String TEXT_216 = NL + "\t";
236
  protected final String TEXT_217 = ") it.next();";
236
  protected final String TEXT_217 = " result = new ";
237
  protected final String TEXT_218 = NL + "\tnextValue = ((";
237
  protected final String TEXT_218 = "();";
238
  protected final String TEXT_219 = ")modelObject).";
238
  protected final String TEXT_219 = NL + "\t";
239
  protected final String TEXT_220 = "();";
239
  protected final String TEXT_220 = " viewObject = ";
240
  protected final String TEXT_221 = NL + "\tnodeVID = ";
240
  protected final String TEXT_221 = ";" + NL + "\t";
241
  protected final String TEXT_222 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
241
  protected final String TEXT_222 = " modelObject = ";
242
  protected final String TEXT_223 = NL + "\tswitch (nodeVID) {";
242
  protected final String TEXT_223 = ";" + NL + "\t";
243
  protected final String TEXT_224 = NL + "\tcase ";
243
  protected final String TEXT_224 = " nextValue;" + NL + "\tint nodeVID;";
244
  protected final String TEXT_225 = ".VISUAL_ID: {";
244
  protected final String TEXT_225 = NL + "\tfor(";
245
  protected final String TEXT_226 = NL + "\tif (";
245
  protected final String TEXT_226 = " it = ((";
246
  protected final String TEXT_227 = ".VISUAL_ID == nodeVID) {";
246
  protected final String TEXT_227 = ")modelObject).";
247
  protected final String TEXT_228 = NL + "\t\tresult.add(nextValue);";
247
  protected final String TEXT_228 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
248
  protected final String TEXT_229 = NL + "\t\tbreak;" + NL + "\t\t}";
248
  protected final String TEXT_229 = ") it.next();";
249
  protected final String TEXT_230 = NL + "\t\t}";
249
  protected final String TEXT_230 = NL + "\tnextValue = ((";
250
  protected final String TEXT_231 = NL + "\t}";
250
  protected final String TEXT_231 = ")modelObject).";
251
  protected final String TEXT_232 = NL + "\t}";
251
  protected final String TEXT_232 = "();";
252
  protected final String TEXT_233 = NL + "\treturn result;";
252
  protected final String TEXT_233 = NL + "\tnodeVID = ";
253
  protected final String TEXT_234 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns ";
253
  protected final String TEXT_234 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
254
  protected final String TEXT_235 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn ";
254
  protected final String TEXT_235 = NL + "\tswitch (nodeVID) {";
255
  protected final String TEXT_236 = ";" + NL + "\t}";
255
  protected final String TEXT_236 = NL + "\tcase ";
256
  protected final String TEXT_237 = NL;
256
  protected final String TEXT_237 = ".VISUAL_ID: {";
257
  protected final String TEXT_238 = NL;
257
  protected final String TEXT_238 = NL + "\tif (";
258
  protected final String TEXT_239 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
258
  protected final String TEXT_239 = ".VISUAL_ID == nodeVID) {";
259
  protected final String TEXT_240 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
259
  protected final String TEXT_240 = NL + "\t\tresult.add(nextValue);";
260
  protected final String TEXT_241 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
260
  protected final String TEXT_241 = NL + "\t\tbreak;" + NL + "\t\t}";
261
  protected final String TEXT_242 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdateManager updateManager = new UpdateManager();" + NL + "}";
261
  protected final String TEXT_242 = NL + "\t\t}";
262
  protected final String TEXT_243 = NL;
262
  protected final String TEXT_243 = NL + "\t}";
263
  protected final String TEXT_244 = NL + "\t}";
264
  protected final String TEXT_245 = NL + "\treturn result;";
265
  protected final String TEXT_246 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns ";
266
  protected final String TEXT_247 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn ";
267
  protected final String TEXT_248 = ";" + NL + "\t}" + NL;
268
  protected final String TEXT_249 = NL;
269
  protected final String TEXT_250 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
270
  protected final String TEXT_251 = " domainModelEditDomain = ";
271
  protected final String TEXT_252 = ".getEditingDomain(";
272
  protected final String TEXT_253 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends ";
273
  protected final String TEXT_254 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
274
  protected final String TEXT_255 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
275
  protected final String TEXT_256 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
276
  protected final String TEXT_257 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in ";
277
  protected final String TEXT_258 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
278
  protected final String TEXT_259 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn ";
279
  protected final String TEXT_260 = ".NOT_TOUCH;" + NL + "\t\t}";
280
  protected final String TEXT_261 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
281
  protected final String TEXT_262 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn ";
282
  protected final String TEXT_263 = ".createEventTypeFilter(";
283
  protected final String TEXT_264 = ".SET).or(" + NL + "\t\t\t\t";
284
  protected final String TEXT_265 = ".createEventTypeFilter(";
285
  protected final String TEXT_266 = ".UNSET).or(" + NL + "\t\t\t\t";
286
  protected final String TEXT_267 = ".createEventTypeFilter(";
287
  protected final String TEXT_268 = ".REMOVE).or(" + NL + "\t\t\t\t";
288
  protected final String TEXT_269 = ".createEventTypeFilter(";
289
  protected final String TEXT_270 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}";
290
  protected final String TEXT_271 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
291
  protected final String TEXT_272 = NL;
292
  protected final String TEXT_273 = NL + "\t\t\tfilter = ";
293
  protected final String TEXT_274 = ".createFeatureFilter(";
294
  protected final String TEXT_275 = ".eINSTANCE.get";
295
  protected final String TEXT_276 = "());";
296
  protected final String TEXT_277 = NL + "\t\t\tfilter = filter.or(";
297
  protected final String TEXT_278 = ".createFeatureFilter(";
298
  protected final String TEXT_279 = ".eINSTANCE.get";
299
  protected final String TEXT_280 = "()));";
300
  protected final String TEXT_281 = NL;
301
  protected final String TEXT_282 = NL + "\t\t\tfilter = ";
302
  protected final String TEXT_283 = ".createFeatureFilter(";
303
  protected final String TEXT_284 = ".eINSTANCE.get";
304
  protected final String TEXT_285 = "());";
305
  protected final String TEXT_286 = NL + "\t\t\tfilter = filter.or(";
306
  protected final String TEXT_287 = ".createFeatureFilter(";
307
  protected final String TEXT_288 = ".eINSTANCE.get";
308
  protected final String TEXT_289 = "()));";
309
  protected final String TEXT_290 = NL;
310
  protected final String TEXT_291 = NL + "\t\t\tfilter = ";
311
  protected final String TEXT_292 = ".createFeatureFilter(";
312
  protected final String TEXT_293 = ".eINSTANCE.get";
313
  protected final String TEXT_294 = "());";
314
  protected final String TEXT_295 = NL + "\t\t\tfilter = filter.or(";
315
  protected final String TEXT_296 = ".createFeatureFilter(";
316
  protected final String TEXT_297 = ".eINSTANCE.get";
317
  protected final String TEXT_298 = "()));";
318
  protected final String TEXT_299 = NL;
319
  protected final String TEXT_300 = NL + "\t\t\tfilter = ";
320
  protected final String TEXT_301 = ".createFeatureFilter(";
321
  protected final String TEXT_302 = ".eINSTANCE.get";
322
  protected final String TEXT_303 = "());";
323
  protected final String TEXT_304 = NL + "\t\t\tfilter = filter.or(";
324
  protected final String TEXT_305 = ".createFeatureFilter(";
325
  protected final String TEXT_306 = ".eINSTANCE.get";
326
  protected final String TEXT_307 = "()));";
327
  protected final String TEXT_308 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);";
328
  protected final String TEXT_309 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();";
329
  protected final String TEXT_310 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());";
330
  protected final String TEXT_311 = NL + "\t\t\tfilter = createUncontainedLinksFilter();";
331
  protected final String TEXT_312 = NL + "\t\t\tfilter = ";
332
  protected final String TEXT_313 = ".ANY.negated();";
333
  protected final String TEXT_314 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
334
  protected final String TEXT_315 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
335
  protected final String TEXT_316 = " transactionAboutToCommit(";
336
  protected final String TEXT_317 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
337
  protected final String TEXT_318 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t";
338
  protected final String TEXT_319 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
339
  protected final String TEXT_320 = " domainModelEditDomain = ";
340
  protected final String TEXT_321 = ".getEditingDomain(";
341
  protected final String TEXT_322 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL;
342
  protected final String TEXT_323 = NL;
343
  protected final String TEXT_324 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
344
  protected final String TEXT_325 = " mySource;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
345
  protected final String TEXT_326 = " myDestination;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
346
  protected final String TEXT_327 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected LinkDescriptor(";
347
  protected final String TEXT_328 = " source, ";
348
  protected final String TEXT_329 = " destination, ";
349
  protected final String TEXT_330 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate LinkDescriptor(";
350
  protected final String TEXT_331 = " source, ";
351
  protected final String TEXT_332 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
352
  protected final String TEXT_333 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
353
  protected final String TEXT_334 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
354
  protected final String TEXT_335 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
355
  protected final String TEXT_336 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t";
356
  protected final String TEXT_337 = "/*<LinkDescriptor>*/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t";
357
  protected final String TEXT_338 = "/*<Edge>*/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal ";
358
  protected final String TEXT_339 = " semanticToNotationalTypeBasedLinks = new ";
359
  protected final String TEXT_340 = "();" + NL + "\t\tfinal ";
360
  protected final String TEXT_341 = "/*<EObject, List<Edge>>*/ semanticToNotationalFeatureBasedLinks = new ";
361
  protected final String TEXT_342 = "();" + NL + "\t\tfor(";
362
  protected final String TEXT_343 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
363
  protected final String TEXT_344 = " next = (";
364
  protected final String TEXT_345 = ") it.next();" + NL + "\t\t\t";
365
  protected final String TEXT_346 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t";
366
  protected final String TEXT_347 = " featureBasedLinksForSource = (";
367
  protected final String TEXT_348 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new ";
368
  protected final String TEXT_349 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
369
  protected final String TEXT_350 = " parentView = ";
370
  protected final String TEXT_351 = ";" + NL + "\t\t";
371
  protected final String TEXT_352 = " command = new ";
372
  protected final String TEXT_353 = "();" + NL + "\t\tfor(";
373
  protected final String TEXT_354 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t";
374
  protected final String TEXT_355 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t";
375
  protected final String TEXT_356 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = (";
376
  protected final String TEXT_357 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t";
377
  protected final String TEXT_358 = " featureBasedLinksForSource = (";
378
  protected final String TEXT_359 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = (";
379
  protected final String TEXT_360 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != ";
380
  protected final String TEXT_361 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t";
381
  protected final String TEXT_362 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
382
  protected final String TEXT_363 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
383
  protected final String TEXT_364 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
384
  protected final String TEXT_365 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t";
385
  protected final String TEXT_366 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
386
  protected final String TEXT_367 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
387
  protected final String TEXT_368 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
388
  protected final String TEXT_369 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
389
  protected final String TEXT_370 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
390
  protected final String TEXT_371 = " obsoleteView = (";
391
  protected final String TEXT_372 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
392
  protected final String TEXT_373 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor(";
393
  protected final String TEXT_374 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
394
  protected final String TEXT_375 = " obsoleteViews = (";
395
  protected final String TEXT_376 = ") it.next();" + NL + "\t\t\tfor(";
396
  protected final String TEXT_377 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t";
397
  protected final String TEXT_378 = " obsoleteView = (";
398
  protected final String TEXT_379 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new ";
399
  protected final String TEXT_380 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
400
  protected final String TEXT_381 = " findView(";
401
  protected final String TEXT_382 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t";
402
  protected final String TEXT_383 = " editPart = (";
403
  protected final String TEXT_384 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof ";
404
  protected final String TEXT_385 = ") {" + NL + "\t\t\treturn (";
405
  protected final String TEXT_386 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t";
406
  protected final String TEXT_387 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t";
407
  protected final String TEXT_388 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
408
  protected final String TEXT_389 = " findNode(";
409
  protected final String TEXT_390 = " parentView, ";
410
  protected final String TEXT_391 = " modelElement) {" + NL + "\t\tfor(";
411
  protected final String TEXT_392 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
412
  protected final String TEXT_393 = " next = (";
413
  protected final String TEXT_394 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t";
414
  protected final String TEXT_395 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
415
  protected final String TEXT_396 = " findEdge(";
416
  protected final String TEXT_397 = " modelElement) {" + NL + "\t\tfor(";
417
  protected final String TEXT_398 = " it = ";
418
  protected final String TEXT_399 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
419
  protected final String TEXT_400 = " next = (";
420
  protected final String TEXT_401 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
421
  protected final String TEXT_402 = " getCreateNotationalEdgeCommand(";
422
  protected final String TEXT_403 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t";
423
  protected final String TEXT_404 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t";
424
  protected final String TEXT_405 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t";
425
  protected final String TEXT_406 = " createdEdge = ";
426
  protected final String TEXT_407 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {";
427
  protected final String TEXT_408 = NL + "\t\tcase ";
428
  protected final String TEXT_409 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof ";
429
  protected final String TEXT_410 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t";
430
  protected final String TEXT_411 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;";
431
  protected final String TEXT_412 = NL + "\t\tcase ";
432
  protected final String TEXT_413 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t";
433
  protected final String TEXT_414 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;";
434
  protected final String TEXT_415 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new ";
435
  protected final String TEXT_416 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
436
  protected final String TEXT_417 = " getSemanticChildLinks() {";
437
  protected final String TEXT_418 = NL;
438
  protected final String TEXT_419 = "\t";
439
  protected final String TEXT_420 = " result = new ";
440
  protected final String TEXT_421 = "();";
441
  protected final String TEXT_422 = NL + "\t";
442
  protected final String TEXT_423 = " modelObject = ";
443
  protected final String TEXT_424 = ";" + NL + "\t";
444
  protected final String TEXT_425 = " nextValue;";
445
  protected final String TEXT_426 = NL + "\tint linkVID;";
446
  protected final String TEXT_427 = NL + "\tfor(";
447
  protected final String TEXT_428 = " it = ((";
448
  protected final String TEXT_429 = ")modelObject).";
449
  protected final String TEXT_430 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
450
  protected final String TEXT_431 = ") it.next();";
451
  protected final String TEXT_432 = NL + "\tnextValue = ((";
452
  protected final String TEXT_433 = ")modelObject).";
453
  protected final String TEXT_434 = "();";
454
  protected final String TEXT_435 = NL + "\tlinkVID = ";
455
  protected final String TEXT_436 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
456
  protected final String TEXT_437 = NL + "\tswitch (linkVID) {";
457
  protected final String TEXT_438 = NL + "\tcase ";
458
  protected final String TEXT_439 = ".VISUAL_ID: {";
459
  protected final String TEXT_440 = NL + "\tif (";
460
  protected final String TEXT_441 = ".VISUAL_ID == linkVID) {";
461
  protected final String TEXT_442 = NL + "\t\t";
462
  protected final String TEXT_443 = " source = ((";
463
  protected final String TEXT_444 = ")nextValue).";
464
  protected final String TEXT_445 = "();";
465
  protected final String TEXT_446 = NL + "\t\t";
466
  protected final String TEXT_447 = " source = ";
467
  protected final String TEXT_448 = ";";
468
  protected final String TEXT_449 = NL + "\t\t";
469
  protected final String TEXT_450 = " target = ((";
470
  protected final String TEXT_451 = ")nextValue).";
471
  protected final String TEXT_452 = "();";
472
  protected final String TEXT_453 = NL + "\t\t";
473
  protected final String TEXT_454 = " target = ";
474
  protected final String TEXT_455 = ";";
475
  protected final String TEXT_456 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}";
476
  protected final String TEXT_457 = NL + "\t\tbreak;" + NL + "\t}";
477
  protected final String TEXT_458 = NL + "\t}";
478
  protected final String TEXT_459 = NL + "\t}";
479
  protected final String TEXT_460 = NL + "\t}";
480
  protected final String TEXT_461 = NL + "\tfor(";
481
  protected final String TEXT_462 = " it = ((";
482
  protected final String TEXT_463 = ")modelObject).";
483
  protected final String TEXT_464 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
484
  protected final String TEXT_465 = ") it.next();";
485
  protected final String TEXT_466 = NL + "\tnextValue = ((";
486
  protected final String TEXT_467 = ")modelObject).";
487
  protected final String TEXT_468 = "();";
488
  protected final String TEXT_469 = NL + "\tif (nextValue != null) {";
489
  protected final String TEXT_470 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, ";
490
  protected final String TEXT_471 = ".VISUAL_ID));";
491
  protected final String TEXT_472 = NL + "\t}";
492
  protected final String TEXT_473 = NL + "\t}";
493
  protected final String TEXT_474 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
494
  protected final String TEXT_475 = " getNotationalChildLinks() {" + NL + "\t\t";
495
  protected final String TEXT_476 = " result = new ";
496
  protected final String TEXT_477 = "();" + NL + "\t\t";
497
  protected final String TEXT_478 = " allLinks = ";
498
  protected final String TEXT_479 = ".getEdges();" + NL + "\t\tfor(";
499
  protected final String TEXT_480 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
500
  protected final String TEXT_481 = " next = (";
501
  protected final String TEXT_482 = ") it.next();";
502
  protected final String TEXT_483 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t";
503
  protected final String TEXT_484 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t";
504
  protected final String TEXT_485 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}";
505
  protected final String TEXT_486 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == ";
506
  protected final String TEXT_487 = ") {" + NL + "\t\t\t\t\tint linkVID = ";
507
  protected final String TEXT_488 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {";
508
  protected final String TEXT_489 = NL + "\t\t\t\t\tcase ";
509
  protected final String TEXT_490 = ".VISUAL_ID:";
510
  protected final String TEXT_491 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}";
511
  protected final String TEXT_492 = NL + "\t\t\t} else {";
512
  protected final String TEXT_493 = NL + "\t\t\t}";
513
  protected final String TEXT_494 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {";
514
  protected final String TEXT_495 = NL + "\t\t\t\tif (next.getElement().eContainer() == ";
515
  protected final String TEXT_496 = ") {" + NL + "\t\t\t\t\tint linkVID = ";
516
  protected final String TEXT_497 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {";
517
  protected final String TEXT_498 = NL + "\t\t\t\t\tcase ";
518
  protected final String TEXT_499 = ".VISUAL_ID:";
519
  protected final String TEXT_500 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}";
520
  protected final String TEXT_501 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns ";
521
  protected final String TEXT_502 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn ";
522
  protected final String TEXT_503 = ";" + NL + "\t}";
523
  protected final String TEXT_504 = NL;
524
  protected final String TEXT_505 = NL;
525
  protected final String TEXT_506 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
526
  protected final String TEXT_507 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
527
  protected final String TEXT_508 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
528
  protected final String TEXT_509 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdateManager updateManager = new UpdateManager();" + NL + "}";
529
  protected final String TEXT_510 = NL;
263
530
264
  public String generate(Object argument)
531
  public String generate(Object argument)
265
  {
532
  {
Lines 268-275 Link Here
268
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
535
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
269
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
536
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
270
importManager.registerInnerClass("NotationModelRefresher");	//from notationModelRefresher.jetinc
537
importManager.registerInnerClass("NotationModelRefresher");	//from notationModelRefresher.jetinc
538
importManager.registerInnerClass("LinkNotationModelRefresher");	//from linkNotationModelRefresher.jetinc
539
importManager.registerInnerClass("LinkDescriptor");	//from linkNotationModelRefresher.jetinc
271
List childNodes = genDiagram.getTopLevelNodes();
540
List childNodes = genDiagram.getTopLevelNodes();
272
541
542
class DiagramEditPartHelper {
543
	private final List myContainedFeatureModelFacetLinks = new LinkedList();
544
	private final List myContainedTypeModelFacetLinks = new LinkedList();
545
	public DiagramEditPartHelper(GenDiagram diagram) {
546
		for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) {
547
			GenLink genLink = (GenLink)it.next();
548
			if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) {
549
				continue;
550
			}
551
			GenClass containerClass;
552
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
553
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
554
				if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
555
					//if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
556
					containerClass = null;
557
				} else {
558
					containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
559
				}
560
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
561
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
562
				containerClass = metaFeature.getGenClass();
563
			} else {
564
				continue;
565
			}
566
			if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) {
567
				if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
568
					myContainedTypeModelFacetLinks.add(genLink);
569
				} else {
570
					myContainedFeatureModelFacetLinks.add(genLink);
571
				}
572
			}
573
		}
574
	}
575
576
	public boolean containsLinks() {
577
		return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
578
	}
579
580
	public boolean containsFeatureModelFacetLinks() {
581
		return !myContainedFeatureModelFacetLinks.isEmpty();
582
	}
583
584
	public boolean containsTypeModelFacetLinks() {
585
		return !myContainedTypeModelFacetLinks.isEmpty();
586
	}
587
588
	public Iterator getContainedFeatureModelFacetLinks() {
589
		return myContainedFeatureModelFacetLinks.iterator();
590
	}
591
592
	public Iterator getContainedTypeModelFacetLinks() {
593
		return myContainedTypeModelFacetLinks.iterator();
594
	}
595
}
596
final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram);
597
273
    stringBuffer.append(TEXT_1);
598
    stringBuffer.append(TEXT_1);
274
    
599
    
275
importManager.emitPackageStatement(stringBuffer);
600
importManager.emitPackageStatement(stringBuffer);
Lines 321-377 Link Here
321
    stringBuffer.append(TEXT_11);
646
    stringBuffer.append(TEXT_11);
322
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
647
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
323
    stringBuffer.append(TEXT_12);
648
    stringBuffer.append(TEXT_12);
649
    stringBuffer.append(TEXT_13);
650
    stringBuffer.append(TEXT_14);
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
652
    stringBuffer.append(TEXT_15);
653
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
654
    stringBuffer.append(TEXT_16);
655
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
656
    stringBuffer.append(TEXT_17);
657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
658
    stringBuffer.append(TEXT_18);
324
    if (null != genDiagram.getPalette()) {
659
    if (null != genDiagram.getPalette()) {
325
final Palette palette = genDiagram.getPalette();
660
final Palette palette = genDiagram.getPalette();
326
    stringBuffer.append(TEXT_13);
661
    stringBuffer.append(TEXT_19);
327
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
662
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
328
    stringBuffer.append(TEXT_14);
663
    stringBuffer.append(TEXT_20);
329
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
664
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
330
    stringBuffer.append(TEXT_15);
665
    stringBuffer.append(TEXT_21);
331
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
666
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
332
    stringBuffer.append(TEXT_16);
667
    stringBuffer.append(TEXT_22);
333
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
668
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
334
    stringBuffer.append(TEXT_17);
669
    stringBuffer.append(TEXT_23);
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
670
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
336
    stringBuffer.append(TEXT_18);
671
    stringBuffer.append(TEXT_24);
337
    
672
    
338
for(Iterator it = childNodes.iterator(); it.hasNext(); ) {
673
for(Iterator it = childNodes.iterator(); it.hasNext(); ) {
339
	GenTopLevelNode next = (GenTopLevelNode)it.next();
674
	GenTopLevelNode next = (GenTopLevelNode)it.next();
340
675
341
    stringBuffer.append(TEXT_19);
676
    stringBuffer.append(TEXT_25);
342
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
677
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
343
    stringBuffer.append(TEXT_20);
678
    stringBuffer.append(TEXT_26);
344
    stringBuffer.append(next.getDomainMetaClass().getName());
679
    stringBuffer.append(next.getDomainMetaClass().getName());
345
    stringBuffer.append(next.getVisualID());
680
    stringBuffer.append(next.getVisualID());
346
    stringBuffer.append(TEXT_21);
681
    stringBuffer.append(TEXT_27);
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
682
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
348
    stringBuffer.append(TEXT_22);
683
    stringBuffer.append(TEXT_28);
349
    
684
    
350
}
685
}
351
686
352
    stringBuffer.append(TEXT_23);
687
    stringBuffer.append(TEXT_29);
353
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
688
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
354
    stringBuffer.append(TEXT_24);
689
    stringBuffer.append(TEXT_30);
355
    }/*when there's palette*/
690
    }/*when there's palette*/
356
    stringBuffer.append(TEXT_25);
691
    stringBuffer.append(TEXT_31);
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
692
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
358
    stringBuffer.append(TEXT_26);
693
    stringBuffer.append(TEXT_32);
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
694
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
360
    stringBuffer.append(TEXT_27);
695
    stringBuffer.append(TEXT_33);
361
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
696
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
362
    stringBuffer.append(TEXT_28);
697
    stringBuffer.append(TEXT_34);
363
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
698
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
364
    stringBuffer.append(TEXT_29);
699
    stringBuffer.append(TEXT_35);
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
700
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
366
    stringBuffer.append(TEXT_30);
701
    stringBuffer.append(TEXT_36);
367
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
702
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
368
    stringBuffer.append(TEXT_31);
703
    stringBuffer.append(TEXT_37);
704
    
705
//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
706
//if (myHelper.containsLinks()) {
707
708
    stringBuffer.append(TEXT_38);
709
    
710
//}
711
712
    stringBuffer.append(TEXT_39);
369
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
713
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
370
    stringBuffer.append(TEXT_32);
714
    stringBuffer.append(TEXT_40);
371
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
715
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
372
    stringBuffer.append(TEXT_33);
716
    stringBuffer.append(TEXT_41);
373
    /*@ include file="adapters/propertySource.javajetinc"*/
717
    /*@ include file="adapters/propertySource.javajetinc"*/
374
    stringBuffer.append(TEXT_34);
718
    stringBuffer.append(TEXT_42);
375
    
719
    
376
for(Iterator it = childNodes.iterator(); it.hasNext(); ) {
720
for(Iterator it = childNodes.iterator(); it.hasNext(); ) {
377
	GenTopLevelNode next = (GenTopLevelNode)it.next();
721
	GenTopLevelNode next = (GenTopLevelNode)it.next();
Lines 379-420 Link Here
379
	boolean isListLayout = false;
723
	boolean isListLayout = false;
380
	String resolvedSemanticElement = "parent.getElement()";
724
	String resolvedSemanticElement = "parent.getElement()";
381
725
382
    stringBuffer.append(TEXT_35);
726
    stringBuffer.append(TEXT_43);
383
    stringBuffer.append(TEXT_36);
727
    stringBuffer.append(TEXT_44);
384
    if (isStatic) {
728
    if (isStatic) {
385
    stringBuffer.append(TEXT_37);
729
    stringBuffer.append(TEXT_45);
386
    }
730
    }
387
    stringBuffer.append(TEXT_38);
731
    stringBuffer.append(TEXT_46);
388
    stringBuffer.append(next.getDomainMetaClass().getName());
732
    stringBuffer.append(next.getDomainMetaClass().getName());
389
    stringBuffer.append(next.getVisualID());
733
    stringBuffer.append(next.getVisualID());
390
    stringBuffer.append(TEXT_39);
734
    stringBuffer.append(TEXT_47);
391
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
735
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
392
    stringBuffer.append(TEXT_40);
736
    stringBuffer.append(TEXT_48);
393
    stringBuffer.append(next.getDomainMetaClass().getName());
737
    stringBuffer.append(next.getDomainMetaClass().getName());
394
    stringBuffer.append(next.getVisualID());
738
    stringBuffer.append(next.getVisualID());
395
    stringBuffer.append(TEXT_41);
739
    stringBuffer.append(TEXT_49);
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
740
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
397
    stringBuffer.append(TEXT_42);
741
    stringBuffer.append(TEXT_50);
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
742
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
399
    stringBuffer.append(TEXT_43);
743
    stringBuffer.append(TEXT_51);
400
    if (!isListLayout) {
744
    if (!isListLayout) {
401
    stringBuffer.append(TEXT_44);
745
    stringBuffer.append(TEXT_52);
402
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
746
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
403
    stringBuffer.append(TEXT_45);
747
    stringBuffer.append(TEXT_53);
404
    }
748
    }
405
    stringBuffer.append(TEXT_46);
749
    stringBuffer.append(TEXT_54);
406
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
750
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
407
    stringBuffer.append(TEXT_47);
751
    stringBuffer.append(TEXT_55);
408
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
752
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
409
    stringBuffer.append(TEXT_48);
753
    stringBuffer.append(TEXT_56);
410
    
754
    
411
	if (!isListLayout) {
755
	if (!isListLayout) {
412
756
413
    stringBuffer.append(TEXT_49);
757
    stringBuffer.append(TEXT_57);
414
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
758
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
415
    stringBuffer.append(TEXT_50);
759
    stringBuffer.append(TEXT_58);
416
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
760
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
417
    stringBuffer.append(TEXT_51);
761
    stringBuffer.append(TEXT_59);
418
    
762
    
419
		int defaultWidth = 40;
763
		int defaultWidth = 40;
420
		int defaultHeight = 40;
764
		int defaultHeight = 40;
Lines 424-622 Link Here
424
			defaultHeight = defSizeAttrs.getHeight();
768
			defaultHeight = defSizeAttrs.getHeight();
425
		}
769
		}
426
770
427
    stringBuffer.append(TEXT_52);
771
    stringBuffer.append(TEXT_60);
428
    stringBuffer.append(defaultWidth);
772
    stringBuffer.append(defaultWidth);
429
    stringBuffer.append(TEXT_53);
773
    stringBuffer.append(TEXT_61);
430
    stringBuffer.append(defaultHeight);
774
    stringBuffer.append(defaultHeight);
431
    stringBuffer.append(TEXT_54);
775
    stringBuffer.append(TEXT_62);
432
    
776
    
433
	}
777
	}
434
778
435
    stringBuffer.append(TEXT_55);
779
    stringBuffer.append(TEXT_63);
436
    
780
    
437
if (genDiagram.getPalette() != null) {
781
if (genDiagram.getPalette() != null) {
438
782
439
    stringBuffer.append(TEXT_56);
783
    stringBuffer.append(TEXT_64);
440
    if (isStatic) {
784
    if (isStatic) {
441
    stringBuffer.append(TEXT_57);
785
    stringBuffer.append(TEXT_65);
442
    }
786
    }
443
    stringBuffer.append(TEXT_58);
787
    stringBuffer.append(TEXT_66);
444
    stringBuffer.append(next.getDomainMetaClass().getName());
788
    stringBuffer.append(next.getDomainMetaClass().getName());
445
    stringBuffer.append(next.getVisualID());
789
    stringBuffer.append(next.getVisualID());
446
    stringBuffer.append(TEXT_59);
790
    stringBuffer.append(TEXT_67);
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
791
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
448
    stringBuffer.append(TEXT_60);
792
    stringBuffer.append(TEXT_68);
449
    stringBuffer.append(next.getDomainMetaClass().getName());
793
    stringBuffer.append(next.getDomainMetaClass().getName());
450
    stringBuffer.append(next.getVisualID());
794
    stringBuffer.append(next.getVisualID());
451
    stringBuffer.append(TEXT_61);
795
    stringBuffer.append(TEXT_69);
452
    stringBuffer.append(next.getDomainMetaClass().getName());
796
    stringBuffer.append(next.getDomainMetaClass().getName());
453
    stringBuffer.append(next.getVisualID());
797
    stringBuffer.append(next.getVisualID());
454
    stringBuffer.append(TEXT_62);
798
    stringBuffer.append(TEXT_70);
455
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
799
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
456
    stringBuffer.append(TEXT_63);
800
    stringBuffer.append(TEXT_71);
457
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
801
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
458
    stringBuffer.append(TEXT_64);
802
    stringBuffer.append(TEXT_72);
459
    if (!isListLayout) {
803
    if (!isListLayout) {
460
    stringBuffer.append(TEXT_65);
804
    stringBuffer.append(TEXT_73);
461
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
805
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
462
    stringBuffer.append(TEXT_66);
806
    stringBuffer.append(TEXT_74);
463
    }
807
    }
464
    stringBuffer.append(TEXT_67);
808
    stringBuffer.append(TEXT_75);
465
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
809
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
466
    stringBuffer.append(TEXT_68);
810
    stringBuffer.append(TEXT_76);
467
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
811
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
468
    stringBuffer.append(TEXT_69);
812
    stringBuffer.append(TEXT_77);
469
    
813
    
470
	if (next.getDomainMetaClass().isMapEntry()) {
814
	if (next.getDomainMetaClass().isMapEntry()) {
471
	/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
815
	/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
472
816
473
    stringBuffer.append(TEXT_70);
817
    stringBuffer.append(TEXT_78);
474
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
818
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
475
    stringBuffer.append(TEXT_71);
819
    stringBuffer.append(TEXT_79);
476
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
820
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
477
    stringBuffer.append(TEXT_72);
821
    stringBuffer.append(TEXT_80);
478
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
822
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
479
    stringBuffer.append(TEXT_73);
823
    stringBuffer.append(TEXT_81);
480
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
824
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
481
    stringBuffer.append(TEXT_74);
825
    stringBuffer.append(TEXT_82);
482
    
826
    
483
	} else {
827
	} else {
484
828
485
    stringBuffer.append(TEXT_75);
829
    stringBuffer.append(TEXT_83);
486
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
830
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
487
    stringBuffer.append(TEXT_76);
831
    stringBuffer.append(TEXT_84);
488
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
832
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
489
    stringBuffer.append(TEXT_77);
833
    stringBuffer.append(TEXT_85);
490
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
834
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
491
    stringBuffer.append(TEXT_78);
835
    stringBuffer.append(TEXT_86);
492
    
836
    
493
	}
837
	}
494
838
495
    stringBuffer.append(TEXT_79);
839
    stringBuffer.append(TEXT_87);
496
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
840
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
497
    stringBuffer.append(TEXT_80);
841
    stringBuffer.append(TEXT_88);
498
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
842
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
499
    stringBuffer.append(TEXT_81);
843
    stringBuffer.append(TEXT_89);
500
    stringBuffer.append(next.getUniqueIdentifier());
844
    stringBuffer.append(next.getUniqueIdentifier());
501
    stringBuffer.append(TEXT_82);
845
    stringBuffer.append(TEXT_90);
502
    
846
    
503
	TypeModelFacet facet = next.getModelFacet();
847
	TypeModelFacet facet = next.getModelFacet();
504
	GenFeature childFeature = facet.getChildMetaFeature();
848
	GenFeature childFeature = facet.getChildMetaFeature();
505
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
849
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
506
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
850
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
507
851
508
    stringBuffer.append(TEXT_83);
852
    stringBuffer.append(TEXT_91);
509
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
853
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
510
    stringBuffer.append(TEXT_84);
854
    stringBuffer.append(TEXT_92);
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
855
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
512
    stringBuffer.append(TEXT_85);
856
    stringBuffer.append(TEXT_93);
513
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
857
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
514
    stringBuffer.append(TEXT_86);
858
    stringBuffer.append(TEXT_94);
515
    stringBuffer.append(resolvedSemanticElement);
859
    stringBuffer.append(resolvedSemanticElement);
516
    stringBuffer.append(TEXT_87);
860
    stringBuffer.append(TEXT_95);
517
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
861
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
518
    stringBuffer.append(TEXT_88);
862
    stringBuffer.append(TEXT_96);
519
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
863
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
520
    stringBuffer.append(TEXT_89);
864
    stringBuffer.append(TEXT_97);
521
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
865
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
522
    stringBuffer.append(TEXT_90);
866
    stringBuffer.append(TEXT_98);
523
    stringBuffer.append(resolvedSemanticElement);
867
    stringBuffer.append(resolvedSemanticElement);
524
    stringBuffer.append(TEXT_91);
868
    stringBuffer.append(TEXT_99);
525
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
869
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
526
    stringBuffer.append(TEXT_92);
870
    stringBuffer.append(TEXT_100);
527
    stringBuffer.append(childFeature.getFeatureAccessorName());
871
    stringBuffer.append(childFeature.getFeatureAccessorName());
528
    stringBuffer.append(TEXT_93);
872
    stringBuffer.append(TEXT_101);
529
    
873
    
530
	} else {
874
	} else {
531
875
532
    stringBuffer.append(TEXT_94);
876
    stringBuffer.append(TEXT_102);
533
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
877
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
534
    stringBuffer.append(TEXT_95);
878
    stringBuffer.append(TEXT_103);
535
    stringBuffer.append(resolvedSemanticElement);
879
    stringBuffer.append(resolvedSemanticElement);
536
    stringBuffer.append(TEXT_96);
880
    stringBuffer.append(TEXT_104);
537
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
881
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
538
    stringBuffer.append(TEXT_97);
882
    stringBuffer.append(TEXT_105);
539
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
883
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
540
    stringBuffer.append(TEXT_98);
884
    stringBuffer.append(TEXT_106);
541
    
885
    
542
	}
886
	}
543
887
544
    stringBuffer.append(TEXT_99);
888
    stringBuffer.append(TEXT_107);
545
    stringBuffer.append(next.getDomainMetaClass().getName());
889
    stringBuffer.append(next.getDomainMetaClass().getName());
546
    stringBuffer.append(next.getVisualID());
890
    stringBuffer.append(next.getVisualID());
547
    stringBuffer.append(TEXT_100);
891
    stringBuffer.append(TEXT_108);
548
    if(!isListLayout) {
892
    if(!isListLayout) {
549
    stringBuffer.append(TEXT_101);
893
    stringBuffer.append(TEXT_109);
550
    }
894
    }
551
    stringBuffer.append(TEXT_102);
895
    stringBuffer.append(TEXT_110);
552
    
896
    
553
}
897
}
554
898
555
    
899
    
556
}
900
}
557
901
558
    stringBuffer.append(TEXT_103);
902
    stringBuffer.append(TEXT_111);
559
    stringBuffer.append(TEXT_104);
903
    stringBuffer.append(TEXT_112);
560
    stringBuffer.append(TEXT_105);
904
    stringBuffer.append(TEXT_113);
561
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
905
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
562
    stringBuffer.append(TEXT_106);
906
    stringBuffer.append(TEXT_114);
563
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
907
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
564
    stringBuffer.append(TEXT_107);
908
    stringBuffer.append(TEXT_115);
565
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
909
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
566
    stringBuffer.append(TEXT_108);
910
    stringBuffer.append(TEXT_116);
567
    stringBuffer.append(TEXT_109);
911
    stringBuffer.append(TEXT_117);
568
    stringBuffer.append(TEXT_110);
912
    stringBuffer.append(TEXT_118);
569
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
913
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
570
    stringBuffer.append(TEXT_111);
914
    stringBuffer.append(TEXT_119);
571
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
915
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
572
    stringBuffer.append(TEXT_112);
916
    stringBuffer.append(TEXT_120);
573
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter"));
917
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter"));
574
    stringBuffer.append(TEXT_113);
918
    stringBuffer.append(TEXT_121);
575
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
919
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
576
    stringBuffer.append(TEXT_114);
920
    stringBuffer.append(TEXT_122);
577
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
921
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
578
    stringBuffer.append(TEXT_115);
922
    stringBuffer.append(TEXT_123);
579
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
923
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
580
    stringBuffer.append(TEXT_116);
924
    stringBuffer.append(TEXT_124);
581
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
925
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
582
    stringBuffer.append(TEXT_117);
926
    stringBuffer.append(TEXT_125);
583
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
927
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
584
    stringBuffer.append(TEXT_118);
928
    stringBuffer.append(TEXT_126);
585
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
929
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
586
    stringBuffer.append(TEXT_119);
930
    stringBuffer.append(TEXT_127);
587
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
931
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
588
    stringBuffer.append(TEXT_120);
932
    stringBuffer.append(TEXT_128);
589
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
933
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
590
    stringBuffer.append(TEXT_121);
934
    stringBuffer.append(TEXT_129);
591
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
935
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
592
    stringBuffer.append(TEXT_122);
936
    stringBuffer.append(TEXT_130);
593
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
937
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
594
    stringBuffer.append(TEXT_123);
938
    stringBuffer.append(TEXT_131);
595
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
939
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
596
    stringBuffer.append(TEXT_124);
940
    stringBuffer.append(TEXT_132);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
941
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
598
    stringBuffer.append(TEXT_125);
942
    stringBuffer.append(TEXT_133);
943
    
944
//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
945
//if (myHelper.containsLinks()) {
946
947
    stringBuffer.append(TEXT_134);
948
    
949
//}
950
951
    stringBuffer.append(TEXT_135);
952
    
953
//link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links
954
//if (myHelper.containsLinks()) {
955
956
    stringBuffer.append(TEXT_136);
957
    
958
//}
959
960
    stringBuffer.append(TEXT_137);
599
    
961
    
600
{
962
{
601
String _getDiagramCode = "getDiagram()";
963
String _getDiagramCode = "getDiagram()";
602
String _getViewCode = "getDiagram()";
964
String _getViewCode = "getDiagram()";
603
String _getSemanticElementCode = "getDiagram().getElement()";
965
String _getSemanticElementCode = "getDiagram().getElement()";
604
boolean isListLayout = false;
966
boolean isListLayout = false;
967
final boolean _includeUncontainedLinks = true;
605
968
606
    stringBuffer.append(TEXT_126);
969
    stringBuffer.append(TEXT_138);
607
    stringBuffer.append(TEXT_127);
970
    stringBuffer.append(TEXT_139);
608
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
971
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
609
    stringBuffer.append(TEXT_128);
972
    stringBuffer.append(TEXT_140);
610
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
973
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
611
    stringBuffer.append(TEXT_129);
974
    stringBuffer.append(TEXT_141);
612
    stringBuffer.append(_getDiagramCode);
975
    stringBuffer.append(_getDiagramCode);
613
    stringBuffer.append(TEXT_130);
976
    stringBuffer.append(TEXT_142);
614
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
977
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
615
    stringBuffer.append(TEXT_131);
978
    stringBuffer.append(TEXT_143);
616
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
979
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
617
    stringBuffer.append(TEXT_132);
980
    stringBuffer.append(TEXT_144);
618
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
981
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
619
    stringBuffer.append(TEXT_133);
982
    stringBuffer.append(TEXT_145);
620
    
983
    
621
boolean hasConstraintsInChildren = false;
984
boolean hasConstraintsInChildren = false;
622
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
985
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
Lines 631-788 Link Here
631
    
994
    
632
if (hasConstraintsInChildren) {
995
if (hasConstraintsInChildren) {
633
996
634
    stringBuffer.append(TEXT_134);
997
    stringBuffer.append(TEXT_146);
635
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
998
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
636
    stringBuffer.append(TEXT_135);
999
    stringBuffer.append(TEXT_147);
637
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1000
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
638
    stringBuffer.append(TEXT_136);
1001
    stringBuffer.append(TEXT_148);
639
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1002
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
640
    stringBuffer.append(TEXT_137);
1003
    stringBuffer.append(TEXT_149);
641
    
1004
    
642
}
1005
}
643
1006
644
    stringBuffer.append(TEXT_138);
1007
    stringBuffer.append(TEXT_150);
645
    
1008
    
646
boolean hasDeclaredFilter = false;
1009
{
647
Set genChildFeatures = new LinkedHashSet();
1010
	boolean hasDeclaredFilter = false;
648
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
1011
	Set genChildFeatures = new LinkedHashSet();
649
	GenNode nextNode = (GenNode) it.next();
1012
	for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
650
	TypeModelFacet typeModelFacet = nextNode.getModelFacet();
1013
		GenNode nextNode = (GenNode) it.next();
651
	if (typeModelFacet == null) {
1014
		TypeModelFacet typeModelFacet = nextNode.getModelFacet();
652
		continue;
1015
		if (typeModelFacet == null) {
653
	}
1016
			continue;
654
	GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
1017
		}
655
	if (genChildFeatures.contains(childMetaFeature)) {
1018
		GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
656
		continue;
1019
		if (genChildFeatures.contains(childMetaFeature)) {
657
	}
1020
			continue;
658
	genChildFeatures.add(childMetaFeature);
1021
		}
659
	if (!hasDeclaredFilter) {
1022
		genChildFeatures.add(childMetaFeature);
660
		hasDeclaredFilter = true;
1023
		if (!hasDeclaredFilter) {
1024
			hasDeclaredFilter = true;
661
1025
662
    stringBuffer.append(TEXT_139);
1026
    stringBuffer.append(TEXT_151);
663
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1027
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
664
    stringBuffer.append(TEXT_140);
1028
    stringBuffer.append(TEXT_152);
665
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1029
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
666
    stringBuffer.append(TEXT_141);
1030
    stringBuffer.append(TEXT_153);
667
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
1031
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
668
    stringBuffer.append(TEXT_142);
1032
    stringBuffer.append(TEXT_154);
669
    
1033
    
670
	} else {
1034
		} else {
671
1035
672
    stringBuffer.append(TEXT_143);
1036
    stringBuffer.append(TEXT_155);
673
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1037
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
674
    stringBuffer.append(TEXT_144);
1038
    stringBuffer.append(TEXT_156);
675
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1039
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
676
    stringBuffer.append(TEXT_145);
1040
    stringBuffer.append(TEXT_157);
677
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
1041
    stringBuffer.append(childMetaFeature.getFeatureAccessorName());
678
    stringBuffer.append(TEXT_146);
1042
    stringBuffer.append(TEXT_158);
679
    
1043
    
680
	}
1044
		}
681
}	//for
1045
	}	//for
682
1046
683
    
1047
    
684
if (hasDeclaredFilter) {
1048
	if (hasDeclaredFilter) {
685
1049
686
    stringBuffer.append(TEXT_147);
1050
    stringBuffer.append(TEXT_159);
687
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1051
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
688
    stringBuffer.append(TEXT_148);
1052
    stringBuffer.append(TEXT_160);
689
    stringBuffer.append(_getSemanticElementCode);
1053
    stringBuffer.append(_getSemanticElementCode);
690
    stringBuffer.append(TEXT_149);
1054
    stringBuffer.append(TEXT_161);
691
    
1055
    
692
} else {
1056
	} else {
693
1057
694
    stringBuffer.append(TEXT_150);
1058
    stringBuffer.append(TEXT_162);
695
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1059
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
696
    stringBuffer.append(TEXT_151);
1060
    stringBuffer.append(TEXT_163);
697
    stringBuffer.append(_getSemanticElementCode);
1061
    stringBuffer.append(_getSemanticElementCode);
698
    stringBuffer.append(TEXT_152);
1062
    stringBuffer.append(TEXT_164);
699
    
1063
    
700
}
1064
	}
1065
}	//local declaration of hasDeclaredFilter
701
1066
702
    
1067
    
703
if (hasConstraintsInChildren) {
1068
if (hasConstraintsInChildren) {
704
1069
705
    stringBuffer.append(TEXT_153);
1070
    stringBuffer.append(TEXT_165);
706
    
1071
    
707
}
1072
}
708
1073
709
    stringBuffer.append(TEXT_154);
1074
    stringBuffer.append(TEXT_166);
710
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1075
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
711
    stringBuffer.append(TEXT_155);
1076
    stringBuffer.append(TEXT_167);
712
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1077
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
713
    stringBuffer.append(TEXT_156);
1078
    stringBuffer.append(TEXT_168);
714
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
1079
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
715
    stringBuffer.append(TEXT_157);
1080
    stringBuffer.append(TEXT_169);
716
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1081
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
717
    stringBuffer.append(TEXT_158);
1082
    stringBuffer.append(TEXT_170);
718
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1083
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
719
    stringBuffer.append(TEXT_159);
1084
    stringBuffer.append(TEXT_171);
720
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1085
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
721
    stringBuffer.append(TEXT_160);
1086
    stringBuffer.append(TEXT_172);
722
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1087
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
723
    stringBuffer.append(TEXT_161);
1088
    stringBuffer.append(TEXT_173);
724
    stringBuffer.append(_getDiagramCode);
1089
    stringBuffer.append(_getDiagramCode);
725
    stringBuffer.append(TEXT_162);
1090
    stringBuffer.append(TEXT_174);
726
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1091
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
727
    stringBuffer.append(TEXT_163);
1092
    stringBuffer.append(TEXT_175);
728
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1093
    stringBuffer.append(importManager.getImportedName("java.util.List"));
729
    stringBuffer.append(TEXT_164);
1094
    stringBuffer.append(TEXT_176);
730
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1095
    stringBuffer.append(importManager.getImportedName("java.util.List"));
731
    stringBuffer.append(TEXT_165);
1096
    stringBuffer.append(TEXT_177);
732
    stringBuffer.append(_getViewCode);
1097
    stringBuffer.append(_getViewCode);
733
    stringBuffer.append(TEXT_166);
1098
    stringBuffer.append(TEXT_178);
734
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
1099
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
735
    stringBuffer.append(TEXT_167);
1100
    stringBuffer.append(TEXT_179);
736
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1101
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
737
    stringBuffer.append(TEXT_168);
1102
    stringBuffer.append(TEXT_180);
738
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1103
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
739
    stringBuffer.append(TEXT_169);
1104
    stringBuffer.append(TEXT_181);
740
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1105
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
741
    stringBuffer.append(TEXT_170);
1106
    stringBuffer.append(TEXT_182);
742
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1107
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
743
    stringBuffer.append(TEXT_171);
1108
    stringBuffer.append(TEXT_183);
744
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1109
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
745
    stringBuffer.append(TEXT_172);
1110
    stringBuffer.append(TEXT_184);
746
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1111
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
747
    stringBuffer.append(TEXT_173);
1112
    stringBuffer.append(TEXT_185);
748
    stringBuffer.append(_getViewCode);
1113
    stringBuffer.append(_getViewCode);
749
    stringBuffer.append(TEXT_174);
1114
    stringBuffer.append(TEXT_186);
750
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1115
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
751
    stringBuffer.append(TEXT_175);
1116
    stringBuffer.append(TEXT_187);
752
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1117
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
753
    stringBuffer.append(TEXT_176);
1118
    stringBuffer.append(TEXT_188);
754
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1119
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
755
    stringBuffer.append(TEXT_177);
1120
    stringBuffer.append(TEXT_189);
756
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1121
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
757
    stringBuffer.append(TEXT_178);
1122
    stringBuffer.append(TEXT_190);
758
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1123
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
759
    stringBuffer.append(TEXT_179);
1124
    stringBuffer.append(TEXT_191);
760
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1125
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
761
    stringBuffer.append(TEXT_180);
1126
    stringBuffer.append(TEXT_192);
762
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1127
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
763
    stringBuffer.append(TEXT_181);
1128
    stringBuffer.append(TEXT_193);
764
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1129
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
765
    stringBuffer.append(TEXT_182);
1130
    stringBuffer.append(TEXT_194);
766
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1131
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
767
    stringBuffer.append(TEXT_183);
1132
    stringBuffer.append(TEXT_195);
768
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
1133
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
769
    stringBuffer.append(TEXT_184);
1134
    stringBuffer.append(TEXT_196);
770
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
1135
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
771
    stringBuffer.append(TEXT_185);
1136
    stringBuffer.append(TEXT_197);
772
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1137
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
773
    stringBuffer.append(TEXT_186);
1138
    stringBuffer.append(TEXT_198);
774
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1139
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
775
    stringBuffer.append(TEXT_187);
1140
    stringBuffer.append(TEXT_199);
776
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1141
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
777
    stringBuffer.append(TEXT_188);
1142
    stringBuffer.append(TEXT_200);
778
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand"));
1143
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand"));
779
    stringBuffer.append(TEXT_189);
1144
    stringBuffer.append(TEXT_201);
780
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
1145
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand"));
781
    stringBuffer.append(TEXT_190);
1146
    stringBuffer.append(TEXT_202);
782
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1147
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
783
    stringBuffer.append(TEXT_191);
1148
    stringBuffer.append(TEXT_203);
784
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1149
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
785
    stringBuffer.append(TEXT_192);
1150
    stringBuffer.append(TEXT_204);
786
    
1151
    
787
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
1152
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
788
	GenNode nextNode = (GenNode) it.next();
1153
	GenNode nextNode = (GenNode) it.next();
Lines 792-830 Link Here
792
	}
1157
	}
793
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
1158
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
794
1159
795
    stringBuffer.append(TEXT_193);
1160
    stringBuffer.append(TEXT_205);
796
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1161
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
797
    stringBuffer.append(TEXT_194);
1162
    stringBuffer.append(TEXT_206);
798
    stringBuffer.append(childNodeInterfaceName);
1163
    stringBuffer.append(childNodeInterfaceName);
799
    stringBuffer.append(TEXT_195);
1164
    stringBuffer.append(TEXT_207);
800
    stringBuffer.append(nextNode.getDomainMetaClass().getName());
1165
    stringBuffer.append(nextNode.getDomainMetaClass().getName());
801
    stringBuffer.append(nextNode.getVisualID());
1166
    stringBuffer.append(nextNode.getVisualID());
802
    stringBuffer.append(TEXT_196);
1167
    stringBuffer.append(TEXT_208);
803
    if (!isListLayout) {
1168
    if (!isListLayout) {
804
    stringBuffer.append(TEXT_197);
1169
    stringBuffer.append(TEXT_209);
805
    }
1170
    }
806
    stringBuffer.append(TEXT_198);
1171
    stringBuffer.append(TEXT_210);
807
    
1172
    
808
}
1173
}
809
1174
810
    stringBuffer.append(TEXT_199);
1175
    stringBuffer.append(TEXT_211);
811
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1176
    stringBuffer.append(importManager.getImportedName("java.util.List"));
812
    stringBuffer.append(TEXT_200);
1177
    stringBuffer.append(TEXT_212);
813
    stringBuffer.append(TEXT_201);
1178
    stringBuffer.append(TEXT_213);
814
    
1179
    
815
if (childNodes.size() == 0) {
1180
if (childNodes.size() == 0) {
816
1181
817
    stringBuffer.append(TEXT_202);
1182
    stringBuffer.append(TEXT_214);
818
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
1183
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
819
    stringBuffer.append(TEXT_203);
1184
    stringBuffer.append(TEXT_215);
820
    
1185
    
821
} else {
1186
} else {
822
1187
823
    stringBuffer.append(TEXT_204);
1188
    stringBuffer.append(TEXT_216);
824
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1189
    stringBuffer.append(importManager.getImportedName("java.util.List"));
825
    stringBuffer.append(TEXT_205);
1190
    stringBuffer.append(TEXT_217);
826
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1191
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
827
    stringBuffer.append(TEXT_206);
1192
    stringBuffer.append(TEXT_218);
828
    
1193
    
829
	Map genFeature2genNodeMap = new LinkedHashMap();
1194
	Map genFeature2genNodeMap = new LinkedHashMap();
830
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
1195
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
Lines 842-858 Link Here
842
	Set entrySet = genFeature2genNodeMap.entrySet();
1207
	Set entrySet = genFeature2genNodeMap.entrySet();
843
	if (entrySet.size() > 0) {
1208
	if (entrySet.size() > 0) {
844
1209
845
    stringBuffer.append(TEXT_207);
1210
    stringBuffer.append(TEXT_219);
846
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1211
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
847
    stringBuffer.append(TEXT_208);
1212
    stringBuffer.append(TEXT_220);
848
    stringBuffer.append(_getViewCode);
1213
    stringBuffer.append(_getViewCode);
849
    stringBuffer.append(TEXT_209);
1214
    stringBuffer.append(TEXT_221);
850
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1215
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
851
    stringBuffer.append(TEXT_210);
1216
    stringBuffer.append(TEXT_222);
852
    stringBuffer.append(_getSemanticElementCode);
1217
    stringBuffer.append(_getSemanticElementCode);
853
    stringBuffer.append(TEXT_211);
1218
    stringBuffer.append(TEXT_223);
854
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1219
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
855
    stringBuffer.append(TEXT_212);
1220
    stringBuffer.append(TEXT_224);
856
    
1221
    
857
	}
1222
	}
858
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
1223
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
Lines 861-959 Link Here
861
		Collection genNodesCollection = (Collection) nextEntry.getValue();
1226
		Collection genNodesCollection = (Collection) nextEntry.getValue();
862
		if (childMetaFeature.isListType()) {
1227
		if (childMetaFeature.isListType()) {
863
1228
864
    stringBuffer.append(TEXT_213);
1229
    stringBuffer.append(TEXT_225);
865
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1230
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
866
    stringBuffer.append(TEXT_214);
1231
    stringBuffer.append(TEXT_226);
867
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
1232
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
868
    stringBuffer.append(TEXT_215);
1233
    stringBuffer.append(TEXT_227);
869
    stringBuffer.append(childMetaFeature.getGetAccessor());
1234
    stringBuffer.append(childMetaFeature.getGetAccessor());
870
    stringBuffer.append(TEXT_216);
1235
    stringBuffer.append(TEXT_228);
871
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1236
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
872
    stringBuffer.append(TEXT_217);
1237
    stringBuffer.append(TEXT_229);
873
    
1238
    
874
		} else {
1239
		} else {
875
1240
876
    stringBuffer.append(TEXT_218);
1241
    stringBuffer.append(TEXT_230);
877
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
1242
    stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName()));
878
    stringBuffer.append(TEXT_219);
1243
    stringBuffer.append(TEXT_231);
879
    stringBuffer.append(childMetaFeature.getGetAccessor());
1244
    stringBuffer.append(childMetaFeature.getGetAccessor());
880
    stringBuffer.append(TEXT_220);
1245
    stringBuffer.append(TEXT_232);
881
    
1246
    
882
	}
1247
	}
883
1248
884
    stringBuffer.append(TEXT_221);
1249
    stringBuffer.append(TEXT_233);
885
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1250
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
886
    stringBuffer.append(TEXT_222);
1251
    stringBuffer.append(TEXT_234);
887
    
1252
    
888
	boolean generateSwitch = genNodesCollection.size() != 1;
1253
	boolean generateSwitch = genNodesCollection.size() != 1;
889
	if (generateSwitch) {
1254
	if (generateSwitch) {
890
1255
891
    stringBuffer.append(TEXT_223);
1256
    stringBuffer.append(TEXT_235);
892
    
1257
    
893
	}
1258
	}
894
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
1259
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
895
		GenNode nextNode = (GenNode) genNodesIterator.next();
1260
		GenNode nextNode = (GenNode) genNodesIterator.next();
896
		if (generateSwitch) {
1261
		if (generateSwitch) {
897
1262
898
    stringBuffer.append(TEXT_224);
1263
    stringBuffer.append(TEXT_236);
899
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1264
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
900
    stringBuffer.append(TEXT_225);
1265
    stringBuffer.append(TEXT_237);
901
    
1266
    
902
		} else {
1267
		} else {
903
1268
904
    stringBuffer.append(TEXT_226);
1269
    stringBuffer.append(TEXT_238);
905
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1270
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
906
    stringBuffer.append(TEXT_227);
1271
    stringBuffer.append(TEXT_239);
907
    
1272
    
908
		}
1273
		}
909
1274
910
    stringBuffer.append(TEXT_228);
1275
    stringBuffer.append(TEXT_240);
911
    
1276
    
912
		if (generateSwitch) {
1277
		if (generateSwitch) {
913
1278
914
    stringBuffer.append(TEXT_229);
1279
    stringBuffer.append(TEXT_241);
915
    
1280
    
916
		} else {
1281
		} else {
917
1282
918
    stringBuffer.append(TEXT_230);
1283
    stringBuffer.append(TEXT_242);
919
    
1284
    
920
		}
1285
		}
921
	}
1286
	}
922
	if (generateSwitch) {
1287
	if (generateSwitch) {
923
1288
924
    stringBuffer.append(TEXT_231);
1289
    stringBuffer.append(TEXT_243);
925
    
1290
    
926
	}
1291
	}
927
	if (childMetaFeature.isListType()) {
1292
	if (childMetaFeature.isListType()) {
928
1293
929
    stringBuffer.append(TEXT_232);
1294
    stringBuffer.append(TEXT_244);
930
    
1295
    
931
	}
1296
	}
932
}
1297
}
933
1298
934
    stringBuffer.append(TEXT_233);
1299
    stringBuffer.append(TEXT_245);
935
    
1300
    
936
}
1301
}
937
1302
938
    stringBuffer.append(TEXT_234);
1303
    stringBuffer.append(TEXT_246);
939
    stringBuffer.append(genDiagram.isSynchronized());
1304
    stringBuffer.append(genDiagram.isSynchronized());
940
    stringBuffer.append(TEXT_235);
1305
    stringBuffer.append(TEXT_247);
941
    stringBuffer.append(genDiagram.isSynchronized());
1306
    stringBuffer.append(genDiagram.isSynchronized());
942
    stringBuffer.append(TEXT_236);
1307
    stringBuffer.append(TEXT_248);
1308
    stringBuffer.append(TEXT_249);
943
    
1309
    
944
}
1310
if (myHelper.containsLinks() || _includeUncontainedLinks) {
945
1311
946
    stringBuffer.append(TEXT_237);
1312
    stringBuffer.append(TEXT_250);
947
    stringBuffer.append(TEXT_238);
1313
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
948
    stringBuffer.append(TEXT_239);
1314
    stringBuffer.append(TEXT_251);
1315
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1316
    stringBuffer.append(TEXT_252);
1317
    stringBuffer.append(_getDiagramCode);
1318
    stringBuffer.append(TEXT_253);
1319
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
1320
    stringBuffer.append(TEXT_254);
1321
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1322
    stringBuffer.append(TEXT_255);
1323
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1324
    stringBuffer.append(TEXT_256);
1325
    
1326
	boolean hasConstraintsInContainedLinks = false;
1327
	for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
1328
		GenLink nextLink = (GenLink) it.next();
1329
		TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1330
		if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
1331
			hasConstraintsInContainedLinks = true;
1332
			break;
1333
		}
1334
	}
1335
	if (hasConstraintsInContainedLinks) {
1336
1337
    stringBuffer.append(TEXT_257);
1338
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
1339
    stringBuffer.append(TEXT_258);
1340
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1341
    stringBuffer.append(TEXT_259);
1342
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1343
    stringBuffer.append(TEXT_260);
1344
    
1345
	}
1346
	if (_includeUncontainedLinks) {
1347
1348
    stringBuffer.append(TEXT_261);
1349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1350
    stringBuffer.append(TEXT_262);
1351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1352
    stringBuffer.append(TEXT_263);
1353
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1354
    stringBuffer.append(TEXT_264);
1355
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1356
    stringBuffer.append(TEXT_265);
1357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1358
    stringBuffer.append(TEXT_266);
1359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1360
    stringBuffer.append(TEXT_267);
1361
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1362
    stringBuffer.append(TEXT_268);
1363
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1364
    stringBuffer.append(TEXT_269);
1365
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1366
    stringBuffer.append(TEXT_270);
1367
    
1368
	}
1369
1370
    stringBuffer.append(TEXT_271);
1371
    
1372
	{
1373
		boolean hasDeclaredFilter = false;
1374
		Set genAffectingFeatures = new LinkedHashSet();
1375
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
1376
			GenLink nextLink = (GenLink) it.next();
1377
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1378
			if (modelFacet == null) {
1379
				continue;
1380
			}
1381
			GenFeature _feature = modelFacet.getChildMetaFeature();
1382
1383
    stringBuffer.append(TEXT_272);
1384
    
1385
	/*
1386
	 * input: 
1387
	 * 		_feature: GenFeature
1388
	 * 		genAffectingFeatures : Set
1389
	 */
1390
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
1391
		continue;
1392
	}
1393
	genAffectingFeatures.add(_feature);
1394
	if (!hasDeclaredFilter) {
1395
		hasDeclaredFilter = true;
1396
1397
    stringBuffer.append(TEXT_273);
1398
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1399
    stringBuffer.append(TEXT_274);
1400
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1401
    stringBuffer.append(TEXT_275);
1402
    stringBuffer.append(_feature.getFeatureAccessorName());
1403
    stringBuffer.append(TEXT_276);
1404
    
1405
	} else {
1406
1407
    stringBuffer.append(TEXT_277);
1408
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1409
    stringBuffer.append(TEXT_278);
1410
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1411
    stringBuffer.append(TEXT_279);
1412
    stringBuffer.append(_feature.getFeatureAccessorName());
1413
    stringBuffer.append(TEXT_280);
1414
    
1415
	}
1416
1417
    
1418
			_feature = modelFacet.getSourceMetaFeature();
1419
1420
    stringBuffer.append(TEXT_281);
1421
    
1422
	/*
1423
	 * input: 
1424
	 * 		_feature: GenFeature
1425
	 * 		genAffectingFeatures : Set
1426
	 */
1427
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
1428
		continue;
1429
	}
1430
	genAffectingFeatures.add(_feature);
1431
	if (!hasDeclaredFilter) {
1432
		hasDeclaredFilter = true;
1433
1434
    stringBuffer.append(TEXT_282);
1435
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1436
    stringBuffer.append(TEXT_283);
1437
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1438
    stringBuffer.append(TEXT_284);
1439
    stringBuffer.append(_feature.getFeatureAccessorName());
1440
    stringBuffer.append(TEXT_285);
1441
    
1442
	} else {
1443
1444
    stringBuffer.append(TEXT_286);
1445
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1446
    stringBuffer.append(TEXT_287);
1447
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1448
    stringBuffer.append(TEXT_288);
1449
    stringBuffer.append(_feature.getFeatureAccessorName());
1450
    stringBuffer.append(TEXT_289);
1451
    
1452
	}
1453
1454
    
1455
			_feature = modelFacet.getTargetMetaFeature();
1456
1457
    stringBuffer.append(TEXT_290);
1458
    
1459
	/*
1460
	 * input: 
1461
	 * 		_feature: GenFeature
1462
	 * 		genAffectingFeatures : Set
1463
	 */
1464
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
1465
		continue;
1466
	}
1467
	genAffectingFeatures.add(_feature);
1468
	if (!hasDeclaredFilter) {
1469
		hasDeclaredFilter = true;
1470
1471
    stringBuffer.append(TEXT_291);
1472
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1473
    stringBuffer.append(TEXT_292);
1474
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1475
    stringBuffer.append(TEXT_293);
1476
    stringBuffer.append(_feature.getFeatureAccessorName());
1477
    stringBuffer.append(TEXT_294);
1478
    
1479
	} else {
1480
1481
    stringBuffer.append(TEXT_295);
1482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1483
    stringBuffer.append(TEXT_296);
1484
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1485
    stringBuffer.append(TEXT_297);
1486
    stringBuffer.append(_feature.getFeatureAccessorName());
1487
    stringBuffer.append(TEXT_298);
1488
    
1489
	}
1490
1491
    
1492
		}
1493
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
1494
			GenLink nextLink = (GenLink) it.next();
1495
			GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature();
1496
1497
    stringBuffer.append(TEXT_299);
1498
    
1499
	/*
1500
	 * input: 
1501
	 * 		_feature: GenFeature
1502
	 * 		genAffectingFeatures : Set
1503
	 */
1504
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
1505
		continue;
1506
	}
1507
	genAffectingFeatures.add(_feature);
1508
	if (!hasDeclaredFilter) {
1509
		hasDeclaredFilter = true;
1510
1511
    stringBuffer.append(TEXT_300);
1512
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1513
    stringBuffer.append(TEXT_301);
1514
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1515
    stringBuffer.append(TEXT_302);
1516
    stringBuffer.append(_feature.getFeatureAccessorName());
1517
    stringBuffer.append(TEXT_303);
1518
    
1519
	} else {
1520
1521
    stringBuffer.append(TEXT_304);
1522
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1523
    stringBuffer.append(TEXT_305);
1524
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1525
    stringBuffer.append(TEXT_306);
1526
    stringBuffer.append(_feature.getFeatureAccessorName());
1527
    stringBuffer.append(TEXT_307);
1528
    
1529
	}
1530
1531
    
1532
		}
1533
		if (hasConstraintsInContainedLinks) {
1534
			if (hasDeclaredFilter) {
1535
1536
    stringBuffer.append(TEXT_308);
1537
    
1538
			} else {
1539
				hasDeclaredFilter = true;
1540
1541
    stringBuffer.append(TEXT_309);
1542
    
1543
			}
1544
		}
1545
		if (_includeUncontainedLinks) {
1546
			if (hasDeclaredFilter) {
1547
1548
    stringBuffer.append(TEXT_310);
1549
    
1550
			} else {
1551
				hasDeclaredFilter = true;
1552
1553
    stringBuffer.append(TEXT_311);
1554
    
1555
			}
1556
		}
1557
		if (!hasDeclaredFilter) {
1558
1559
    stringBuffer.append(TEXT_312);
1560
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1561
    stringBuffer.append(TEXT_313);
1562
    
1563
		}
1564
	}	//local declaration of hasDeclaredFilter
1565
1566
    stringBuffer.append(TEXT_314);
1567
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1568
    stringBuffer.append(TEXT_315);
1569
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1570
    stringBuffer.append(TEXT_316);
1571
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
1572
    stringBuffer.append(TEXT_317);
1573
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1574
    stringBuffer.append(TEXT_318);
1575
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1576
    stringBuffer.append(TEXT_319);
1577
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1578
    stringBuffer.append(TEXT_320);
1579
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1580
    stringBuffer.append(TEXT_321);
1581
    stringBuffer.append(_getDiagramCode);
1582
    stringBuffer.append(TEXT_322);
1583
    stringBuffer.append(TEXT_323);
1584
    /*inner class*/
1585
    stringBuffer.append(TEXT_324);
1586
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1587
    stringBuffer.append(TEXT_325);
1588
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1589
    stringBuffer.append(TEXT_326);
1590
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1591
    stringBuffer.append(TEXT_327);
1592
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1593
    stringBuffer.append(TEXT_328);
1594
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1595
    stringBuffer.append(TEXT_329);
1596
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1597
    stringBuffer.append(TEXT_330);
1598
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1599
    stringBuffer.append(TEXT_331);
1600
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1601
    stringBuffer.append(TEXT_332);
1602
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1603
    stringBuffer.append(TEXT_333);
1604
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1605
    stringBuffer.append(TEXT_334);
1606
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1607
    stringBuffer.append(TEXT_335);
1608
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1609
    stringBuffer.append(TEXT_336);
1610
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1611
    stringBuffer.append(TEXT_337);
1612
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1613
    stringBuffer.append(TEXT_338);
1614
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
1615
    stringBuffer.append(TEXT_339);
1616
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1617
    stringBuffer.append(TEXT_340);
1618
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
1619
    stringBuffer.append(TEXT_341);
1620
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1621
    stringBuffer.append(TEXT_342);
1622
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1623
    stringBuffer.append(TEXT_343);
1624
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1625
    stringBuffer.append(TEXT_344);
1626
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1627
    stringBuffer.append(TEXT_345);
1628
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1629
    stringBuffer.append(TEXT_346);
1630
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1631
    stringBuffer.append(TEXT_347);
1632
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1633
    stringBuffer.append(TEXT_348);
1634
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1635
    stringBuffer.append(TEXT_349);
1636
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1637
    stringBuffer.append(TEXT_350);
1638
    stringBuffer.append(_getDiagramCode);
1639
    stringBuffer.append(TEXT_351);
1640
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1641
    stringBuffer.append(TEXT_352);
1642
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1643
    stringBuffer.append(TEXT_353);
1644
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1645
    stringBuffer.append(TEXT_354);
1646
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1647
    stringBuffer.append(TEXT_355);
1648
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1649
    stringBuffer.append(TEXT_356);
1650
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1651
    stringBuffer.append(TEXT_357);
1652
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1653
    stringBuffer.append(TEXT_358);
1654
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1655
    stringBuffer.append(TEXT_359);
1656
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1657
    stringBuffer.append(TEXT_360);
1658
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1659
    stringBuffer.append(TEXT_361);
1660
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
1661
    stringBuffer.append(TEXT_362);
1662
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
1663
    stringBuffer.append(TEXT_363);
1664
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
1665
    stringBuffer.append(TEXT_364);
1666
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
1667
    stringBuffer.append(TEXT_365);
1668
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1669
    stringBuffer.append(TEXT_366);
1670
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand"));
1671
    stringBuffer.append(TEXT_367);
1672
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1673
    stringBuffer.append(TEXT_368);
1674
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand"));
1675
    stringBuffer.append(TEXT_369);
1676
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1677
    stringBuffer.append(TEXT_370);
1678
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1679
    stringBuffer.append(TEXT_371);
1680
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1681
    stringBuffer.append(TEXT_372);
1682
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
1683
    stringBuffer.append(TEXT_373);
1684
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1685
    stringBuffer.append(TEXT_374);
1686
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1687
    stringBuffer.append(TEXT_375);
1688
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1689
    stringBuffer.append(TEXT_376);
1690
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1691
    stringBuffer.append(TEXT_377);
1692
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1693
    stringBuffer.append(TEXT_378);
1694
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1695
    stringBuffer.append(TEXT_379);
1696
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
1697
    stringBuffer.append(TEXT_380);
1698
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1699
    stringBuffer.append(TEXT_381);
1700
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1701
    stringBuffer.append(TEXT_382);
1702
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1703
    stringBuffer.append(TEXT_383);
1704
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1705
    stringBuffer.append(TEXT_384);
1706
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1707
    stringBuffer.append(TEXT_385);
1708
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1709
    stringBuffer.append(TEXT_386);
1710
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1711
    stringBuffer.append(TEXT_387);
1712
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1713
    stringBuffer.append(TEXT_388);
1714
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1715
    stringBuffer.append(TEXT_389);
1716
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1717
    stringBuffer.append(TEXT_390);
1718
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1719
    stringBuffer.append(TEXT_391);
1720
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1721
    stringBuffer.append(TEXT_392);
1722
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1723
    stringBuffer.append(TEXT_393);
1724
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1725
    stringBuffer.append(TEXT_394);
1726
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1727
    stringBuffer.append(TEXT_395);
1728
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1729
    stringBuffer.append(TEXT_396);
1730
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1731
    stringBuffer.append(TEXT_397);
1732
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1733
    stringBuffer.append(TEXT_398);
1734
    stringBuffer.append(_getDiagramCode);
1735
    stringBuffer.append(TEXT_399);
1736
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1737
    stringBuffer.append(TEXT_400);
1738
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1739
    stringBuffer.append(TEXT_401);
1740
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
1741
    stringBuffer.append(TEXT_402);
1742
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1743
    stringBuffer.append(TEXT_403);
1744
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1745
    stringBuffer.append(TEXT_404);
1746
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1747
    stringBuffer.append(TEXT_405);
1748
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1749
    stringBuffer.append(TEXT_406);
1750
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
1751
    stringBuffer.append(TEXT_407);
1752
    
1753
	for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
1754
		GenLink nextLink = (GenLink) it.next();
1755
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1756
		if (modelFacet == null) {
1757
			continue;
1758
		}
1759
1760
    stringBuffer.append(TEXT_408);
1761
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1762
    stringBuffer.append(TEXT_409);
1763
    stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
1764
    stringBuffer.append(TEXT_410);
1765
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1766
    stringBuffer.append(TEXT_411);
1767
    
1768
	}
1769
	for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
1770
		GenLink nextLink = (GenLink) it.next();
1771
1772
    stringBuffer.append(TEXT_412);
1773
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1774
    stringBuffer.append(TEXT_413);
1775
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1776
    stringBuffer.append(TEXT_414);
1777
    
1778
	}
1779
1780
    stringBuffer.append(TEXT_415);
1781
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
1782
    stringBuffer.append(TEXT_416);
1783
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1784
    stringBuffer.append(TEXT_417);
1785
    stringBuffer.append(TEXT_418);
1786
    stringBuffer.append(TEXT_419);
1787
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1788
    stringBuffer.append(TEXT_420);
1789
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1790
    stringBuffer.append(TEXT_421);
1791
    
1792
Map genFeature2genLinkMap = new LinkedHashMap();
1793
for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
1794
	GenLink genLink = (GenLink)it.next();
1795
	TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1796
	GenFeature metaFeature = modelFacet.getChildMetaFeature();
1797
	if (!genFeature2genLinkMap.containsKey(metaFeature)) {
1798
		genFeature2genLinkMap.put(metaFeature, new ArrayList());
1799
	}
1800
	((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
1801
}
1802
Map genFeature2featureGenLinkMap = new LinkedHashMap();
1803
for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
1804
	GenLink genLink = (GenLink)it.next();
1805
	GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
1806
	if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
1807
		genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
1808
	}
1809
	((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
1810
}
1811
if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
1812
1813
    stringBuffer.append(TEXT_422);
1814
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1815
    stringBuffer.append(TEXT_423);
1816
    stringBuffer.append(_getSemanticElementCode);
1817
    stringBuffer.append(TEXT_424);
1818
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1819
    stringBuffer.append(TEXT_425);
1820
    
1821
}
1822
if (!genFeature2genLinkMap.isEmpty()) {
1823
1824
    stringBuffer.append(TEXT_426);
1825
    
1826
}
1827
for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
1828
	Map.Entry nextEntry = (Map.Entry) entries.next();
1829
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
1830
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1831
	if (metaFeature.isListType()) {
1832
1833
    stringBuffer.append(TEXT_427);
1834
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1835
    stringBuffer.append(TEXT_428);
1836
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
1837
    stringBuffer.append(TEXT_429);
1838
    stringBuffer.append(metaFeature.getGetAccessor());
1839
    stringBuffer.append(TEXT_430);
1840
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1841
    stringBuffer.append(TEXT_431);
1842
    
1843
	} else {
1844
1845
    stringBuffer.append(TEXT_432);
1846
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
1847
    stringBuffer.append(TEXT_433);
1848
    stringBuffer.append(metaFeature.getGetAccessor());
1849
    stringBuffer.append(TEXT_434);
1850
    
1851
	}
1852
1853
    stringBuffer.append(TEXT_435);
1854
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1855
    stringBuffer.append(TEXT_436);
1856
    
1857
	boolean generateSwitch = genLinksCollection.size() != 1;
1858
	if (generateSwitch) {
1859
1860
    stringBuffer.append(TEXT_437);
1861
    
1862
	}
1863
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
1864
		GenLink nextLink = (GenLink) genLinksIterator.next();
1865
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1866
		if (generateSwitch) {
1867
1868
    stringBuffer.append(TEXT_438);
1869
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1870
    stringBuffer.append(TEXT_439);
1871
    
1872
		} else {
1873
1874
    stringBuffer.append(TEXT_440);
1875
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1876
    stringBuffer.append(TEXT_441);
1877
    
1878
		}
1879
		if (modelFacet.getSourceMetaFeature() != null) {
1880
1881
    stringBuffer.append(TEXT_442);
1882
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1883
    stringBuffer.append(TEXT_443);
1884
    stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName()));
1885
    stringBuffer.append(TEXT_444);
1886
    stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor());
1887
    stringBuffer.append(TEXT_445);
1888
    
1889
		} else {
1890
1891
    stringBuffer.append(TEXT_446);
1892
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1893
    stringBuffer.append(TEXT_447);
1894
    stringBuffer.append(_getSemanticElementCode);
1895
    stringBuffer.append(TEXT_448);
1896
    
1897
		}
1898
		if (modelFacet.getTargetMetaFeature() != null) {
1899
1900
    stringBuffer.append(TEXT_449);
1901
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1902
    stringBuffer.append(TEXT_450);
1903
    stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName()));
1904
    stringBuffer.append(TEXT_451);
1905
    stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor());
1906
    stringBuffer.append(TEXT_452);
1907
    
1908
		} else {
1909
1910
    stringBuffer.append(TEXT_453);
1911
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1912
    stringBuffer.append(TEXT_454);
1913
    stringBuffer.append(_getSemanticElementCode);
1914
    stringBuffer.append(TEXT_455);
1915
    
1916
		}
1917
1918
    stringBuffer.append(TEXT_456);
1919
    
1920
		if (generateSwitch) {
1921
1922
    stringBuffer.append(TEXT_457);
1923
    
1924
		} else {
1925
1926
    stringBuffer.append(TEXT_458);
1927
    
1928
		}
1929
1930
    
1931
	}	//iterate over genLinksCollection
1932
	if (generateSwitch) {
1933
1934
    stringBuffer.append(TEXT_459);
1935
    
1936
	}
1937
	if (metaFeature.isListType()) {
1938
1939
    stringBuffer.append(TEXT_460);
1940
    
1941
	}
1942
}
1943
for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
1944
	Map.Entry nextEntry = (Map.Entry) entries.next();
1945
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
1946
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1947
	if (metaFeature.isListType()) {
1948
1949
    stringBuffer.append(TEXT_461);
1950
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1951
    stringBuffer.append(TEXT_462);
1952
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
1953
    stringBuffer.append(TEXT_463);
1954
    stringBuffer.append(metaFeature.getGetAccessor());
1955
    stringBuffer.append(TEXT_464);
1956
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1957
    stringBuffer.append(TEXT_465);
1958
    
1959
	} else {
1960
1961
    stringBuffer.append(TEXT_466);
1962
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
1963
    stringBuffer.append(TEXT_467);
1964
    stringBuffer.append(metaFeature.getGetAccessor());
1965
    stringBuffer.append(TEXT_468);
1966
    
1967
	}
1968
1969
    stringBuffer.append(TEXT_469);
1970
    
1971
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
1972
		GenLink nextLink = (GenLink) genLinksIterator.next();
1973
1974
    stringBuffer.append(TEXT_470);
1975
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1976
    stringBuffer.append(TEXT_471);
1977
    
1978
	}
1979
1980
    stringBuffer.append(TEXT_472);
1981
    
1982
	if (metaFeature.isListType()) {
1983
1984
    stringBuffer.append(TEXT_473);
1985
    
1986
	}
1987
}
1988
1989
    stringBuffer.append(TEXT_474);
1990
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1991
    stringBuffer.append(TEXT_475);
1992
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1993
    stringBuffer.append(TEXT_476);
1994
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1995
    stringBuffer.append(TEXT_477);
1996
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1997
    stringBuffer.append(TEXT_478);
1998
    stringBuffer.append(_getDiagramCode);
1999
    stringBuffer.append(TEXT_479);
2000
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2001
    stringBuffer.append(TEXT_480);
2002
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2003
    stringBuffer.append(TEXT_481);
2004
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2005
    stringBuffer.append(TEXT_482);
2006
    
2007
	if (_includeUncontainedLinks) {
2008
2009
    stringBuffer.append(TEXT_483);
2010
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2011
    stringBuffer.append(TEXT_484);
2012
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2013
    stringBuffer.append(TEXT_485);
2014
    
2015
	}
2016
2017
    
2018
	if (myHelper.containsFeatureModelFacetLinks()) {
2019
2020
    stringBuffer.append(TEXT_486);
2021
    stringBuffer.append(_getViewCode);
2022
    stringBuffer.append(TEXT_487);
2023
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2024
    stringBuffer.append(TEXT_488);
2025
    
2026
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
2027
			GenLink nextLink = (GenLink) it.next();
2028
2029
    stringBuffer.append(TEXT_489);
2030
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2031
    stringBuffer.append(TEXT_490);
2032
    
2033
		}
2034
2035
    stringBuffer.append(TEXT_491);
2036
    
2037
		if (myHelper.containsTypeModelFacetLinks()) {
2038
2039
    stringBuffer.append(TEXT_492);
2040
    
2041
		} else {
2042
2043
    stringBuffer.append(TEXT_493);
2044
    
2045
		}
2046
	}
2047
	
2048
2049
    
2050
	if (myHelper.containsTypeModelFacetLinks()) {
2051
		if (!myHelper.containsFeatureModelFacetLinks()) {
2052
2053
    stringBuffer.append(TEXT_494);
2054
    
2055
		}
2056
2057
    stringBuffer.append(TEXT_495);
2058
    stringBuffer.append(_getSemanticElementCode);
2059
    stringBuffer.append(TEXT_496);
2060
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2061
    stringBuffer.append(TEXT_497);
2062
    
2063
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2064
			GenLink nextLink = (GenLink) it.next();
2065
2066
    stringBuffer.append(TEXT_498);
2067
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2068
    stringBuffer.append(TEXT_499);
2069
    
2070
		}
2071
2072
    stringBuffer.append(TEXT_500);
2073
    
2074
	}
2075
2076
    stringBuffer.append(TEXT_501);
2077
    stringBuffer.append(genDiagram.isSynchronized());
2078
    stringBuffer.append(TEXT_502);
2079
    stringBuffer.append(genDiagram.isSynchronized());
2080
    stringBuffer.append(TEXT_503);
2081
    
2082
}
2083
2084
    
2085
}
2086
2087
    stringBuffer.append(TEXT_504);
2088
    stringBuffer.append(TEXT_505);
2089
    stringBuffer.append(TEXT_506);
949
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
2090
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
950
    stringBuffer.append(TEXT_240);
2091
    stringBuffer.append(TEXT_507);
951
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
2092
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
952
    stringBuffer.append(TEXT_241);
2093
    stringBuffer.append(TEXT_508);
953
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2094
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
954
    stringBuffer.append(TEXT_242);
2095
    stringBuffer.append(TEXT_509);
955
    importManager.emitSortedImports();
2096
    importManager.emitSortedImports();
956
    stringBuffer.append(TEXT_243);
2097
    stringBuffer.append(TEXT_510);
957
    return stringBuffer.toString();
2098
    return stringBuffer.toString();
958
  }
2099
  }
959
}
2100
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java (-129 / +176 lines)
Lines 180-250 Link Here
180
  protected final String TEXT_160 = " imageDescriptor = ";
180
  protected final String TEXT_160 = " imageDescriptor = ";
181
  protected final String TEXT_161 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
181
  protected final String TEXT_161 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
182
  protected final String TEXT_162 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
182
  protected final String TEXT_162 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
183
  protected final String TEXT_163 = " resolveSemanticElement() {" + NL + "\t\tfor(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tView view = (View)editPart.getModel();" + NL + "\t\t\tif (view != null && view.getElement() != null) {" + NL + "\t\t\t\treturn (";
183
  protected final String TEXT_163 = " resolveSemanticElement() {" + NL + "\t\t";
184
  protected final String TEXT_164 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
184
  protected final String TEXT_164 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof ";
185
  protected final String TEXT_165 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
185
  protected final String TEXT_165 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}";
186
  protected final String TEXT_166 = ") {" + NL + "\t\t\t\treturn (";
186
  protected final String TEXT_166 = NL + "\t\t";
187
  protected final String TEXT_167 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
187
  protected final String TEXT_167 = " view = (";
188
  protected final String TEXT_168 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
188
  protected final String TEXT_168 = ") parent.getModel();" + NL + "\t\treturn (";
189
  protected final String TEXT_169 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
189
  protected final String TEXT_169 = ") view.getElement();";
190
  protected final String TEXT_170 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
190
  protected final String TEXT_170 = NL + "\t\t";
191
  protected final String TEXT_171 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
191
  protected final String TEXT_171 = " target = ((";
192
  protected final String TEXT_172 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
192
  protected final String TEXT_172 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof ";
193
  protected final String TEXT_173 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
193
  protected final String TEXT_173 = ") ? (";
194
  protected final String TEXT_174 = NL + "\t\t\tupdatableParent.addRefresher(";
194
  protected final String TEXT_174 = ") target.getElement() : null;";
195
  protected final String TEXT_175 = ".eINSTANCE.get";
195
  protected final String TEXT_175 = NL + "\t\treturn null;";
196
  protected final String TEXT_176 = "(), labelRefresher);";
196
  protected final String TEXT_176 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
197
  protected final String TEXT_177 = NL + "\t\t\tupdatableParent.addRefresher(";
197
  protected final String TEXT_177 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
198
  protected final String TEXT_178 = ".eINSTANCE.get";
198
  protected final String TEXT_178 = ") {" + NL + "\t\t\t\treturn (";
199
  protected final String TEXT_179 = "(), labelRefresher);";
199
  protected final String TEXT_179 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
200
  protected final String TEXT_180 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
200
  protected final String TEXT_180 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
201
  protected final String TEXT_181 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
201
  protected final String TEXT_181 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
202
  protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
202
  protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
203
  protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
203
  protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
204
  protected final String TEXT_184 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
204
  protected final String TEXT_184 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
205
  protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
205
  protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
206
  protected final String TEXT_186 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
206
  protected final String TEXT_186 = NL + "\t\t\tupdatableParent.addRefresher(";
207
  protected final String TEXT_187 = NL + "\t\t\tupdatableParent.removeRefresher(";
207
  protected final String TEXT_187 = ".eINSTANCE.get";
208
  protected final String TEXT_188 = ".eINSTANCE.get";
208
  protected final String TEXT_188 = "(), labelRefresher);";
209
  protected final String TEXT_189 = "(), labelRefresher);";
209
  protected final String TEXT_189 = NL + "\t\t\tupdatableParent.addRefresher(";
210
  protected final String TEXT_190 = NL + "\t\t\tupdatableParent.removeRefresher(";
210
  protected final String TEXT_190 = ".eINSTANCE.get";
211
  protected final String TEXT_191 = ".eINSTANCE.get";
211
  protected final String TEXT_191 = "(), labelRefresher);";
212
  protected final String TEXT_192 = "(), labelRefresher);";
212
  protected final String TEXT_192 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
213
  protected final String TEXT_193 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL;
213
  protected final String TEXT_193 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
214
  protected final String TEXT_194 = NL;
214
  protected final String TEXT_194 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
215
  protected final String TEXT_195 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
215
  protected final String TEXT_195 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
216
  protected final String TEXT_196 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
216
  protected final String TEXT_196 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
217
  protected final String TEXT_197 = " method" + NL + "\t\treturn null;" + NL + "\t}";
217
  protected final String TEXT_197 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
218
  protected final String TEXT_198 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
218
  protected final String TEXT_198 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
219
  protected final String TEXT_199 = " createLabel() {";
219
  protected final String TEXT_199 = NL + "\t\t\tupdatableParent.removeRefresher(";
220
  protected final String TEXT_200 = NL + "\t\treturn new ";
220
  protected final String TEXT_200 = ".eINSTANCE.get";
221
  protected final String TEXT_201 = "();";
221
  protected final String TEXT_201 = "(), labelRefresher);";
222
  protected final String TEXT_202 = NL + "\t\treturn ";
222
  protected final String TEXT_202 = NL + "\t\t\tupdatableParent.removeRefresher(";
223
  protected final String TEXT_203 = ";";
223
  protected final String TEXT_203 = ".eINSTANCE.get";
224
  protected final String TEXT_204 = NL + "\t\treturn new ";
224
  protected final String TEXT_204 = "(), labelRefresher);";
225
  protected final String TEXT_205 = "();";
225
  protected final String TEXT_205 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL;
226
  protected final String TEXT_206 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
226
  protected final String TEXT_206 = NL;
227
  protected final String TEXT_207 = " createFigure() {" + NL + "\t\t";
227
  protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
228
  protected final String TEXT_208 = " label = createLabel();";
228
  protected final String TEXT_208 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
229
  protected final String TEXT_209 = NL + "\t\tdefaultText = label.getText();";
229
  protected final String TEXT_209 = " method" + NL + "\t\treturn null;" + NL + "\t}";
230
  protected final String TEXT_210 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
230
  protected final String TEXT_210 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
231
  protected final String TEXT_211 = NL + "\t\treturn label;" + NL + "\t}";
231
  protected final String TEXT_211 = " createLabel() {";
232
  protected final String TEXT_212 = NL + NL + "\t/**";
232
  protected final String TEXT_212 = NL + "\t\treturn new ";
233
  protected final String TEXT_213 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
233
  protected final String TEXT_213 = "();";
234
  protected final String TEXT_214 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
234
  protected final String TEXT_214 = NL + "\t\treturn ";
235
  protected final String TEXT_215 = " getLabel() {" + NL + "\t\treturn (";
235
  protected final String TEXT_215 = ";";
236
  protected final String TEXT_216 = ") getFigure();" + NL + "\t}" + NL;
236
  protected final String TEXT_216 = NL + "\t\treturn new ";
237
  protected final String TEXT_217 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
237
  protected final String TEXT_217 = "();";
238
  protected final String TEXT_218 = "(";
238
  protected final String TEXT_218 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
239
  protected final String TEXT_219 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
239
  protected final String TEXT_219 = " createFigure() {" + NL + "\t\t";
240
  protected final String TEXT_220 = NL + "\t\tdefaultText = figure.getText();";
240
  protected final String TEXT_220 = " label = createLabel();";
241
  protected final String TEXT_221 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
241
  protected final String TEXT_221 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment(";
242
  protected final String TEXT_222 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
242
  protected final String TEXT_222 = ".LEFT);";
243
  protected final String TEXT_223 = NL;
243
  protected final String TEXT_223 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
244
  protected final String TEXT_224 = NL;
244
  protected final String TEXT_224 = NL + "\t\treturn label;" + NL + "\t}";
245
  protected final String TEXT_225 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
245
  protected final String TEXT_225 = NL + NL + "\t/**";
246
  protected final String TEXT_226 = NL + "}";
246
  protected final String TEXT_226 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
247
  protected final String TEXT_227 = NL;
247
  protected final String TEXT_227 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
248
  protected final String TEXT_228 = " getLabel() {" + NL + "\t\treturn (";
249
  protected final String TEXT_229 = ") getFigure();" + NL + "\t}" + NL;
250
  protected final String TEXT_230 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
251
  protected final String TEXT_231 = "(";
252
  protected final String TEXT_232 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
253
  protected final String TEXT_233 = NL + "\t\tdefaultText = figure.getText();";
254
  protected final String TEXT_234 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
255
  protected final String TEXT_235 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
256
  protected final String TEXT_236 = NL;
257
  protected final String TEXT_237 = NL;
258
  protected final String TEXT_238 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
259
  protected final String TEXT_239 = NL + "}";
260
  protected final String TEXT_240 = NL;
248
261
249
  public String generate(Object argument)
262
  public String generate(Object argument)
250
  {
263
  {
Lines 757-848 Link Here
757
    stringBuffer.append(TEXT_162);
770
    stringBuffer.append(TEXT_162);
758
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
771
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
759
    stringBuffer.append(TEXT_163);
772
    stringBuffer.append(TEXT_163);
760
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
761
    stringBuffer.append(TEXT_164);
762
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
773
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
774
    stringBuffer.append(TEXT_164);
775
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
763
    stringBuffer.append(TEXT_165);
776
    stringBuffer.append(TEXT_165);
764
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
777
    
778
if (genHost.getModelFacet() instanceof TypeLinkModelFacet) {
779
765
    stringBuffer.append(TEXT_166);
780
    stringBuffer.append(TEXT_166);
766
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
781
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
767
    stringBuffer.append(TEXT_167);
782
    stringBuffer.append(TEXT_167);
768
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
783
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
769
    stringBuffer.append(TEXT_168);
784
    stringBuffer.append(TEXT_168);
770
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
785
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
771
    stringBuffer.append(TEXT_169);
786
    stringBuffer.append(TEXT_169);
772
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
787
    
788
} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) {
789
773
    stringBuffer.append(TEXT_170);
790
    stringBuffer.append(TEXT_170);
774
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
791
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
775
    stringBuffer.append(TEXT_171);
792
    stringBuffer.append(TEXT_171);
776
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
777
    stringBuffer.append(TEXT_172);
794
    stringBuffer.append(TEXT_172);
778
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
795
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
779
    stringBuffer.append(TEXT_173);
796
    stringBuffer.append(TEXT_173);
797
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
798
    stringBuffer.append(TEXT_174);
799
    
800
} else {
801
802
    stringBuffer.append(TEXT_175);
803
    
804
}
805
806
    stringBuffer.append(TEXT_176);
807
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
808
    stringBuffer.append(TEXT_177);
809
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
810
    stringBuffer.append(TEXT_178);
811
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
812
    stringBuffer.append(TEXT_179);
813
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
814
    stringBuffer.append(TEXT_180);
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
816
    stringBuffer.append(TEXT_181);
817
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
818
    stringBuffer.append(TEXT_182);
819
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
820
    stringBuffer.append(TEXT_183);
821
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
822
    stringBuffer.append(TEXT_184);
823
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
824
    stringBuffer.append(TEXT_185);
780
    
825
    
781
if (labelModelFacet instanceof FeatureLabelModelFacet) {
826
if (labelModelFacet instanceof FeatureLabelModelFacet) {
782
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
827
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
783
828
784
    stringBuffer.append(TEXT_174);
829
    stringBuffer.append(TEXT_186);
785
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
830
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
786
    stringBuffer.append(TEXT_175);
831
    stringBuffer.append(TEXT_187);
787
    stringBuffer.append(feature.getFeatureAccessorName());
832
    stringBuffer.append(feature.getFeatureAccessorName());
788
    stringBuffer.append(TEXT_176);
833
    stringBuffer.append(TEXT_188);
789
    
834
    
790
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
835
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
791
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
836
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
792
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
837
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
793
		GenFeature next = (GenFeature) it.next();
838
		GenFeature next = (GenFeature) it.next();
794
839
795
    stringBuffer.append(TEXT_177);
840
    stringBuffer.append(TEXT_189);
796
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
841
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
797
    stringBuffer.append(TEXT_178);
842
    stringBuffer.append(TEXT_190);
798
    stringBuffer.append(next.getFeatureAccessorName());
843
    stringBuffer.append(next.getFeatureAccessorName());
799
    stringBuffer.append(TEXT_179);
844
    stringBuffer.append(TEXT_191);
800
    
845
    
801
	}
846
	}
802
}
847
}
803
848
804
    stringBuffer.append(TEXT_180);
849
    stringBuffer.append(TEXT_192);
805
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
850
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
806
    stringBuffer.append(TEXT_181);
851
    stringBuffer.append(TEXT_193);
807
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
852
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
808
    stringBuffer.append(TEXT_182);
853
    stringBuffer.append(TEXT_194);
809
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
854
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
810
    stringBuffer.append(TEXT_183);
855
    stringBuffer.append(TEXT_195);
811
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
856
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
812
    stringBuffer.append(TEXT_184);
857
    stringBuffer.append(TEXT_196);
813
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
858
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
814
    stringBuffer.append(TEXT_185);
859
    stringBuffer.append(TEXT_197);
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
860
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
816
    stringBuffer.append(TEXT_186);
861
    stringBuffer.append(TEXT_198);
817
    
862
    
818
if (labelModelFacet instanceof FeatureLabelModelFacet) {
863
if (labelModelFacet instanceof FeatureLabelModelFacet) {
819
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
864
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
820
865
821
    stringBuffer.append(TEXT_187);
866
    stringBuffer.append(TEXT_199);
822
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
867
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
823
    stringBuffer.append(TEXT_188);
868
    stringBuffer.append(TEXT_200);
824
    stringBuffer.append(feature.getFeatureAccessorName());
869
    stringBuffer.append(feature.getFeatureAccessorName());
825
    stringBuffer.append(TEXT_189);
870
    stringBuffer.append(TEXT_201);
826
    
871
    
827
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
872
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
828
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
873
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
829
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
874
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
830
		GenFeature next = (GenFeature) it.next();
875
		GenFeature next = (GenFeature) it.next();
831
876
832
    stringBuffer.append(TEXT_190);
877
    stringBuffer.append(TEXT_202);
833
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
878
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
834
    stringBuffer.append(TEXT_191);
879
    stringBuffer.append(TEXT_203);
835
    stringBuffer.append(next.getFeatureAccessorName());
880
    stringBuffer.append(next.getFeatureAccessorName());
836
    stringBuffer.append(TEXT_192);
881
    stringBuffer.append(TEXT_204);
837
    
882
    
838
	}
883
	}
839
}
884
}
840
885
841
    stringBuffer.append(TEXT_193);
886
    stringBuffer.append(TEXT_205);
842
    
887
    
843
final Viewmap viewmap = genLabel.getViewmap();
888
final Viewmap viewmap = genLabel.getViewmap();
844
889
845
    stringBuffer.append(TEXT_194);
890
    stringBuffer.append(TEXT_206);
846
    
891
    
847
final String figureQualifiedClassName;
892
final String figureQualifiedClassName;
848
if (viewmap instanceof ParentAssignedViewmap) {
893
if (viewmap instanceof ParentAssignedViewmap) {
Lines 871-934 Link Here
871
if (viewmap instanceof ParentAssignedViewmap) {
916
if (viewmap instanceof ParentAssignedViewmap) {
872
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
917
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
873
918
874
    stringBuffer.append(TEXT_195);
919
    stringBuffer.append(TEXT_207);
875
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
920
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
876
    stringBuffer.append(TEXT_196);
921
    stringBuffer.append(TEXT_208);
877
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
922
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
878
    stringBuffer.append(TEXT_197);
923
    stringBuffer.append(TEXT_209);
879
    } else { 
924
    } else { 
880
    stringBuffer.append(TEXT_198);
925
    stringBuffer.append(TEXT_210);
881
    stringBuffer.append(figureImportedName);
926
    stringBuffer.append(figureImportedName);
882
    stringBuffer.append(TEXT_199);
927
    stringBuffer.append(TEXT_211);
883
    
928
    
884
if (viewmap instanceof FigureViewmap) {
929
if (viewmap instanceof FigureViewmap) {
885
930
886
    stringBuffer.append(TEXT_200);
931
    stringBuffer.append(TEXT_212);
887
    stringBuffer.append(figureImportedName);
932
    stringBuffer.append(figureImportedName);
888
    stringBuffer.append(TEXT_201);
933
    stringBuffer.append(TEXT_213);
889
    } // instanceof FigureViewmap
934
    } // instanceof FigureViewmap
890
 else if (viewmap instanceof SnippetViewmap) {
935
 else if (viewmap instanceof SnippetViewmap) {
891
    stringBuffer.append(TEXT_202);
936
    stringBuffer.append(TEXT_214);
892
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
937
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
893
    stringBuffer.append(TEXT_203);
938
    stringBuffer.append(TEXT_215);
894
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
939
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
895
 else if (viewmap instanceof InnerClassViewmap) {
940
 else if (viewmap instanceof InnerClassViewmap) {
896
941
897
    stringBuffer.append(TEXT_204);
942
    stringBuffer.append(TEXT_216);
898
    stringBuffer.append(figureImportedName);
943
    stringBuffer.append(figureImportedName);
899
    stringBuffer.append(TEXT_205);
944
    stringBuffer.append(TEXT_217);
900
    }
945
    }
901
    stringBuffer.append(TEXT_206);
946
    stringBuffer.append(TEXT_218);
902
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
947
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
903
    stringBuffer.append(TEXT_207);
948
    stringBuffer.append(TEXT_219);
904
    stringBuffer.append(figureImportedName);
949
    stringBuffer.append(figureImportedName);
905
    stringBuffer.append(TEXT_208);
950
    stringBuffer.append(TEXT_220);
906
    
951
    
907
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
952
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
908
953
909
    stringBuffer.append(TEXT_209);
954
    stringBuffer.append(TEXT_221);
955
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
956
    stringBuffer.append(TEXT_222);
910
    
957
    
911
} else {
958
} else {
912
959
913
    stringBuffer.append(TEXT_210);
960
    stringBuffer.append(TEXT_223);
914
    
961
    
915
}
962
}
916
963
917
    stringBuffer.append(TEXT_211);
964
    stringBuffer.append(TEXT_224);
918
    }	/*not parent-assigned*/
965
    }	/*not parent-assigned*/
919
    stringBuffer.append(TEXT_212);
966
    stringBuffer.append(TEXT_225);
920
    
967
    
921
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
968
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
922
969
923
    stringBuffer.append(TEXT_213);
970
    stringBuffer.append(TEXT_226);
924
    
971
    
925
}
972
}
926
973
927
    stringBuffer.append(TEXT_214);
974
    stringBuffer.append(TEXT_227);
928
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
975
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
929
    stringBuffer.append(TEXT_215);
976
    stringBuffer.append(TEXT_228);
930
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
977
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
931
    stringBuffer.append(TEXT_216);
978
    stringBuffer.append(TEXT_229);
932
    
979
    
933
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
980
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
934
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
981
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
Lines 942-984 Link Here
942
	}
989
	}
943
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
990
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
944
991
945
    stringBuffer.append(TEXT_217);
992
    stringBuffer.append(TEXT_230);
946
    stringBuffer.append(labelSetterName);
993
    stringBuffer.append(labelSetterName);
947
    stringBuffer.append(TEXT_218);
994
    stringBuffer.append(TEXT_231);
948
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
995
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
949
    stringBuffer.append(TEXT_219);
996
    stringBuffer.append(TEXT_232);
950
    
997
    
951
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
998
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
952
999
953
    stringBuffer.append(TEXT_220);
1000
    stringBuffer.append(TEXT_233);
954
    
1001
    
955
} else {
1002
} else {
956
1003
957
    stringBuffer.append(TEXT_221);
1004
    stringBuffer.append(TEXT_234);
958
    
1005
    
959
}
1006
}
960
1007
961
    stringBuffer.append(TEXT_222);
1008
    stringBuffer.append(TEXT_235);
962
    
1009
    
963
if (viewmap instanceof InnerClassViewmap) {
1010
if (viewmap instanceof InnerClassViewmap) {
964
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
1011
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
965
1012
966
    stringBuffer.append(TEXT_223);
1013
    stringBuffer.append(TEXT_236);
967
    stringBuffer.append(classBody);
1014
    stringBuffer.append(classBody);
968
    stringBuffer.append(TEXT_224);
1015
    stringBuffer.append(TEXT_237);
969
    
1016
    
970
if (classBody.indexOf("DPtoLP") != -1) {
1017
if (classBody.indexOf("DPtoLP") != -1) {
971
1018
972
    stringBuffer.append(TEXT_225);
1019
    stringBuffer.append(TEXT_238);
973
    
1020
    
974
}
1021
}
975
1022
976
    
1023
    
977
}
1024
}
978
1025
979
    stringBuffer.append(TEXT_226);
1026
    stringBuffer.append(TEXT_239);
980
    importManager.emitSortedImports();
1027
    importManager.emitSortedImports();
981
    stringBuffer.append(TEXT_227);
1028
    stringBuffer.append(TEXT_240);
982
    return stringBuffer.toString();
1029
    return stringBuffer.toString();
983
  }
1030
  }
984
}
1031
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java (-1720 / +2848 lines)
Lines 35-909 Link Here
35
  protected final String TEXT_14 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
35
  protected final String TEXT_14 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
36
  protected final String TEXT_15 = "(";
36
  protected final String TEXT_15 = "(";
37
  protected final String TEXT_16 = " model) {" + NL + "\t\tassert model instanceof ";
37
  protected final String TEXT_16 = " model) {" + NL + "\t\tassert model instanceof ";
38
  protected final String TEXT_17 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
38
  protected final String TEXT_17 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL;
39
  protected final String TEXT_18 = NL;
39
  protected final String TEXT_18 = NL;
40
  protected final String TEXT_19 = "\t\tinstallEditPolicy(";
40
  protected final String TEXT_19 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
41
  protected final String TEXT_20 = ".COMPONENT_ROLE, new ";
41
  protected final String TEXT_20 = " view = (";
42
  protected final String TEXT_21 = "() {" + NL + "\t\t\tprotected ";
42
  protected final String TEXT_21 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
43
  protected final String TEXT_22 = " createDeleteCommand(";
43
  protected final String TEXT_22 = " view = (";
44
  protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\t";
44
  protected final String TEXT_23 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
45
  protected final String TEXT_24 = " editingDomain = ";
45
  protected final String TEXT_24 = NL;
46
  protected final String TEXT_25 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
46
  protected final String TEXT_25 = "\t\tinstallEditPolicy(";
47
  protected final String TEXT_26 = " cc = new ";
47
  protected final String TEXT_26 = ".COMPONENT_ROLE, new ";
48
  protected final String TEXT_27 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
48
  protected final String TEXT_27 = "() {" + NL + "\t\t\tprotected ";
49
  protected final String TEXT_28 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(";
49
  protected final String TEXT_28 = " createDeleteCommand(";
50
  protected final String TEXT_29 = " editingDomain) {";
50
  protected final String TEXT_29 = " deleteRequest) {" + NL + "\t\t\t\t";
51
  protected final String TEXT_30 = NL + "\t\t\t\t";
51
  protected final String TEXT_30 = " editingDomain = ";
52
  protected final String TEXT_31 = " result = new ";
52
  protected final String TEXT_31 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
53
  protected final String TEXT_32 = "();";
53
  protected final String TEXT_32 = " cc = new ";
54
  protected final String TEXT_33 = NL + "\t\t\t\tresult.append(";
54
  protected final String TEXT_33 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
55
  protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
55
  protected final String TEXT_34 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(";
56
  protected final String TEXT_35 = ".eINSTANCE.get";
56
  protected final String TEXT_35 = " editingDomain) {";
57
  protected final String TEXT_36 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
57
  protected final String TEXT_36 = NL + "\t\t\t\t";
58
  protected final String TEXT_37 = NL + "\t\t\t\tresult.append(";
58
  protected final String TEXT_37 = " result = new ";
59
  protected final String TEXT_38 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
59
  protected final String TEXT_38 = "();";
60
  protected final String TEXT_39 = ".eINSTANCE.get";
60
  protected final String TEXT_39 = NL + "\t\t\t\tresult.append(";
61
  protected final String TEXT_40 = "()," + NL + "\t\t\t\t\t";
61
  protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
62
  protected final String TEXT_41 = ".UNSET_VALUE));";
62
  protected final String TEXT_41 = ".eINSTANCE.get";
63
  protected final String TEXT_42 = NL + "\t\t\t\tresult.append(";
63
  protected final String TEXT_42 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
64
  protected final String TEXT_43 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
64
  protected final String TEXT_43 = NL + "\t\t\t\tresult.append(";
65
  protected final String TEXT_44 = ".eINSTANCE.get";
65
  protected final String TEXT_44 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
66
  protected final String TEXT_45 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
66
  protected final String TEXT_45 = ".eINSTANCE.get";
67
  protected final String TEXT_46 = NL + "\t\t\t\tresult.append(";
67
  protected final String TEXT_46 = "()," + NL + "\t\t\t\t\t";
68
  protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
68
  protected final String TEXT_47 = ".UNSET_VALUE));";
69
  protected final String TEXT_48 = ".eINSTANCE.get";
69
  protected final String TEXT_48 = NL + "\t\t\t\tresult.append(";
70
  protected final String TEXT_49 = "()," + NL + "\t\t\t\t\t";
70
  protected final String TEXT_49 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
71
  protected final String TEXT_50 = ".UNSET_VALUE));";
71
  protected final String TEXT_50 = ".eINSTANCE.get";
72
  protected final String TEXT_51 = NL + "\t\t\t\treturn result;";
72
  protected final String TEXT_51 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
73
  protected final String TEXT_52 = NL + "\t\t\t\treturn ";
73
  protected final String TEXT_52 = NL + "\t\t\t\tresult.append(";
74
  protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
74
  protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
75
  protected final String TEXT_54 = ".eINSTANCE.get";
75
  protected final String TEXT_54 = ".eINSTANCE.get";
76
  protected final String TEXT_55 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
76
  protected final String TEXT_55 = "()," + NL + "\t\t\t\t\t";
77
  protected final String TEXT_56 = NL + "\t\t\t\treturn ";
77
  protected final String TEXT_56 = ".UNSET_VALUE));";
78
  protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
78
  protected final String TEXT_57 = NL + "\t\t\t\treturn result;";
79
  protected final String TEXT_58 = ".eINSTANCE.get";
79
  protected final String TEXT_58 = NL + "\t\t\t\treturn ";
80
  protected final String TEXT_59 = "()," + NL + "\t\t\t\t\t";
80
  protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
81
  protected final String TEXT_60 = ".UNSET_VALUE);";
81
  protected final String TEXT_60 = ".eINSTANCE.get";
82
  protected final String TEXT_61 = NL + "\t\t\t}" + NL + "\t\t});";
82
  protected final String TEXT_61 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
83
  protected final String TEXT_62 = NL + "\t\tinstallEditPolicy(";
83
  protected final String TEXT_62 = NL + "\t\t\t\treturn ";
84
  protected final String TEXT_63 = ".LAYOUT_ROLE, new ";
84
  protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
85
  protected final String TEXT_64 = "() {" + NL + "\t\t\tprotected ";
85
  protected final String TEXT_64 = ".eINSTANCE.get";
86
  protected final String TEXT_65 = " getCreateCommand(";
86
  protected final String TEXT_65 = "()," + NL + "\t\t\t\t\t";
87
  protected final String TEXT_66 = " request) {" + NL + "\t\t\t\treturn ";
87
  protected final String TEXT_66 = ".UNSET_VALUE);";
88
  protected final String TEXT_67 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
88
  protected final String TEXT_67 = NL + "\t\t\t}" + NL + "\t\t});";
89
  protected final String TEXT_68 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
89
  protected final String TEXT_68 = NL + "\t\tinstallEditPolicy(";
90
  protected final String TEXT_69 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
90
  protected final String TEXT_69 = ".LAYOUT_ROLE, new ";
91
  protected final String TEXT_70 = " createChangeConstraintCommand(";
91
  protected final String TEXT_70 = "() {" + NL + "\t\t\tprotected ";
92
  protected final String TEXT_71 = " child, Object constraint) {" + NL + "\t\t\t\treturn ";
92
  protected final String TEXT_71 = " getCreateCommand(";
93
  protected final String TEXT_72 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
93
  protected final String TEXT_72 = " request) {" + NL + "\t\t\t\treturn ";
94
  protected final String TEXT_73 = " createChildEditPolicy(";
94
  protected final String TEXT_73 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
95
  protected final String TEXT_74 = " child) {" + NL + "\t\t\t\treturn new ";
95
  protected final String TEXT_74 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
96
  protected final String TEXT_75 = "() {" + NL + "\t\t\t\t\tpublic ";
96
  protected final String TEXT_75 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
97
  protected final String TEXT_76 = " getTargetEditPart(";
97
  protected final String TEXT_76 = " createChangeConstraintCommand(";
98
  protected final String TEXT_77 = " request) {" + NL + "\t\t\t\t\t\tif (";
98
  protected final String TEXT_77 = " child, Object constraint) {" + NL + "\t\t\t\treturn ";
99
  protected final String TEXT_78 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn ";
99
  protected final String TEXT_78 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
100
  protected final String TEXT_79 = ".this;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn super.getTargetEditPart(request);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
100
  protected final String TEXT_79 = " createChildEditPolicy(";
101
  protected final String TEXT_80 = ".GRAPHICAL_NODE_ROLE, new ";
101
  protected final String TEXT_80 = " child) {" + NL + "\t\t\t\treturn new ";
102
  protected final String TEXT_81 = "() {" + NL + "\t\t\tprotected ";
102
  protected final String TEXT_81 = "() {" + NL + "\t\t\t\t\tpublic ";
103
  protected final String TEXT_82 = " getReconnectTargetCommand(";
103
  protected final String TEXT_82 = " getTargetEditPart(";
104
  protected final String TEXT_83 = " request) {";
104
  protected final String TEXT_83 = " request) {" + NL + "\t\t\t\t\t\tif (";
105
  protected final String TEXT_84 = " " + NL + "\t\t\t\treturn ";
105
  protected final String TEXT_84 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn ";
106
  protected final String TEXT_85 = ".INSTANCE;";
106
  protected final String TEXT_85 = ".this;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn super.getTargetEditPart(request);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
107
  protected final String TEXT_86 = NL + "\t\t\t\t";
107
  protected final String TEXT_86 = ".GRAPHICAL_NODE_ROLE, new ";
108
  protected final String TEXT_87 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof ";
108
  protected final String TEXT_87 = "() {" + NL + "\t\t\tprotected ";
109
  protected final String TEXT_88 = " == false) {" + NL + "\t\t\t\t\treturn ";
109
  protected final String TEXT_88 = " getReconnectTargetCommand(";
110
  protected final String TEXT_89 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
110
  protected final String TEXT_89 = " request) {";
111
  protected final String TEXT_90 = " edge = (";
111
  protected final String TEXT_90 = " " + NL + "\t\t\t\treturn ";
112
  protected final String TEXT_91 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = ";
112
  protected final String TEXT_91 = ".INSTANCE;";
113
  protected final String TEXT_92 = ".getModelID(edge);" + NL + "\t\t\t\tif (!";
113
  protected final String TEXT_92 = NL + "\t\t\t\t";
114
  protected final String TEXT_93 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn ";
114
  protected final String TEXT_93 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof ";
115
  protected final String TEXT_94 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
115
  protected final String TEXT_94 = " == false) {" + NL + "\t\t\t\t\treturn ";
116
  protected final String TEXT_95 = " result = null;" + NL + "\t\t\t\tint visualID = ";
116
  protected final String TEXT_95 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
117
  protected final String TEXT_96 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {";
117
  protected final String TEXT_96 = " edge = (";
118
  protected final String TEXT_97 = NL + "\t\t\t\tcase ";
118
  protected final String TEXT_97 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = ";
119
  protected final String TEXT_98 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect";
119
  protected final String TEXT_98 = ".getModelID(edge);" + NL + "\t\t\t\tif (!";
120
  protected final String TEXT_99 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;";
120
  protected final String TEXT_99 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn ";
121
  protected final String TEXT_100 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn ";
121
  protected final String TEXT_100 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
122
  protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand(";
122
  protected final String TEXT_101 = " result = null;" + NL + "\t\t\t\tint visualID = ";
123
  protected final String TEXT_102 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);";
123
  protected final String TEXT_102 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {";
124
  protected final String TEXT_103 = NL + "\t\t\t}" + NL + "\t\t\tprotected ";
124
  protected final String TEXT_103 = NL + "\t\t\t\tcase ";
125
  protected final String TEXT_104 = " getReconnectSourceCommand(";
125
  protected final String TEXT_104 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect";
126
  protected final String TEXT_105 = " request) {";
126
  protected final String TEXT_105 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;";
127
  protected final String TEXT_106 = " " + NL + "\t\t\t\treturn ";
127
  protected final String TEXT_106 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn ";
128
  protected final String TEXT_107 = ".INSTANCE;";
128
  protected final String TEXT_107 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand(";
129
  protected final String TEXT_108 = NL + "\t\t\t\t";
129
  protected final String TEXT_108 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);";
130
  protected final String TEXT_109 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof ";
130
  protected final String TEXT_109 = NL + "\t\t\t}" + NL + "\t\t\tprotected ";
131
  protected final String TEXT_110 = " == false) {" + NL + "\t\t\t\t\treturn ";
131
  protected final String TEXT_110 = " getReconnectSourceCommand(";
132
  protected final String TEXT_111 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
132
  protected final String TEXT_111 = " request) {";
133
  protected final String TEXT_112 = " edge = (";
133
  protected final String TEXT_112 = " " + NL + "\t\t\t\treturn ";
134
  protected final String TEXT_113 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = ";
134
  protected final String TEXT_113 = ".INSTANCE;";
135
  protected final String TEXT_114 = ".getModelID(edge);" + NL + "\t\t\t\tif (!";
135
  protected final String TEXT_114 = NL + "\t\t\t\t";
136
  protected final String TEXT_115 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn ";
136
  protected final String TEXT_115 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof ";
137
  protected final String TEXT_116 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
137
  protected final String TEXT_116 = " == false) {" + NL + "\t\t\t\t\treturn ";
138
  protected final String TEXT_117 = " result = null;" + NL + "\t\t\t\tint visualID = ";
138
  protected final String TEXT_117 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
139
  protected final String TEXT_118 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {";
139
  protected final String TEXT_118 = " edge = (";
140
  protected final String TEXT_119 = NL + "\t\t\t\tcase ";
140
  protected final String TEXT_119 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = ";
141
  protected final String TEXT_120 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect";
141
  protected final String TEXT_120 = ".getModelID(edge);" + NL + "\t\t\t\tif (!";
142
  protected final String TEXT_121 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;";
142
  protected final String TEXT_121 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn ";
143
  protected final String TEXT_122 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn ";
143
  protected final String TEXT_122 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
144
  protected final String TEXT_123 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand(";
144
  protected final String TEXT_123 = " result = null;" + NL + "\t\t\t\tint visualID = ";
145
  protected final String TEXT_124 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);";
145
  protected final String TEXT_124 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {";
146
  protected final String TEXT_125 = NL + "\t\t\t}" + NL + "\t\t\tprotected ";
146
  protected final String TEXT_125 = NL + "\t\t\t\tcase ";
147
  protected final String TEXT_126 = " getConnectionCreateCommand(";
147
  protected final String TEXT_126 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect";
148
  protected final String TEXT_127 = " request) {";
148
  protected final String TEXT_127 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;";
149
  protected final String TEXT_128 = NL + "\t\t\t\tif (request instanceof ";
149
  protected final String TEXT_128 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn ";
150
  protected final String TEXT_129 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
150
  protected final String TEXT_129 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand(";
151
  protected final String TEXT_130 = ".CreateConnectionRequestEx requestEx = (";
151
  protected final String TEXT_130 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);";
152
  protected final String TEXT_131 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
152
  protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t\tprotected ";
153
  protected final String TEXT_132 = " result = new ";
153
  protected final String TEXT_132 = " getConnectionCreateCommand(";
154
  protected final String TEXT_133 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
154
  protected final String TEXT_133 = " request) {";
155
  protected final String TEXT_134 = NL + "\t\t\t\t\t\tcase ";
155
  protected final String TEXT_134 = NL + "\t\t\t\tif (request instanceof ";
156
  protected final String TEXT_135 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
156
  protected final String TEXT_135 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
157
  protected final String TEXT_136 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
157
  protected final String TEXT_136 = ".CreateConnectionRequestEx requestEx = (";
158
  protected final String TEXT_137 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1 || !result.canExecute()) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\t//returning an unexecutable command does not change cursor to \"No\"." + NL + "\t\t\t\t\t\treturn null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
158
  protected final String TEXT_137 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
159
  protected final String TEXT_138 = " wrappedResult = new WrappingCommand(";
159
  protected final String TEXT_138 = " result = new ";
160
  protected final String TEXT_139 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t\trequest.setStartCommand(wrappedResult);" + NL + "\t\t\t\t\treturn wrappedResult;" + NL + "\t\t\t\t}";
160
  protected final String TEXT_139 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
161
  protected final String TEXT_140 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
161
  protected final String TEXT_140 = NL + "\t\t\t\t\t\tcase ";
162
  protected final String TEXT_141 = " getConnectionCompleteCommand(";
162
  protected final String TEXT_141 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
163
  protected final String TEXT_142 = " request) {";
163
  protected final String TEXT_142 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
164
  protected final String TEXT_143 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn ";
164
  protected final String TEXT_143 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1 || !result.canExecute()) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\t//returning an unexecutable command does not change cursor to \"No\"." + NL + "\t\t\t\t\t\treturn null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
165
  protected final String TEXT_144 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof ";
165
  protected final String TEXT_144 = " wrappedResult = new WrappingCommand(";
166
  protected final String TEXT_145 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
166
  protected final String TEXT_145 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t\trequest.setStartCommand(wrappedResult);" + NL + "\t\t\t\t\treturn wrappedResult;" + NL + "\t\t\t\t}";
167
  protected final String TEXT_146 = ".CreateConnectionRequestEx requestEx = (";
167
  protected final String TEXT_146 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
168
  protected final String TEXT_147 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
168
  protected final String TEXT_147 = " getConnectionCompleteCommand(";
169
  protected final String TEXT_148 = " result = new ";
169
  protected final String TEXT_148 = " request) {";
170
  protected final String TEXT_149 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
170
  protected final String TEXT_149 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn ";
171
  protected final String TEXT_150 = NL + "\t\t\t\t\t\tcase ";
171
  protected final String TEXT_150 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof ";
172
  protected final String TEXT_151 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
172
  protected final String TEXT_151 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
173
  protected final String TEXT_152 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
173
  protected final String TEXT_152 = ".CreateConnectionRequestEx requestEx = (";
174
  protected final String TEXT_153 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn ";
174
  protected final String TEXT_153 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
175
  protected final String TEXT_154 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
175
  protected final String TEXT_154 = " result = new ";
176
  protected final String TEXT_155 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
176
  protected final String TEXT_155 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {";
177
  protected final String TEXT_156 = NL + "\t\t\t\treturn ";
177
  protected final String TEXT_156 = NL + "\t\t\t\t\t\tcase ";
178
  protected final String TEXT_157 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
178
  protected final String TEXT_157 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
179
  protected final String TEXT_158 = " createFigure() {" + NL + "\t\t";
179
  protected final String TEXT_158 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
180
  protected final String TEXT_159 = " invisibleRectangle = new ";
180
  protected final String TEXT_159 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn ";
181
  protected final String TEXT_160 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new ";
181
  protected final String TEXT_160 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
182
  protected final String TEXT_161 = "());" + NL + "\t\t";
182
  protected final String TEXT_161 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
183
  protected final String TEXT_162 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t";
183
  protected final String TEXT_162 = NL + "\t\t\t\treturn ";
184
  protected final String TEXT_163 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tinvisibleRectangle.add(decorationShape);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
184
  protected final String TEXT_163 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});";
185
  protected final String TEXT_164 = " createNodeShape() {";
185
  protected final String TEXT_164 = NL + "\t\tinstallLinkNotationModelRefresher();";
186
  protected final String TEXT_165 = NL + "\t\tprimaryShape = new ";
186
  protected final String TEXT_165 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
187
  protected final String TEXT_166 = "()";
187
  protected final String TEXT_166 = " createFigure() {" + NL + "\t\t";
188
  protected final String TEXT_167 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}";
188
  protected final String TEXT_167 = " invisibleRectangle = new ";
189
  protected final String TEXT_168 = ";";
189
  protected final String TEXT_168 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new ";
190
  protected final String TEXT_169 = NL + "\t\tprimaryShape = ";
190
  protected final String TEXT_169 = "());" + NL + "\t\t";
191
  protected final String TEXT_170 = ";";
191
  protected final String TEXT_170 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t";
192
  protected final String TEXT_171 = NL + "\t\t";
192
  protected final String TEXT_171 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tinvisibleRectangle.add(decorationShape);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
193
  protected final String TEXT_172 = " figure = new ";
193
  protected final String TEXT_172 = " createNodeShape() {";
194
  protected final String TEXT_173 = "();";
194
  protected final String TEXT_173 = NL + "\t\tprimaryShape = new ";
195
  protected final String TEXT_174 = NL + " \t\tfigure.setUseLocalCoordinates(true);";
195
  protected final String TEXT_174 = "()";
196
  protected final String TEXT_175 = NL + " \t\tprimaryShape = figure;";
196
  protected final String TEXT_175 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}";
197
  protected final String TEXT_176 = NL + "\t\treturn primaryShape;" + NL + "\t}";
197
  protected final String TEXT_176 = ";";
198
  protected final String TEXT_177 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
198
  protected final String TEXT_177 = NL + "\t\tprimaryShape = ";
199
  protected final String TEXT_178 = " getPrimaryShape() {" + NL + "\t\treturn (";
199
  protected final String TEXT_178 = ";";
200
  protected final String TEXT_179 = ") primaryShape;" + NL + "\t}";
200
  protected final String TEXT_179 = NL + "\t\t";
201
  protected final String TEXT_180 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
201
  protected final String TEXT_180 = " figure = new ";
202
  protected final String TEXT_181 = " createDecorationPane() {" + NL + "\t\t";
202
  protected final String TEXT_181 = "();";
203
  protected final String TEXT_182 = " view = (";
203
  protected final String TEXT_182 = NL + " \t\tfigure.setUseLocalCoordinates(true);";
204
  protected final String TEXT_183 = ") getModel();" + NL + "\t\t";
204
  protected final String TEXT_183 = NL + " \t\tprimaryShape = figure;";
205
  protected final String TEXT_184 = " annotation = view.getEAnnotation(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t";
205
  protected final String TEXT_184 = NL + "\t\treturn primaryShape;" + NL + "\t}";
206
  protected final String TEXT_185 = " decorationPane = new ";
206
  protected final String TEXT_185 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
207
  protected final String TEXT_186 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new ";
207
  protected final String TEXT_186 = " getPrimaryShape() {" + NL + "\t\treturn (";
208
  protected final String TEXT_187 = "());" + NL + "" + NL + "\t\t";
208
  protected final String TEXT_187 = ") primaryShape;" + NL + "\t}";
209
  protected final String TEXT_188 = " imageFigure = new ";
209
  protected final String TEXT_188 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
210
  protected final String TEXT_189 = "(";
210
  protected final String TEXT_189 = " createDecorationPane() {" + NL + "\t\t";
211
  protected final String TEXT_190 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), ";
211
  protected final String TEXT_190 = " view = (";
212
  protected final String TEXT_191 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, ";
212
  protected final String TEXT_191 = ") getModel();" + NL + "\t\t";
213
  protected final String TEXT_192 = ".BOTTOM);" + NL + " \t\treturn decorationPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Default implementation treats passed figure as content pane." + NL + "\t * Respects layout one may have set for generated figure." + NL + "\t * @param nodeShape instance of generated figure class" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
213
  protected final String TEXT_192 = " annotation = view.getEAnnotation(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t";
214
  protected final String TEXT_193 = " setupContentPane(";
214
  protected final String TEXT_193 = " decorationPane = new ";
215
  protected final String TEXT_194 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {";
215
  protected final String TEXT_194 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new ";
216
  protected final String TEXT_195 = NL + "\t\t\t";
216
  protected final String TEXT_195 = "());" + NL + "" + NL + "\t\t";
217
  protected final String TEXT_196 = " layout = new ";
217
  protected final String TEXT_196 = " imageFigure = new ";
218
  protected final String TEXT_197 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);";
218
  protected final String TEXT_197 = "(";
219
  protected final String TEXT_198 = NL + "\t\tnodeShape.setLayoutManager(new ";
219
  protected final String TEXT_198 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), ";
220
  protected final String TEXT_199 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(";
220
  protected final String TEXT_199 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, ";
221
  protected final String TEXT_200 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new ";
221
  protected final String TEXT_200 = ".BOTTOM);" + NL + " \t\treturn decorationPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Default implementation treats passed figure as content pane." + NL + "\t * Respects layout one may have set for generated figure." + NL + "\t * @param nodeShape instance of generated figure class" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
222
  protected final String TEXT_201 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});";
222
  protected final String TEXT_201 = " setupContentPane(";
223
  protected final String TEXT_202 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
223
  protected final String TEXT_202 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {";
224
  protected final String TEXT_203 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
224
  protected final String TEXT_203 = NL + "\t\t\t";
225
  protected final String TEXT_204 = " getDiagramNode() {" + NL + "\t\treturn (";
225
  protected final String TEXT_204 = " layout = new ";
226
  protected final String TEXT_205 = ") getModel();" + NL + "\t}" + NL;
226
  protected final String TEXT_205 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);";
227
  protected final String TEXT_206 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild(";
227
  protected final String TEXT_206 = NL + "\t\tnodeShape.setLayoutManager(new ";
228
  protected final String TEXT_207 = " childEditPart) {";
228
  protected final String TEXT_207 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(";
229
  protected final String TEXT_208 = NL + "\t\tif (childEditPart instanceof ";
229
  protected final String TEXT_208 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new ";
230
  protected final String TEXT_209 = ") {" + NL + "\t\t\t((";
230
  protected final String TEXT_209 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});";
231
  protected final String TEXT_210 = ") childEditPart).";
231
  protected final String TEXT_210 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
232
  protected final String TEXT_211 = "(getPrimaryShape().";
232
  protected final String TEXT_211 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
233
  protected final String TEXT_212 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}";
233
  protected final String TEXT_212 = " getDiagramNode() {" + NL + "\t\treturn (";
234
  protected final String TEXT_213 = NL + "\t\tif (childEditPart instanceof ";
234
  protected final String TEXT_213 = ") getModel();" + NL + "\t}" + NL;
235
  protected final String TEXT_214 = ") {" + NL + "\t\t\t";
235
  protected final String TEXT_214 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild(";
236
  protected final String TEXT_215 = " pane = getPrimaryShape().";
236
  protected final String TEXT_215 = " childEditPart) {";
237
  protected final String TEXT_216 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add(((";
237
  protected final String TEXT_216 = NL + "\t\tif (childEditPart instanceof ";
238
  protected final String TEXT_217 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
238
  protected final String TEXT_217 = ") {" + NL + "\t\t\t((";
239
  protected final String TEXT_218 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {";
239
  protected final String TEXT_218 = ") childEditPart).";
240
  protected final String TEXT_219 = "\t\t" + NL + "\t\tif (childEditPart instanceof ";
240
  protected final String TEXT_219 = "(getPrimaryShape().";
241
  protected final String TEXT_220 = ") {" + NL + "\t\t\t";
241
  protected final String TEXT_220 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}";
242
  protected final String TEXT_221 = " pane = getPrimaryShape().";
242
  protected final String TEXT_221 = NL + "\t\tif (childEditPart instanceof ";
243
  protected final String TEXT_222 = "();" + NL + "\t\t\tpane.remove(((";
243
  protected final String TEXT_222 = ") {" + NL + "\t\t\t";
244
  protected final String TEXT_223 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
244
  protected final String TEXT_223 = " pane = getPrimaryShape().";
245
  protected final String TEXT_224 = NL + "\t\treturn false;" + NL + "\t}";
245
  protected final String TEXT_224 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add(((";
246
  protected final String TEXT_225 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
246
  protected final String TEXT_225 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
247
  protected final String TEXT_226 = " getPrimaryLabelEditPart() {";
247
  protected final String TEXT_226 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {";
248
  protected final String TEXT_227 = NL + "\t\tfor(";
248
  protected final String TEXT_227 = "\t\t" + NL + "\t\tif (childEditPart instanceof ";
249
  protected final String TEXT_228 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
249
  protected final String TEXT_228 = ") {" + NL + "\t\t\t";
250
  protected final String TEXT_229 = " nextChild = (";
250
  protected final String TEXT_229 = " pane = getPrimaryShape().";
251
  protected final String TEXT_230 = ")it.next();" + NL + "\t\t\tif (";
251
  protected final String TEXT_230 = "();" + NL + "\t\t\tpane.remove(((";
252
  protected final String TEXT_231 = ".getVisualID(nextChild) == ";
252
  protected final String TEXT_231 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
253
  protected final String TEXT_232 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (";
253
  protected final String TEXT_232 = NL + "\t\treturn false;" + NL + "\t}";
254
  protected final String TEXT_233 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}";
254
  protected final String TEXT_233 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
255
  protected final String TEXT_234 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
255
  protected final String TEXT_234 = " getPrimaryLabelEditPart() {";
256
  protected final String TEXT_235 = " req) {" + NL + "\t\tif (";
256
  protected final String TEXT_235 = NL + "\t\tfor(";
257
  protected final String TEXT_236 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
257
  protected final String TEXT_236 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
258
  protected final String TEXT_237 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
258
  protected final String TEXT_237 = " nextChild = (";
259
  protected final String TEXT_238 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
259
  protected final String TEXT_238 = ")it.next();" + NL + "\t\t\tif (";
260
  protected final String TEXT_239 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
260
  protected final String TEXT_239 = ".getVisualID(nextChild) == ";
261
  protected final String TEXT_240 = " getLabelEditPart(";
261
  protected final String TEXT_240 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (";
262
  protected final String TEXT_241 = " req) {" + NL + "\t\t";
262
  protected final String TEXT_241 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}";
263
  protected final String TEXT_242 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
263
  protected final String TEXT_242 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
264
  protected final String TEXT_243 = " view = (";
264
  protected final String TEXT_243 = " req) {" + NL + "\t\tif (";
265
  protected final String TEXT_244 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
265
  protected final String TEXT_244 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
266
  protected final String TEXT_245 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
266
  protected final String TEXT_245 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
267
  protected final String TEXT_246 = NL + "\t\t\t\tcase ";
267
  protected final String TEXT_246 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
268
  protected final String TEXT_247 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
268
  protected final String TEXT_247 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
269
  protected final String TEXT_248 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
269
  protected final String TEXT_248 = " getLabelEditPart(";
270
  protected final String TEXT_249 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel(";
270
  protected final String TEXT_249 = " req) {" + NL + "\t\t";
271
  protected final String TEXT_250 = " childEditPart) {";
271
  protected final String TEXT_250 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
272
  protected final String TEXT_251 = NL + "\t\tif (childEditPart instanceof ";
272
  protected final String TEXT_251 = " view = (";
273
  protected final String TEXT_252 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
273
  protected final String TEXT_252 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
274
  protected final String TEXT_253 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
274
  protected final String TEXT_253 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
275
  protected final String TEXT_254 = " getExternalLabelsContainer() {" + NL + "\t\t";
275
  protected final String TEXT_254 = NL + "\t\t\t\tcase ";
276
  protected final String TEXT_255 = " root = (";
276
  protected final String TEXT_255 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
277
  protected final String TEXT_256 = ") getRoot();" + NL + "\t\treturn root.getLayer(";
277
  protected final String TEXT_256 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
278
  protected final String TEXT_257 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL;
278
  protected final String TEXT_257 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel(";
279
  protected final String TEXT_258 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
279
  protected final String TEXT_258 = " childEditPart) {";
280
  protected final String TEXT_259 = " childEditPart, int index) {";
280
  protected final String TEXT_259 = NL + "\t\tif (childEditPart instanceof ";
281
  protected final String TEXT_260 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
281
  protected final String TEXT_260 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
282
  protected final String TEXT_261 = " labelFigure = ((";
282
  protected final String TEXT_261 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
283
  protected final String TEXT_262 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
283
  protected final String TEXT_262 = " getExternalLabelsContainer() {" + NL + "\t\t";
284
  protected final String TEXT_263 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}";
284
  protected final String TEXT_263 = " root = (";
285
  protected final String TEXT_264 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual(";
285
  protected final String TEXT_264 = ") getRoot();" + NL + "\t\treturn root.getLayer(";
286
  protected final String TEXT_265 = " childEditPart) {";
286
  protected final String TEXT_265 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL;
287
  protected final String TEXT_266 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
287
  protected final String TEXT_266 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
288
  protected final String TEXT_267 = " labelFigure = ((";
288
  protected final String TEXT_267 = " childEditPart, int index) {";
289
  protected final String TEXT_268 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
289
  protected final String TEXT_268 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
290
  protected final String TEXT_269 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}";
290
  protected final String TEXT_269 = " labelFigure = ((";
291
  protected final String TEXT_270 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}";
291
  protected final String TEXT_270 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
292
  protected final String TEXT_271 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor (";
292
  protected final String TEXT_271 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}";
293
  protected final String TEXT_272 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t";
293
  protected final String TEXT_272 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual(";
294
  protected final String TEXT_273 = " childEditPart = (";
294
  protected final String TEXT_273 = " childEditPart) {";
295
  protected final String TEXT_274 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = ((";
295
  protected final String TEXT_274 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
296
  protected final String TEXT_275 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}";
296
  protected final String TEXT_275 = " labelFigure = ((";
297
  protected final String TEXT_276 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t\trefreshBackgroundColor();" + NL + "\t\trefreshForegroundColor();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\t";
297
  protected final String TEXT_276 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
298
  protected final String TEXT_277 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
298
  protected final String TEXT_277 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}";
299
  protected final String TEXT_278 = ";" + NL + "\t\t";
299
  protected final String TEXT_278 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}";
300
  protected final String TEXT_279 = " bounds = (";
300
  protected final String TEXT_279 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor (";
301
  protected final String TEXT_280 = ") node.getLayoutConstraint();" + NL + "\t\t((";
301
  protected final String TEXT_280 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t";
302
  protected final String TEXT_281 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew ";
302
  protected final String TEXT_281 = " childEditPart = (";
303
  protected final String TEXT_282 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
303
  protected final String TEXT_282 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = ((";
304
  protected final String TEXT_283 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
304
  protected final String TEXT_283 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}";
305
  protected final String TEXT_284 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
305
  protected final String TEXT_284 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t\trefreshBackgroundColor();" + NL + "\t\trefreshForegroundColor();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\t";
306
  protected final String TEXT_285 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
306
  protected final String TEXT_285 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
307
  protected final String TEXT_286 = " getSourceConnectionAnchor(";
307
  protected final String TEXT_286 = ";" + NL + "\t\t";
308
  protected final String TEXT_287 = " connection) {" + NL + "\t\treturn new ";
308
  protected final String TEXT_287 = " bounds = (";
309
  protected final String TEXT_288 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
309
  protected final String TEXT_288 = ") node.getLayoutConstraint();" + NL + "\t\t((";
310
  protected final String TEXT_289 = " getSourceConnectionAnchor(";
310
  protected final String TEXT_289 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew ";
311
  protected final String TEXT_290 = " request) {" + NL + "\t\treturn new ";
311
  protected final String TEXT_290 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
312
  protected final String TEXT_291 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
312
  protected final String TEXT_291 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
313
  protected final String TEXT_292 = "  getTargetConnectionAnchor(";
313
  protected final String TEXT_292 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
314
  protected final String TEXT_293 = " connection) {" + NL + "\t\treturn new ";
314
  protected final String TEXT_293 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
315
  protected final String TEXT_294 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
315
  protected final String TEXT_294 = " getSourceConnectionAnchor(";
316
  protected final String TEXT_295 = "  getTargetConnectionAnchor(";
316
  protected final String TEXT_295 = " connection) {" + NL + "\t\treturn new ";
317
  protected final String TEXT_296 = " request) {" + NL + "\t\treturn new ";
317
  protected final String TEXT_296 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
318
  protected final String TEXT_297 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
318
  protected final String TEXT_297 = " getSourceConnectionAnchor(";
319
  protected final String TEXT_298 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
319
  protected final String TEXT_298 = " request) {" + NL + "\t\treturn new ";
320
  protected final String TEXT_299 = NL;
320
  protected final String TEXT_299 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
321
  protected final String TEXT_300 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
321
  protected final String TEXT_300 = "  getTargetConnectionAnchor(";
322
  protected final String TEXT_301 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
322
  protected final String TEXT_301 = " connection) {" + NL + "\t\treturn new ";
323
  protected final String TEXT_302 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
323
  protected final String TEXT_302 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
324
  protected final String TEXT_303 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
324
  protected final String TEXT_303 = "  getTargetConnectionAnchor(";
325
  protected final String TEXT_304 = NL;
325
  protected final String TEXT_304 = " request) {" + NL + "\t\treturn new ";
326
  protected final String TEXT_305 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
326
  protected final String TEXT_305 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
327
  protected final String TEXT_306 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
327
  protected final String TEXT_306 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);";
328
  protected final String TEXT_307 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
328
  protected final String TEXT_307 = NL + "\t\tinstallLinkNotationModelRefresher();";
329
  protected final String TEXT_308 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL;
329
  protected final String TEXT_308 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {";
330
  protected final String TEXT_309 = NL;
330
  protected final String TEXT_309 = NL + "\t\tuninstallLinkNotationModelRefresher();";
331
  protected final String TEXT_310 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
331
  protected final String TEXT_310 = NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}";
332
  protected final String TEXT_311 = NL + "\t\t";
332
  protected final String TEXT_311 = NL;
333
  protected final String TEXT_312 = " style =" + NL + "\t\t\t(";
333
  protected final String TEXT_312 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
334
  protected final String TEXT_313 = ") ";
334
  protected final String TEXT_313 = " domainModelEditDomain = ";
335
  protected final String TEXT_314 = ".getStyle(" + NL + "\t\t\t\t";
335
  protected final String TEXT_314 = ".getEditingDomain(";
336
  protected final String TEXT_315 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
336
  protected final String TEXT_315 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends ";
337
  protected final String TEXT_316 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = ";
337
  protected final String TEXT_316 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
338
  protected final String TEXT_317 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
338
  protected final String TEXT_317 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
339
  protected final String TEXT_318 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
339
  protected final String TEXT_318 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}";
340
  protected final String TEXT_319 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
340
  protected final String TEXT_319 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in ";
341
  protected final String TEXT_320 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
341
  protected final String TEXT_320 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
342
  protected final String TEXT_321 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new ";
342
  protected final String TEXT_321 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn ";
343
  protected final String TEXT_322 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
343
  protected final String TEXT_322 = ".NOT_TOUCH;" + NL + "\t\t}";
344
  protected final String TEXT_323 = "\t" + NL + "\t}";
344
  protected final String TEXT_323 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
345
  protected final String TEXT_324 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
345
  protected final String TEXT_324 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn ";
346
  protected final String TEXT_325 = " createdFont;";
346
  protected final String TEXT_325 = ".createEventTypeFilter(";
347
  protected final String TEXT_326 = "\t" + NL;
347
  protected final String TEXT_326 = ".SET).or(" + NL + "\t\t\t\t";
348
  protected final String TEXT_327 = NL;
348
  protected final String TEXT_327 = ".createEventTypeFilter(";
349
  protected final String TEXT_328 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t";
349
  protected final String TEXT_328 = ".UNSET).or(" + NL + "\t\t\t\t";
350
  protected final String TEXT_329 = " style = (";
350
  protected final String TEXT_329 = ".createEventTypeFilter(";
351
  protected final String TEXT_330 = ")  ";
351
  protected final String TEXT_330 = ".REMOVE).or(" + NL + "\t\t\t\t";
352
  protected final String TEXT_331 = ".getStyle(";
352
  protected final String TEXT_331 = ".createEventTypeFilter(";
353
  protected final String TEXT_332 = ".eINSTANCE.getLineStyle());" + NL + "\t\t";
353
  protected final String TEXT_332 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}";
354
  protected final String TEXT_333 = " toDispose = createdForegroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint foregroundColor = style.getLineColor();" + NL + "\t\t\tint red = foregroundColor & 0x000000FF;" + NL + "\t\t\tint green = (foregroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (foregroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
354
  protected final String TEXT_333 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {";
355
  protected final String TEXT_334 = " currentColor = getFigure().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedForegroundColor = new ";
355
  protected final String TEXT_334 = NL;
356
  protected final String TEXT_335 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdForegroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedForegroundColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshForegroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
356
  protected final String TEXT_335 = NL + "\t\t\tfilter = ";
357
  protected final String TEXT_336 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t";
357
  protected final String TEXT_336 = ".createFeatureFilter(";
358
  protected final String TEXT_337 = " style = (";
358
  protected final String TEXT_337 = ".eINSTANCE.get";
359
  protected final String TEXT_338 = ")  ";
359
  protected final String TEXT_338 = "());";
360
  protected final String TEXT_339 = ".getStyle(";
360
  protected final String TEXT_339 = NL + "\t\t\tfilter = filter.or(";
361
  protected final String TEXT_340 = ".eINSTANCE.getFillStyle());" + NL + "\t\t";
361
  protected final String TEXT_340 = ".createFeatureFilter(";
362
  protected final String TEXT_341 = " toDispose = createdBackgroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint backgroundColor = style.getFillColor();" + NL + "\t\t\tint red = backgroundColor & 0x000000FF;" + NL + "\t\t\tint green = (backgroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (backgroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
362
  protected final String TEXT_341 = ".eINSTANCE.get";
363
  protected final String TEXT_342 = " currentColor = getFigure().getBackgroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedBackgroundColor = new ";
363
  protected final String TEXT_342 = "()));";
364
  protected final String TEXT_343 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setBackgroundColor(createdBackgroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setBackgroundColor(getViewer().getControl().getBackground());" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshBackgroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
364
  protected final String TEXT_343 = NL;
365
  protected final String TEXT_344 = " createdBackgroundColor;" + NL;
365
  protected final String TEXT_344 = NL + "\t\t\tfilter = ";
366
  protected final String TEXT_345 = NL;
366
  protected final String TEXT_345 = ".createFeatureFilter(";
367
  protected final String TEXT_346 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
367
  protected final String TEXT_346 = ".eINSTANCE.get";
368
  protected final String TEXT_347 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
368
  protected final String TEXT_347 = "());";
369
  protected final String TEXT_348 = " feature, ";
369
  protected final String TEXT_348 = NL + "\t\t\tfilter = filter.or(";
370
  protected final String TEXT_349 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new ";
370
  protected final String TEXT_349 = ".createFeatureFilter(";
371
  protected final String TEXT_350 = "();";
371
  protected final String TEXT_350 = ".eINSTANCE.get";
372
  protected final String TEXT_351 = NL;
372
  protected final String TEXT_351 = "()));";
373
  protected final String TEXT_352 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
373
  protected final String TEXT_352 = NL;
374
  protected final String TEXT_353 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
374
  protected final String TEXT_353 = NL + "\t\t\tfilter = ";
375
  protected final String TEXT_354 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
375
  protected final String TEXT_354 = ".createFeatureFilter(";
376
  protected final String TEXT_355 = NL;
376
  protected final String TEXT_355 = ".eINSTANCE.get";
377
  protected final String TEXT_356 = "\t\tRefresher boundsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBounds();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
377
  protected final String TEXT_356 = "());";
378
  protected final String TEXT_357 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
378
  protected final String TEXT_357 = NL + "\t\t\tfilter = filter.or(";
379
  protected final String TEXT_358 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
379
  protected final String TEXT_358 = ".createFeatureFilter(";
380
  protected final String TEXT_359 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
380
  protected final String TEXT_359 = ".eINSTANCE.get";
381
  protected final String TEXT_360 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
381
  protected final String TEXT_360 = "()));";
382
  protected final String TEXT_361 = ".eINSTANCE.getLocation_Y(), boundsRefresher);";
382
  protected final String TEXT_361 = NL;
383
  protected final String TEXT_362 = NL;
383
  protected final String TEXT_362 = NL + "\t\t\tfilter = ";
384
  protected final String TEXT_363 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
384
  protected final String TEXT_363 = ".createFeatureFilter(";
385
  protected final String TEXT_364 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
385
  protected final String TEXT_364 = ".eINSTANCE.get";
386
  protected final String TEXT_365 = NL;
386
  protected final String TEXT_365 = "());";
387
  protected final String TEXT_366 = "\t\tRefresher sourceEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshSourceConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
387
  protected final String TEXT_366 = NL + "\t\t\tfilter = filter.or(";
388
  protected final String TEXT_367 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);";
388
  protected final String TEXT_367 = ".createFeatureFilter(";
389
  protected final String TEXT_368 = NL;
389
  protected final String TEXT_368 = ".eINSTANCE.get";
390
  protected final String TEXT_369 = "\t\tRefresher targetEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshTargetConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
390
  protected final String TEXT_369 = "()));";
391
  protected final String TEXT_370 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);";
391
  protected final String TEXT_370 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);";
392
  protected final String TEXT_371 = NL;
392
  protected final String TEXT_371 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();";
393
  protected final String TEXT_372 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
393
  protected final String TEXT_372 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());";
394
  protected final String TEXT_373 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
394
  protected final String TEXT_373 = NL + "\t\t\tfilter = createUncontainedLinksFilter();";
395
  protected final String TEXT_374 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
395
  protected final String TEXT_374 = NL + "\t\t\tfilter = ";
396
  protected final String TEXT_375 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
396
  protected final String TEXT_375 = ".ANY.negated();";
397
  protected final String TEXT_376 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
397
  protected final String TEXT_376 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install(";
398
  protected final String TEXT_377 = NL;
398
  protected final String TEXT_377 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
399
  protected final String TEXT_378 = "\t\tRefresher backgroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBackgroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
399
  protected final String TEXT_378 = " transactionAboutToCommit(";
400
  protected final String TEXT_379 = ".eINSTANCE.getFillStyle_FillColor(), backgroundColorRefresher);" + NL + "\t\tRefresher foregroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshForegroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
400
  protected final String TEXT_379 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
401
  protected final String TEXT_380 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL;
401
  protected final String TEXT_380 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t";
402
  protected final String TEXT_381 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect";
402
  protected final String TEXT_381 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
403
  protected final String TEXT_382 = "SourceCommand extends ";
403
  protected final String TEXT_382 = " domainModelEditDomain = ";
404
  protected final String TEXT_383 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
404
  protected final String TEXT_383 = ".getEditingDomain(";
405
  protected final String TEXT_384 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
405
  protected final String TEXT_384 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL;
406
  protected final String TEXT_385 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
406
  protected final String TEXT_385 = NL;
407
  protected final String TEXT_386 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
407
  protected final String TEXT_386 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
408
  protected final String TEXT_387 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
408
  protected final String TEXT_387 = " mySource;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
409
  protected final String TEXT_388 = "SourceCommand(";
409
  protected final String TEXT_388 = " myDestination;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate ";
410
  protected final String TEXT_389 = " request) {" + NL + "\t\t\tthis((";
410
  protected final String TEXT_389 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected LinkDescriptor(";
411
  protected final String TEXT_390 = ")request.getConnectionEditPart().getModel(), (";
411
  protected final String TEXT_390 = " source, ";
412
  protected final String TEXT_391 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
412
  protected final String TEXT_391 = " destination, ";
413
  protected final String TEXT_392 = "SourceCommand(";
413
  protected final String TEXT_392 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprivate LinkDescriptor(";
414
  protected final String TEXT_393 = " edge, ";
414
  protected final String TEXT_393 = " source, ";
415
  protected final String TEXT_394 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {";
415
  protected final String TEXT_394 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
416
  protected final String TEXT_395 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal ";
416
  protected final String TEXT_395 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
417
  protected final String TEXT_396 = " domainModelEditDomain = ";
417
  protected final String TEXT_396 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected ";
418
  protected final String TEXT_397 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t";
418
  protected final String TEXT_397 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "   \t * @generated" + NL + "     */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
419
  protected final String TEXT_398 = " command = new ";
419
  protected final String TEXT_398 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t";
420
  protected final String TEXT_399 = "() {" + NL + "\t\t\t\tprivate ";
420
  protected final String TEXT_399 = "/*<LinkDescriptor>*/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t";
421
  protected final String TEXT_400 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();";
421
  protected final String TEXT_400 = "/*<Edge>*/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal ";
422
  protected final String TEXT_401 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;";
422
  protected final String TEXT_401 = " semanticToNotationalTypeBasedLinks = new ";
423
  protected final String TEXT_402 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {";
423
  protected final String TEXT_402 = "();" + NL + "\t\tfinal ";
424
  protected final String TEXT_403 = NL + "\t\t\treturn false;";
424
  protected final String TEXT_403 = "/*<EObject, List<Edge>>*/ semanticToNotationalFeatureBasedLinks = new ";
425
  protected final String TEXT_404 = NL + "\t\t\t";
425
  protected final String TEXT_404 = "();" + NL + "\t\tfor(";
426
  protected final String TEXT_405 = " container = (";
426
  protected final String TEXT_405 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
427
  protected final String TEXT_406 = ")getRelationshipContainer(newSource.getElement(), ";
427
  protected final String TEXT_406 = " next = (";
428
  protected final String TEXT_407 = ".eINSTANCE.get";
428
  protected final String TEXT_407 = ") it.next();" + NL + "\t\t\t";
429
  protected final String TEXT_408 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
429
  protected final String TEXT_408 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t";
430
  protected final String TEXT_409 = NL;
430
  protected final String TEXT_409 = " featureBasedLinksForSource = (";
431
  protected final String TEXT_410 = NL + "\t\tif (";
431
  protected final String TEXT_410 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new ";
432
  protected final String TEXT_411 = ".";
432
  protected final String TEXT_411 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
433
  protected final String TEXT_412 = "() != null) {" + NL + "\t\t\t";
433
  protected final String TEXT_412 = " parentView = ";
434
  protected final String TEXT_413 = NL + "\t\t}";
434
  protected final String TEXT_413 = ";" + NL + "\t\t";
435
  protected final String TEXT_414 = NL + "\t\tif (";
435
  protected final String TEXT_414 = " command = new ";
436
  protected final String TEXT_415 = ".";
436
  protected final String TEXT_415 = "();" + NL + "\t\tfor(";
437
  protected final String TEXT_416 = "().size() >= ";
437
  protected final String TEXT_416 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t";
438
  protected final String TEXT_417 = ".eINSTANCE.get";
438
  protected final String TEXT_417 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t";
439
  protected final String TEXT_418 = ".getUpperBound()) {" + NL + "\t\t\t";
439
  protected final String TEXT_418 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = (";
440
  protected final String TEXT_419 = NL + "\t\t}";
440
  protected final String TEXT_419 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t";
441
  protected final String TEXT_420 = NL;
441
  protected final String TEXT_420 = " featureBasedLinksForSource = (";
442
  protected final String TEXT_421 = NL + "\t\tif (";
442
  protected final String TEXT_421 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = (";
443
  protected final String TEXT_422 = ".";
443
  protected final String TEXT_422 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != ";
444
  protected final String TEXT_423 = "() != null) {" + NL + "\t\t\t";
444
  protected final String TEXT_423 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t";
445
  protected final String TEXT_424 = NL + "\t\t}";
445
  protected final String TEXT_424 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
446
  protected final String TEXT_425 = NL + "\t\tif (";
446
  protected final String TEXT_425 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
447
  protected final String TEXT_426 = ".";
447
  protected final String TEXT_426 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
448
  protected final String TEXT_427 = "().size() >= ";
448
  protected final String TEXT_427 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t";
449
  protected final String TEXT_428 = ".eINSTANCE.get";
449
  protected final String TEXT_428 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
450
  protected final String TEXT_429 = ".getUpperBound()) {" + NL + "\t\t\t";
450
  protected final String TEXT_429 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
451
  protected final String TEXT_430 = NL + "\t\t}";
451
  protected final String TEXT_430 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new ";
452
  protected final String TEXT_431 = NL;
452
  protected final String TEXT_431 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor(";
453
  protected final String TEXT_432 = NL + "\t\t\tif(!";
453
  protected final String TEXT_432 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
454
  protected final String TEXT_433 = ".canCreateLink(";
454
  protected final String TEXT_433 = " obsoleteView = (";
455
  protected final String TEXT_434 = ", ";
455
  protected final String TEXT_434 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new ";
456
  protected final String TEXT_435 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
456
  protected final String TEXT_435 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor(";
457
  protected final String TEXT_436 = NL + "\t\t\treturn true;";
457
  protected final String TEXT_436 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
458
  protected final String TEXT_437 = NL;
458
  protected final String TEXT_437 = " obsoleteViews = (";
459
  protected final String TEXT_438 = NL + "\t\tif (";
459
  protected final String TEXT_438 = ") it.next();" + NL + "\t\t\tfor(";
460
  protected final String TEXT_439 = ".";
460
  protected final String TEXT_439 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t";
461
  protected final String TEXT_440 = "() != null) {" + NL + "\t\t\t";
461
  protected final String TEXT_440 = " obsoleteView = (";
462
  protected final String TEXT_441 = NL + "\t\t}";
462
  protected final String TEXT_441 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new ";
463
  protected final String TEXT_442 = NL + "\t\tif (";
463
  protected final String TEXT_442 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
464
  protected final String TEXT_443 = ".";
464
  protected final String TEXT_443 = " findView(";
465
  protected final String TEXT_444 = "().size() >= ";
465
  protected final String TEXT_444 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t";
466
  protected final String TEXT_445 = ".eINSTANCE.get";
466
  protected final String TEXT_445 = " editPart = (";
467
  protected final String TEXT_446 = ".getUpperBound()) {" + NL + "\t\t\t";
467
  protected final String TEXT_446 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof ";
468
  protected final String TEXT_447 = NL + "\t\t}";
468
  protected final String TEXT_447 = ") {" + NL + "\t\t\treturn (";
469
  protected final String TEXT_448 = NL;
469
  protected final String TEXT_448 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t";
470
  protected final String TEXT_449 = NL + "\t\t\tif(!";
470
  protected final String TEXT_449 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t";
471
  protected final String TEXT_450 = ".canCreateLink(";
471
  protected final String TEXT_450 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
472
  protected final String TEXT_451 = ", ";
472
  protected final String TEXT_451 = " findNode(";
473
  protected final String TEXT_452 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
473
  protected final String TEXT_452 = " parentView, ";
474
  protected final String TEXT_453 = NL + "\t\t\treturn true;";
474
  protected final String TEXT_453 = " modelElement) {" + NL + "\t\tfor(";
475
  protected final String TEXT_454 = NL + "\t\t\treturn false;";
475
  protected final String TEXT_454 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
476
  protected final String TEXT_455 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
476
  protected final String TEXT_455 = " next = (";
477
  protected final String TEXT_456 = " createReconnectCommand() {" + NL + "\t\t\t";
477
  protected final String TEXT_456 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t";
478
  protected final String TEXT_457 = " editingDomain = ";
478
  protected final String TEXT_457 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
479
  protected final String TEXT_458 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t";
479
  protected final String TEXT_458 = " findEdge(";
480
  protected final String TEXT_459 = " result = new ";
480
  protected final String TEXT_459 = " modelElement) {" + NL + "\t\tfor(";
481
  protected final String TEXT_460 = "();" + NL + "\t\t\tresult.append(new ";
481
  protected final String TEXT_460 = " it = ";
482
  protected final String TEXT_461 = "(edge, newSource));";
482
  protected final String TEXT_461 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
483
  protected final String TEXT_462 = NL + "\t\t\t";
483
  protected final String TEXT_462 = " next = (";
484
  protected final String TEXT_463 = " container = getRelationshipContainer(newSource.getElement(), ";
484
  protected final String TEXT_463 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
485
  protected final String TEXT_464 = ".eINSTANCE.get";
485
  protected final String TEXT_464 = " getCreateNotationalEdgeCommand(";
486
  protected final String TEXT_465 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn ";
486
  protected final String TEXT_465 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t";
487
  protected final String TEXT_466 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t";
487
  protected final String TEXT_466 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t";
488
  protected final String TEXT_467 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn ";
488
  protected final String TEXT_467 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t";
489
  protected final String TEXT_468 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {";
489
  protected final String TEXT_468 = " createdEdge = ";
490
  protected final String TEXT_469 = NL + "\t\t\t\tresult.append(";
490
  protected final String TEXT_469 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {";
491
  protected final String TEXT_470 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));";
491
  protected final String TEXT_470 = NL + "\t\tcase ";
492
  protected final String TEXT_471 = NL + "\t\t\t\tresult.append(";
492
  protected final String TEXT_471 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof ";
493
  protected final String TEXT_472 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), ";
493
  protected final String TEXT_472 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t";
494
  protected final String TEXT_473 = ".UNSET_VALUE));";
494
  protected final String TEXT_473 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;";
495
  protected final String TEXT_474 = NL + "\t\t\t\tresult.append(";
495
  protected final String TEXT_474 = NL + "\t\tcase ";
496
  protected final String TEXT_475 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, ";
496
  protected final String TEXT_475 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t";
497
  protected final String TEXT_476 = ".eINSTANCE.get";
497
  protected final String TEXT_476 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;";
498
  protected final String TEXT_477 = "(), edge.getElement()));";
498
  protected final String TEXT_477 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new ";
499
  protected final String TEXT_478 = NL + "\t\t\t\tresult.append(";
499
  protected final String TEXT_478 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
500
  protected final String TEXT_479 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), ";
500
  protected final String TEXT_479 = " getSemanticChildLinks() {";
501
  protected final String TEXT_480 = ".eINSTANCE.get";
501
  protected final String TEXT_480 = NL;
502
  protected final String TEXT_481 = "()," + NL + "\t\t\t\t\tedge.getElement()));";
502
  protected final String TEXT_481 = "\t";
503
  protected final String TEXT_482 = NL + "\t\t\t\tresult.append(";
503
  protected final String TEXT_482 = " result = new ";
504
  protected final String TEXT_483 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), ";
504
  protected final String TEXT_483 = "();";
505
  protected final String TEXT_484 = ".eINSTANCE.get";
505
  protected final String TEXT_484 = NL + "\t";
506
  protected final String TEXT_485 = "()," + NL + "\t\t\t\t\t";
506
  protected final String TEXT_485 = " modelObject = ";
507
  protected final String TEXT_486 = ".UNSET_VALUE));";
507
  protected final String TEXT_486 = ";" + NL + "\t";
508
  protected final String TEXT_487 = NL + "\t\t\t\tresult.append(";
508
  protected final String TEXT_487 = " nextValue;";
509
  protected final String TEXT_488 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, ";
509
  protected final String TEXT_488 = NL + "\tint linkVID;";
510
  protected final String TEXT_489 = ".eINSTANCE.get";
510
  protected final String TEXT_489 = NL + "\tfor(";
511
  protected final String TEXT_490 = "(), edge.getElement()));";
511
  protected final String TEXT_490 = " it = ((";
512
  protected final String TEXT_491 = NL + "\t\t\t}";
512
  protected final String TEXT_491 = ")modelObject).";
513
  protected final String TEXT_492 = NL + "\t\t\tresult.append(";
513
  protected final String TEXT_492 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
514
  protected final String TEXT_493 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
514
  protected final String TEXT_493 = ") it.next();";
515
  protected final String TEXT_494 = ".eINSTANCE.get";
515
  protected final String TEXT_494 = NL + "\tnextValue = ((";
516
  protected final String TEXT_495 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append(";
516
  protected final String TEXT_495 = ")modelObject).";
517
  protected final String TEXT_496 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
517
  protected final String TEXT_496 = "();";
518
  protected final String TEXT_497 = ".eINSTANCE.get";
518
  protected final String TEXT_497 = NL + "\tlinkVID = ";
519
  protected final String TEXT_498 = "()," + NL + "\t\t\t\tnewSource.getElement()));";
519
  protected final String TEXT_498 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
520
  protected final String TEXT_499 = NL + "\t\t\tresult.append(";
520
  protected final String TEXT_499 = NL + "\tswitch (linkVID) {";
521
  protected final String TEXT_500 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
521
  protected final String TEXT_500 = NL + "\tcase ";
522
  protected final String TEXT_501 = ".eINSTANCE.get";
522
  protected final String TEXT_501 = ".VISUAL_ID: {";
523
  protected final String TEXT_502 = "()," + NL + "\t\t\t\tnewSource.getElement()));";
523
  protected final String TEXT_502 = NL + "\tif (";
524
  protected final String TEXT_503 = NL + "\t\t\tresult.append(";
524
  protected final String TEXT_503 = ".VISUAL_ID == linkVID) {";
525
  protected final String TEXT_504 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), ";
525
  protected final String TEXT_504 = NL + "\t\t";
526
  protected final String TEXT_505 = ".eINSTANCE.get";
526
  protected final String TEXT_505 = " source = ((";
527
  protected final String TEXT_506 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append(";
527
  protected final String TEXT_506 = ")nextValue).";
528
  protected final String TEXT_507 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), ";
528
  protected final String TEXT_507 = "();";
529
  protected final String TEXT_508 = ".eINSTANCE.get";
529
  protected final String TEXT_508 = NL + "\t\t";
530
  protected final String TEXT_509 = "(), edge.getTarget().getElement()));";
530
  protected final String TEXT_509 = " source = ";
531
  protected final String TEXT_510 = NL + "\t\t\tresult.append(";
531
  protected final String TEXT_510 = ";";
532
  protected final String TEXT_511 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), ";
532
  protected final String TEXT_511 = NL + "\t\t";
533
  protected final String TEXT_512 = ".eINSTANCE.get";
533
  protected final String TEXT_512 = " target = ((";
534
  protected final String TEXT_513 = "(), ";
534
  protected final String TEXT_513 = ")nextValue).";
535
  protected final String TEXT_514 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append(";
535
  protected final String TEXT_514 = "();";
536
  protected final String TEXT_515 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), ";
536
  protected final String TEXT_515 = NL + "\t\t";
537
  protected final String TEXT_516 = ".eINSTANCE.get";
537
  protected final String TEXT_516 = " target = ";
538
  protected final String TEXT_517 = "(), edge.getTarget().getElement()));";
538
  protected final String TEXT_517 = ";";
539
  protected final String TEXT_518 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL;
539
  protected final String TEXT_518 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}";
540
  protected final String TEXT_519 = NL;
540
  protected final String TEXT_519 = NL + "\t\tbreak;" + NL + "\t}";
541
  protected final String TEXT_520 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
541
  protected final String TEXT_520 = NL + "\t}";
542
  protected final String TEXT_521 = " getRelationshipContainer(";
542
  protected final String TEXT_521 = NL + "\t}";
543
  protected final String TEXT_522 = " element, ";
543
  protected final String TEXT_522 = NL + "\t}";
544
  protected final String TEXT_523 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
544
  protected final String TEXT_523 = NL + "\tfor(";
545
  protected final String TEXT_524 = NL;
545
  protected final String TEXT_524 = " it = ((";
546
  protected final String TEXT_525 = NL + "\t\t\tprivate ";
546
  protected final String TEXT_525 = ")modelObject).";
547
  protected final String TEXT_526 = " createDomainModelRemoveCommand(";
547
  protected final String TEXT_526 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
548
  protected final String TEXT_527 = " editingDomain) {";
548
  protected final String TEXT_527 = ") it.next();";
549
  protected final String TEXT_528 = NL + "\t\t\t\t";
549
  protected final String TEXT_528 = NL + "\tnextValue = ((";
550
  protected final String TEXT_529 = " result = new ";
550
  protected final String TEXT_529 = ")modelObject).";
551
  protected final String TEXT_530 = "();";
551
  protected final String TEXT_530 = "();";
552
  protected final String TEXT_531 = NL + "\t\t\t\tresult.append(";
552
  protected final String TEXT_531 = NL + "\tif (nextValue != null) {";
553
  protected final String TEXT_532 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
553
  protected final String TEXT_532 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, ";
554
  protected final String TEXT_533 = ".getElement().eContainer(), ";
554
  protected final String TEXT_533 = ".VISUAL_ID));";
555
  protected final String TEXT_534 = ".getElement().eContainmentFeature(), ";
555
  protected final String TEXT_534 = NL + "\t}";
556
  protected final String TEXT_535 = ".getElement()));";
556
  protected final String TEXT_535 = NL + "\t}";
557
  protected final String TEXT_536 = NL + "\t\t\t\tresult.append(";
557
  protected final String TEXT_536 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
558
  protected final String TEXT_537 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
558
  protected final String TEXT_537 = " getNotationalChildLinks() {" + NL + "\t\t";
559
  protected final String TEXT_538 = ".getElement().eContainer(), ";
559
  protected final String TEXT_538 = " result = new ";
560
  protected final String TEXT_539 = ".getElement().eContainmentFeature(), ";
560
  protected final String TEXT_539 = "();" + NL + "\t\t";
561
  protected final String TEXT_540 = ".UNSET_VALUE));";
561
  protected final String TEXT_540 = " allLinks = ";
562
  protected final String TEXT_541 = NL + "\t\t\t\treturn ";
562
  protected final String TEXT_541 = ".getEdges();" + NL + "\t\tfor(";
563
  protected final String TEXT_542 = ".INSTANCE;";
563
  protected final String TEXT_542 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
564
  protected final String TEXT_543 = NL + "\t\t\t\tresult.append(";
564
  protected final String TEXT_543 = " next = (";
565
  protected final String TEXT_544 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
565
  protected final String TEXT_544 = ") it.next();";
566
  protected final String TEXT_545 = ".getElement().eContainer(), ";
566
  protected final String TEXT_545 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t";
567
  protected final String TEXT_546 = ".eINSTANCE.get";
567
  protected final String TEXT_546 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t";
568
  protected final String TEXT_547 = "()," + NL + "\t\t\t\t\t";
568
  protected final String TEXT_547 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}";
569
  protected final String TEXT_548 = ".getElement()));";
569
  protected final String TEXT_548 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == ";
570
  protected final String TEXT_549 = NL + "\t\t\t\tresult.append(";
570
  protected final String TEXT_549 = ") {" + NL + "\t\t\t\t\tint linkVID = ";
571
  protected final String TEXT_550 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
571
  protected final String TEXT_550 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {";
572
  protected final String TEXT_551 = ".getElement().eContainer(), ";
572
  protected final String TEXT_551 = NL + "\t\t\t\t\tcase ";
573
  protected final String TEXT_552 = ".eINSTANCE.get";
573
  protected final String TEXT_552 = ".VISUAL_ID:";
574
  protected final String TEXT_553 = "()," + NL + "\t\t\t\t\t";
574
  protected final String TEXT_553 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}";
575
  protected final String TEXT_554 = ".UNSET_VALUE));";
575
  protected final String TEXT_554 = NL + "\t\t\t} else {";
576
  protected final String TEXT_555 = NL + "\t\t\t\tresult.append(";
576
  protected final String TEXT_555 = NL + "\t\t\t}";
577
  protected final String TEXT_556 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
577
  protected final String TEXT_556 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {";
578
  protected final String TEXT_557 = ".getElement(), ";
578
  protected final String TEXT_557 = NL + "\t\t\t\tif (next.getElement().eContainer() == ";
579
  protected final String TEXT_558 = ".eINSTANCE.get";
579
  protected final String TEXT_558 = ") {" + NL + "\t\t\t\t\tint linkVID = ";
580
  protected final String TEXT_559 = "(), ";
580
  protected final String TEXT_559 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {";
581
  protected final String TEXT_560 = ".getSource().getElement()));";
581
  protected final String TEXT_560 = NL + "\t\t\t\t\tcase ";
582
  protected final String TEXT_561 = NL + "\t\t\t\tresult.append(";
582
  protected final String TEXT_561 = ".VISUAL_ID:";
583
  protected final String TEXT_562 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
583
  protected final String TEXT_562 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}";
584
  protected final String TEXT_563 = ".getElement(), ";
584
  protected final String TEXT_563 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns ";
585
  protected final String TEXT_564 = ".eINSTANCE.get";
585
  protected final String TEXT_564 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn ";
586
  protected final String TEXT_565 = "(), ";
586
  protected final String TEXT_565 = ";" + NL + "\t}";
587
  protected final String TEXT_566 = ".UNSET_VALUE));";
587
  protected final String TEXT_566 = NL;
588
  protected final String TEXT_567 = NL + "\t\t\t\tresult.append(";
588
  protected final String TEXT_567 = NL;
589
  protected final String TEXT_568 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
589
  protected final String TEXT_568 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
590
  protected final String TEXT_569 = ".getElement(), ";
590
  protected final String TEXT_569 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
591
  protected final String TEXT_570 = ".eINSTANCE.get";
591
  protected final String TEXT_570 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
592
  protected final String TEXT_571 = "(), ";
592
  protected final String TEXT_571 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
593
  protected final String TEXT_572 = ".getTarget().getElement()));";
593
  protected final String TEXT_572 = NL;
594
  protected final String TEXT_573 = NL + "\t\t\t\tresult.append(";
594
  protected final String TEXT_573 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
595
  protected final String TEXT_574 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
595
  protected final String TEXT_574 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
596
  protected final String TEXT_575 = ".getElement(), ";
596
  protected final String TEXT_575 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
597
  protected final String TEXT_576 = ".eINSTANCE.get";
597
  protected final String TEXT_576 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL;
598
  protected final String TEXT_577 = "(), ";
598
  protected final String TEXT_577 = NL;
599
  protected final String TEXT_578 = ".UNSET_VALUE));";
599
  protected final String TEXT_578 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
600
  protected final String TEXT_579 = NL + "\t\t\t\treturn result;";
600
  protected final String TEXT_579 = NL + "\t\t";
601
  protected final String TEXT_580 = NL + "\t\t\t\treturn ";
601
  protected final String TEXT_580 = " style =" + NL + "\t\t\t(";
602
  protected final String TEXT_581 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
602
  protected final String TEXT_581 = ") ";
603
  protected final String TEXT_582 = ".getSource().getElement(), ";
603
  protected final String TEXT_582 = ".getStyle(" + NL + "\t\t\t\t";
604
  protected final String TEXT_583 = ".eINSTANCE.get";
604
  protected final String TEXT_583 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
605
  protected final String TEXT_584 = "(), ";
605
  protected final String TEXT_584 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = ";
606
  protected final String TEXT_585 = ".getTarget().getElement());";
606
  protected final String TEXT_585 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
607
  protected final String TEXT_586 = NL + "\t\t\t\treturn ";
607
  protected final String TEXT_586 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
608
  protected final String TEXT_587 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
608
  protected final String TEXT_587 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
609
  protected final String TEXT_588 = ".getSource().getElement(), ";
609
  protected final String TEXT_588 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
610
  protected final String TEXT_589 = ".eINSTANCE.get";
610
  protected final String TEXT_589 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new ";
611
  protected final String TEXT_590 = "(), ";
611
  protected final String TEXT_590 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
612
  protected final String TEXT_591 = ".UNSET_VALUE);";
612
  protected final String TEXT_591 = "\t" + NL + "\t}";
613
  protected final String TEXT_592 = NL + "\t\t\t}";
613
  protected final String TEXT_592 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
614
  protected final String TEXT_593 = NL + "\t}" + NL;
614
  protected final String TEXT_593 = " createdFont;";
615
  protected final String TEXT_594 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
615
  protected final String TEXT_594 = "\t" + NL;
616
  protected final String TEXT_595 = "StartCommand extends ";
616
  protected final String TEXT_595 = NL;
617
  protected final String TEXT_596 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
617
  protected final String TEXT_596 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t";
618
  protected final String TEXT_597 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
618
  protected final String TEXT_597 = " style = (";
619
  protected final String TEXT_598 = "StartCommand(";
619
  protected final String TEXT_598 = ")  ";
620
  protected final String TEXT_599 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = (";
620
  protected final String TEXT_599 = ".getStyle(";
621
  protected final String TEXT_600 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
621
  protected final String TEXT_600 = ".eINSTANCE.getLineStyle());" + NL + "\t\t";
622
  protected final String TEXT_601 = NL + "\t\t\treturn false;";
622
  protected final String TEXT_601 = " toDispose = createdForegroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint foregroundColor = style.getLineColor();" + NL + "\t\t\tint red = foregroundColor & 0x000000FF;" + NL + "\t\t\tint green = (foregroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (foregroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
623
  protected final String TEXT_602 = NL + "\t\t\t";
623
  protected final String TEXT_602 = " currentColor = getFigure().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedForegroundColor = new ";
624
  protected final String TEXT_603 = " container = (";
624
  protected final String TEXT_603 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdForegroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedForegroundColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshForegroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
625
  protected final String TEXT_604 = ")getRelationshipContainer(source.getElement(), ";
625
  protected final String TEXT_604 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t";
626
  protected final String TEXT_605 = ".eINSTANCE.get";
626
  protected final String TEXT_605 = " style = (";
627
  protected final String TEXT_606 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
627
  protected final String TEXT_606 = ")  ";
628
  protected final String TEXT_607 = NL;
628
  protected final String TEXT_607 = ".getStyle(";
629
  protected final String TEXT_608 = NL + "\t\tif (";
629
  protected final String TEXT_608 = ".eINSTANCE.getFillStyle());" + NL + "\t\t";
630
  protected final String TEXT_609 = ".";
630
  protected final String TEXT_609 = " toDispose = createdBackgroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint backgroundColor = style.getFillColor();" + NL + "\t\t\tint red = backgroundColor & 0x000000FF;" + NL + "\t\t\tint green = (backgroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (backgroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
631
  protected final String TEXT_610 = "() != null) {" + NL + "\t\t\t";
631
  protected final String TEXT_610 = " currentColor = getFigure().getBackgroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedBackgroundColor = new ";
632
  protected final String TEXT_611 = NL + "\t\t}";
632
  protected final String TEXT_611 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setBackgroundColor(createdBackgroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setBackgroundColor(getViewer().getControl().getBackground());" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshBackgroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
633
  protected final String TEXT_612 = NL + "\t\tif (";
633
  protected final String TEXT_612 = " createdBackgroundColor;" + NL;
634
  protected final String TEXT_613 = ".";
634
  protected final String TEXT_613 = NL;
635
  protected final String TEXT_614 = "().size() >= ";
635
  protected final String TEXT_614 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
636
  protected final String TEXT_615 = ".eINSTANCE.get";
636
  protected final String TEXT_615 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
637
  protected final String TEXT_616 = ".getUpperBound()) {" + NL + "\t\t\t";
637
  protected final String TEXT_616 = " feature, ";
638
  protected final String TEXT_617 = NL + "\t\t}";
638
  protected final String TEXT_617 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new ";
639
  protected final String TEXT_618 = NL;
639
  protected final String TEXT_618 = "();";
640
  protected final String TEXT_619 = NL + "\t\tif (";
640
  protected final String TEXT_619 = NL;
641
  protected final String TEXT_620 = ".";
641
  protected final String TEXT_620 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
642
  protected final String TEXT_621 = "() != null) {" + NL + "\t\t\t";
642
  protected final String TEXT_621 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
643
  protected final String TEXT_622 = NL + "\t\t}";
643
  protected final String TEXT_622 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
644
  protected final String TEXT_623 = NL + "\t\tif (";
644
  protected final String TEXT_623 = NL;
645
  protected final String TEXT_624 = ".";
645
  protected final String TEXT_624 = "\t\tRefresher boundsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBounds();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
646
  protected final String TEXT_625 = "().size() >= ";
646
  protected final String TEXT_625 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
647
  protected final String TEXT_626 = ".eINSTANCE.get";
647
  protected final String TEXT_626 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
648
  protected final String TEXT_627 = ".getUpperBound()) {" + NL + "\t\t\t";
648
  protected final String TEXT_627 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
649
  protected final String TEXT_628 = NL + "\t\t}";
649
  protected final String TEXT_628 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
650
  protected final String TEXT_629 = NL;
650
  protected final String TEXT_629 = ".eINSTANCE.getLocation_Y(), boundsRefresher);";
651
  protected final String TEXT_630 = NL + "\t\t\tif(!";
651
  protected final String TEXT_630 = NL;
652
  protected final String TEXT_631 = ".canCreateLink(";
652
  protected final String TEXT_631 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
653
  protected final String TEXT_632 = ", ";
653
  protected final String TEXT_632 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
654
  protected final String TEXT_633 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
654
  protected final String TEXT_633 = NL;
655
  protected final String TEXT_634 = NL + "\t\t\treturn true;";
655
  protected final String TEXT_634 = "\t\tRefresher sourceEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshSourceConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
656
  protected final String TEXT_635 = NL;
656
  protected final String TEXT_635 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);";
657
  protected final String TEXT_636 = NL + "\t\tif (";
657
  protected final String TEXT_636 = NL;
658
  protected final String TEXT_637 = ".";
658
  protected final String TEXT_637 = "\t\tRefresher targetEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshTargetConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
659
  protected final String TEXT_638 = "() != null) {" + NL + "\t\t\t";
659
  protected final String TEXT_638 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);";
660
  protected final String TEXT_639 = NL + "\t\t}";
660
  protected final String TEXT_639 = NL;
661
  protected final String TEXT_640 = NL + "\t\tif (";
661
  protected final String TEXT_640 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
662
  protected final String TEXT_641 = ".";
662
  protected final String TEXT_641 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
663
  protected final String TEXT_642 = "().size() >= ";
663
  protected final String TEXT_642 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
664
  protected final String TEXT_643 = ".eINSTANCE.get";
664
  protected final String TEXT_643 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
665
  protected final String TEXT_644 = ".getUpperBound()) {" + NL + "\t\t\t";
665
  protected final String TEXT_644 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
666
  protected final String TEXT_645 = NL + "\t\t}";
666
  protected final String TEXT_645 = NL;
667
  protected final String TEXT_646 = NL;
667
  protected final String TEXT_646 = "\t\tRefresher backgroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBackgroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
668
  protected final String TEXT_647 = NL + "\t\t\tif(!";
668
  protected final String TEXT_647 = ".eINSTANCE.getFillStyle_FillColor(), backgroundColorRefresher);" + NL + "\t\tRefresher foregroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshForegroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
669
  protected final String TEXT_648 = ".canCreateLink(";
669
  protected final String TEXT_648 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL;
670
  protected final String TEXT_649 = ", ";
670
  protected final String TEXT_649 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect";
671
  protected final String TEXT_650 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
671
  protected final String TEXT_650 = "SourceCommand extends ";
672
  protected final String TEXT_651 = NL + "\t\t\treturn true;";
672
  protected final String TEXT_651 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
673
  protected final String TEXT_652 = NL + "\t\t\treturn false;";
673
  protected final String TEXT_652 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
674
  protected final String TEXT_653 = NL + "\t\t}";
674
  protected final String TEXT_653 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
675
  protected final String TEXT_654 = NL;
675
  protected final String TEXT_654 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
676
  protected final String TEXT_655 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
676
  protected final String TEXT_655 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
677
  protected final String TEXT_656 = " getRelationshipContainer(";
677
  protected final String TEXT_656 = "SourceCommand(";
678
  protected final String TEXT_657 = " element, ";
678
  protected final String TEXT_657 = " request) {" + NL + "\t\t\tthis((";
679
  protected final String TEXT_658 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
679
  protected final String TEXT_658 = ")request.getConnectionEditPart().getModel(), (";
680
  protected final String TEXT_659 = NL + NL + "\t}";
680
  protected final String TEXT_659 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
681
  protected final String TEXT_660 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect";
681
  protected final String TEXT_660 = "SourceCommand(";
682
  protected final String TEXT_661 = "TargetCommand extends ";
682
  protected final String TEXT_661 = " edge, ";
683
  protected final String TEXT_662 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
683
  protected final String TEXT_662 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {";
684
  protected final String TEXT_663 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
684
  protected final String TEXT_663 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal ";
685
  protected final String TEXT_664 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
685
  protected final String TEXT_664 = " domainModelEditDomain = ";
686
  protected final String TEXT_665 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
686
  protected final String TEXT_665 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t";
687
  protected final String TEXT_666 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
687
  protected final String TEXT_666 = " command = new ";
688
  protected final String TEXT_667 = "TargetCommand(";
688
  protected final String TEXT_667 = "() {" + NL + "\t\t\t\tprivate ";
689
  protected final String TEXT_668 = " request) {" + NL + "\t\t\tthis((";
689
  protected final String TEXT_668 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();";
690
  protected final String TEXT_669 = ")request.getConnectionEditPart().getModel(), (";
690
  protected final String TEXT_669 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;";
691
  protected final String TEXT_670 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
691
  protected final String TEXT_670 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {";
692
  protected final String TEXT_671 = "TargetCommand(";
692
  protected final String TEXT_671 = NL + "\t\t\treturn false;";
693
  protected final String TEXT_672 = " edge, ";
693
  protected final String TEXT_672 = NL + "\t\t\t";
694
  protected final String TEXT_673 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {";
694
  protected final String TEXT_673 = " container = (";
695
  protected final String TEXT_674 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal ";
695
  protected final String TEXT_674 = ")getRelationshipContainer(newSource.getElement(), ";
696
  protected final String TEXT_675 = " domainModelEditDomain = ";
696
  protected final String TEXT_675 = ".eINSTANCE.get";
697
  protected final String TEXT_676 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t";
697
  protected final String TEXT_676 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
698
  protected final String TEXT_677 = " command = new ";
698
  protected final String TEXT_677 = NL;
699
  protected final String TEXT_678 = "() {" + NL + "\t\t\t\tprivate ";
699
  protected final String TEXT_678 = NL + "\t\tif (";
700
  protected final String TEXT_679 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();";
700
  protected final String TEXT_679 = ".";
701
  protected final String TEXT_680 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;";
701
  protected final String TEXT_680 = "() != null) {" + NL + "\t\t\t";
702
  protected final String TEXT_681 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {";
702
  protected final String TEXT_681 = NL + "\t\t}";
703
  protected final String TEXT_682 = NL;
703
  protected final String TEXT_682 = NL + "\t\tif (";
704
  protected final String TEXT_683 = NL + "\t\t\tif(!";
704
  protected final String TEXT_683 = ".";
705
  protected final String TEXT_684 = ".canCreateLink(";
705
  protected final String TEXT_684 = "().size() >= ";
706
  protected final String TEXT_685 = ", ";
706
  protected final String TEXT_685 = ".eINSTANCE.get";
707
  protected final String TEXT_686 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
707
  protected final String TEXT_686 = ".getUpperBound()) {" + NL + "\t\t\t";
708
  protected final String TEXT_687 = NL + "\t\t\treturn true;";
708
  protected final String TEXT_687 = NL + "\t\t}";
709
  protected final String TEXT_688 = NL;
709
  protected final String TEXT_688 = NL;
710
  protected final String TEXT_689 = NL + "\t\t\tif(!";
710
  protected final String TEXT_689 = NL + "\t\tif (";
711
  protected final String TEXT_690 = ".canCreateLink(";
711
  protected final String TEXT_690 = ".";
712
  protected final String TEXT_691 = ", ";
712
  protected final String TEXT_691 = "() != null) {" + NL + "\t\t\t";
713
  protected final String TEXT_692 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
713
  protected final String TEXT_692 = NL + "\t\t}";
714
  protected final String TEXT_693 = NL + "\t\t\treturn true;";
714
  protected final String TEXT_693 = NL + "\t\tif (";
715
  protected final String TEXT_694 = NL + "\t\t\treturn false;";
715
  protected final String TEXT_694 = ".";
716
  protected final String TEXT_695 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
716
  protected final String TEXT_695 = "().size() >= ";
717
  protected final String TEXT_696 = " createReconnectCommand() {" + NL + "\t\t\t";
717
  protected final String TEXT_696 = ".eINSTANCE.get";
718
  protected final String TEXT_697 = " editingDomain = ";
718
  protected final String TEXT_697 = ".getUpperBound()) {" + NL + "\t\t\t";
719
  protected final String TEXT_698 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t";
719
  protected final String TEXT_698 = NL + "\t\t}";
720
  protected final String TEXT_699 = " result = new ";
720
  protected final String TEXT_699 = NL;
721
  protected final String TEXT_700 = "();" + NL + "\t\t\tresult.append(new ";
721
  protected final String TEXT_700 = NL + "\t\t\tif(!";
722
  protected final String TEXT_701 = "(edge, newTarget));";
722
  protected final String TEXT_701 = ".canCreateLink(";
723
  protected final String TEXT_702 = NL + "\t\t\tresult.append(";
723
  protected final String TEXT_702 = ", ";
724
  protected final String TEXT_703 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
724
  protected final String TEXT_703 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
725
  protected final String TEXT_704 = ".eINSTANCE.get";
725
  protected final String TEXT_704 = NL + "\t\t\treturn true;";
726
  protected final String TEXT_705 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append(";
726
  protected final String TEXT_705 = NL;
727
  protected final String TEXT_706 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
727
  protected final String TEXT_706 = NL + "\t\tif (";
728
  protected final String TEXT_707 = ".eINSTANCE.get";
728
  protected final String TEXT_707 = ".";
729
  protected final String TEXT_708 = "()," + NL + "\t\t\t\tnewTarget.getElement()));";
729
  protected final String TEXT_708 = "() != null) {" + NL + "\t\t\t";
730
  protected final String TEXT_709 = NL + "\t\t\tresult.append(";
730
  protected final String TEXT_709 = NL + "\t\t}";
731
  protected final String TEXT_710 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
731
  protected final String TEXT_710 = NL + "\t\tif (";
732
  protected final String TEXT_711 = ".eINSTANCE.get";
732
  protected final String TEXT_711 = ".";
733
  protected final String TEXT_712 = "()," + NL + "\t\t\t\tnewTarget.getElement()));";
733
  protected final String TEXT_712 = "().size() >= ";
734
  protected final String TEXT_713 = NL + "\t\t\tresult.append(";
734
  protected final String TEXT_713 = ".eINSTANCE.get";
735
  protected final String TEXT_714 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
735
  protected final String TEXT_714 = ".getUpperBound()) {" + NL + "\t\t\t";
736
  protected final String TEXT_715 = ".eINSTANCE.get";
736
  protected final String TEXT_715 = NL + "\t\t}";
737
  protected final String TEXT_716 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append(";
737
  protected final String TEXT_716 = NL;
738
  protected final String TEXT_717 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
738
  protected final String TEXT_717 = NL + "\t\t\tif(!";
739
  protected final String TEXT_718 = ".eINSTANCE.get";
739
  protected final String TEXT_718 = ".canCreateLink(";
740
  protected final String TEXT_719 = "(), newTarget.getElement()));";
740
  protected final String TEXT_719 = ", ";
741
  protected final String TEXT_720 = NL + "\t\t\tresult.append(";
741
  protected final String TEXT_720 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
742
  protected final String TEXT_721 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
742
  protected final String TEXT_721 = NL + "\t\t\treturn true;";
743
  protected final String TEXT_722 = ".eINSTANCE.get";
743
  protected final String TEXT_722 = NL + "\t\t\treturn false;";
744
  protected final String TEXT_723 = "(), newTarget.getElement()));";
744
  protected final String TEXT_723 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
745
  protected final String TEXT_724 = NL + "\t\t\treturn result;" + NL + "\t\t}";
745
  protected final String TEXT_724 = " createReconnectCommand() {" + NL + "\t\t\t";
746
  protected final String TEXT_725 = NL;
746
  protected final String TEXT_725 = " editingDomain = ";
747
  protected final String TEXT_726 = NL + "\t\t\tprivate ";
747
  protected final String TEXT_726 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t";
748
  protected final String TEXT_727 = " createDomainModelRemoveCommand(";
748
  protected final String TEXT_727 = " result = new ";
749
  protected final String TEXT_728 = " editingDomain) {";
749
  protected final String TEXT_728 = "();" + NL + "\t\t\tresult.append(new ";
750
  protected final String TEXT_729 = NL + "\t\t\t\t";
750
  protected final String TEXT_729 = "(edge, newSource));";
751
  protected final String TEXT_730 = " result = new ";
751
  protected final String TEXT_730 = NL + "\t\t\t";
752
  protected final String TEXT_731 = "();";
752
  protected final String TEXT_731 = " container = getRelationshipContainer(newSource.getElement(), ";
753
  protected final String TEXT_732 = NL + "\t\t\t\tresult.append(";
753
  protected final String TEXT_732 = ".eINSTANCE.get";
754
  protected final String TEXT_733 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
754
  protected final String TEXT_733 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn ";
755
  protected final String TEXT_734 = ".getElement().eContainer(), ";
755
  protected final String TEXT_734 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t";
756
  protected final String TEXT_735 = ".getElement().eContainmentFeature(), ";
756
  protected final String TEXT_735 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn ";
757
  protected final String TEXT_736 = ".getElement()));";
757
  protected final String TEXT_736 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {";
758
  protected final String TEXT_737 = NL + "\t\t\t\tresult.append(";
758
  protected final String TEXT_737 = NL + "\t\t\t\tresult.append(";
759
  protected final String TEXT_738 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
759
  protected final String TEXT_738 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));";
760
  protected final String TEXT_739 = ".getElement().eContainer(), ";
760
  protected final String TEXT_739 = NL + "\t\t\t\tresult.append(";
761
  protected final String TEXT_740 = ".getElement().eContainmentFeature(), ";
761
  protected final String TEXT_740 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), ";
762
  protected final String TEXT_741 = ".UNSET_VALUE));";
762
  protected final String TEXT_741 = ".UNSET_VALUE));";
763
  protected final String TEXT_742 = NL + "\t\t\t\treturn ";
763
  protected final String TEXT_742 = NL + "\t\t\t\tresult.append(";
764
  protected final String TEXT_743 = ".INSTANCE;";
764
  protected final String TEXT_743 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, ";
765
  protected final String TEXT_744 = NL + "\t\t\t\tresult.append(";
765
  protected final String TEXT_744 = ".eINSTANCE.get";
766
  protected final String TEXT_745 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
766
  protected final String TEXT_745 = "(), edge.getElement()));";
767
  protected final String TEXT_746 = ".getElement().eContainer(), ";
767
  protected final String TEXT_746 = NL + "\t\t\t\tresult.append(";
768
  protected final String TEXT_747 = ".eINSTANCE.get";
768
  protected final String TEXT_747 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), ";
769
  protected final String TEXT_748 = "()," + NL + "\t\t\t\t\t";
769
  protected final String TEXT_748 = ".eINSTANCE.get";
770
  protected final String TEXT_749 = ".getElement()));";
770
  protected final String TEXT_749 = "()," + NL + "\t\t\t\t\tedge.getElement()));";
771
  protected final String TEXT_750 = NL + "\t\t\t\tresult.append(";
771
  protected final String TEXT_750 = NL + "\t\t\t\tresult.append(";
772
  protected final String TEXT_751 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
772
  protected final String TEXT_751 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), ";
773
  protected final String TEXT_752 = ".getElement().eContainer(), ";
773
  protected final String TEXT_752 = ".eINSTANCE.get";
774
  protected final String TEXT_753 = ".eINSTANCE.get";
774
  protected final String TEXT_753 = "()," + NL + "\t\t\t\t\t";
775
  protected final String TEXT_754 = "()," + NL + "\t\t\t\t\t";
775
  protected final String TEXT_754 = ".UNSET_VALUE));";
776
  protected final String TEXT_755 = ".UNSET_VALUE));";
776
  protected final String TEXT_755 = NL + "\t\t\t\tresult.append(";
777
  protected final String TEXT_756 = NL + "\t\t\t\tresult.append(";
777
  protected final String TEXT_756 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, ";
778
  protected final String TEXT_757 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
778
  protected final String TEXT_757 = ".eINSTANCE.get";
779
  protected final String TEXT_758 = ".getElement(), ";
779
  protected final String TEXT_758 = "(), edge.getElement()));";
780
  protected final String TEXT_759 = ".eINSTANCE.get";
780
  protected final String TEXT_759 = NL + "\t\t\t}";
781
  protected final String TEXT_760 = "(), ";
781
  protected final String TEXT_760 = NL + "\t\t\tresult.append(";
782
  protected final String TEXT_761 = ".getSource().getElement()));";
782
  protected final String TEXT_761 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
783
  protected final String TEXT_762 = NL + "\t\t\t\tresult.append(";
783
  protected final String TEXT_762 = ".eINSTANCE.get";
784
  protected final String TEXT_763 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
784
  protected final String TEXT_763 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append(";
785
  protected final String TEXT_764 = ".getElement(), ";
785
  protected final String TEXT_764 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
786
  protected final String TEXT_765 = ".eINSTANCE.get";
786
  protected final String TEXT_765 = ".eINSTANCE.get";
787
  protected final String TEXT_766 = "(), ";
787
  protected final String TEXT_766 = "()," + NL + "\t\t\t\tnewSource.getElement()));";
788
  protected final String TEXT_767 = ".UNSET_VALUE));";
788
  protected final String TEXT_767 = NL + "\t\t\tresult.append(";
789
  protected final String TEXT_768 = NL + "\t\t\t\tresult.append(";
789
  protected final String TEXT_768 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
790
  protected final String TEXT_769 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
790
  protected final String TEXT_769 = ".eINSTANCE.get";
791
  protected final String TEXT_770 = ".getElement(), ";
791
  protected final String TEXT_770 = "()," + NL + "\t\t\t\tnewSource.getElement()));";
792
  protected final String TEXT_771 = ".eINSTANCE.get";
792
  protected final String TEXT_771 = NL + "\t\t\tresult.append(";
793
  protected final String TEXT_772 = "(), ";
793
  protected final String TEXT_772 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), ";
794
  protected final String TEXT_773 = ".getTarget().getElement()));";
794
  protected final String TEXT_773 = ".eINSTANCE.get";
795
  protected final String TEXT_774 = NL + "\t\t\t\tresult.append(";
795
  protected final String TEXT_774 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append(";
796
  protected final String TEXT_775 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
796
  protected final String TEXT_775 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), ";
797
  protected final String TEXT_776 = ".getElement(), ";
797
  protected final String TEXT_776 = ".eINSTANCE.get";
798
  protected final String TEXT_777 = ".eINSTANCE.get";
798
  protected final String TEXT_777 = "(), edge.getTarget().getElement()));";
799
  protected final String TEXT_778 = "(), ";
799
  protected final String TEXT_778 = NL + "\t\t\tresult.append(";
800
  protected final String TEXT_779 = ".UNSET_VALUE));";
800
  protected final String TEXT_779 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), ";
801
  protected final String TEXT_780 = NL + "\t\t\t\treturn result;";
801
  protected final String TEXT_780 = ".eINSTANCE.get";
802
  protected final String TEXT_781 = NL + "\t\t\t\treturn ";
802
  protected final String TEXT_781 = "(), ";
803
  protected final String TEXT_782 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
803
  protected final String TEXT_782 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append(";
804
  protected final String TEXT_783 = ".getSource().getElement(), ";
804
  protected final String TEXT_783 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), ";
805
  protected final String TEXT_784 = ".eINSTANCE.get";
805
  protected final String TEXT_784 = ".eINSTANCE.get";
806
  protected final String TEXT_785 = "(), ";
806
  protected final String TEXT_785 = "(), edge.getTarget().getElement()));";
807
  protected final String TEXT_786 = ".getTarget().getElement());";
807
  protected final String TEXT_786 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL;
808
  protected final String TEXT_787 = NL + "\t\t\t\treturn ";
808
  protected final String TEXT_787 = NL;
809
  protected final String TEXT_788 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
809
  protected final String TEXT_788 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
810
  protected final String TEXT_789 = ".getSource().getElement(), ";
810
  protected final String TEXT_789 = " getRelationshipContainer(";
811
  protected final String TEXT_790 = ".eINSTANCE.get";
811
  protected final String TEXT_790 = " element, ";
812
  protected final String TEXT_791 = "(), ";
812
  protected final String TEXT_791 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
813
  protected final String TEXT_792 = ".UNSET_VALUE);";
813
  protected final String TEXT_792 = NL;
814
  protected final String TEXT_793 = NL + "\t\t\t}";
814
  protected final String TEXT_793 = NL + "\t\t\tprivate ";
815
  protected final String TEXT_794 = NL + "\t}" + NL;
815
  protected final String TEXT_794 = " createDomainModelRemoveCommand(";
816
  protected final String TEXT_795 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
816
  protected final String TEXT_795 = " editingDomain) {";
817
  protected final String TEXT_796 = "Command extends ";
817
  protected final String TEXT_796 = NL + "\t\t\t\t";
818
  protected final String TEXT_797 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
818
  protected final String TEXT_797 = " result = new ";
819
  protected final String TEXT_798 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
819
  protected final String TEXT_798 = "();";
820
  protected final String TEXT_799 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
820
  protected final String TEXT_799 = NL + "\t\t\t\tresult.append(";
821
  protected final String TEXT_800 = " createdEdge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
821
  protected final String TEXT_800 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
822
  protected final String TEXT_801 = "Command(";
822
  protected final String TEXT_801 = ".getElement().eContainer(), ";
823
  protected final String TEXT_802 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof ";
823
  protected final String TEXT_802 = ".getElement().eContainmentFeature(), ";
824
  protected final String TEXT_803 = ") {" + NL + "\t\t\t\tsource = (";
824
  protected final String TEXT_803 = ".getElement()));";
825
  protected final String TEXT_804 = ")requestEx.getSourceEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\tsource = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (requestEx.getTargetEditPart().getModel() instanceof ";
825
  protected final String TEXT_804 = NL + "\t\t\t\tresult.append(";
826
  protected final String TEXT_805 = ") {" + NL + "\t\t\t\ttarget = (";
826
  protected final String TEXT_805 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
827
  protected final String TEXT_806 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (source == null || target == null) {" + NL + "\t\t\t\tcreatedEdge = null;" + NL + "\t\t\t\tdomainModelAddCommand = ";
827
  protected final String TEXT_806 = ".getElement().eContainer(), ";
828
  protected final String TEXT_807 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = ";
828
  protected final String TEXT_807 = ".getElement().eContainmentFeature(), ";
829
  protected final String TEXT_808 = ".eINSTANCE.createEdge();";
829
  protected final String TEXT_808 = ".UNSET_VALUE));";
830
  protected final String TEXT_809 = NL + "\t\t\t";
830
  protected final String TEXT_809 = NL + "\t\t\t\treturn ";
831
  protected final String TEXT_810 = " createdDomainElement = ";
831
  protected final String TEXT_810 = ".INSTANCE;";
832
  protected final String TEXT_811 = ".eINSTANCE.create";
832
  protected final String TEXT_811 = NL + "\t\t\t\tresult.append(";
833
  protected final String TEXT_812 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t";
833
  protected final String TEXT_812 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
834
  protected final String TEXT_813 = NL + "\t\t\t";
834
  protected final String TEXT_813 = ".getElement().eContainer(), ";
835
  protected final String TEXT_814 = ".";
835
  protected final String TEXT_814 = ".eINSTANCE.get";
836
  protected final String TEXT_815 = ".initializeElement(createdDomainElement);";
836
  protected final String TEXT_815 = "()," + NL + "\t\t\t\t\t";
837
  protected final String TEXT_816 = NL + "\t\t\tcreatedEdge.setElement(null);";
837
  protected final String TEXT_816 = ".getElement()));";
838
  protected final String TEXT_817 = NL + "\t\t\t";
838
  protected final String TEXT_817 = NL + "\t\t\t\tresult.append(";
839
  protected final String TEXT_818 = ".decorateView(createdEdge);" + NL + "\t\t\t";
839
  protected final String TEXT_818 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
840
  protected final String TEXT_819 = " domainModelEditDomain = ";
840
  protected final String TEXT_819 = ".getElement().eContainer(), ";
841
  protected final String TEXT_820 = ".getEditingDomain(source.getDiagram().getElement());";
841
  protected final String TEXT_820 = ".eINSTANCE.get";
842
  protected final String TEXT_821 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();";
842
  protected final String TEXT_821 = "()," + NL + "\t\t\t\t\t";
843
  protected final String TEXT_822 = NL + "\t\t\t";
843
  protected final String TEXT_822 = ".UNSET_VALUE));";
844
  protected final String TEXT_823 = " container = getRelationshipContainer(source.getElement(), ";
844
  protected final String TEXT_823 = NL + "\t\t\t\tresult.append(";
845
  protected final String TEXT_824 = ".eINSTANCE.get";
845
  protected final String TEXT_824 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
846
  protected final String TEXT_825 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\tdomainModelAddCommand = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\taddLinkEndsCommand.append(";
846
  protected final String TEXT_825 = ".getElement(), ";
847
  protected final String TEXT_826 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, ";
847
  protected final String TEXT_826 = ".eINSTANCE.get";
848
  protected final String TEXT_827 = ".eINSTANCE.get";
848
  protected final String TEXT_827 = "(), ";
849
  protected final String TEXT_828 = "(), createdDomainElement));";
849
  protected final String TEXT_828 = ".getSource().getElement()));";
850
  protected final String TEXT_829 = NL + "\t\t\taddLinkEndsCommand.append(";
850
  protected final String TEXT_829 = NL + "\t\t\t\tresult.append(";
851
  protected final String TEXT_830 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, ";
851
  protected final String TEXT_830 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
852
  protected final String TEXT_831 = ".eINSTANCE.get";
852
  protected final String TEXT_831 = ".getElement(), ";
853
  protected final String TEXT_832 = "(), createdDomainElement));";
853
  protected final String TEXT_832 = ".eINSTANCE.get";
854
  protected final String TEXT_833 = NL;
854
  protected final String TEXT_833 = "(), ";
855
  protected final String TEXT_834 = NL + "\t\tif (";
855
  protected final String TEXT_834 = ".UNSET_VALUE));";
856
  protected final String TEXT_835 = ".";
856
  protected final String TEXT_835 = NL + "\t\t\t\tresult.append(";
857
  protected final String TEXT_836 = "() != null) {" + NL + "\t\t\t";
857
  protected final String TEXT_836 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
858
  protected final String TEXT_837 = NL + "\t\t}";
858
  protected final String TEXT_837 = ".getElement(), ";
859
  protected final String TEXT_838 = NL + "\t\tif (";
859
  protected final String TEXT_838 = ".eINSTANCE.get";
860
  protected final String TEXT_839 = ".";
860
  protected final String TEXT_839 = "(), ";
861
  protected final String TEXT_840 = "().size() >= ";
861
  protected final String TEXT_840 = ".getTarget().getElement()));";
862
  protected final String TEXT_841 = ".eINSTANCE.get";
862
  protected final String TEXT_841 = NL + "\t\t\t\tresult.append(";
863
  protected final String TEXT_842 = ".getUpperBound()) {" + NL + "\t\t\t";
863
  protected final String TEXT_842 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
864
  protected final String TEXT_843 = NL + "\t\t}";
864
  protected final String TEXT_843 = ".getElement(), ";
865
  protected final String TEXT_844 = NL + "\t\t\taddLinkEndsCommand.append(";
865
  protected final String TEXT_844 = ".eINSTANCE.get";
866
  protected final String TEXT_845 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
866
  protected final String TEXT_845 = "(), ";
867
  protected final String TEXT_846 = ".eINSTANCE.get";
867
  protected final String TEXT_846 = ".UNSET_VALUE));";
868
  protected final String TEXT_847 = "(), source.getElement()));";
868
  protected final String TEXT_847 = NL + "\t\t\t\treturn result;";
869
  protected final String TEXT_848 = NL;
869
  protected final String TEXT_848 = NL + "\t\t\t\treturn ";
870
  protected final String TEXT_849 = NL + "\t\tif (";
870
  protected final String TEXT_849 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
871
  protected final String TEXT_850 = ".";
871
  protected final String TEXT_850 = ".getSource().getElement(), ";
872
  protected final String TEXT_851 = "() != null) {" + NL + "\t\t\t";
872
  protected final String TEXT_851 = ".eINSTANCE.get";
873
  protected final String TEXT_852 = NL + "\t\t}";
873
  protected final String TEXT_852 = "(), ";
874
  protected final String TEXT_853 = NL + "\t\tif (";
874
  protected final String TEXT_853 = ".getTarget().getElement());";
875
  protected final String TEXT_854 = ".";
875
  protected final String TEXT_854 = NL + "\t\t\t\treturn ";
876
  protected final String TEXT_855 = "().size() >= ";
876
  protected final String TEXT_855 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
877
  protected final String TEXT_856 = ".eINSTANCE.get";
877
  protected final String TEXT_856 = ".getSource().getElement(), ";
878
  protected final String TEXT_857 = ".getUpperBound()) {" + NL + "\t\t\t";
878
  protected final String TEXT_857 = ".eINSTANCE.get";
879
  protected final String TEXT_858 = NL + "\t\t}";
879
  protected final String TEXT_858 = "(), ";
880
  protected final String TEXT_859 = NL + "\t\t\taddLinkEndsCommand.append(";
880
  protected final String TEXT_859 = ".UNSET_VALUE);";
881
  protected final String TEXT_860 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
881
  protected final String TEXT_860 = NL + "\t\t\t}";
882
  protected final String TEXT_861 = ".eINSTANCE.get";
882
  protected final String TEXT_861 = NL + "\t}" + NL;
883
  protected final String TEXT_862 = "(), target.getElement()));";
883
  protected final String TEXT_862 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
884
  protected final String TEXT_863 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;";
884
  protected final String TEXT_863 = "StartCommand extends ";
885
  protected final String TEXT_864 = NL + "\t\t\tdomainModelAddCommand = ";
885
  protected final String TEXT_864 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
886
  protected final String TEXT_865 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t";
886
  protected final String TEXT_865 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
887
  protected final String TEXT_866 = ".eINSTANCE.get";
887
  protected final String TEXT_866 = "StartCommand(";
888
  protected final String TEXT_867 = "(), target.getElement());";
888
  protected final String TEXT_867 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = (";
889
  protected final String TEXT_868 = NL + "\t\t}" + NL;
889
  protected final String TEXT_868 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
890
  protected final String TEXT_869 = NL;
890
  protected final String TEXT_869 = NL + "\t\t\treturn false;";
891
  protected final String TEXT_870 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
891
  protected final String TEXT_870 = NL + "\t\t\t";
892
  protected final String TEXT_871 = " getRelationshipContainer(";
892
  protected final String TEXT_871 = " container = (";
893
  protected final String TEXT_872 = " element, ";
893
  protected final String TEXT_872 = ")getRelationshipContainer(source.getElement(), ";
894
  protected final String TEXT_873 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
894
  protected final String TEXT_873 = ".eINSTANCE.get";
895
  protected final String TEXT_874 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
895
  protected final String TEXT_874 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
896
  protected final String TEXT_875 = NL;
896
  protected final String TEXT_875 = NL;
897
  protected final String TEXT_876 = NL + "\t\t\tif(!";
897
  protected final String TEXT_876 = NL + "\t\tif (";
898
  protected final String TEXT_877 = ".canCreateLink(";
898
  protected final String TEXT_877 = ".";
899
  protected final String TEXT_878 = ", ";
899
  protected final String TEXT_878 = "() != null) {" + NL + "\t\t\t";
900
  protected final String TEXT_879 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
900
  protected final String TEXT_879 = NL + "\t\t}";
901
  protected final String TEXT_880 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
901
  protected final String TEXT_880 = NL + "\t\tif (";
902
  protected final String TEXT_881 = NL;
902
  protected final String TEXT_881 = ".";
903
  protected final String TEXT_882 = NL;
903
  protected final String TEXT_882 = "().size() >= ";
904
  protected final String TEXT_883 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
904
  protected final String TEXT_883 = ".eINSTANCE.get";
905
  protected final String TEXT_884 = NL + "}";
905
  protected final String TEXT_884 = ".getUpperBound()) {" + NL + "\t\t\t";
906
  protected final String TEXT_885 = NL;
906
  protected final String TEXT_885 = NL + "\t\t}";
907
  protected final String TEXT_886 = NL;
908
  protected final String TEXT_887 = NL + "\t\tif (";
909
  protected final String TEXT_888 = ".";
910
  protected final String TEXT_889 = "() != null) {" + NL + "\t\t\t";
911
  protected final String TEXT_890 = NL + "\t\t}";
912
  protected final String TEXT_891 = NL + "\t\tif (";
913
  protected final String TEXT_892 = ".";
914
  protected final String TEXT_893 = "().size() >= ";
915
  protected final String TEXT_894 = ".eINSTANCE.get";
916
  protected final String TEXT_895 = ".getUpperBound()) {" + NL + "\t\t\t";
917
  protected final String TEXT_896 = NL + "\t\t}";
918
  protected final String TEXT_897 = NL;
919
  protected final String TEXT_898 = NL + "\t\t\tif(!";
920
  protected final String TEXT_899 = ".canCreateLink(";
921
  protected final String TEXT_900 = ", ";
922
  protected final String TEXT_901 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
923
  protected final String TEXT_902 = NL + "\t\t\treturn true;";
924
  protected final String TEXT_903 = NL;
925
  protected final String TEXT_904 = NL + "\t\tif (";
926
  protected final String TEXT_905 = ".";
927
  protected final String TEXT_906 = "() != null) {" + NL + "\t\t\t";
928
  protected final String TEXT_907 = NL + "\t\t}";
929
  protected final String TEXT_908 = NL + "\t\tif (";
930
  protected final String TEXT_909 = ".";
931
  protected final String TEXT_910 = "().size() >= ";
932
  protected final String TEXT_911 = ".eINSTANCE.get";
933
  protected final String TEXT_912 = ".getUpperBound()) {" + NL + "\t\t\t";
934
  protected final String TEXT_913 = NL + "\t\t}";
935
  protected final String TEXT_914 = NL;
936
  protected final String TEXT_915 = NL + "\t\t\tif(!";
937
  protected final String TEXT_916 = ".canCreateLink(";
938
  protected final String TEXT_917 = ", ";
939
  protected final String TEXT_918 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
940
  protected final String TEXT_919 = NL + "\t\t\treturn true;";
941
  protected final String TEXT_920 = NL + "\t\t\treturn false;";
942
  protected final String TEXT_921 = NL + "\t\t}";
943
  protected final String TEXT_922 = NL;
944
  protected final String TEXT_923 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
945
  protected final String TEXT_924 = " getRelationshipContainer(";
946
  protected final String TEXT_925 = " element, ";
947
  protected final String TEXT_926 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
948
  protected final String TEXT_927 = NL + NL + "\t}";
949
  protected final String TEXT_928 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect";
950
  protected final String TEXT_929 = "TargetCommand extends ";
951
  protected final String TEXT_930 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
952
  protected final String TEXT_931 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
953
  protected final String TEXT_932 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
954
  protected final String TEXT_933 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
955
  protected final String TEXT_934 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
956
  protected final String TEXT_935 = "TargetCommand(";
957
  protected final String TEXT_936 = " request) {" + NL + "\t\t\tthis((";
958
  protected final String TEXT_937 = ")request.getConnectionEditPart().getModel(), (";
959
  protected final String TEXT_938 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect";
960
  protected final String TEXT_939 = "TargetCommand(";
961
  protected final String TEXT_940 = " edge, ";
962
  protected final String TEXT_941 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {";
963
  protected final String TEXT_942 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal ";
964
  protected final String TEXT_943 = " domainModelEditDomain = ";
965
  protected final String TEXT_944 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t";
966
  protected final String TEXT_945 = " command = new ";
967
  protected final String TEXT_946 = "() {" + NL + "\t\t\t\tprivate ";
968
  protected final String TEXT_947 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();";
969
  protected final String TEXT_948 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;";
970
  protected final String TEXT_949 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {";
971
  protected final String TEXT_950 = NL;
972
  protected final String TEXT_951 = NL + "\t\t\tif(!";
973
  protected final String TEXT_952 = ".canCreateLink(";
974
  protected final String TEXT_953 = ", ";
975
  protected final String TEXT_954 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
976
  protected final String TEXT_955 = NL + "\t\t\treturn true;";
977
  protected final String TEXT_956 = NL;
978
  protected final String TEXT_957 = NL + "\t\t\tif(!";
979
  protected final String TEXT_958 = ".canCreateLink(";
980
  protected final String TEXT_959 = ", ";
981
  protected final String TEXT_960 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
982
  protected final String TEXT_961 = NL + "\t\t\treturn true;";
983
  protected final String TEXT_962 = NL + "\t\t\treturn false;";
984
  protected final String TEXT_963 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
985
  protected final String TEXT_964 = " createReconnectCommand() {" + NL + "\t\t\t";
986
  protected final String TEXT_965 = " editingDomain = ";
987
  protected final String TEXT_966 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t";
988
  protected final String TEXT_967 = " result = new ";
989
  protected final String TEXT_968 = "();" + NL + "\t\t\tresult.append(new ";
990
  protected final String TEXT_969 = "(edge, newTarget));";
991
  protected final String TEXT_970 = NL + "\t\t\tresult.append(";
992
  protected final String TEXT_971 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
993
  protected final String TEXT_972 = ".eINSTANCE.get";
994
  protected final String TEXT_973 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append(";
995
  protected final String TEXT_974 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
996
  protected final String TEXT_975 = ".eINSTANCE.get";
997
  protected final String TEXT_976 = "()," + NL + "\t\t\t\tnewTarget.getElement()));";
998
  protected final String TEXT_977 = NL + "\t\t\tresult.append(";
999
  protected final String TEXT_978 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), ";
1000
  protected final String TEXT_979 = ".eINSTANCE.get";
1001
  protected final String TEXT_980 = "()," + NL + "\t\t\t\tnewTarget.getElement()));";
1002
  protected final String TEXT_981 = NL + "\t\t\tresult.append(";
1003
  protected final String TEXT_982 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
1004
  protected final String TEXT_983 = ".eINSTANCE.get";
1005
  protected final String TEXT_984 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append(";
1006
  protected final String TEXT_985 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
1007
  protected final String TEXT_986 = ".eINSTANCE.get";
1008
  protected final String TEXT_987 = "(), newTarget.getElement()));";
1009
  protected final String TEXT_988 = NL + "\t\t\tresult.append(";
1010
  protected final String TEXT_989 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), ";
1011
  protected final String TEXT_990 = ".eINSTANCE.get";
1012
  protected final String TEXT_991 = "(), newTarget.getElement()));";
1013
  protected final String TEXT_992 = NL + "\t\t\treturn result;" + NL + "\t\t}";
1014
  protected final String TEXT_993 = NL;
1015
  protected final String TEXT_994 = NL + "\t\t\tprivate ";
1016
  protected final String TEXT_995 = " createDomainModelRemoveCommand(";
1017
  protected final String TEXT_996 = " editingDomain) {";
1018
  protected final String TEXT_997 = NL + "\t\t\t\t";
1019
  protected final String TEXT_998 = " result = new ";
1020
  protected final String TEXT_999 = "();";
1021
  protected final String TEXT_1000 = NL + "\t\t\t\tresult.append(";
1022
  protected final String TEXT_1001 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1023
  protected final String TEXT_1002 = ".getElement().eContainer(), ";
1024
  protected final String TEXT_1003 = ".getElement().eContainmentFeature(), ";
1025
  protected final String TEXT_1004 = ".getElement()));";
1026
  protected final String TEXT_1005 = NL + "\t\t\t\tresult.append(";
1027
  protected final String TEXT_1006 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1028
  protected final String TEXT_1007 = ".getElement().eContainer(), ";
1029
  protected final String TEXT_1008 = ".getElement().eContainmentFeature(), ";
1030
  protected final String TEXT_1009 = ".UNSET_VALUE));";
1031
  protected final String TEXT_1010 = NL + "\t\t\t\treturn ";
1032
  protected final String TEXT_1011 = ".INSTANCE;";
1033
  protected final String TEXT_1012 = NL + "\t\t\t\tresult.append(";
1034
  protected final String TEXT_1013 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1035
  protected final String TEXT_1014 = ".getElement().eContainer(), ";
1036
  protected final String TEXT_1015 = ".eINSTANCE.get";
1037
  protected final String TEXT_1016 = "()," + NL + "\t\t\t\t\t";
1038
  protected final String TEXT_1017 = ".getElement()));";
1039
  protected final String TEXT_1018 = NL + "\t\t\t\tresult.append(";
1040
  protected final String TEXT_1019 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1041
  protected final String TEXT_1020 = ".getElement().eContainer(), ";
1042
  protected final String TEXT_1021 = ".eINSTANCE.get";
1043
  protected final String TEXT_1022 = "()," + NL + "\t\t\t\t\t";
1044
  protected final String TEXT_1023 = ".UNSET_VALUE));";
1045
  protected final String TEXT_1024 = NL + "\t\t\t\tresult.append(";
1046
  protected final String TEXT_1025 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1047
  protected final String TEXT_1026 = ".getElement(), ";
1048
  protected final String TEXT_1027 = ".eINSTANCE.get";
1049
  protected final String TEXT_1028 = "(), ";
1050
  protected final String TEXT_1029 = ".getSource().getElement()));";
1051
  protected final String TEXT_1030 = NL + "\t\t\t\tresult.append(";
1052
  protected final String TEXT_1031 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1053
  protected final String TEXT_1032 = ".getElement(), ";
1054
  protected final String TEXT_1033 = ".eINSTANCE.get";
1055
  protected final String TEXT_1034 = "(), ";
1056
  protected final String TEXT_1035 = ".UNSET_VALUE));";
1057
  protected final String TEXT_1036 = NL + "\t\t\t\tresult.append(";
1058
  protected final String TEXT_1037 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1059
  protected final String TEXT_1038 = ".getElement(), ";
1060
  protected final String TEXT_1039 = ".eINSTANCE.get";
1061
  protected final String TEXT_1040 = "(), ";
1062
  protected final String TEXT_1041 = ".getTarget().getElement()));";
1063
  protected final String TEXT_1042 = NL + "\t\t\t\tresult.append(";
1064
  protected final String TEXT_1043 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1065
  protected final String TEXT_1044 = ".getElement(), ";
1066
  protected final String TEXT_1045 = ".eINSTANCE.get";
1067
  protected final String TEXT_1046 = "(), ";
1068
  protected final String TEXT_1047 = ".UNSET_VALUE));";
1069
  protected final String TEXT_1048 = NL + "\t\t\t\treturn result;";
1070
  protected final String TEXT_1049 = NL + "\t\t\t\treturn ";
1071
  protected final String TEXT_1050 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1072
  protected final String TEXT_1051 = ".getSource().getElement(), ";
1073
  protected final String TEXT_1052 = ".eINSTANCE.get";
1074
  protected final String TEXT_1053 = "(), ";
1075
  protected final String TEXT_1054 = ".getTarget().getElement());";
1076
  protected final String TEXT_1055 = NL + "\t\t\t\treturn ";
1077
  protected final String TEXT_1056 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t";
1078
  protected final String TEXT_1057 = ".getSource().getElement(), ";
1079
  protected final String TEXT_1058 = ".eINSTANCE.get";
1080
  protected final String TEXT_1059 = "(), ";
1081
  protected final String TEXT_1060 = ".UNSET_VALUE);";
1082
  protected final String TEXT_1061 = NL + "\t\t\t}";
1083
  protected final String TEXT_1062 = NL + "\t}" + NL;
1084
  protected final String TEXT_1063 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
1085
  protected final String TEXT_1064 = "Command extends ";
1086
  protected final String TEXT_1065 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
1087
  protected final String TEXT_1066 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
1088
  protected final String TEXT_1067 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
1089
  protected final String TEXT_1068 = " createdEdge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
1090
  protected final String TEXT_1069 = "Command(";
1091
  protected final String TEXT_1070 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof ";
1092
  protected final String TEXT_1071 = ") {" + NL + "\t\t\t\tsource = (";
1093
  protected final String TEXT_1072 = ")requestEx.getSourceEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\tsource = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (requestEx.getTargetEditPart().getModel() instanceof ";
1094
  protected final String TEXT_1073 = ") {" + NL + "\t\t\t\ttarget = (";
1095
  protected final String TEXT_1074 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (source == null || target == null) {" + NL + "\t\t\t\tcreatedEdge = null;" + NL + "\t\t\t\tdomainModelAddCommand = ";
1096
  protected final String TEXT_1075 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = ";
1097
  protected final String TEXT_1076 = ".eINSTANCE.createEdge();";
1098
  protected final String TEXT_1077 = NL + "\t\t\t";
1099
  protected final String TEXT_1078 = " createdDomainElement = ";
1100
  protected final String TEXT_1079 = ".eINSTANCE.create";
1101
  protected final String TEXT_1080 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t";
1102
  protected final String TEXT_1081 = NL + "\t\t\t";
1103
  protected final String TEXT_1082 = ".";
1104
  protected final String TEXT_1083 = ".initializeElement(createdDomainElement);";
1105
  protected final String TEXT_1084 = NL + "\t\t\tcreatedEdge.setElement(null);";
1106
  protected final String TEXT_1085 = NL + "\t\t\t";
1107
  protected final String TEXT_1086 = ".decorateView(createdEdge);" + NL + "\t\t\t";
1108
  protected final String TEXT_1087 = " domainModelEditDomain = ";
1109
  protected final String TEXT_1088 = ".getEditingDomain(source.getDiagram().getElement());";
1110
  protected final String TEXT_1089 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();";
1111
  protected final String TEXT_1090 = NL + "\t\t\t";
1112
  protected final String TEXT_1091 = " container = getRelationshipContainer(source.getElement(), ";
1113
  protected final String TEXT_1092 = ".eINSTANCE.get";
1114
  protected final String TEXT_1093 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\tdomainModelAddCommand = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\taddLinkEndsCommand.append(";
1115
  protected final String TEXT_1094 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, ";
1116
  protected final String TEXT_1095 = ".eINSTANCE.get";
1117
  protected final String TEXT_1096 = "(), createdDomainElement));";
1118
  protected final String TEXT_1097 = NL + "\t\t\taddLinkEndsCommand.append(";
1119
  protected final String TEXT_1098 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, ";
1120
  protected final String TEXT_1099 = ".eINSTANCE.get";
1121
  protected final String TEXT_1100 = "(), createdDomainElement));";
1122
  protected final String TEXT_1101 = NL;
1123
  protected final String TEXT_1102 = NL + "\t\tif (";
1124
  protected final String TEXT_1103 = ".";
1125
  protected final String TEXT_1104 = "() != null) {" + NL + "\t\t\t";
1126
  protected final String TEXT_1105 = NL + "\t\t}";
1127
  protected final String TEXT_1106 = NL + "\t\tif (";
1128
  protected final String TEXT_1107 = ".";
1129
  protected final String TEXT_1108 = "().size() >= ";
1130
  protected final String TEXT_1109 = ".eINSTANCE.get";
1131
  protected final String TEXT_1110 = ".getUpperBound()) {" + NL + "\t\t\t";
1132
  protected final String TEXT_1111 = NL + "\t\t}";
1133
  protected final String TEXT_1112 = NL + "\t\t\taddLinkEndsCommand.append(";
1134
  protected final String TEXT_1113 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
1135
  protected final String TEXT_1114 = ".eINSTANCE.get";
1136
  protected final String TEXT_1115 = "(), source.getElement()));";
1137
  protected final String TEXT_1116 = NL;
1138
  protected final String TEXT_1117 = NL + "\t\tif (";
1139
  protected final String TEXT_1118 = ".";
1140
  protected final String TEXT_1119 = "() != null) {" + NL + "\t\t\t";
1141
  protected final String TEXT_1120 = NL + "\t\t}";
1142
  protected final String TEXT_1121 = NL + "\t\tif (";
1143
  protected final String TEXT_1122 = ".";
1144
  protected final String TEXT_1123 = "().size() >= ";
1145
  protected final String TEXT_1124 = ".eINSTANCE.get";
1146
  protected final String TEXT_1125 = ".getUpperBound()) {" + NL + "\t\t\t";
1147
  protected final String TEXT_1126 = NL + "\t\t}";
1148
  protected final String TEXT_1127 = NL + "\t\t\taddLinkEndsCommand.append(";
1149
  protected final String TEXT_1128 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
1150
  protected final String TEXT_1129 = ".eINSTANCE.get";
1151
  protected final String TEXT_1130 = "(), target.getElement()));";
1152
  protected final String TEXT_1131 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;";
1153
  protected final String TEXT_1132 = NL + "\t\t\tdomainModelAddCommand = ";
1154
  protected final String TEXT_1133 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t";
1155
  protected final String TEXT_1134 = ".eINSTANCE.get";
1156
  protected final String TEXT_1135 = "(), target.getElement());";
1157
  protected final String TEXT_1136 = NL + "\t\t}" + NL;
1158
  protected final String TEXT_1137 = NL;
1159
  protected final String TEXT_1138 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
1160
  protected final String TEXT_1139 = " getRelationshipContainer(";
1161
  protected final String TEXT_1140 = " element, ";
1162
  protected final String TEXT_1141 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
1163
  protected final String TEXT_1142 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
1164
  protected final String TEXT_1143 = NL;
1165
  protected final String TEXT_1144 = NL + "\t\t\tif(!";
1166
  protected final String TEXT_1145 = ".canCreateLink(";
1167
  protected final String TEXT_1146 = ", ";
1168
  protected final String TEXT_1147 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}";
1169
  protected final String TEXT_1148 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}";
1170
  protected final String TEXT_1149 = NL;
1171
  protected final String TEXT_1150 = NL;
1172
  protected final String TEXT_1151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
1173
  protected final String TEXT_1152 = NL + "}";
1174
  protected final String TEXT_1153 = NL;
907
1175
908
  public String generate(Object argument)
1176
  public String generate(Object argument)
909
  {
1177
  {
Lines 915-920 Link Here
915
Palette palette = genDiagram.getPalette();
1183
Palette palette = genDiagram.getPalette();
916
boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode);
1184
boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode);
917
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
1185
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
1186
importManager.registerInnerClass("LinkNotationModelRefresher");	//from linkNotationModelRefresher.jetinc
1187
importManager.registerInnerClass("LinkDescriptor");	//from linkNotationModelRefresher.jetinc
918
1188
919
class NodeEditPartHelper {
1189
class NodeEditPartHelper {
920
	private final List myInnerLabels = new LinkedList();
1190
	private final List myInnerLabels = new LinkedList();
Lines 922-927 Link Here
922
	private final List myExternalLabels = new LinkedList();
1192
	private final List myExternalLabels = new LinkedList();
923
	private final List myPinnedCompartments = new LinkedList();
1193
	private final List myPinnedCompartments = new LinkedList();
924
	private final List myFloatingCompartments = new LinkedList();
1194
	private final List myFloatingCompartments = new LinkedList();
1195
	private final List myContainedFeatureModelFacetLinks = new LinkedList();
1196
	private final List myContainedTypeModelFacetLinks = new LinkedList();
925
	private GenNodeLabel myPrimaryLabel;
1197
	private GenNodeLabel myPrimaryLabel;
926
	private boolean myHasChildrenInListCompartments = false;
1198
	private boolean myHasChildrenInListCompartments = false;
927
	private boolean hasIncomingLinks = false;
1199
	private boolean hasIncomingLinks = false;
Lines 963-986 Link Here
963
			}
1235
			}
964
			GenClass incomingClass;
1236
			GenClass incomingClass;
965
			GenClass outgoingClass;
1237
			GenClass outgoingClass;
1238
			GenClass containerClass;
966
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1239
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
967
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1240
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
968
				incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass();
1241
				incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass();
969
				outgoingClass = modelFacet.getSourceMetaFeature() == null
1242
				outgoingClass = modelFacet.getSourceMetaFeature() == null
970
					? modelFacet.getContainmentMetaFeature().getGenClass()
1243
					? modelFacet.getContainmentMetaFeature().getGenClass()
971
					: modelFacet.getSourceMetaFeature().getTypeGenClass();
1244
					: modelFacet.getSourceMetaFeature().getTypeGenClass();
1245
				if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
1246
					//if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
1247
					containerClass = null;
1248
				} else {
1249
					containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
1250
				}
972
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
1251
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
973
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
1252
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
974
				incomingClass = metaFeature.getTypeGenClass();
1253
				incomingClass = metaFeature.getTypeGenClass();
975
				outgoingClass = metaFeature.getGenClass();
1254
				outgoingClass = metaFeature.getGenClass();
1255
				containerClass = metaFeature.getGenClass();
976
			} else {
1256
			} else {
977
				continue;
1257
				continue;
978
			}
1258
			}
979
			hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
1259
			hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
980
			hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
1260
			hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
1261
			if (containerClass != null && containerClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) {
1262
				if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1263
					myContainedTypeModelFacetLinks.add(genLink);
1264
				} else {
1265
					myContainedFeatureModelFacetLinks.add(genLink);
1266
				}
1267
			}
981
		}
1268
		}
982
	}
1269
	}
983
1270
1271
	public boolean containsLinks() {
1272
		return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
1273
	}
1274
1275
	public boolean containsFeatureModelFacetLinks() {
1276
		return !myContainedFeatureModelFacetLinks.isEmpty();
1277
	}
1278
1279
	public boolean containsTypeModelFacetLinks() {
1280
		return !myContainedTypeModelFacetLinks.isEmpty();
1281
	}
1282
984
	public boolean hasIncomingLinks() {
1283
	public boolean hasIncomingLinks() {
985
		return hasIncomingLinks;
1284
		return hasIncomingLinks;
986
	}
1285
	}
Lines 1028-1033 Link Here
1028
	public Iterator getAllInnerLabels() {
1327
	public Iterator getAllInnerLabels() {
1029
		return myAllInnerLabels.iterator();
1328
		return myAllInnerLabels.iterator();
1030
	}
1329
	}
1330
1331
	public Iterator getContainedFeatureModelFacetLinks() {
1332
		return myContainedFeatureModelFacetLinks.iterator();
1333
	}
1334
1335
	public Iterator getContainedTypeModelFacetLinks() {
1336
		return myContainedTypeModelFacetLinks.iterator();
1337
	}
1031
}
1338
}
1032
final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode);
1339
final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode);
1033
1340
Lines 1072-1097 Link Here
1072
    stringBuffer.append(TEXT_17);
1379
    stringBuffer.append(TEXT_17);
1073
    stringBuffer.append(TEXT_18);
1380
    stringBuffer.append(TEXT_18);
1074
    stringBuffer.append(TEXT_19);
1381
    stringBuffer.append(TEXT_19);
1075
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1382
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1076
    stringBuffer.append(TEXT_20);
1383
    stringBuffer.append(TEXT_20);
1077
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
1384
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1078
    stringBuffer.append(TEXT_21);
1385
    stringBuffer.append(TEXT_21);
1079
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1386
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1080
    stringBuffer.append(TEXT_22);
1387
    stringBuffer.append(TEXT_22);
1081
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
1388
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1082
    stringBuffer.append(TEXT_23);
1389
    stringBuffer.append(TEXT_23);
1083
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1084
    stringBuffer.append(TEXT_24);
1390
    stringBuffer.append(TEXT_24);
1085
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1086
    stringBuffer.append(TEXT_25);
1391
    stringBuffer.append(TEXT_25);
1087
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1392
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1088
    stringBuffer.append(TEXT_26);
1393
    stringBuffer.append(TEXT_26);
1089
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1394
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
1090
    stringBuffer.append(TEXT_27);
1395
    stringBuffer.append(TEXT_27);
1091
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1396
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1092
    stringBuffer.append(TEXT_28);
1397
    stringBuffer.append(TEXT_28);
1093
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1398
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
1094
    stringBuffer.append(TEXT_29);
1399
    stringBuffer.append(TEXT_29);
1400
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1401
    stringBuffer.append(TEXT_30);
1402
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1403
    stringBuffer.append(TEXT_31);
1404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1405
    stringBuffer.append(TEXT_32);
1406
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1407
    stringBuffer.append(TEXT_33);
1408
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1409
    stringBuffer.append(TEXT_34);
1410
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1411
    stringBuffer.append(TEXT_35);
1095
    
1412
    
1096
{
1413
{
1097
TypeModelFacet facet = genNode.getModelFacet();
1414
TypeModelFacet facet = genNode.getModelFacet();
Lines 1099-1264 Link Here
1099
GenFeature containmentFeature = facet.getContainmentMetaFeature();
1416
GenFeature containmentFeature = facet.getContainmentMetaFeature();
1100
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
1417
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
1101
1418
1102
    stringBuffer.append(TEXT_30);
1419
    stringBuffer.append(TEXT_36);
1103
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1420
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1104
    stringBuffer.append(TEXT_31);
1421
    stringBuffer.append(TEXT_37);
1105
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1422
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1106
    stringBuffer.append(TEXT_32);
1423
    stringBuffer.append(TEXT_38);
1107
    
1424
    
1108
	if (containmentFeature.getEcoreFeature().isMany()) {
1425
	if (containmentFeature.getEcoreFeature().isMany()) {
1109
1426
1110
    stringBuffer.append(TEXT_33);
1427
    stringBuffer.append(TEXT_39);
1111
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1428
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1112
    stringBuffer.append(TEXT_34);
1429
    stringBuffer.append(TEXT_40);
1113
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1430
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1114
    stringBuffer.append(TEXT_35);
1431
    stringBuffer.append(TEXT_41);
1115
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1432
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1116
    stringBuffer.append(TEXT_36);
1433
    stringBuffer.append(TEXT_42);
1117
    
1434
    
1118
	} else {
1435
	} else {
1119
1436
1120
    stringBuffer.append(TEXT_37);
1437
    stringBuffer.append(TEXT_43);
1121
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1438
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1122
    stringBuffer.append(TEXT_38);
1439
    stringBuffer.append(TEXT_44);
1123
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1440
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1124
    stringBuffer.append(TEXT_39);
1441
    stringBuffer.append(TEXT_45);
1125
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1442
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1126
    stringBuffer.append(TEXT_40);
1443
    stringBuffer.append(TEXT_46);
1127
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1444
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1128
    stringBuffer.append(TEXT_41);
1445
    stringBuffer.append(TEXT_47);
1129
    
1446
    
1130
	}
1447
	}
1131
1448
1132
    
1449
    
1133
	if (childFeature.getEcoreFeature().isMany()) {
1450
	if (childFeature.getEcoreFeature().isMany()) {
1134
1451
1135
    stringBuffer.append(TEXT_42);
1452
    stringBuffer.append(TEXT_48);
1136
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1137
    stringBuffer.append(TEXT_43);
1454
    stringBuffer.append(TEXT_49);
1138
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1455
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1139
    stringBuffer.append(TEXT_44);
1456
    stringBuffer.append(TEXT_50);
1140
    stringBuffer.append(childFeature.getFeatureAccessorName());
1457
    stringBuffer.append(childFeature.getFeatureAccessorName());
1141
    stringBuffer.append(TEXT_45);
1458
    stringBuffer.append(TEXT_51);
1142
    
1459
    
1143
	} else {
1460
	} else {
1144
1461
1145
    stringBuffer.append(TEXT_46);
1462
    stringBuffer.append(TEXT_52);
1146
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1463
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1147
    stringBuffer.append(TEXT_47);
1464
    stringBuffer.append(TEXT_53);
1148
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1465
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1149
    stringBuffer.append(TEXT_48);
1466
    stringBuffer.append(TEXT_54);
1150
    stringBuffer.append(childFeature.getFeatureAccessorName());
1467
    stringBuffer.append(childFeature.getFeatureAccessorName());
1151
    stringBuffer.append(TEXT_49);
1468
    stringBuffer.append(TEXT_55);
1152
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1469
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1153
    stringBuffer.append(TEXT_50);
1470
    stringBuffer.append(TEXT_56);
1154
    
1471
    
1155
	}
1472
	}
1156
1473
1157
    stringBuffer.append(TEXT_51);
1474
    stringBuffer.append(TEXT_57);
1158
    
1475
    
1159
} else {
1476
} else {
1160
	if (containmentFeature.getEcoreFeature().isMany()) {
1477
	if (containmentFeature.getEcoreFeature().isMany()) {
1161
1478
1162
    stringBuffer.append(TEXT_52);
1479
    stringBuffer.append(TEXT_58);
1163
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1480
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
1164
    stringBuffer.append(TEXT_53);
1481
    stringBuffer.append(TEXT_59);
1165
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1482
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1166
    stringBuffer.append(TEXT_54);
1483
    stringBuffer.append(TEXT_60);
1167
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1484
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1168
    stringBuffer.append(TEXT_55);
1485
    stringBuffer.append(TEXT_61);
1169
    
1486
    
1170
	} else {
1487
	} else {
1171
1488
1172
    stringBuffer.append(TEXT_56);
1489
    stringBuffer.append(TEXT_62);
1173
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1174
    stringBuffer.append(TEXT_57);
1491
    stringBuffer.append(TEXT_63);
1175
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1492
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1176
    stringBuffer.append(TEXT_58);
1493
    stringBuffer.append(TEXT_64);
1177
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1494
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1178
    stringBuffer.append(TEXT_59);
1495
    stringBuffer.append(TEXT_65);
1179
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1496
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
1180
    stringBuffer.append(TEXT_60);
1497
    stringBuffer.append(TEXT_66);
1181
    
1498
    
1182
	}
1499
	}
1183
}
1500
}
1184
1501
1185
    stringBuffer.append(TEXT_61);
1502
    stringBuffer.append(TEXT_67);
1186
    
1503
    
1187
}	/*restrict local vars used in component edit policy*/
1504
}	/*restrict local vars used in component edit policy*/
1188
1505
1189
    stringBuffer.append(TEXT_62);
1506
    stringBuffer.append(TEXT_68);
1190
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1507
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1191
    stringBuffer.append(TEXT_63);
1508
    stringBuffer.append(TEXT_69);
1192
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
1509
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
1193
    stringBuffer.append(TEXT_64);
1510
    stringBuffer.append(TEXT_70);
1194
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1511
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1195
    stringBuffer.append(TEXT_65);
1512
    stringBuffer.append(TEXT_71);
1196
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest"));
1513
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest"));
1197
    stringBuffer.append(TEXT_66);
1514
    stringBuffer.append(TEXT_72);
1198
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1515
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1199
    stringBuffer.append(TEXT_67);
1516
    stringBuffer.append(TEXT_73);
1200
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1517
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1201
    stringBuffer.append(TEXT_68);
1518
    stringBuffer.append(TEXT_74);
1202
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
1519
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
1203
    stringBuffer.append(TEXT_69);
1520
    stringBuffer.append(TEXT_75);
1204
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1521
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1205
    stringBuffer.append(TEXT_70);
1522
    stringBuffer.append(TEXT_76);
1206
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1523
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1207
    stringBuffer.append(TEXT_71);
1524
    stringBuffer.append(TEXT_77);
1208
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1525
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1209
    stringBuffer.append(TEXT_72);
1526
    stringBuffer.append(TEXT_78);
1210
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1527
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1211
    stringBuffer.append(TEXT_73);
1528
    stringBuffer.append(TEXT_79);
1212
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1529
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1213
    stringBuffer.append(TEXT_74);
1530
    stringBuffer.append(TEXT_80);
1214
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
1531
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
1215
    stringBuffer.append(TEXT_75);
1532
    stringBuffer.append(TEXT_81);
1216
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1533
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1217
    stringBuffer.append(TEXT_76);
1534
    stringBuffer.append(TEXT_82);
1218
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1535
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1219
    stringBuffer.append(TEXT_77);
1536
    stringBuffer.append(TEXT_83);
1220
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
1537
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
1221
    stringBuffer.append(TEXT_78);
1538
    stringBuffer.append(TEXT_84);
1222
    stringBuffer.append(genNode.getEditPartClassName());
1539
    stringBuffer.append(genNode.getEditPartClassName());
1223
    stringBuffer.append(TEXT_79);
1540
    stringBuffer.append(TEXT_85);
1224
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1541
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
1225
    stringBuffer.append(TEXT_80);
1542
    stringBuffer.append(TEXT_86);
1226
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy"));
1543
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy"));
1227
    stringBuffer.append(TEXT_81);
1544
    stringBuffer.append(TEXT_87);
1228
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1545
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1229
    stringBuffer.append(TEXT_82);
1546
    stringBuffer.append(TEXT_88);
1230
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
1547
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
1231
    stringBuffer.append(TEXT_83);
1548
    stringBuffer.append(TEXT_89);
1232
    
1549
    
1233
if (!myHelper.hasIncomingLinks()) {
1550
if (!myHelper.hasIncomingLinks()) {
1234
1551
1235
    stringBuffer.append(TEXT_84);
1552
    stringBuffer.append(TEXT_90);
1236
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1553
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1237
    stringBuffer.append(TEXT_85);
1554
    stringBuffer.append(TEXT_91);
1238
    
1555
    
1239
} else {
1556
} else {
1240
1557
1241
    stringBuffer.append(TEXT_86);
1558
    stringBuffer.append(TEXT_92);
1242
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1559
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1243
    stringBuffer.append(TEXT_87);
1560
    stringBuffer.append(TEXT_93);
1244
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1561
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1245
    stringBuffer.append(TEXT_88);
1562
    stringBuffer.append(TEXT_94);
1246
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1563
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1247
    stringBuffer.append(TEXT_89);
1564
    stringBuffer.append(TEXT_95);
1248
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1565
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1249
    stringBuffer.append(TEXT_90);
1566
    stringBuffer.append(TEXT_96);
1250
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1567
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1251
    stringBuffer.append(TEXT_91);
1568
    stringBuffer.append(TEXT_97);
1252
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1569
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1253
    stringBuffer.append(TEXT_92);
1570
    stringBuffer.append(TEXT_98);
1254
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1571
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1255
    stringBuffer.append(TEXT_93);
1572
    stringBuffer.append(TEXT_99);
1256
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1573
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1257
    stringBuffer.append(TEXT_94);
1574
    stringBuffer.append(TEXT_100);
1258
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1575
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1259
    stringBuffer.append(TEXT_95);
1576
    stringBuffer.append(TEXT_101);
1260
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1577
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1261
    stringBuffer.append(TEXT_96);
1578
    stringBuffer.append(TEXT_102);
1262
    
1579
    
1263
	for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1580
	for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1264
		GenLink genLink = (GenLink)it.next();
1581
		GenLink genLink = (GenLink)it.next();
Lines 1282-1339 Link Here
1282
			continue;
1599
			continue;
1283
		}
1600
		}
1284
1601
1285
    stringBuffer.append(TEXT_97);
1602
    stringBuffer.append(TEXT_103);
1286
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1603
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1287
    stringBuffer.append(TEXT_98);
1604
    stringBuffer.append(TEXT_104);
1288
    stringBuffer.append(reconnectCommandNameInfix);
1605
    stringBuffer.append(reconnectCommandNameInfix);
1289
    stringBuffer.append(genLink.getVisualID());
1606
    stringBuffer.append(genLink.getVisualID());
1290
    stringBuffer.append(TEXT_99);
1607
    stringBuffer.append(TEXT_105);
1291
    
1608
    
1292
	}
1609
	}
1293
1610
1294
    stringBuffer.append(TEXT_100);
1611
    stringBuffer.append(TEXT_106);
1295
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1612
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1296
    stringBuffer.append(TEXT_101);
1613
    stringBuffer.append(TEXT_107);
1297
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1614
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1298
    stringBuffer.append(TEXT_102);
1615
    stringBuffer.append(TEXT_108);
1299
    
1616
    
1300
}
1617
}
1301
1618
1302
    stringBuffer.append(TEXT_103);
1619
    stringBuffer.append(TEXT_109);
1303
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1620
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1304
    stringBuffer.append(TEXT_104);
1621
    stringBuffer.append(TEXT_110);
1305
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
1622
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
1306
    stringBuffer.append(TEXT_105);
1623
    stringBuffer.append(TEXT_111);
1307
    
1624
    
1308
if (!myHelper.hasOutgoingLinks()) {
1625
if (!myHelper.hasOutgoingLinks()) {
1309
1626
1310
    stringBuffer.append(TEXT_106);
1627
    stringBuffer.append(TEXT_112);
1311
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1628
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1312
    stringBuffer.append(TEXT_107);
1629
    stringBuffer.append(TEXT_113);
1313
    
1630
    
1314
} else {
1631
} else {
1315
1632
1316
    stringBuffer.append(TEXT_108);
1633
    stringBuffer.append(TEXT_114);
1317
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1634
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1318
    stringBuffer.append(TEXT_109);
1635
    stringBuffer.append(TEXT_115);
1319
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1636
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1320
    stringBuffer.append(TEXT_110);
1637
    stringBuffer.append(TEXT_116);
1321
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1322
    stringBuffer.append(TEXT_111);
1639
    stringBuffer.append(TEXT_117);
1323
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1640
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1324
    stringBuffer.append(TEXT_112);
1641
    stringBuffer.append(TEXT_118);
1325
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1642
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1326
    stringBuffer.append(TEXT_113);
1643
    stringBuffer.append(TEXT_119);
1327
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1644
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1328
    stringBuffer.append(TEXT_114);
1645
    stringBuffer.append(TEXT_120);
1329
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1646
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1330
    stringBuffer.append(TEXT_115);
1647
    stringBuffer.append(TEXT_121);
1331
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1648
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1332
    stringBuffer.append(TEXT_116);
1649
    stringBuffer.append(TEXT_122);
1333
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1650
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
1334
    stringBuffer.append(TEXT_117);
1651
    stringBuffer.append(TEXT_123);
1335
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1652
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1336
    stringBuffer.append(TEXT_118);
1653
    stringBuffer.append(TEXT_124);
1337
    
1654
    
1338
	for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1655
	for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1339
		GenLink genLink = (GenLink)it.next();
1656
		GenLink genLink = (GenLink)it.next();
Lines 1359-1398 Link Here
1359
			continue;
1676
			continue;
1360
		}
1677
		}
1361
1678
1362
    stringBuffer.append(TEXT_119);
1679
    stringBuffer.append(TEXT_125);
1363
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1680
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1364
    stringBuffer.append(TEXT_120);
1681
    stringBuffer.append(TEXT_126);
1365
    stringBuffer.append(reconnectCommandNameInfix);
1682
    stringBuffer.append(reconnectCommandNameInfix);
1366
    stringBuffer.append(genLink.getVisualID());
1683
    stringBuffer.append(genLink.getVisualID());
1367
    stringBuffer.append(TEXT_121);
1684
    stringBuffer.append(TEXT_127);
1368
    
1685
    
1369
	}
1686
	}
1370
1687
1371
    stringBuffer.append(TEXT_122);
1688
    stringBuffer.append(TEXT_128);
1372
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1689
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1373
    stringBuffer.append(TEXT_123);
1690
    stringBuffer.append(TEXT_129);
1374
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1691
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1375
    stringBuffer.append(TEXT_124);
1692
    stringBuffer.append(TEXT_130);
1376
    
1693
    
1377
}
1694
}
1378
1695
1379
    stringBuffer.append(TEXT_125);
1696
    stringBuffer.append(TEXT_131);
1380
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1697
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1381
    stringBuffer.append(TEXT_126);
1698
    stringBuffer.append(TEXT_132);
1382
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
1699
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
1383
    stringBuffer.append(TEXT_127);
1700
    stringBuffer.append(TEXT_133);
1384
    if (palette != null && myHelper.hasOutgoingLinks()) {
1701
    if (palette != null && myHelper.hasOutgoingLinks()) {
1385
    stringBuffer.append(TEXT_128);
1702
    stringBuffer.append(TEXT_134);
1386
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1703
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1387
    stringBuffer.append(TEXT_129);
1704
    stringBuffer.append(TEXT_135);
1388
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1705
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1389
    stringBuffer.append(TEXT_130);
1706
    stringBuffer.append(TEXT_136);
1390
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1707
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1391
    stringBuffer.append(TEXT_131);
1708
    stringBuffer.append(TEXT_137);
1392
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1709
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1393
    stringBuffer.append(TEXT_132);
1710
    stringBuffer.append(TEXT_138);
1394
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1711
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1395
    stringBuffer.append(TEXT_133);
1712
    stringBuffer.append(TEXT_139);
1396
    
1713
    
1397
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1714
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1398
	GenLink genLink = (GenLink)it.next();
1715
	GenLink genLink = (GenLink)it.next();
Lines 1418-1457 Link Here
1418
		continue;
1735
		continue;
1419
	}
1736
	}
1420
1737
1421
    stringBuffer.append(TEXT_134);
1738
    stringBuffer.append(TEXT_140);
1422
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1739
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1423
    stringBuffer.append(TEXT_135);
1740
    stringBuffer.append(TEXT_141);
1424
    stringBuffer.append(createCommandNameInfix);
1741
    stringBuffer.append(createCommandNameInfix);
1425
    stringBuffer.append(genLink.getVisualID());
1742
    stringBuffer.append(genLink.getVisualID());
1426
    stringBuffer.append(TEXT_136);
1743
    stringBuffer.append(TEXT_142);
1427
    
1744
    
1428
}
1745
}
1429
1746
1430
    stringBuffer.append(TEXT_137);
1747
    stringBuffer.append(TEXT_143);
1431
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1748
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1432
    stringBuffer.append(TEXT_138);
1749
    stringBuffer.append(TEXT_144);
1433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1750
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1434
    stringBuffer.append(TEXT_139);
1751
    stringBuffer.append(TEXT_145);
1435
    }/*when there's palette*/
1752
    }/*when there's palette*/
1436
    stringBuffer.append(TEXT_140);
1753
    stringBuffer.append(TEXT_146);
1437
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1754
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1438
    stringBuffer.append(TEXT_141);
1755
    stringBuffer.append(TEXT_147);
1439
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
1756
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
1440
    stringBuffer.append(TEXT_142);
1757
    stringBuffer.append(TEXT_148);
1441
    if (palette != null && myHelper.hasIncomingLinks()) {
1758
    if (palette != null && myHelper.hasIncomingLinks()) {
1442
    stringBuffer.append(TEXT_143);
1759
    stringBuffer.append(TEXT_149);
1443
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1760
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1444
    stringBuffer.append(TEXT_144);
1761
    stringBuffer.append(TEXT_150);
1445
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1762
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1446
    stringBuffer.append(TEXT_145);
1763
    stringBuffer.append(TEXT_151);
1447
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1764
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1448
    stringBuffer.append(TEXT_146);
1765
    stringBuffer.append(TEXT_152);
1449
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1766
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1450
    stringBuffer.append(TEXT_147);
1767
    stringBuffer.append(TEXT_153);
1451
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1768
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1452
    stringBuffer.append(TEXT_148);
1769
    stringBuffer.append(TEXT_154);
1453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1770
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
1454
    stringBuffer.append(TEXT_149);
1771
    stringBuffer.append(TEXT_155);
1455
    
1772
    
1456
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1773
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1457
	GenLink genLink = (GenLink)it.next();
1774
	GenLink genLink = (GenLink)it.next();
Lines 1475-1512 Link Here
1475
		continue;
1792
		continue;
1476
	}
1793
	}
1477
1794
1478
    stringBuffer.append(TEXT_150);
1795
    stringBuffer.append(TEXT_156);
1479
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1796
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
1480
    stringBuffer.append(TEXT_151);
1797
    stringBuffer.append(TEXT_157);
1481
    stringBuffer.append(createCommandNameInfix);
1798
    stringBuffer.append(createCommandNameInfix);
1482
    stringBuffer.append(genLink.getVisualID());
1799
    stringBuffer.append(genLink.getVisualID());
1483
    stringBuffer.append(TEXT_152);
1800
    stringBuffer.append(TEXT_158);
1484
    
1801
    
1485
}
1802
}
1486
1803
1487
    stringBuffer.append(TEXT_153);
1804
    stringBuffer.append(TEXT_159);
1488
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1805
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1489
    stringBuffer.append(TEXT_154);
1806
    stringBuffer.append(TEXT_160);
1490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1807
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1491
    stringBuffer.append(TEXT_155);
1808
    stringBuffer.append(TEXT_161);
1492
    }/*when there's palette*/
1809
    }/*when there's palette*/
1493
    stringBuffer.append(TEXT_156);
1810
    stringBuffer.append(TEXT_162);
1494
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1811
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
1495
    stringBuffer.append(TEXT_157);
1812
    stringBuffer.append(TEXT_163);
1813
    
1814
if (myHelper.containsLinks()) {
1815
1816
    stringBuffer.append(TEXT_164);
1817
    
1818
}
1819
1820
    stringBuffer.append(TEXT_165);
1496
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1821
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1497
    stringBuffer.append(TEXT_158);
1822
    stringBuffer.append(TEXT_166);
1498
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1823
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1499
    stringBuffer.append(TEXT_159);
1824
    stringBuffer.append(TEXT_167);
1500
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1825
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1501
    stringBuffer.append(TEXT_160);
1826
    stringBuffer.append(TEXT_168);
1502
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
1827
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
1503
    stringBuffer.append(TEXT_161);
1828
    stringBuffer.append(TEXT_169);
1504
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1829
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1505
    stringBuffer.append(TEXT_162);
1830
    stringBuffer.append(TEXT_170);
1506
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1831
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1507
    stringBuffer.append(TEXT_163);
1832
    stringBuffer.append(TEXT_171);
1508
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1833
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1509
    stringBuffer.append(TEXT_164);
1834
    stringBuffer.append(TEXT_172);
1510
    
1835
    
1511
String figureQualifiedClassName = null;
1836
String figureQualifiedClassName = null;
1512
Viewmap viewmap = genNode.getViewmap();
1837
Viewmap viewmap = genNode.getViewmap();
Lines 1516-1613 Link Here
1516
		figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure";
1841
		figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure";
1517
	}
1842
	}
1518
1843
1519
    stringBuffer.append(TEXT_165);
1844
    stringBuffer.append(TEXT_173);
1520
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
1845
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
1521
    stringBuffer.append(TEXT_166);
1846
    stringBuffer.append(TEXT_174);
1522
    if (isXYLayout) {
1847
    if (isXYLayout) {
1523
    stringBuffer.append(TEXT_167);
1848
    stringBuffer.append(TEXT_175);
1524
    } /* use flow layout*/ 
1849
    } /* use flow layout*/ 
1525
    stringBuffer.append(TEXT_168);
1850
    stringBuffer.append(TEXT_176);
1526
    } else if (viewmap instanceof SnippetViewmap) {
1851
    } else if (viewmap instanceof SnippetViewmap) {
1527
    stringBuffer.append(TEXT_169);
1852
    stringBuffer.append(TEXT_177);
1528
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
1853
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
1529
    stringBuffer.append(TEXT_170);
1854
    stringBuffer.append(TEXT_178);
1530
    } else if (viewmap instanceof InnerClassViewmap) {
1855
    } else if (viewmap instanceof InnerClassViewmap) {
1531
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
1856
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
1532
1857
1533
    stringBuffer.append(TEXT_171);
1858
    stringBuffer.append(TEXT_179);
1534
    stringBuffer.append(figureQualifiedClassName);
1859
    stringBuffer.append(figureQualifiedClassName);
1535
    stringBuffer.append(TEXT_172);
1860
    stringBuffer.append(TEXT_180);
1536
    stringBuffer.append(figureQualifiedClassName);
1861
    stringBuffer.append(figureQualifiedClassName);
1537
    stringBuffer.append(TEXT_173);
1862
    stringBuffer.append(TEXT_181);
1538
    if (!genNode.getChildNodes().isEmpty() && isXYLayout) { /*otherwise, leave to figure's default value*/
1863
    if (!genNode.getChildNodes().isEmpty() && isXYLayout) { /*otherwise, leave to figure's default value*/
1539
    stringBuffer.append(TEXT_174);
1864
    stringBuffer.append(TEXT_182);
1540
    }
1865
    }
1541
    stringBuffer.append(TEXT_175);
1866
    stringBuffer.append(TEXT_183);
1542
    }
1867
    }
1543
    stringBuffer.append(TEXT_176);
1868
    stringBuffer.append(TEXT_184);
1544
    if (figureQualifiedClassName != null) {
1869
    if (figureQualifiedClassName != null) {
1545
    stringBuffer.append(TEXT_177);
1870
    stringBuffer.append(TEXT_185);
1546
    stringBuffer.append(figureQualifiedClassName);
1871
    stringBuffer.append(figureQualifiedClassName);
1547
    stringBuffer.append(TEXT_178);
1872
    stringBuffer.append(TEXT_186);
1548
    stringBuffer.append(figureQualifiedClassName);
1873
    stringBuffer.append(figureQualifiedClassName);
1549
    stringBuffer.append(TEXT_179);
1874
    stringBuffer.append(TEXT_187);
1550
    }
1875
    }
1551
    stringBuffer.append(TEXT_180);
1876
    stringBuffer.append(TEXT_188);
1552
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1877
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1553
    stringBuffer.append(TEXT_181);
1878
    stringBuffer.append(TEXT_189);
1554
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1879
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1555
    stringBuffer.append(TEXT_182);
1880
    stringBuffer.append(TEXT_190);
1556
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1881
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1557
    stringBuffer.append(TEXT_183);
1882
    stringBuffer.append(TEXT_191);
1558
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
1883
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
1559
    stringBuffer.append(TEXT_184);
1884
    stringBuffer.append(TEXT_192);
1560
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1885
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1561
    stringBuffer.append(TEXT_185);
1886
    stringBuffer.append(TEXT_193);
1562
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1887
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
1563
    stringBuffer.append(TEXT_186);
1888
    stringBuffer.append(TEXT_194);
1564
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
1889
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
1565
    stringBuffer.append(TEXT_187);
1890
    stringBuffer.append(TEXT_195);
1566
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
1891
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
1567
    stringBuffer.append(TEXT_188);
1892
    stringBuffer.append(TEXT_196);
1568
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
1893
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
1569
    stringBuffer.append(TEXT_189);
1894
    stringBuffer.append(TEXT_197);
1570
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
1895
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
1571
    stringBuffer.append(TEXT_190);
1896
    stringBuffer.append(TEXT_198);
1572
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
1897
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
1573
    stringBuffer.append(TEXT_191);
1898
    stringBuffer.append(TEXT_199);
1574
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
1899
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
1575
    stringBuffer.append(TEXT_192);
1900
    stringBuffer.append(TEXT_200);
1576
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1901
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1577
    stringBuffer.append(TEXT_193);
1902
    stringBuffer.append(TEXT_201);
1578
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1903
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1579
    stringBuffer.append(TEXT_194);
1904
    stringBuffer.append(TEXT_202);
1580
    
1905
    
1581
if (!isXYLayout) {
1906
if (!isXYLayout) {
1582
	String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout");
1907
	String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout");
1583
1908
1584
    stringBuffer.append(TEXT_195);
1909
    stringBuffer.append(TEXT_203);
1585
    stringBuffer.append(layoutClassName);
1910
    stringBuffer.append(layoutClassName);
1586
    stringBuffer.append(TEXT_196);
1911
    stringBuffer.append(TEXT_204);
1587
    stringBuffer.append(layoutClassName);
1912
    stringBuffer.append(layoutClassName);
1588
    stringBuffer.append(TEXT_197);
1913
    stringBuffer.append(TEXT_205);
1589
    } else {
1914
    } else {
1590
    stringBuffer.append(TEXT_198);
1915
    stringBuffer.append(TEXT_206);
1591
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
1916
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
1592
    stringBuffer.append(TEXT_199);
1917
    stringBuffer.append(TEXT_207);
1593
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1918
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1594
    stringBuffer.append(TEXT_200);
1919
    stringBuffer.append(TEXT_208);
1595
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1920
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1596
    stringBuffer.append(TEXT_201);
1921
    stringBuffer.append(TEXT_209);
1597
    }
1922
    }
1598
    stringBuffer.append(TEXT_202);
1923
    stringBuffer.append(TEXT_210);
1599
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1924
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1600
    stringBuffer.append(TEXT_203);
1925
    stringBuffer.append(TEXT_211);
1601
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1926
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1602
    stringBuffer.append(TEXT_204);
1927
    stringBuffer.append(TEXT_212);
1603
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1928
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1604
    stringBuffer.append(TEXT_205);
1929
    stringBuffer.append(TEXT_213);
1605
    
1930
    
1606
	if (myHelper.hasFixedChildren()) {
1931
	if (myHelper.hasFixedChildren()) {
1607
1932
1608
    stringBuffer.append(TEXT_206);
1933
    stringBuffer.append(TEXT_214);
1609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1934
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1610
    stringBuffer.append(TEXT_207);
1935
    stringBuffer.append(TEXT_215);
1611
    
1936
    
1612
for (Iterator it = myHelper.getInnerFixedLabels(); it.hasNext(); ) {
1937
for (Iterator it = myHelper.getInnerFixedLabels(); it.hasNext(); ) {
1613
	GenNodeLabel genLabel = (GenNodeLabel) it.next();
1938
	GenNodeLabel genLabel = (GenNodeLabel) it.next();
Lines 1615-1629 Link Here
1615
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) genLabel.getViewmap();
1940
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) genLabel.getViewmap();
1616
	final String childSetterName = childViewmap.getSetterName() == null ? "setLabel" : childViewmap.getSetterName();
1941
	final String childSetterName = childViewmap.getSetterName() == null ? "setLabel" : childViewmap.getSetterName();
1617
1942
1618
    stringBuffer.append(TEXT_208);
1943
    stringBuffer.append(TEXT_216);
1619
    stringBuffer.append(labelEditPart);
1944
    stringBuffer.append(labelEditPart);
1620
    stringBuffer.append(TEXT_209);
1945
    stringBuffer.append(TEXT_217);
1621
    stringBuffer.append(labelEditPart);
1946
    stringBuffer.append(labelEditPart);
1622
    stringBuffer.append(TEXT_210);
1947
    stringBuffer.append(TEXT_218);
1623
    stringBuffer.append(childSetterName);
1948
    stringBuffer.append(childSetterName);
1624
    stringBuffer.append(TEXT_211);
1949
    stringBuffer.append(TEXT_219);
1625
    stringBuffer.append(childViewmap.getGetterName());
1950
    stringBuffer.append(childViewmap.getGetterName());
1626
    stringBuffer.append(TEXT_212);
1951
    stringBuffer.append(TEXT_220);
1627
    
1952
    
1628
}
1953
}
1629
1954
Lines 1632-1650 Link Here
1632
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
1957
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
1633
	String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
1958
	String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
1634
1959
1635
    stringBuffer.append(TEXT_213);
1960
    stringBuffer.append(TEXT_221);
1636
    stringBuffer.append(compartmentEditPartFQN);
1961
    stringBuffer.append(compartmentEditPartFQN);
1637
    stringBuffer.append(TEXT_214);
1962
    stringBuffer.append(TEXT_222);
1638
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1963
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1639
    stringBuffer.append(TEXT_215);
1964
    stringBuffer.append(TEXT_223);
1640
    stringBuffer.append(childViewmap.getGetterName());
1965
    stringBuffer.append(childViewmap.getGetterName());
1641
    stringBuffer.append(TEXT_216);
1966
    stringBuffer.append(TEXT_224);
1642
    stringBuffer.append(compartmentEditPartFQN);
1967
    stringBuffer.append(compartmentEditPartFQN);
1643
    stringBuffer.append(TEXT_217);
1968
    stringBuffer.append(TEXT_225);
1644
    	
1969
    	
1645
} // for pinned compartments
1970
} // for pinned compartments
1646
1971
1647
    stringBuffer.append(TEXT_218);
1972
    stringBuffer.append(TEXT_226);
1648
    
1973
    
1649
//XXX: ignore labels assuming that they never may be removed
1974
//XXX: ignore labels assuming that they never may be removed
1650
for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) {
1975
for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) {
Lines 1652-1676 Link Here
1652
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
1977
	final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
1653
	String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
1978
	String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
1654
1979
1655
    stringBuffer.append(TEXT_219);
1980
    stringBuffer.append(TEXT_227);
1656
    stringBuffer.append(compartmentEditPartFQN);
1981
    stringBuffer.append(compartmentEditPartFQN);
1657
    stringBuffer.append(TEXT_220);
1982
    stringBuffer.append(TEXT_228);
1658
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1983
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1659
    stringBuffer.append(TEXT_221);
1984
    stringBuffer.append(TEXT_229);
1660
    stringBuffer.append(childViewmap.getGetterName());
1985
    stringBuffer.append(childViewmap.getGetterName());
1661
    stringBuffer.append(TEXT_222);
1986
    stringBuffer.append(TEXT_230);
1662
    stringBuffer.append(compartmentEditPartFQN);
1987
    stringBuffer.append(compartmentEditPartFQN);
1663
    stringBuffer.append(TEXT_223);
1988
    stringBuffer.append(TEXT_231);
1664
    
1989
    
1665
} // for pinned compartments
1990
} // for pinned compartments
1666
1991
1667
    stringBuffer.append(TEXT_224);
1992
    stringBuffer.append(TEXT_232);
1668
    
1993
    
1669
} // if myHelper.hasFixedChildren()
1994
} // if myHelper.hasFixedChildren()
1670
1995
1671
    stringBuffer.append(TEXT_225);
1996
    stringBuffer.append(TEXT_233);
1672
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1997
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1673
    stringBuffer.append(TEXT_226);
1998
    stringBuffer.append(TEXT_234);
1674
    
1999
    
1675
		GenNodeLabel firstEditableLabel = null;
2000
		GenNodeLabel firstEditableLabel = null;
1676
		for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) {
2001
		for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) {
Lines 1682-1726 Link Here
1682
		}
2007
		}
1683
		if (firstEditableLabel != null) {
2008
		if (firstEditableLabel != null) {
1684
2009
1685
    stringBuffer.append(TEXT_227);
2010
    stringBuffer.append(TEXT_235);
1686
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2011
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1687
    stringBuffer.append(TEXT_228);
2012
    stringBuffer.append(TEXT_236);
1688
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2013
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1689
    stringBuffer.append(TEXT_229);
2014
    stringBuffer.append(TEXT_237);
1690
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2015
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1691
    stringBuffer.append(TEXT_230);
2016
    stringBuffer.append(TEXT_238);
1692
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2017
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1693
    stringBuffer.append(TEXT_231);
2018
    stringBuffer.append(TEXT_239);
1694
    stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName()));
2019
    stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName()));
1695
    stringBuffer.append(TEXT_232);
2020
    stringBuffer.append(TEXT_240);
1696
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2021
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1697
    stringBuffer.append(TEXT_233);
2022
    stringBuffer.append(TEXT_241);
1698
    
2023
    
1699
		}
2024
		}
1700
2025
1701
    stringBuffer.append(TEXT_234);
2026
    stringBuffer.append(TEXT_242);
1702
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
2027
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1703
    stringBuffer.append(TEXT_235);
2028
    stringBuffer.append(TEXT_243);
1704
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
2029
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
1705
    stringBuffer.append(TEXT_236);
2030
    stringBuffer.append(TEXT_244);
1706
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2031
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1707
    stringBuffer.append(TEXT_237);
2032
    stringBuffer.append(TEXT_245);
1708
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
2033
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
1709
    stringBuffer.append(TEXT_238);
2034
    stringBuffer.append(TEXT_246);
1710
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
2035
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
1711
    stringBuffer.append(TEXT_239);
2036
    stringBuffer.append(TEXT_247);
1712
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2037
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1713
    stringBuffer.append(TEXT_240);
2038
    stringBuffer.append(TEXT_248);
1714
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
2039
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
1715
    stringBuffer.append(TEXT_241);
2040
    stringBuffer.append(TEXT_249);
1716
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2041
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1717
    stringBuffer.append(TEXT_242);
2042
    stringBuffer.append(TEXT_250);
1718
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2043
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1719
    stringBuffer.append(TEXT_243);
2044
    stringBuffer.append(TEXT_251);
1720
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2045
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1721
    stringBuffer.append(TEXT_244);
2046
    stringBuffer.append(TEXT_252);
1722
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2047
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1723
    stringBuffer.append(TEXT_245);
2048
    stringBuffer.append(TEXT_253);
1724
    
2049
    
1725
		for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) {
2050
		for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) {
1726
			GenNodeLabel genLabel = (GenNodeLabel) it.next();
2051
			GenNodeLabel genLabel = (GenNodeLabel) it.next();
Lines 1728-2029 Link Here
1728
				continue;
2053
				continue;
1729
			}
2054
			}
1730
2055
1731
    stringBuffer.append(TEXT_246);
2056
    stringBuffer.append(TEXT_254);
1732
    stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
2057
    stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
1733
    stringBuffer.append(TEXT_247);
2058
    stringBuffer.append(TEXT_255);
1734
    
2059
    
1735
		}
2060
		}
1736
2061
1737
    stringBuffer.append(TEXT_248);
2062
    stringBuffer.append(TEXT_256);
1738
    
2063
    
1739
if (myHelper.hasExternalLabels()) {
2064
if (myHelper.hasExternalLabels()) {
1740
2065
1741
    stringBuffer.append(TEXT_249);
2066
    stringBuffer.append(TEXT_257);
1742
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2067
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1743
    stringBuffer.append(TEXT_250);
2068
    stringBuffer.append(TEXT_258);
1744
    
2069
    
1745
	for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) {
2070
	for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) {
1746
		GenNodeLabel next = (GenNodeLabel) externalLabels.next();
2071
		GenNodeLabel next = (GenNodeLabel) externalLabels.next();
1747
2072
1748
    stringBuffer.append(TEXT_251);
2073
    stringBuffer.append(TEXT_259);
1749
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
2074
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
1750
    stringBuffer.append(TEXT_252);
2075
    stringBuffer.append(TEXT_260);
1751
    
2076
    
1752
	}
2077
	}
1753
2078
1754
    stringBuffer.append(TEXT_253);
2079
    stringBuffer.append(TEXT_261);
1755
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
2080
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1756
    stringBuffer.append(TEXT_254);
2081
    stringBuffer.append(TEXT_262);
1757
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
2082
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
1758
    stringBuffer.append(TEXT_255);
2083
    stringBuffer.append(TEXT_263);
1759
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
2084
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
1760
    stringBuffer.append(TEXT_256);
2085
    stringBuffer.append(TEXT_264);
1761
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
2086
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
1762
    stringBuffer.append(TEXT_257);
2087
    stringBuffer.append(TEXT_265);
1763
    
2088
    
1764
}
2089
}
1765
if (myHelper.hasExternalLabels() || myHelper.hasFixedChildren()) {
2090
if (myHelper.hasExternalLabels() || myHelper.hasFixedChildren()) {
1766
2091
1767
    stringBuffer.append(TEXT_258);
2092
    stringBuffer.append(TEXT_266);
1768
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2093
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1769
    stringBuffer.append(TEXT_259);
2094
    stringBuffer.append(TEXT_267);
1770
    
2095
    
1771
	if (myHelper.hasExternalLabels()) {
2096
	if (myHelper.hasExternalLabels()) {
1772
2097
1773
    stringBuffer.append(TEXT_260);
2098
    stringBuffer.append(TEXT_268);
1774
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
2099
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1775
    stringBuffer.append(TEXT_261);
2100
    stringBuffer.append(TEXT_269);
1776
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
2101
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
1777
    stringBuffer.append(TEXT_262);
2102
    stringBuffer.append(TEXT_270);
1778
    
2103
    
1779
	}
2104
	}
1780
	if (myHelper.hasFixedChildren()) {
2105
	if (myHelper.hasFixedChildren()) {
1781
2106
1782
    stringBuffer.append(TEXT_263);
2107
    stringBuffer.append(TEXT_271);
1783
    
2108
    
1784
	}
2109
	}
1785
2110
1786
    stringBuffer.append(TEXT_264);
2111
    stringBuffer.append(TEXT_272);
1787
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2112
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1788
    stringBuffer.append(TEXT_265);
2113
    stringBuffer.append(TEXT_273);
1789
    
2114
    
1790
	if (myHelper.hasExternalLabels()) {
2115
	if (myHelper.hasExternalLabels()) {
1791
2116
1792
    stringBuffer.append(TEXT_266);
2117
    stringBuffer.append(TEXT_274);
1793
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
2118
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1794
    stringBuffer.append(TEXT_267);
2119
    stringBuffer.append(TEXT_275);
1795
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
2120
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
1796
    stringBuffer.append(TEXT_268);
2121
    stringBuffer.append(TEXT_276);
1797
    
2122
    
1798
	}
2123
	}
1799
	if (myHelper.hasFixedChildren()){
2124
	if (myHelper.hasFixedChildren()){
1800
2125
1801
    stringBuffer.append(TEXT_269);
2126
    stringBuffer.append(TEXT_277);
1802
    
2127
    
1803
	}
2128
	}
1804
2129
1805
    stringBuffer.append(TEXT_270);
2130
    stringBuffer.append(TEXT_278);
1806
    
2131
    
1807
}
2132
}
1808
2133
1809
    
2134
    
1810
if (myHelper.hasExternalLabels()) {
2135
if (myHelper.hasExternalLabels()) {
1811
2136
1812
    stringBuffer.append(TEXT_271);
2137
    stringBuffer.append(TEXT_279);
1813
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2138
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1814
    stringBuffer.append(TEXT_272);
2139
    stringBuffer.append(TEXT_280);
1815
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2140
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1816
    stringBuffer.append(TEXT_273);
2141
    stringBuffer.append(TEXT_281);
1817
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2142
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
1818
    stringBuffer.append(TEXT_274);
2143
    stringBuffer.append(TEXT_282);
1819
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
2144
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
1820
    stringBuffer.append(TEXT_275);
2145
    stringBuffer.append(TEXT_283);
1821
    
2146
    
1822
}
2147
}
1823
2148
1824
    stringBuffer.append(TEXT_276);
1825
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1826
    stringBuffer.append(TEXT_277);
1827
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1828
    stringBuffer.append(TEXT_278);
1829
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1830
    stringBuffer.append(TEXT_279);
1831
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1832
    stringBuffer.append(TEXT_280);
1833
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
1834
    stringBuffer.append(TEXT_281);
1835
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1836
    stringBuffer.append(TEXT_282);
1837
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1838
    stringBuffer.append(TEXT_283);
1839
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1840
    stringBuffer.append(TEXT_284);
2149
    stringBuffer.append(TEXT_284);
1841
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2150
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
1842
    stringBuffer.append(TEXT_285);
2151
    stringBuffer.append(TEXT_285);
1843
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
2152
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1844
    stringBuffer.append(TEXT_286);
2153
    stringBuffer.append(TEXT_286);
1845
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
2154
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1846
    stringBuffer.append(TEXT_287);
2155
    stringBuffer.append(TEXT_287);
1847
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
2156
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
1848
    stringBuffer.append(TEXT_288);
2157
    stringBuffer.append(TEXT_288);
1849
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
2158
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
1850
    stringBuffer.append(TEXT_289);
2159
    stringBuffer.append(TEXT_289);
1851
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
2160
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1852
    stringBuffer.append(TEXT_290);
2161
    stringBuffer.append(TEXT_290);
1853
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
2162
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1854
    stringBuffer.append(TEXT_291);
2163
    stringBuffer.append(TEXT_291);
1855
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
2164
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1856
    stringBuffer.append(TEXT_292);
2165
    stringBuffer.append(TEXT_292);
1857
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
2166
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1858
    stringBuffer.append(TEXT_293);
2167
    stringBuffer.append(TEXT_293);
1859
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
1860
    stringBuffer.append(TEXT_294);
1861
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
2168
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
2169
    stringBuffer.append(TEXT_294);
2170
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1862
    stringBuffer.append(TEXT_295);
2171
    stringBuffer.append(TEXT_295);
1863
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1864
    stringBuffer.append(TEXT_296);
1865
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
2172
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
2173
    stringBuffer.append(TEXT_296);
2174
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
1866
    stringBuffer.append(TEXT_297);
2175
    stringBuffer.append(TEXT_297);
1867
    /*@ include file="adapters/propertySource.javajetinc"*/
2176
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1868
    stringBuffer.append(TEXT_298);
2177
    stringBuffer.append(TEXT_298);
2178
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
1869
    stringBuffer.append(TEXT_299);
2179
    stringBuffer.append(TEXT_299);
2180
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
1870
    stringBuffer.append(TEXT_300);
2181
    stringBuffer.append(TEXT_300);
1871
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
2182
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
1872
    stringBuffer.append(TEXT_301);
2183
    stringBuffer.append(TEXT_301);
1873
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
2184
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
1874
    stringBuffer.append(TEXT_302);
2185
    stringBuffer.append(TEXT_302);
1875
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2186
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
1876
    stringBuffer.append(TEXT_303);
2187
    stringBuffer.append(TEXT_303);
2188
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
1877
    stringBuffer.append(TEXT_304);
2189
    stringBuffer.append(TEXT_304);
2190
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
1878
    stringBuffer.append(TEXT_305);
2191
    stringBuffer.append(TEXT_305);
1879
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2192
    /*@ include file="adapters/propertySource.javajetinc"*/
1880
    stringBuffer.append(TEXT_306);
2193
    stringBuffer.append(TEXT_306);
1881
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2194
    
2195
if (myHelper.containsLinks()) {
2196
1882
    stringBuffer.append(TEXT_307);
2197
    stringBuffer.append(TEXT_307);
1883
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2198
    
2199
}
2200
1884
    stringBuffer.append(TEXT_308);
2201
    stringBuffer.append(TEXT_308);
1885
    
2202
    
1886
	final String primaryView = "getDiagramNode()";
2203
if (myHelper.containsLinks()) {
1887
2204
1888
    stringBuffer.append(TEXT_309);
2205
    stringBuffer.append(TEXT_309);
1889
    
2206
    
1890
boolean isFixedFontSetInFigure;
1891
{
1892
	StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
1893
	isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
1894
}
2207
}
1895
2208
1896
    stringBuffer.append(TEXT_310);
2209
    stringBuffer.append(TEXT_310);
1897
    
2210
    
1898
if (!isFixedFontSetInFigure) {
2211
{
2212
	final String _getViewCode = "getDiagramNode()";
2213
	final String _getDiagramCode = "getDiagramNode().getDiagram()";
2214
	final String _getSemanticElementCode = "getDiagramNode().getElement()";
2215
	final boolean _includeUncontainedLinks = false;
1899
2216
1900
    stringBuffer.append(TEXT_311);
2217
    stringBuffer.append(TEXT_311);
1901
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
2218
    
2219
if (myHelper.containsLinks() || _includeUncontainedLinks) {
2220
1902
    stringBuffer.append(TEXT_312);
2221
    stringBuffer.append(TEXT_312);
1903
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
2222
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1904
    stringBuffer.append(TEXT_313);
2223
    stringBuffer.append(TEXT_313);
1905
    stringBuffer.append(primaryView);
2224
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1906
    stringBuffer.append(TEXT_314);
2225
    stringBuffer.append(TEXT_314);
1907
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2226
    stringBuffer.append(_getDiagramCode);
1908
    stringBuffer.append(TEXT_315);
2227
    stringBuffer.append(TEXT_315);
1909
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
2228
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl"));
1910
    stringBuffer.append(TEXT_316);
2229
    stringBuffer.append(TEXT_316);
1911
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
2230
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1912
    stringBuffer.append(TEXT_317);
2231
    stringBuffer.append(TEXT_317);
1913
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
2232
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1914
    stringBuffer.append(TEXT_318);
2233
    stringBuffer.append(TEXT_318);
1915
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
2234
    
2235
	boolean hasConstraintsInContainedLinks = false;
2236
	for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2237
		GenLink nextLink = (GenLink) it.next();
2238
		TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
2239
		if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
2240
			hasConstraintsInContainedLinks = true;
2241
			break;
2242
		}
2243
	}
2244
	if (hasConstraintsInContainedLinks) {
2245
1916
    stringBuffer.append(TEXT_319);
2246
    stringBuffer.append(TEXT_319);
1917
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
2247
    stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
1918
    stringBuffer.append(TEXT_320);
2248
    stringBuffer.append(TEXT_320);
1919
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
2249
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1920
    stringBuffer.append(TEXT_321);
2250
    stringBuffer.append(TEXT_321);
1921
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
2251
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1922
    stringBuffer.append(TEXT_322);
2252
    stringBuffer.append(TEXT_322);
1923
    
2253
    
1924
}
2254
	}
2255
	if (_includeUncontainedLinks) {
1925
2256
1926
    stringBuffer.append(TEXT_323);
2257
    stringBuffer.append(TEXT_323);
1927
    
2258
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1928
if (!isFixedFontSetInFigure) {
1929
1930
    stringBuffer.append(TEXT_324);
2259
    stringBuffer.append(TEXT_324);
1931
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
2260
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1932
    stringBuffer.append(TEXT_325);
2261
    stringBuffer.append(TEXT_325);
1933
    
2262
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1934
}
1935
1936
    stringBuffer.append(TEXT_326);
2263
    stringBuffer.append(TEXT_326);
2264
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1937
    stringBuffer.append(TEXT_327);
2265
    stringBuffer.append(TEXT_327);
2266
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1938
    stringBuffer.append(TEXT_328);
2267
    stringBuffer.append(TEXT_328);
1939
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
2268
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1940
    stringBuffer.append(TEXT_329);
2269
    stringBuffer.append(TEXT_329);
1941
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
2270
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1942
    stringBuffer.append(TEXT_330);
2271
    stringBuffer.append(TEXT_330);
1943
    stringBuffer.append(primaryView);
2272
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1944
    stringBuffer.append(TEXT_331);
2273
    stringBuffer.append(TEXT_331);
1945
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2274
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1946
    stringBuffer.append(TEXT_332);
2275
    stringBuffer.append(TEXT_332);
1947
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2276
    
2277
	}
2278
1948
    stringBuffer.append(TEXT_333);
2279
    stringBuffer.append(TEXT_333);
1949
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2280
    
2281
	{
2282
		boolean hasDeclaredFilter = false;
2283
		Set genAffectingFeatures = new LinkedHashSet();
2284
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2285
			GenLink nextLink = (GenLink) it.next();
2286
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
2287
			if (modelFacet == null) {
2288
				continue;
2289
			}
2290
			GenFeature _feature = modelFacet.getChildMetaFeature();
2291
1950
    stringBuffer.append(TEXT_334);
2292
    stringBuffer.append(TEXT_334);
1951
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2293
    
2294
	/*
2295
	 * input: 
2296
	 * 		_feature: GenFeature
2297
	 * 		genAffectingFeatures : Set
2298
	 */
2299
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
2300
		continue;
2301
	}
2302
	genAffectingFeatures.add(_feature);
2303
	if (!hasDeclaredFilter) {
2304
		hasDeclaredFilter = true;
2305
1952
    stringBuffer.append(TEXT_335);
2306
    stringBuffer.append(TEXT_335);
1953
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2307
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1954
    stringBuffer.append(TEXT_336);
2308
    stringBuffer.append(TEXT_336);
1955
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
2309
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1956
    stringBuffer.append(TEXT_337);
2310
    stringBuffer.append(TEXT_337);
1957
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
2311
    stringBuffer.append(_feature.getFeatureAccessorName());
1958
    stringBuffer.append(TEXT_338);
2312
    stringBuffer.append(TEXT_338);
1959
    stringBuffer.append(primaryView);
2313
    
2314
	} else {
2315
1960
    stringBuffer.append(TEXT_339);
2316
    stringBuffer.append(TEXT_339);
1961
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2317
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1962
    stringBuffer.append(TEXT_340);
2318
    stringBuffer.append(TEXT_340);
1963
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2319
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1964
    stringBuffer.append(TEXT_341);
2320
    stringBuffer.append(TEXT_341);
1965
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2321
    stringBuffer.append(_feature.getFeatureAccessorName());
1966
    stringBuffer.append(TEXT_342);
2322
    stringBuffer.append(TEXT_342);
1967
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2323
    
2324
	}
2325
2326
    
2327
			_feature = modelFacet.getSourceMetaFeature();
2328
1968
    stringBuffer.append(TEXT_343);
2329
    stringBuffer.append(TEXT_343);
1969
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
2330
    
2331
	/*
2332
	 * input: 
2333
	 * 		_feature: GenFeature
2334
	 * 		genAffectingFeatures : Set
2335
	 */
2336
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
2337
		continue;
2338
	}
2339
	genAffectingFeatures.add(_feature);
2340
	if (!hasDeclaredFilter) {
2341
		hasDeclaredFilter = true;
2342
1970
    stringBuffer.append(TEXT_344);
2343
    stringBuffer.append(TEXT_344);
2344
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1971
    stringBuffer.append(TEXT_345);
2345
    stringBuffer.append(TEXT_345);
2346
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1972
    stringBuffer.append(TEXT_346);
2347
    stringBuffer.append(TEXT_346);
1973
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
2348
    stringBuffer.append(_feature.getFeatureAccessorName());
1974
    stringBuffer.append(TEXT_347);
2349
    stringBuffer.append(TEXT_347);
1975
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
2350
    
2351
	} else {
2352
1976
    stringBuffer.append(TEXT_348);
2353
    stringBuffer.append(TEXT_348);
1977
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
2354
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1978
    stringBuffer.append(TEXT_349);
2355
    stringBuffer.append(TEXT_349);
1979
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
2356
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1980
    stringBuffer.append(TEXT_350);
2357
    stringBuffer.append(TEXT_350);
2358
    stringBuffer.append(_feature.getFeatureAccessorName());
1981
    stringBuffer.append(TEXT_351);
2359
    stringBuffer.append(TEXT_351);
2360
    
2361
	}
2362
2363
    
2364
			_feature = modelFacet.getTargetMetaFeature();
2365
1982
    stringBuffer.append(TEXT_352);
2366
    stringBuffer.append(TEXT_352);
1983
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2367
    
2368
	/*
2369
	 * input: 
2370
	 * 		_feature: GenFeature
2371
	 * 		genAffectingFeatures : Set
2372
	 */
2373
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
2374
		continue;
2375
	}
2376
	genAffectingFeatures.add(_feature);
2377
	if (!hasDeclaredFilter) {
2378
		hasDeclaredFilter = true;
2379
1984
    stringBuffer.append(TEXT_353);
2380
    stringBuffer.append(TEXT_353);
1985
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2381
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1986
    stringBuffer.append(TEXT_354);
2382
    stringBuffer.append(TEXT_354);
2383
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1987
    stringBuffer.append(TEXT_355);
2384
    stringBuffer.append(TEXT_355);
2385
    stringBuffer.append(_feature.getFeatureAccessorName());
1988
    stringBuffer.append(TEXT_356);
2386
    stringBuffer.append(TEXT_356);
1989
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2387
    
2388
	} else {
2389
1990
    stringBuffer.append(TEXT_357);
2390
    stringBuffer.append(TEXT_357);
1991
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2391
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
1992
    stringBuffer.append(TEXT_358);
2392
    stringBuffer.append(TEXT_358);
1993
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2393
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
1994
    stringBuffer.append(TEXT_359);
2394
    stringBuffer.append(TEXT_359);
1995
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2395
    stringBuffer.append(_feature.getFeatureAccessorName());
1996
    stringBuffer.append(TEXT_360);
2396
    stringBuffer.append(TEXT_360);
1997
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2397
    
2398
	}
2399
2400
    
2401
		}
2402
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
2403
			GenLink nextLink = (GenLink) it.next();
2404
			GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature();
2405
1998
    stringBuffer.append(TEXT_361);
2406
    stringBuffer.append(TEXT_361);
2407
    
2408
	/*
2409
	 * input: 
2410
	 * 		_feature: GenFeature
2411
	 * 		genAffectingFeatures : Set
2412
	 */
2413
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
2414
		continue;
2415
	}
2416
	genAffectingFeatures.add(_feature);
2417
	if (!hasDeclaredFilter) {
2418
		hasDeclaredFilter = true;
2419
1999
    stringBuffer.append(TEXT_362);
2420
    stringBuffer.append(TEXT_362);
2421
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
2000
    stringBuffer.append(TEXT_363);
2422
    stringBuffer.append(TEXT_363);
2001
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2423
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2002
    stringBuffer.append(TEXT_364);
2424
    stringBuffer.append(TEXT_364);
2425
    stringBuffer.append(_feature.getFeatureAccessorName());
2003
    stringBuffer.append(TEXT_365);
2426
    stringBuffer.append(TEXT_365);
2427
    
2428
	} else {
2429
2004
    stringBuffer.append(TEXT_366);
2430
    stringBuffer.append(TEXT_366);
2005
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
2006
    stringBuffer.append(TEXT_367);
2432
    stringBuffer.append(TEXT_367);
2433
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2007
    stringBuffer.append(TEXT_368);
2434
    stringBuffer.append(TEXT_368);
2435
    stringBuffer.append(_feature.getFeatureAccessorName());
2008
    stringBuffer.append(TEXT_369);
2436
    stringBuffer.append(TEXT_369);
2437
    
2438
	}
2439
2440
    
2441
		}
2442
		if (hasConstraintsInContainedLinks) {
2443
			if (hasDeclaredFilter) {
2444
2445
    stringBuffer.append(TEXT_370);
2446
    
2447
			} else {
2448
				hasDeclaredFilter = true;
2449
2450
    stringBuffer.append(TEXT_371);
2451
    
2452
			}
2453
		}
2454
		if (_includeUncontainedLinks) {
2455
			if (hasDeclaredFilter) {
2456
2457
    stringBuffer.append(TEXT_372);
2458
    
2459
			} else {
2460
				hasDeclaredFilter = true;
2461
2462
    stringBuffer.append(TEXT_373);
2463
    
2464
			}
2465
		}
2466
		if (!hasDeclaredFilter) {
2467
2468
    stringBuffer.append(TEXT_374);
2469
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
2470
    stringBuffer.append(TEXT_375);
2471
    
2472
		}
2473
	}	//local declaration of hasDeclaredFilter
2474
2475
    stringBuffer.append(TEXT_376);
2476
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2477
    stringBuffer.append(TEXT_377);
2478
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2479
    stringBuffer.append(TEXT_378);
2480
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent"));
2481
    stringBuffer.append(TEXT_379);
2482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
2483
    stringBuffer.append(TEXT_380);
2484
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2485
    stringBuffer.append(TEXT_381);
2486
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2487
    stringBuffer.append(TEXT_382);
2488
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
2489
    stringBuffer.append(TEXT_383);
2490
    stringBuffer.append(_getDiagramCode);
2491
    stringBuffer.append(TEXT_384);
2492
    stringBuffer.append(TEXT_385);
2493
    /*inner class*/
2494
    stringBuffer.append(TEXT_386);
2495
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2496
    stringBuffer.append(TEXT_387);
2497
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2498
    stringBuffer.append(TEXT_388);
2499
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2500
    stringBuffer.append(TEXT_389);
2501
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2502
    stringBuffer.append(TEXT_390);
2503
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2504
    stringBuffer.append(TEXT_391);
2505
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2506
    stringBuffer.append(TEXT_392);
2507
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2508
    stringBuffer.append(TEXT_393);
2509
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2510
    stringBuffer.append(TEXT_394);
2511
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2512
    stringBuffer.append(TEXT_395);
2513
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2514
    stringBuffer.append(TEXT_396);
2515
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2516
    stringBuffer.append(TEXT_397);
2517
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2518
    stringBuffer.append(TEXT_398);
2519
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2520
    stringBuffer.append(TEXT_399);
2521
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2522
    stringBuffer.append(TEXT_400);
2523
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
2524
    stringBuffer.append(TEXT_401);
2525
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
2526
    stringBuffer.append(TEXT_402);
2527
    stringBuffer.append(importManager.getImportedName("java.util.Map"));
2528
    stringBuffer.append(TEXT_403);
2529
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
2530
    stringBuffer.append(TEXT_404);
2531
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2532
    stringBuffer.append(TEXT_405);
2533
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2534
    stringBuffer.append(TEXT_406);
2535
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2536
    stringBuffer.append(TEXT_407);
2537
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2538
    stringBuffer.append(TEXT_408);
2539
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2540
    stringBuffer.append(TEXT_409);
2541
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2542
    stringBuffer.append(TEXT_410);
2543
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
2544
    stringBuffer.append(TEXT_411);
2545
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2546
    stringBuffer.append(TEXT_412);
2547
    stringBuffer.append(_getDiagramCode);
2548
    stringBuffer.append(TEXT_413);
2549
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2550
    stringBuffer.append(TEXT_414);
2551
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2552
    stringBuffer.append(TEXT_415);
2553
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2554
    stringBuffer.append(TEXT_416);
2555
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2556
    stringBuffer.append(TEXT_417);
2557
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2558
    stringBuffer.append(TEXT_418);
2559
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2560
    stringBuffer.append(TEXT_419);
2561
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2562
    stringBuffer.append(TEXT_420);
2563
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2564
    stringBuffer.append(TEXT_421);
2565
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2566
    stringBuffer.append(TEXT_422);
2567
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2568
    stringBuffer.append(TEXT_423);
2569
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
2570
    stringBuffer.append(TEXT_424);
2571
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand"));
2572
    stringBuffer.append(TEXT_425);
2573
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
2574
    stringBuffer.append(TEXT_426);
2575
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
2576
    stringBuffer.append(TEXT_427);
2577
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2578
    stringBuffer.append(TEXT_428);
2579
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand"));
2580
    stringBuffer.append(TEXT_429);
2581
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2582
    stringBuffer.append(TEXT_430);
2583
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand"));
2584
    stringBuffer.append(TEXT_431);
2585
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2586
    stringBuffer.append(TEXT_432);
2587
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2588
    stringBuffer.append(TEXT_433);
2589
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2590
    stringBuffer.append(TEXT_434);
2591
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
2592
    stringBuffer.append(TEXT_435);
2593
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2594
    stringBuffer.append(TEXT_436);
2595
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2596
    stringBuffer.append(TEXT_437);
2597
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2598
    stringBuffer.append(TEXT_438);
2599
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2600
    stringBuffer.append(TEXT_439);
2601
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2602
    stringBuffer.append(TEXT_440);
2603
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2604
    stringBuffer.append(TEXT_441);
2605
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand"));
2606
    stringBuffer.append(TEXT_442);
2607
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2608
    stringBuffer.append(TEXT_443);
2609
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2610
    stringBuffer.append(TEXT_444);
2611
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2612
    stringBuffer.append(TEXT_445);
2613
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
2614
    stringBuffer.append(TEXT_446);
2615
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2616
    stringBuffer.append(TEXT_447);
2617
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2618
    stringBuffer.append(TEXT_448);
2619
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2620
    stringBuffer.append(TEXT_449);
2621
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2622
    stringBuffer.append(TEXT_450);
2623
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2624
    stringBuffer.append(TEXT_451);
2625
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2626
    stringBuffer.append(TEXT_452);
2627
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2628
    stringBuffer.append(TEXT_453);
2629
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2630
    stringBuffer.append(TEXT_454);
2631
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2632
    stringBuffer.append(TEXT_455);
2633
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2634
    stringBuffer.append(TEXT_456);
2635
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2636
    stringBuffer.append(TEXT_457);
2637
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2638
    stringBuffer.append(TEXT_458);
2639
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2640
    stringBuffer.append(TEXT_459);
2641
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2642
    stringBuffer.append(TEXT_460);
2643
    stringBuffer.append(_getDiagramCode);
2644
    stringBuffer.append(TEXT_461);
2645
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2646
    stringBuffer.append(TEXT_462);
2647
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2648
    stringBuffer.append(TEXT_463);
2649
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
2650
    stringBuffer.append(TEXT_464);
2651
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2652
    stringBuffer.append(TEXT_465);
2653
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2654
    stringBuffer.append(TEXT_466);
2655
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2656
    stringBuffer.append(TEXT_467);
2657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2658
    stringBuffer.append(TEXT_468);
2659
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
2660
    stringBuffer.append(TEXT_469);
2661
    
2662
	for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2663
		GenLink nextLink = (GenLink) it.next();
2664
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
2665
		if (modelFacet == null) {
2666
			continue;
2667
		}
2668
2669
    stringBuffer.append(TEXT_470);
2670
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2671
    stringBuffer.append(TEXT_471);
2672
    stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
2673
    stringBuffer.append(TEXT_472);
2674
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
2675
    stringBuffer.append(TEXT_473);
2676
    
2677
	}
2678
	for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
2679
		GenLink nextLink = (GenLink) it.next();
2680
2681
    stringBuffer.append(TEXT_474);
2682
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2683
    stringBuffer.append(TEXT_475);
2684
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
2685
    stringBuffer.append(TEXT_476);
2686
    
2687
	}
2688
2689
    stringBuffer.append(TEXT_477);
2690
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand"));
2691
    stringBuffer.append(TEXT_478);
2692
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2693
    stringBuffer.append(TEXT_479);
2694
    stringBuffer.append(TEXT_480);
2695
    stringBuffer.append(TEXT_481);
2696
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2697
    stringBuffer.append(TEXT_482);
2698
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
2699
    stringBuffer.append(TEXT_483);
2700
    
2701
Map genFeature2genLinkMap = new LinkedHashMap();
2702
for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2703
	GenLink genLink = (GenLink)it.next();
2704
	TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
2705
	GenFeature metaFeature = modelFacet.getChildMetaFeature();
2706
	if (!genFeature2genLinkMap.containsKey(metaFeature)) {
2707
		genFeature2genLinkMap.put(metaFeature, new ArrayList());
2708
	}
2709
	((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
2710
}
2711
Map genFeature2featureGenLinkMap = new LinkedHashMap();
2712
for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
2713
	GenLink genLink = (GenLink)it.next();
2714
	GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
2715
	if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
2716
		genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
2717
	}
2718
	((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
2719
}
2720
if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
2721
2722
    stringBuffer.append(TEXT_484);
2723
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2724
    stringBuffer.append(TEXT_485);
2725
    stringBuffer.append(_getSemanticElementCode);
2726
    stringBuffer.append(TEXT_486);
2727
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2728
    stringBuffer.append(TEXT_487);
2729
    
2730
}
2731
if (!genFeature2genLinkMap.isEmpty()) {
2732
2733
    stringBuffer.append(TEXT_488);
2734
    
2735
}
2736
for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
2737
	Map.Entry nextEntry = (Map.Entry) entries.next();
2738
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
2739
	Collection genLinksCollection = (Collection) nextEntry.getValue();
2740
	if (metaFeature.isListType()) {
2741
2742
    stringBuffer.append(TEXT_489);
2743
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2744
    stringBuffer.append(TEXT_490);
2745
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
2746
    stringBuffer.append(TEXT_491);
2747
    stringBuffer.append(metaFeature.getGetAccessor());
2748
    stringBuffer.append(TEXT_492);
2749
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2750
    stringBuffer.append(TEXT_493);
2751
    
2752
	} else {
2753
2754
    stringBuffer.append(TEXT_494);
2755
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
2756
    stringBuffer.append(TEXT_495);
2757
    stringBuffer.append(metaFeature.getGetAccessor());
2758
    stringBuffer.append(TEXT_496);
2759
    
2760
	}
2761
2762
    stringBuffer.append(TEXT_497);
2763
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2764
    stringBuffer.append(TEXT_498);
2765
    
2766
	boolean generateSwitch = genLinksCollection.size() != 1;
2767
	if (generateSwitch) {
2768
2769
    stringBuffer.append(TEXT_499);
2770
    
2771
	}
2772
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
2773
		GenLink nextLink = (GenLink) genLinksIterator.next();
2774
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
2775
		if (generateSwitch) {
2776
2777
    stringBuffer.append(TEXT_500);
2778
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2779
    stringBuffer.append(TEXT_501);
2780
    
2781
		} else {
2782
2783
    stringBuffer.append(TEXT_502);
2784
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2785
    stringBuffer.append(TEXT_503);
2786
    
2787
		}
2788
		if (modelFacet.getSourceMetaFeature() != null) {
2789
2790
    stringBuffer.append(TEXT_504);
2791
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2792
    stringBuffer.append(TEXT_505);
2793
    stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName()));
2794
    stringBuffer.append(TEXT_506);
2795
    stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor());
2796
    stringBuffer.append(TEXT_507);
2797
    
2798
		} else {
2799
2800
    stringBuffer.append(TEXT_508);
2801
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2802
    stringBuffer.append(TEXT_509);
2803
    stringBuffer.append(_getSemanticElementCode);
2804
    stringBuffer.append(TEXT_510);
2805
    
2806
		}
2807
		if (modelFacet.getTargetMetaFeature() != null) {
2808
2809
    stringBuffer.append(TEXT_511);
2810
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2811
    stringBuffer.append(TEXT_512);
2812
    stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName()));
2813
    stringBuffer.append(TEXT_513);
2814
    stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor());
2815
    stringBuffer.append(TEXT_514);
2816
    
2817
		} else {
2818
2819
    stringBuffer.append(TEXT_515);
2820
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2821
    stringBuffer.append(TEXT_516);
2822
    stringBuffer.append(_getSemanticElementCode);
2823
    stringBuffer.append(TEXT_517);
2824
    
2825
		}
2826
2827
    stringBuffer.append(TEXT_518);
2828
    
2829
		if (generateSwitch) {
2830
2831
    stringBuffer.append(TEXT_519);
2832
    
2833
		} else {
2834
2835
    stringBuffer.append(TEXT_520);
2836
    
2837
		}
2838
2839
    
2840
	}	//iterate over genLinksCollection
2841
	if (generateSwitch) {
2842
2843
    stringBuffer.append(TEXT_521);
2844
    
2845
	}
2846
	if (metaFeature.isListType()) {
2847
2848
    stringBuffer.append(TEXT_522);
2849
    
2850
	}
2851
}
2852
for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
2853
	Map.Entry nextEntry = (Map.Entry) entries.next();
2854
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
2855
	Collection genLinksCollection = (Collection) nextEntry.getValue();
2856
	if (metaFeature.isListType()) {
2857
2858
    stringBuffer.append(TEXT_523);
2859
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2860
    stringBuffer.append(TEXT_524);
2861
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
2862
    stringBuffer.append(TEXT_525);
2863
    stringBuffer.append(metaFeature.getGetAccessor());
2864
    stringBuffer.append(TEXT_526);
2865
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2866
    stringBuffer.append(TEXT_527);
2867
    
2868
	} else {
2869
2870
    stringBuffer.append(TEXT_528);
2871
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName()));
2872
    stringBuffer.append(TEXT_529);
2873
    stringBuffer.append(metaFeature.getGetAccessor());
2874
    stringBuffer.append(TEXT_530);
2875
    
2876
	}
2877
2878
    stringBuffer.append(TEXT_531);
2879
    
2880
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
2881
		GenLink nextLink = (GenLink) genLinksIterator.next();
2882
2883
    stringBuffer.append(TEXT_532);
2884
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2885
    stringBuffer.append(TEXT_533);
2886
    
2887
	}
2888
2889
    stringBuffer.append(TEXT_534);
2890
    
2891
	if (metaFeature.isListType()) {
2892
2893
    stringBuffer.append(TEXT_535);
2894
    
2895
	}
2896
}
2897
2898
    stringBuffer.append(TEXT_536);
2899
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2900
    stringBuffer.append(TEXT_537);
2901
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2902
    stringBuffer.append(TEXT_538);
2903
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
2904
    stringBuffer.append(TEXT_539);
2905
    stringBuffer.append(importManager.getImportedName("java.util.List"));
2906
    stringBuffer.append(TEXT_540);
2907
    stringBuffer.append(_getDiagramCode);
2908
    stringBuffer.append(TEXT_541);
2909
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
2910
    stringBuffer.append(TEXT_542);
2911
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2912
    stringBuffer.append(TEXT_543);
2913
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2914
    stringBuffer.append(TEXT_544);
2915
    
2916
	if (_includeUncontainedLinks) {
2917
2918
    stringBuffer.append(TEXT_545);
2919
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2920
    stringBuffer.append(TEXT_546);
2921
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2922
    stringBuffer.append(TEXT_547);
2923
    
2924
	}
2925
2926
    
2927
	if (myHelper.containsFeatureModelFacetLinks()) {
2928
2929
    stringBuffer.append(TEXT_548);
2930
    stringBuffer.append(_getViewCode);
2931
    stringBuffer.append(TEXT_549);
2932
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2933
    stringBuffer.append(TEXT_550);
2934
    
2935
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
2936
			GenLink nextLink = (GenLink) it.next();
2937
2938
    stringBuffer.append(TEXT_551);
2939
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2940
    stringBuffer.append(TEXT_552);
2941
    
2942
		}
2943
2944
    stringBuffer.append(TEXT_553);
2945
    
2946
		if (myHelper.containsTypeModelFacetLinks()) {
2947
2948
    stringBuffer.append(TEXT_554);
2949
    
2950
		} else {
2951
2952
    stringBuffer.append(TEXT_555);
2953
    
2954
		}
2955
	}
2956
	
2957
2958
    
2959
	if (myHelper.containsTypeModelFacetLinks()) {
2960
		if (!myHelper.containsFeatureModelFacetLinks()) {
2961
2962
    stringBuffer.append(TEXT_556);
2963
    
2964
		}
2965
2966
    stringBuffer.append(TEXT_557);
2967
    stringBuffer.append(_getSemanticElementCode);
2968
    stringBuffer.append(TEXT_558);
2969
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
2970
    stringBuffer.append(TEXT_559);
2971
    
2972
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
2973
			GenLink nextLink = (GenLink) it.next();
2974
2975
    stringBuffer.append(TEXT_560);
2976
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
2977
    stringBuffer.append(TEXT_561);
2978
    
2979
		}
2980
2981
    stringBuffer.append(TEXT_562);
2982
    
2983
	}
2984
2985
    stringBuffer.append(TEXT_563);
2986
    stringBuffer.append(genDiagram.isSynchronized());
2987
    stringBuffer.append(TEXT_564);
2988
    stringBuffer.append(genDiagram.isSynchronized());
2989
    stringBuffer.append(TEXT_565);
2990
    
2991
}
2992
2993
    
2994
}	//end of local declarations
2995
2996
    stringBuffer.append(TEXT_566);
2997
    stringBuffer.append(TEXT_567);
2998
    stringBuffer.append(TEXT_568);
2999
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
3000
    stringBuffer.append(TEXT_569);
3001
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
3002
    stringBuffer.append(TEXT_570);
3003
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
3004
    stringBuffer.append(TEXT_571);
3005
    stringBuffer.append(TEXT_572);
3006
    stringBuffer.append(TEXT_573);
3007
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
3008
    stringBuffer.append(TEXT_574);
3009
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
3010
    stringBuffer.append(TEXT_575);
3011
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
3012
    stringBuffer.append(TEXT_576);
3013
    
3014
	final String primaryView = "getDiagramNode()";
3015
3016
    stringBuffer.append(TEXT_577);
3017
    
3018
boolean isFixedFontSetInFigure;
3019
{
3020
	StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
3021
	isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
3022
}
3023
3024
    stringBuffer.append(TEXT_578);
3025
    
3026
if (!isFixedFontSetInFigure) {
3027
3028
    stringBuffer.append(TEXT_579);
3029
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
3030
    stringBuffer.append(TEXT_580);
3031
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
3032
    stringBuffer.append(TEXT_581);
3033
    stringBuffer.append(primaryView);
3034
    stringBuffer.append(TEXT_582);
3035
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3036
    stringBuffer.append(TEXT_583);
3037
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
3038
    stringBuffer.append(TEXT_584);
3039
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
3040
    stringBuffer.append(TEXT_585);
3041
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
3042
    stringBuffer.append(TEXT_586);
3043
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
3044
    stringBuffer.append(TEXT_587);
3045
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
3046
    stringBuffer.append(TEXT_588);
3047
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
3048
    stringBuffer.append(TEXT_589);
3049
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
3050
    stringBuffer.append(TEXT_590);
3051
    
3052
}
3053
3054
    stringBuffer.append(TEXT_591);
3055
    
3056
if (!isFixedFontSetInFigure) {
3057
3058
    stringBuffer.append(TEXT_592);
3059
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
3060
    stringBuffer.append(TEXT_593);
3061
    
3062
}
3063
3064
    stringBuffer.append(TEXT_594);
3065
    stringBuffer.append(TEXT_595);
3066
    stringBuffer.append(TEXT_596);
3067
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
3068
    stringBuffer.append(TEXT_597);
3069
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
3070
    stringBuffer.append(TEXT_598);
3071
    stringBuffer.append(primaryView);
3072
    stringBuffer.append(TEXT_599);
3073
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3074
    stringBuffer.append(TEXT_600);
3075
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3076
    stringBuffer.append(TEXT_601);
3077
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3078
    stringBuffer.append(TEXT_602);
3079
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3080
    stringBuffer.append(TEXT_603);
3081
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3082
    stringBuffer.append(TEXT_604);
3083
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
3084
    stringBuffer.append(TEXT_605);
3085
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
3086
    stringBuffer.append(TEXT_606);
3087
    stringBuffer.append(primaryView);
3088
    stringBuffer.append(TEXT_607);
3089
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3090
    stringBuffer.append(TEXT_608);
3091
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3092
    stringBuffer.append(TEXT_609);
3093
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3094
    stringBuffer.append(TEXT_610);
3095
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3096
    stringBuffer.append(TEXT_611);
3097
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
3098
    stringBuffer.append(TEXT_612);
3099
    stringBuffer.append(TEXT_613);
3100
    stringBuffer.append(TEXT_614);
3101
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
3102
    stringBuffer.append(TEXT_615);
3103
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
3104
    stringBuffer.append(TEXT_616);
3105
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
3106
    stringBuffer.append(TEXT_617);
3107
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
3108
    stringBuffer.append(TEXT_618);
3109
    stringBuffer.append(TEXT_619);
3110
    stringBuffer.append(TEXT_620);
3111
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3112
    stringBuffer.append(TEXT_621);
3113
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3114
    stringBuffer.append(TEXT_622);
3115
    stringBuffer.append(TEXT_623);
3116
    stringBuffer.append(TEXT_624);
3117
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3118
    stringBuffer.append(TEXT_625);
3119
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3120
    stringBuffer.append(TEXT_626);
3121
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3122
    stringBuffer.append(TEXT_627);
3123
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3124
    stringBuffer.append(TEXT_628);
3125
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3126
    stringBuffer.append(TEXT_629);
3127
    stringBuffer.append(TEXT_630);
3128
    stringBuffer.append(TEXT_631);
3129
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3130
    stringBuffer.append(TEXT_632);
3131
    stringBuffer.append(TEXT_633);
3132
    stringBuffer.append(TEXT_634);
2009
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3133
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2010
    stringBuffer.append(TEXT_370);
3134
    stringBuffer.append(TEXT_635);
2011
    stringBuffer.append(TEXT_371);
3135
    stringBuffer.append(TEXT_636);
2012
    stringBuffer.append(TEXT_372);
3136
    stringBuffer.append(TEXT_637);
2013
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3137
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2014
    stringBuffer.append(TEXT_373);
3138
    stringBuffer.append(TEXT_638);
3139
    stringBuffer.append(TEXT_639);
3140
    stringBuffer.append(TEXT_640);
2015
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3141
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2016
    stringBuffer.append(TEXT_374);
3142
    stringBuffer.append(TEXT_641);
2017
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3143
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2018
    stringBuffer.append(TEXT_375);
3144
    stringBuffer.append(TEXT_642);
2019
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3145
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2020
    stringBuffer.append(TEXT_376);
3146
    stringBuffer.append(TEXT_643);
2021
    stringBuffer.append(TEXT_377);
2022
    stringBuffer.append(TEXT_378);
2023
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3147
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2024
    stringBuffer.append(TEXT_379);
3148
    stringBuffer.append(TEXT_644);
3149
    stringBuffer.append(TEXT_645);
3150
    stringBuffer.append(TEXT_646);
2025
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3151
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
2026
    stringBuffer.append(TEXT_380);
3152
    stringBuffer.append(TEXT_647);
3153
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
3154
    stringBuffer.append(TEXT_648);
2027
    
3155
    
2028
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
3156
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
2029
	GenLink genLink = (GenLink)it.next();
3157
	GenLink genLink = (GenLink)it.next();
Lines 2051-2160 Link Here
2051
	}
3179
	}
2052
	GenLinkConstraints linkConstraints = genLink.getCreationConstraints();
3180
	GenLinkConstraints linkConstraints = genLink.getCreationConstraints();
2053
3181
2054
    stringBuffer.append(TEXT_381);
3182
    stringBuffer.append(TEXT_649);
2055
    stringBuffer.append(reconnectCommandNameInfix);
3183
    stringBuffer.append(reconnectCommandNameInfix);
2056
    stringBuffer.append(genLink.getVisualID());
3184
    stringBuffer.append(genLink.getVisualID());
2057
    stringBuffer.append(TEXT_382);
3185
    stringBuffer.append(TEXT_650);
2058
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
3186
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
2059
    stringBuffer.append(TEXT_383);
3187
    stringBuffer.append(TEXT_651);
2060
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
3188
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2061
    stringBuffer.append(TEXT_384);
3189
    stringBuffer.append(TEXT_652);
2062
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3190
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2063
    stringBuffer.append(TEXT_385);
3191
    stringBuffer.append(TEXT_653);
2064
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3192
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2065
    stringBuffer.append(TEXT_386);
3193
    stringBuffer.append(TEXT_654);
2066
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3194
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2067
    stringBuffer.append(TEXT_387);
3195
    stringBuffer.append(TEXT_655);
2068
    stringBuffer.append(reconnectCommandNameInfix);
3196
    stringBuffer.append(reconnectCommandNameInfix);
2069
    stringBuffer.append(genLink.getVisualID());
3197
    stringBuffer.append(genLink.getVisualID());
2070
    stringBuffer.append(TEXT_388);
3198
    stringBuffer.append(TEXT_656);
2071
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
3199
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
2072
    stringBuffer.append(TEXT_389);
3200
    stringBuffer.append(TEXT_657);
2073
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
3201
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2074
    stringBuffer.append(TEXT_390);
3202
    stringBuffer.append(TEXT_658);
2075
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3203
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2076
    stringBuffer.append(TEXT_391);
3204
    stringBuffer.append(TEXT_659);
2077
    stringBuffer.append(reconnectCommandNameInfix);
3205
    stringBuffer.append(reconnectCommandNameInfix);
2078
    stringBuffer.append(genLink.getVisualID());
3206
    stringBuffer.append(genLink.getVisualID());
2079
    stringBuffer.append(TEXT_392);
3207
    stringBuffer.append(TEXT_660);
2080
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
3208
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2081
    stringBuffer.append(TEXT_393);
3209
    stringBuffer.append(TEXT_661);
2082
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3210
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2083
    stringBuffer.append(TEXT_394);
3211
    stringBuffer.append(TEXT_662);
2084
    
3212
    
2085
	if (linkConstraints != null) {
3213
	if (linkConstraints != null) {
2086
3214
2087
    stringBuffer.append(TEXT_395);
3215
    stringBuffer.append(TEXT_663);
2088
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3216
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2089
    stringBuffer.append(TEXT_396);
3217
    stringBuffer.append(TEXT_664);
2090
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
3218
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
2091
    stringBuffer.append(TEXT_397);
3219
    stringBuffer.append(TEXT_665);
2092
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3220
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2093
    stringBuffer.append(TEXT_398);
3221
    stringBuffer.append(TEXT_666);
2094
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
3222
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
2095
    stringBuffer.append(TEXT_399);
3223
    stringBuffer.append(TEXT_667);
2096
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3224
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2097
    stringBuffer.append(TEXT_400);
3225
    stringBuffer.append(TEXT_668);
2098
    
3226
    
2099
	} else {
3227
	} else {
2100
3228
2101
    stringBuffer.append(TEXT_401);
3229
    stringBuffer.append(TEXT_669);
2102
    
3230
    
2103
	}
3231
	}
2104
3232
2105
    stringBuffer.append(TEXT_402);
3233
    stringBuffer.append(TEXT_670);
2106
    
3234
    
2107
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3235
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2108
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3236
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
2109
			GenFeature containmentFeature = modelFacet.getContainmentMetaFeature();
3237
			GenFeature containmentFeature = modelFacet.getContainmentMetaFeature();
2110
			if (containmentFeature == null) {
3238
			if (containmentFeature == null) {
2111
3239
2112
    stringBuffer.append(TEXT_403);
3240
    stringBuffer.append(TEXT_671);
2113
    
3241
    
2114
			} else {
3242
			} else {
2115
3243
2116
    stringBuffer.append(TEXT_404);
3244
    stringBuffer.append(TEXT_672);
2117
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
3245
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
2118
    stringBuffer.append(TEXT_405);
3246
    stringBuffer.append(TEXT_673);
2119
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
3247
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
2120
    stringBuffer.append(TEXT_406);
3248
    stringBuffer.append(TEXT_674);
2121
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
3249
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
2122
    stringBuffer.append(TEXT_407);
3250
    stringBuffer.append(TEXT_675);
2123
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
3251
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
2124
    stringBuffer.append(TEXT_408);
3252
    stringBuffer.append(TEXT_676);
2125
    
3253
    
2126
				{
3254
				{
2127
					GenFeature _feature = containmentFeature;
3255
					GenFeature _feature = containmentFeature;
2128
					String _ownerInstance = "container";
3256
					String _ownerInstance = "container";
2129
					String _exceedsUpperBound = "return false;";
3257
					String _exceedsUpperBound = "return false;";
2130
3258
2131
    stringBuffer.append(TEXT_409);
3259
    stringBuffer.append(TEXT_677);
2132
    
3260
    
2133
int upperBound = _feature.getEcoreFeature().getUpperBound();
3261
int upperBound = _feature.getEcoreFeature().getUpperBound();
2134
if (upperBound > 0) {
3262
if (upperBound > 0) {
2135
	if (upperBound == 1) {
3263
	if (upperBound == 1) {
2136
3264
2137
    stringBuffer.append(TEXT_410);
3265
    stringBuffer.append(TEXT_678);
2138
    stringBuffer.append(_ownerInstance);
3266
    stringBuffer.append(_ownerInstance);
2139
    stringBuffer.append(TEXT_411);
3267
    stringBuffer.append(TEXT_679);
2140
    stringBuffer.append(_feature.getGetAccessor());
3268
    stringBuffer.append(_feature.getGetAccessor());
2141
    stringBuffer.append(TEXT_412);
3269
    stringBuffer.append(TEXT_680);
2142
    stringBuffer.append(_exceedsUpperBound);
3270
    stringBuffer.append(_exceedsUpperBound);
2143
    stringBuffer.append(TEXT_413);
3271
    stringBuffer.append(TEXT_681);
2144
    
3272
    
2145
	} else {
3273
	} else {
2146
3274
2147
    stringBuffer.append(TEXT_414);
3275
    stringBuffer.append(TEXT_682);
2148
    stringBuffer.append(_ownerInstance);
3276
    stringBuffer.append(_ownerInstance);
2149
    stringBuffer.append(TEXT_415);
3277
    stringBuffer.append(TEXT_683);
2150
    stringBuffer.append(_feature.getGetAccessor());
3278
    stringBuffer.append(_feature.getGetAccessor());
2151
    stringBuffer.append(TEXT_416);
3279
    stringBuffer.append(TEXT_684);
2152
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3280
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2153
    stringBuffer.append(TEXT_417);
3281
    stringBuffer.append(TEXT_685);
2154
    stringBuffer.append(_feature.getFeatureAccessorName());
3282
    stringBuffer.append(_feature.getFeatureAccessorName());
2155
    stringBuffer.append(TEXT_418);
3283
    stringBuffer.append(TEXT_686);
2156
    stringBuffer.append(_exceedsUpperBound);
3284
    stringBuffer.append(_exceedsUpperBound);
2157
    stringBuffer.append(TEXT_419);
3285
    stringBuffer.append(TEXT_687);
2158
    
3286
    
2159
	}
3287
	}
2160
}
3288
}
Lines 2168-2200 Link Here
2168
						String _ownerInstance = "container";
3296
						String _ownerInstance = "container";
2169
						String _exceedsUpperBound = "return false;";
3297
						String _exceedsUpperBound = "return false;";
2170
3298
2171
    stringBuffer.append(TEXT_420);
3299
    stringBuffer.append(TEXT_688);
2172
    
3300
    
2173
int upperBound = _feature.getEcoreFeature().getUpperBound();
3301
int upperBound = _feature.getEcoreFeature().getUpperBound();
2174
if (upperBound > 0) {
3302
if (upperBound > 0) {
2175
	if (upperBound == 1) {
3303
	if (upperBound == 1) {
2176
3304
2177
    stringBuffer.append(TEXT_421);
3305
    stringBuffer.append(TEXT_689);
2178
    stringBuffer.append(_ownerInstance);
3306
    stringBuffer.append(_ownerInstance);
2179
    stringBuffer.append(TEXT_422);
3307
    stringBuffer.append(TEXT_690);
2180
    stringBuffer.append(_feature.getGetAccessor());
3308
    stringBuffer.append(_feature.getGetAccessor());
2181
    stringBuffer.append(TEXT_423);
3309
    stringBuffer.append(TEXT_691);
2182
    stringBuffer.append(_exceedsUpperBound);
3310
    stringBuffer.append(_exceedsUpperBound);
2183
    stringBuffer.append(TEXT_424);
3311
    stringBuffer.append(TEXT_692);
2184
    
3312
    
2185
	} else {
3313
	} else {
2186
3314
2187
    stringBuffer.append(TEXT_425);
3315
    stringBuffer.append(TEXT_693);
2188
    stringBuffer.append(_ownerInstance);
3316
    stringBuffer.append(_ownerInstance);
2189
    stringBuffer.append(TEXT_426);
3317
    stringBuffer.append(TEXT_694);
2190
    stringBuffer.append(_feature.getGetAccessor());
3318
    stringBuffer.append(_feature.getGetAccessor());
2191
    stringBuffer.append(TEXT_427);
3319
    stringBuffer.append(TEXT_695);
2192
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3320
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2193
    stringBuffer.append(TEXT_428);
3321
    stringBuffer.append(TEXT_696);
2194
    stringBuffer.append(_feature.getFeatureAccessorName());
3322
    stringBuffer.append(_feature.getFeatureAccessorName());
2195
    stringBuffer.append(TEXT_429);
3323
    stringBuffer.append(TEXT_697);
2196
    stringBuffer.append(_exceedsUpperBound);
3324
    stringBuffer.append(_exceedsUpperBound);
2197
    stringBuffer.append(TEXT_430);
3325
    stringBuffer.append(TEXT_698);
2198
    
3326
    
2199
	}
3327
	}
2200
}
3328
}
Lines 2208-2231 Link Here
2208
	String _source = "newSource.getElement()";
3336
	String _source = "newSource.getElement()";
2209
	String _target = "edge.getTarget().getElement()";
3337
	String _target = "edge.getTarget().getElement()";
2210
3338
2211
    stringBuffer.append(TEXT_431);
3339
    stringBuffer.append(TEXT_699);
2212
    
3340
    
2213
			if (linkConstraints != null) {
3341
			if (linkConstraints != null) {
2214
3342
2215
    stringBuffer.append(TEXT_432);
3343
    stringBuffer.append(TEXT_700);
2216
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3344
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
2217
    stringBuffer.append(TEXT_433);
3345
    stringBuffer.append(TEXT_701);
2218
    stringBuffer.append(_source);
3346
    stringBuffer.append(_source);
2219
    stringBuffer.append(TEXT_434);
3347
    stringBuffer.append(TEXT_702);
2220
    stringBuffer.append(_target);
3348
    stringBuffer.append(_target);
2221
    stringBuffer.append(TEXT_435);
3349
    stringBuffer.append(TEXT_703);
2222
    
3350
    
2223
			}
3351
			}
2224
3352
2225
    
3353
    
2226
}	//local declarations for linkConstraints.jetinc
3354
}	//local declarations for linkConstraints.jetinc
2227
3355
2228
    stringBuffer.append(TEXT_436);
3356
    stringBuffer.append(TEXT_704);
2229
    
3357
    
2230
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3358
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
2231
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3359
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
Lines 2234-2266 Link Here
2234
				String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") newSource.getElement())";
3362
				String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") newSource.getElement())";
2235
				String _exceedsUpperBound = "return false;";
3363
				String _exceedsUpperBound = "return false;";
2236
3364
2237
    stringBuffer.append(TEXT_437);
3365
    stringBuffer.append(TEXT_705);
2238
    
3366
    
2239
int upperBound = _feature.getEcoreFeature().getUpperBound();
3367
int upperBound = _feature.getEcoreFeature().getUpperBound();
2240
if (upperBound > 0) {
3368
if (upperBound > 0) {
2241
	if (upperBound == 1) {
3369
	if (upperBound == 1) {
2242
3370
2243
    stringBuffer.append(TEXT_438);
3371
    stringBuffer.append(TEXT_706);
2244
    stringBuffer.append(_ownerInstance);
3372
    stringBuffer.append(_ownerInstance);
2245
    stringBuffer.append(TEXT_439);
3373
    stringBuffer.append(TEXT_707);
2246
    stringBuffer.append(_feature.getGetAccessor());
3374
    stringBuffer.append(_feature.getGetAccessor());
2247
    stringBuffer.append(TEXT_440);
3375
    stringBuffer.append(TEXT_708);
2248
    stringBuffer.append(_exceedsUpperBound);
3376
    stringBuffer.append(_exceedsUpperBound);
2249
    stringBuffer.append(TEXT_441);
3377
    stringBuffer.append(TEXT_709);
2250
    
3378
    
2251
	} else {
3379
	} else {
2252
3380
2253
    stringBuffer.append(TEXT_442);
3381
    stringBuffer.append(TEXT_710);
2254
    stringBuffer.append(_ownerInstance);
3382
    stringBuffer.append(_ownerInstance);
2255
    stringBuffer.append(TEXT_443);
3383
    stringBuffer.append(TEXT_711);
2256
    stringBuffer.append(_feature.getGetAccessor());
3384
    stringBuffer.append(_feature.getGetAccessor());
2257
    stringBuffer.append(TEXT_444);
3385
    stringBuffer.append(TEXT_712);
2258
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3386
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2259
    stringBuffer.append(TEXT_445);
3387
    stringBuffer.append(TEXT_713);
2260
    stringBuffer.append(_feature.getFeatureAccessorName());
3388
    stringBuffer.append(_feature.getFeatureAccessorName());
2261
    stringBuffer.append(TEXT_446);
3389
    stringBuffer.append(TEXT_714);
2262
    stringBuffer.append(_exceedsUpperBound);
3390
    stringBuffer.append(_exceedsUpperBound);
2263
    stringBuffer.append(TEXT_447);
3391
    stringBuffer.append(TEXT_715);
2264
    
3392
    
2265
	}
3393
	}
2266
}
3394
}
Lines 2271-2314 Link Here
2271
	String _source = "newSource.getElement()";
3399
	String _source = "newSource.getElement()";
2272
	String _target = "edge.getTarget().getElement()";
3400
	String _target = "edge.getTarget().getElement()";
2273
3401
2274
    stringBuffer.append(TEXT_448);
3402
    stringBuffer.append(TEXT_716);
2275
    
3403
    
2276
			if (linkConstraints != null) {
3404
			if (linkConstraints != null) {
2277
3405
2278
    stringBuffer.append(TEXT_449);
3406
    stringBuffer.append(TEXT_717);
2279
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3407
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
2280
    stringBuffer.append(TEXT_450);
3408
    stringBuffer.append(TEXT_718);
2281
    stringBuffer.append(_source);
3409
    stringBuffer.append(_source);
2282
    stringBuffer.append(TEXT_451);
3410
    stringBuffer.append(TEXT_719);
2283
    stringBuffer.append(_target);
3411
    stringBuffer.append(_target);
2284
    stringBuffer.append(TEXT_452);
3412
    stringBuffer.append(TEXT_720);
2285
    
3413
    
2286
			}
3414
			}
2287
3415
2288
    
3416
    
2289
}	//local declarations for linkConstraints.jetinc
3417
}	//local declarations for linkConstraints.jetinc
2290
3418
2291
    stringBuffer.append(TEXT_453);
3419
    stringBuffer.append(TEXT_721);
2292
    
3420
    
2293
		} else {
3421
		} else {
2294
3422
2295
    stringBuffer.append(TEXT_454);
3423
    stringBuffer.append(TEXT_722);
2296
    
3424
    
2297
		}
3425
		}
2298
3426
2299
    stringBuffer.append(TEXT_455);
3427
    stringBuffer.append(TEXT_723);
2300
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3428
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2301
    stringBuffer.append(TEXT_456);
3429
    stringBuffer.append(TEXT_724);
2302
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3430
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2303
    stringBuffer.append(TEXT_457);
3431
    stringBuffer.append(TEXT_725);
2304
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
3432
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
2305
    stringBuffer.append(TEXT_458);
3433
    stringBuffer.append(TEXT_726);
2306
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2307
    stringBuffer.append(TEXT_459);
3435
    stringBuffer.append(TEXT_727);
2308
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3436
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2309
    stringBuffer.append(TEXT_460);
3437
    stringBuffer.append(TEXT_728);
2310
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand"));
3438
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand"));
2311
    stringBuffer.append(TEXT_461);
3439
    stringBuffer.append(TEXT_729);
2312
    
3440
    
2313
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3441
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2314
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3442
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 2327-2436 Link Here
2327
			}
3455
			}
2328
			if (containmentFeature != null || setChild) {
3456
			if (containmentFeature != null || setChild) {
2329
3457
2330
    stringBuffer.append(TEXT_462);
3458
    stringBuffer.append(TEXT_730);
2331
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3459
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2332
    stringBuffer.append(TEXT_463);
3460
    stringBuffer.append(TEXT_731);
2333
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
3461
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
2334
    stringBuffer.append(TEXT_464);
3462
    stringBuffer.append(TEXT_732);
2335
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
3463
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
2336
    stringBuffer.append(TEXT_465);
3464
    stringBuffer.append(TEXT_733);
2337
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
3465
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
2338
    stringBuffer.append(TEXT_466);
3466
    stringBuffer.append(TEXT_734);
2339
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3467
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2340
    stringBuffer.append(TEXT_467);
3468
    stringBuffer.append(TEXT_735);
2341
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
3469
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
2342
    stringBuffer.append(TEXT_468);
3470
    stringBuffer.append(TEXT_736);
2343
    
3471
    
2344
			}
3472
			}
2345
			if (containmentFeature != null) {
3473
			if (containmentFeature != null) {
2346
				if (containmentFeature.getEcoreFeature().isMany()) {
3474
				if (containmentFeature.getEcoreFeature().isMany()) {
2347
3475
2348
    stringBuffer.append(TEXT_469);
3476
    stringBuffer.append(TEXT_737);
2349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3477
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2350
    stringBuffer.append(TEXT_470);
3478
    stringBuffer.append(TEXT_738);
2351
    
3479
    
2352
				} else {
3480
				} else {
2353
3481
2354
    stringBuffer.append(TEXT_471);
3482
    stringBuffer.append(TEXT_739);
2355
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3483
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2356
    stringBuffer.append(TEXT_472);
3484
    stringBuffer.append(TEXT_740);
2357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3485
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2358
    stringBuffer.append(TEXT_473);
3486
    stringBuffer.append(TEXT_741);
2359
    
3487
    
2360
				}
3488
				}
2361
3489
2362
    stringBuffer.append(TEXT_474);
3490
    stringBuffer.append(TEXT_742);
2363
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3491
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
2364
    stringBuffer.append(TEXT_475);
3492
    stringBuffer.append(TEXT_743);
2365
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3493
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2366
    stringBuffer.append(TEXT_476);
3494
    stringBuffer.append(TEXT_744);
2367
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
3495
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
2368
    stringBuffer.append(TEXT_477);
3496
    stringBuffer.append(TEXT_745);
2369
    
3497
    
2370
			}
3498
			}
2371
			if (setChild) {
3499
			if (setChild) {
2372
				if (childFeature.getEcoreFeature().isMany()) {
3500
				if (childFeature.getEcoreFeature().isMany()) {
2373
3501
2374
    stringBuffer.append(TEXT_478);
3502
    stringBuffer.append(TEXT_746);
2375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3503
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2376
    stringBuffer.append(TEXT_479);
3504
    stringBuffer.append(TEXT_747);
2377
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3505
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2378
    stringBuffer.append(TEXT_480);
3506
    stringBuffer.append(TEXT_748);
2379
    stringBuffer.append(childFeature.getFeatureAccessorName());
3507
    stringBuffer.append(childFeature.getFeatureAccessorName());
2380
    stringBuffer.append(TEXT_481);
3508
    stringBuffer.append(TEXT_749);
2381
    
3509
    
2382
				} else {
3510
				} else {
2383
3511
2384
    stringBuffer.append(TEXT_482);
3512
    stringBuffer.append(TEXT_750);
2385
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3513
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2386
    stringBuffer.append(TEXT_483);
3514
    stringBuffer.append(TEXT_751);
2387
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3515
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2388
    stringBuffer.append(TEXT_484);
3516
    stringBuffer.append(TEXT_752);
2389
    stringBuffer.append(childFeature.getFeatureAccessorName());
3517
    stringBuffer.append(childFeature.getFeatureAccessorName());
2390
    stringBuffer.append(TEXT_485);
3518
    stringBuffer.append(TEXT_753);
2391
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3519
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2392
    stringBuffer.append(TEXT_486);
3520
    stringBuffer.append(TEXT_754);
2393
    
3521
    
2394
				}
3522
				}
2395
3523
2396
    stringBuffer.append(TEXT_487);
3524
    stringBuffer.append(TEXT_755);
2397
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3525
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
2398
    stringBuffer.append(TEXT_488);
3526
    stringBuffer.append(TEXT_756);
2399
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3527
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2400
    stringBuffer.append(TEXT_489);
3528
    stringBuffer.append(TEXT_757);
2401
    stringBuffer.append(childFeature.getFeatureAccessorName());
3529
    stringBuffer.append(childFeature.getFeatureAccessorName());
2402
    stringBuffer.append(TEXT_490);
3530
    stringBuffer.append(TEXT_758);
2403
    
3531
    
2404
			}
3532
			}
2405
3533
2406
    stringBuffer.append(TEXT_491);
3534
    stringBuffer.append(TEXT_759);
2407
    
3535
    
2408
			if (setSource) {
3536
			if (setSource) {
2409
				if (sourceFeature.getEcoreFeature().isMany()) {
3537
				if (sourceFeature.getEcoreFeature().isMany()) {
2410
3538
2411
    stringBuffer.append(TEXT_492);
3539
    stringBuffer.append(TEXT_760);
2412
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3540
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2413
    stringBuffer.append(TEXT_493);
3541
    stringBuffer.append(TEXT_761);
2414
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3542
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2415
    stringBuffer.append(TEXT_494);
3543
    stringBuffer.append(TEXT_762);
2416
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3544
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
2417
    stringBuffer.append(TEXT_495);
3545
    stringBuffer.append(TEXT_763);
2418
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
3546
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
2419
    stringBuffer.append(TEXT_496);
3547
    stringBuffer.append(TEXT_764);
2420
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3548
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2421
    stringBuffer.append(TEXT_497);
3549
    stringBuffer.append(TEXT_765);
2422
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3550
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
2423
    stringBuffer.append(TEXT_498);
3551
    stringBuffer.append(TEXT_766);
2424
    
3552
    
2425
				} else {
3553
				} else {
2426
3554
2427
    stringBuffer.append(TEXT_499);
3555
    stringBuffer.append(TEXT_767);
2428
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3556
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2429
    stringBuffer.append(TEXT_500);
3557
    stringBuffer.append(TEXT_768);
2430
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3558
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2431
    stringBuffer.append(TEXT_501);
3559
    stringBuffer.append(TEXT_769);
2432
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3560
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
2433
    stringBuffer.append(TEXT_502);
3561
    stringBuffer.append(TEXT_770);
2434
    
3562
    
2435
				}
3563
				}
2436
			}
3564
			}
Lines 2438-2490 Link Here
2438
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3566
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
2439
			if (metaFeature.getEcoreFeature().isMany()) {
3567
			if (metaFeature.getEcoreFeature().isMany()) {
2440
3568
2441
    stringBuffer.append(TEXT_503);
3569
    stringBuffer.append(TEXT_771);
2442
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3570
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2443
    stringBuffer.append(TEXT_504);
3571
    stringBuffer.append(TEXT_772);
2444
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3572
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2445
    stringBuffer.append(TEXT_505);
3573
    stringBuffer.append(TEXT_773);
2446
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3574
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2447
    stringBuffer.append(TEXT_506);
3575
    stringBuffer.append(TEXT_774);
2448
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
3576
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
2449
    stringBuffer.append(TEXT_507);
3577
    stringBuffer.append(TEXT_775);
2450
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3578
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2451
    stringBuffer.append(TEXT_508);
3579
    stringBuffer.append(TEXT_776);
2452
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3580
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2453
    stringBuffer.append(TEXT_509);
3581
    stringBuffer.append(TEXT_777);
2454
    
3582
    
2455
			} else {
3583
			} else {
2456
3584
2457
    stringBuffer.append(TEXT_510);
3585
    stringBuffer.append(TEXT_778);
2458
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3586
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2459
    stringBuffer.append(TEXT_511);
3587
    stringBuffer.append(TEXT_779);
2460
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3588
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2461
    stringBuffer.append(TEXT_512);
3589
    stringBuffer.append(TEXT_780);
2462
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3590
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2463
    stringBuffer.append(TEXT_513);
3591
    stringBuffer.append(TEXT_781);
2464
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3592
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2465
    stringBuffer.append(TEXT_514);
3593
    stringBuffer.append(TEXT_782);
2466
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3594
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2467
    stringBuffer.append(TEXT_515);
3595
    stringBuffer.append(TEXT_783);
2468
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3596
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2469
    stringBuffer.append(TEXT_516);
3597
    stringBuffer.append(TEXT_784);
2470
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3598
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2471
    stringBuffer.append(TEXT_517);
3599
    stringBuffer.append(TEXT_785);
2472
    
3600
    
2473
			}
3601
			}
2474
		}
3602
		}
2475
3603
2476
    stringBuffer.append(TEXT_518);
3604
    stringBuffer.append(TEXT_786);
2477
    stringBuffer.append(TEXT_519);
3605
    stringBuffer.append(TEXT_787);
2478
    
3606
    
2479
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3607
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2480
3608
2481
    stringBuffer.append(TEXT_520);
3609
    stringBuffer.append(TEXT_788);
2482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3610
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2483
    stringBuffer.append(TEXT_521);
3611
    stringBuffer.append(TEXT_789);
2484
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3612
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2485
    stringBuffer.append(TEXT_522);
3613
    stringBuffer.append(TEXT_790);
2486
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
3614
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
2487
    stringBuffer.append(TEXT_523);
3615
    stringBuffer.append(TEXT_791);
2488
    
3616
    
2489
		}
3617
		}
2490
3618
Lines 2492-2506 Link Here
2492
	if (linkConstraints != null) {
3620
	if (linkConstraints != null) {
2493
		String _edge = "edge";
3621
		String _edge = "edge";
2494
3622
2495
    stringBuffer.append(TEXT_524);
3623
    stringBuffer.append(TEXT_792);
2496
    
3624
    
2497
	//input: _edge : String
3625
	//input: _edge : String
2498
3626
2499
    stringBuffer.append(TEXT_525);
3627
    stringBuffer.append(TEXT_793);
2500
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3628
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2501
    stringBuffer.append(TEXT_526);
3629
    stringBuffer.append(TEXT_794);
2502
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3630
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2503
    stringBuffer.append(TEXT_527);
3631
    stringBuffer.append(TEXT_795);
2504
    
3632
    
2505
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3633
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2506
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3634
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 2527-2776 Link Here
2527
				}
3655
				}
2528
			}
3656
			}
2529
3657
2530
    stringBuffer.append(TEXT_528);
3658
    stringBuffer.append(TEXT_796);
2531
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3659
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2532
    stringBuffer.append(TEXT_529);
3660
    stringBuffer.append(TEXT_797);
2533
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3661
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
2534
    stringBuffer.append(TEXT_530);
3662
    stringBuffer.append(TEXT_798);
2535
    
3663
    
2536
			if (containmentFeature.getEcoreFeature().isMany()) {
3664
			if (containmentFeature.getEcoreFeature().isMany()) {
2537
3665
2538
    stringBuffer.append(TEXT_531);
3666
    stringBuffer.append(TEXT_799);
2539
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3667
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2540
    stringBuffer.append(TEXT_532);
3668
    stringBuffer.append(TEXT_800);
2541
    stringBuffer.append(_edge);
3669
    stringBuffer.append(_edge);
2542
    stringBuffer.append(TEXT_533);
3670
    stringBuffer.append(TEXT_801);
2543
    stringBuffer.append(_edge);
3671
    stringBuffer.append(_edge);
2544
    stringBuffer.append(TEXT_534);
3672
    stringBuffer.append(TEXT_802);
2545
    stringBuffer.append(_edge);
3673
    stringBuffer.append(_edge);
2546
    stringBuffer.append(TEXT_535);
3674
    stringBuffer.append(TEXT_803);
2547
    
3675
    
2548
			} else {
3676
			} else {
2549
3677
2550
    stringBuffer.append(TEXT_536);
3678
    stringBuffer.append(TEXT_804);
2551
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3679
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2552
    stringBuffer.append(TEXT_537);
3680
    stringBuffer.append(TEXT_805);
2553
    stringBuffer.append(_edge);
3681
    stringBuffer.append(_edge);
2554
    stringBuffer.append(TEXT_538);
3682
    stringBuffer.append(TEXT_806);
2555
    stringBuffer.append(_edge);
3683
    stringBuffer.append(_edge);
2556
    stringBuffer.append(TEXT_539);
3684
    stringBuffer.append(TEXT_807);
2557
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3685
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2558
    stringBuffer.append(TEXT_540);
3686
    stringBuffer.append(TEXT_808);
2559
    
3687
    
2560
			}
3688
			}
2561
		} else {
3689
		} else {
2562
3690
2563
    stringBuffer.append(TEXT_541);
3691
    stringBuffer.append(TEXT_809);
2564
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
3692
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
2565
    stringBuffer.append(TEXT_542);
3693
    stringBuffer.append(TEXT_810);
2566
    
3694
    
2567
		}
3695
		}
2568
		if (removeChild) {
3696
		if (removeChild) {
2569
			if (childFeature.getEcoreFeature().isMany()) {
3697
			if (childFeature.getEcoreFeature().isMany()) {
2570
3698
2571
    stringBuffer.append(TEXT_543);
3699
    stringBuffer.append(TEXT_811);
2572
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3700
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2573
    stringBuffer.append(TEXT_544);
3701
    stringBuffer.append(TEXT_812);
2574
    stringBuffer.append(_edge);
3702
    stringBuffer.append(_edge);
2575
    stringBuffer.append(TEXT_545);
3703
    stringBuffer.append(TEXT_813);
2576
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3704
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2577
    stringBuffer.append(TEXT_546);
3705
    stringBuffer.append(TEXT_814);
2578
    stringBuffer.append(childFeature.getFeatureAccessorName());
3706
    stringBuffer.append(childFeature.getFeatureAccessorName());
2579
    stringBuffer.append(TEXT_547);
3707
    stringBuffer.append(TEXT_815);
2580
    stringBuffer.append(_edge);
3708
    stringBuffer.append(_edge);
2581
    stringBuffer.append(TEXT_548);
3709
    stringBuffer.append(TEXT_816);
2582
    
3710
    
2583
			} else {
3711
			} else {
2584
3712
2585
    stringBuffer.append(TEXT_549);
3713
    stringBuffer.append(TEXT_817);
2586
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3714
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2587
    stringBuffer.append(TEXT_550);
3715
    stringBuffer.append(TEXT_818);
2588
    stringBuffer.append(_edge);
3716
    stringBuffer.append(_edge);
2589
    stringBuffer.append(TEXT_551);
3717
    stringBuffer.append(TEXT_819);
2590
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3718
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2591
    stringBuffer.append(TEXT_552);
3719
    stringBuffer.append(TEXT_820);
2592
    stringBuffer.append(childFeature.getFeatureAccessorName());
3720
    stringBuffer.append(childFeature.getFeatureAccessorName());
2593
    stringBuffer.append(TEXT_553);
3721
    stringBuffer.append(TEXT_821);
2594
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3722
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2595
    stringBuffer.append(TEXT_554);
3723
    stringBuffer.append(TEXT_822);
2596
    
3724
    
2597
			}
3725
			}
2598
		}
3726
		}
2599
		if (removeSource) {
3727
		if (removeSource) {
2600
			if (sourceFeature.getEcoreFeature().isMany()) {
3728
			if (sourceFeature.getEcoreFeature().isMany()) {
2601
3729
2602
    stringBuffer.append(TEXT_555);
3730
    stringBuffer.append(TEXT_823);
2603
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3731
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2604
    stringBuffer.append(TEXT_556);
3732
    stringBuffer.append(TEXT_824);
2605
    stringBuffer.append(_edge);
3733
    stringBuffer.append(_edge);
2606
    stringBuffer.append(TEXT_557);
3734
    stringBuffer.append(TEXT_825);
2607
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3735
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2608
    stringBuffer.append(TEXT_558);
3736
    stringBuffer.append(TEXT_826);
2609
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3737
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
2610
    stringBuffer.append(TEXT_559);
3738
    stringBuffer.append(TEXT_827);
2611
    stringBuffer.append(_edge);
3739
    stringBuffer.append(_edge);
2612
    stringBuffer.append(TEXT_560);
3740
    stringBuffer.append(TEXT_828);
2613
    
3741
    
2614
			} else {
3742
			} else {
2615
3743
2616
    stringBuffer.append(TEXT_561);
3744
    stringBuffer.append(TEXT_829);
2617
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3745
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2618
    stringBuffer.append(TEXT_562);
3746
    stringBuffer.append(TEXT_830);
2619
    stringBuffer.append(_edge);
3747
    stringBuffer.append(_edge);
2620
    stringBuffer.append(TEXT_563);
3748
    stringBuffer.append(TEXT_831);
2621
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3749
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2622
    stringBuffer.append(TEXT_564);
3750
    stringBuffer.append(TEXT_832);
2623
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3751
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
2624
    stringBuffer.append(TEXT_565);
3752
    stringBuffer.append(TEXT_833);
2625
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3753
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2626
    stringBuffer.append(TEXT_566);
3754
    stringBuffer.append(TEXT_834);
2627
    
3755
    
2628
			}
3756
			}
2629
		}
3757
		}
2630
		if (removeTarget) {
3758
		if (removeTarget) {
2631
			if (targetFeature.getEcoreFeature().isMany()) {
3759
			if (targetFeature.getEcoreFeature().isMany()) {
2632
3760
2633
    stringBuffer.append(TEXT_567);
3761
    stringBuffer.append(TEXT_835);
2634
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3762
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2635
    stringBuffer.append(TEXT_568);
3763
    stringBuffer.append(TEXT_836);
2636
    stringBuffer.append(_edge);
3764
    stringBuffer.append(_edge);
2637
    stringBuffer.append(TEXT_569);
3765
    stringBuffer.append(TEXT_837);
2638
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3766
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2639
    stringBuffer.append(TEXT_570);
3767
    stringBuffer.append(TEXT_838);
2640
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3768
    stringBuffer.append(targetFeature.getFeatureAccessorName());
2641
    stringBuffer.append(TEXT_571);
3769
    stringBuffer.append(TEXT_839);
2642
    stringBuffer.append(_edge);
3770
    stringBuffer.append(_edge);
2643
    stringBuffer.append(TEXT_572);
3771
    stringBuffer.append(TEXT_840);
2644
    
3772
    
2645
			} else {
3773
			} else {
2646
3774
2647
    stringBuffer.append(TEXT_573);
3775
    stringBuffer.append(TEXT_841);
2648
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3776
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2649
    stringBuffer.append(TEXT_574);
3777
    stringBuffer.append(TEXT_842);
2650
    stringBuffer.append(_edge);
3778
    stringBuffer.append(_edge);
2651
    stringBuffer.append(TEXT_575);
3779
    stringBuffer.append(TEXT_843);
2652
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3780
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2653
    stringBuffer.append(TEXT_576);
3781
    stringBuffer.append(TEXT_844);
2654
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3782
    stringBuffer.append(targetFeature.getFeatureAccessorName());
2655
    stringBuffer.append(TEXT_577);
3783
    stringBuffer.append(TEXT_845);
2656
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3784
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2657
    stringBuffer.append(TEXT_578);
3785
    stringBuffer.append(TEXT_846);
2658
    
3786
    
2659
			}
3787
			}
2660
		}
3788
		}
2661
3789
2662
    stringBuffer.append(TEXT_579);
3790
    stringBuffer.append(TEXT_847);
2663
    
3791
    
2664
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3792
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
2665
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3793
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
2666
		if (metaFeature.getEcoreFeature().isMany()) {
3794
		if (metaFeature.getEcoreFeature().isMany()) {
2667
3795
2668
    stringBuffer.append(TEXT_580);
3796
    stringBuffer.append(TEXT_848);
2669
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3797
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
2670
    stringBuffer.append(TEXT_581);
3798
    stringBuffer.append(TEXT_849);
2671
    stringBuffer.append(_edge);
3799
    stringBuffer.append(_edge);
2672
    stringBuffer.append(TEXT_582);
3800
    stringBuffer.append(TEXT_850);
2673
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3801
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2674
    stringBuffer.append(TEXT_583);
3802
    stringBuffer.append(TEXT_851);
2675
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3803
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2676
    stringBuffer.append(TEXT_584);
3804
    stringBuffer.append(TEXT_852);
2677
    stringBuffer.append(_edge);
3805
    stringBuffer.append(_edge);
2678
    stringBuffer.append(TEXT_585);
3806
    stringBuffer.append(TEXT_853);
2679
    
3807
    
2680
		} else {
3808
		} else {
2681
3809
2682
    stringBuffer.append(TEXT_586);
3810
    stringBuffer.append(TEXT_854);
2683
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3811
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2684
    stringBuffer.append(TEXT_587);
3812
    stringBuffer.append(TEXT_855);
2685
    stringBuffer.append(_edge);
3813
    stringBuffer.append(_edge);
2686
    stringBuffer.append(TEXT_588);
3814
    stringBuffer.append(TEXT_856);
2687
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3815
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
2688
    stringBuffer.append(TEXT_589);
3816
    stringBuffer.append(TEXT_857);
2689
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3817
    stringBuffer.append(metaFeature.getFeatureAccessorName());
2690
    stringBuffer.append(TEXT_590);
3818
    stringBuffer.append(TEXT_858);
2691
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3819
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
2692
    stringBuffer.append(TEXT_591);
3820
    stringBuffer.append(TEXT_859);
2693
    
3821
    
2694
		}
3822
		}
2695
3823
2696
    
3824
    
2697
	}
3825
	}
2698
3826
2699
    stringBuffer.append(TEXT_592);
3827
    stringBuffer.append(TEXT_860);
2700
    
3828
    
2701
	}
3829
	}
2702
3830
2703
    stringBuffer.append(TEXT_593);
3831
    stringBuffer.append(TEXT_861);
2704
    
3832
    
2705
	if (palette != null) {
3833
	if (palette != null) {
2706
3834
2707
    stringBuffer.append(TEXT_594);
3835
    stringBuffer.append(TEXT_862);
2708
    stringBuffer.append(createCommandNameInfix);
3836
    stringBuffer.append(createCommandNameInfix);
2709
    stringBuffer.append(genLink.getVisualID());
3837
    stringBuffer.append(genLink.getVisualID());
2710
    stringBuffer.append(TEXT_595);
3838
    stringBuffer.append(TEXT_863);
2711
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
3839
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
2712
    stringBuffer.append(TEXT_596);
3840
    stringBuffer.append(TEXT_864);
2713
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3841
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2714
    stringBuffer.append(TEXT_597);
3842
    stringBuffer.append(TEXT_865);
2715
    stringBuffer.append(createCommandNameInfix);
3843
    stringBuffer.append(createCommandNameInfix);
2716
    stringBuffer.append(genLink.getVisualID());
3844
    stringBuffer.append(genLink.getVisualID());
2717
    stringBuffer.append(TEXT_598);
3845
    stringBuffer.append(TEXT_866);
2718
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
3846
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
2719
    stringBuffer.append(TEXT_599);
3847
    stringBuffer.append(TEXT_867);
2720
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3848
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2721
    stringBuffer.append(TEXT_600);
3849
    stringBuffer.append(TEXT_868);
2722
    
3850
    
2723
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3851
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2724
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3852
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
2725
			GenFeature containmentFeature = modelFacet.getContainmentMetaFeature();
3853
			GenFeature containmentFeature = modelFacet.getContainmentMetaFeature();
2726
			if (containmentFeature == null) {
3854
			if (containmentFeature == null) {
2727
3855
2728
    stringBuffer.append(TEXT_601);
3856
    stringBuffer.append(TEXT_869);
2729
    
3857
    
2730
			} else {
3858
			} else {
2731
3859
2732
    stringBuffer.append(TEXT_602);
3860
    stringBuffer.append(TEXT_870);
2733
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
3861
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
2734
    stringBuffer.append(TEXT_603);
3862
    stringBuffer.append(TEXT_871);
2735
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
3863
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName()));
2736
    stringBuffer.append(TEXT_604);
3864
    stringBuffer.append(TEXT_872);
2737
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
3865
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
2738
    stringBuffer.append(TEXT_605);
3866
    stringBuffer.append(TEXT_873);
2739
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
3867
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
2740
    stringBuffer.append(TEXT_606);
3868
    stringBuffer.append(TEXT_874);
2741
    
3869
    
2742
				{
3870
				{
2743
					GenFeature _feature = containmentFeature;
3871
					GenFeature _feature = containmentFeature;
2744
					String _ownerInstance = "container";
3872
					String _ownerInstance = "container";
2745
					String _exceedsUpperBound = "return false;";
3873
					String _exceedsUpperBound = "return false;";
2746
3874
2747
    stringBuffer.append(TEXT_607);
3875
    stringBuffer.append(TEXT_875);
2748
    
3876
    
2749
int upperBound = _feature.getEcoreFeature().getUpperBound();
3877
int upperBound = _feature.getEcoreFeature().getUpperBound();
2750
if (upperBound > 0) {
3878
if (upperBound > 0) {
2751
	if (upperBound == 1) {
3879
	if (upperBound == 1) {
2752
3880
2753
    stringBuffer.append(TEXT_608);
3881
    stringBuffer.append(TEXT_876);
2754
    stringBuffer.append(_ownerInstance);
3882
    stringBuffer.append(_ownerInstance);
2755
    stringBuffer.append(TEXT_609);
3883
    stringBuffer.append(TEXT_877);
2756
    stringBuffer.append(_feature.getGetAccessor());
3884
    stringBuffer.append(_feature.getGetAccessor());
2757
    stringBuffer.append(TEXT_610);
3885
    stringBuffer.append(TEXT_878);
2758
    stringBuffer.append(_exceedsUpperBound);
3886
    stringBuffer.append(_exceedsUpperBound);
2759
    stringBuffer.append(TEXT_611);
3887
    stringBuffer.append(TEXT_879);
2760
    
3888
    
2761
	} else {
3889
	} else {
2762
3890
2763
    stringBuffer.append(TEXT_612);
3891
    stringBuffer.append(TEXT_880);
2764
    stringBuffer.append(_ownerInstance);
3892
    stringBuffer.append(_ownerInstance);
2765
    stringBuffer.append(TEXT_613);
3893
    stringBuffer.append(TEXT_881);
2766
    stringBuffer.append(_feature.getGetAccessor());
3894
    stringBuffer.append(_feature.getGetAccessor());
2767
    stringBuffer.append(TEXT_614);
3895
    stringBuffer.append(TEXT_882);
2768
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3896
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2769
    stringBuffer.append(TEXT_615);
3897
    stringBuffer.append(TEXT_883);
2770
    stringBuffer.append(_feature.getFeatureAccessorName());
3898
    stringBuffer.append(_feature.getFeatureAccessorName());
2771
    stringBuffer.append(TEXT_616);
3899
    stringBuffer.append(TEXT_884);
2772
    stringBuffer.append(_exceedsUpperBound);
3900
    stringBuffer.append(_exceedsUpperBound);
2773
    stringBuffer.append(TEXT_617);
3901
    stringBuffer.append(TEXT_885);
2774
    
3902
    
2775
	}
3903
	}
2776
}
3904
}
Lines 2784-2816 Link Here
2784
						String _ownerInstance = "container";
3912
						String _ownerInstance = "container";
2785
						String _exceedsUpperBound = "return false;";
3913
						String _exceedsUpperBound = "return false;";
2786
3914
2787
    stringBuffer.append(TEXT_618);
3915
    stringBuffer.append(TEXT_886);
2788
    
3916
    
2789
int upperBound = _feature.getEcoreFeature().getUpperBound();
3917
int upperBound = _feature.getEcoreFeature().getUpperBound();
2790
if (upperBound > 0) {
3918
if (upperBound > 0) {
2791
	if (upperBound == 1) {
3919
	if (upperBound == 1) {
2792
3920
2793
    stringBuffer.append(TEXT_619);
3921
    stringBuffer.append(TEXT_887);
2794
    stringBuffer.append(_ownerInstance);
3922
    stringBuffer.append(_ownerInstance);
2795
    stringBuffer.append(TEXT_620);
3923
    stringBuffer.append(TEXT_888);
2796
    stringBuffer.append(_feature.getGetAccessor());
3924
    stringBuffer.append(_feature.getGetAccessor());
2797
    stringBuffer.append(TEXT_621);
3925
    stringBuffer.append(TEXT_889);
2798
    stringBuffer.append(_exceedsUpperBound);
3926
    stringBuffer.append(_exceedsUpperBound);
2799
    stringBuffer.append(TEXT_622);
3927
    stringBuffer.append(TEXT_890);
2800
    
3928
    
2801
	} else {
3929
	} else {
2802
3930
2803
    stringBuffer.append(TEXT_623);
3931
    stringBuffer.append(TEXT_891);
2804
    stringBuffer.append(_ownerInstance);
3932
    stringBuffer.append(_ownerInstance);
2805
    stringBuffer.append(TEXT_624);
3933
    stringBuffer.append(TEXT_892);
2806
    stringBuffer.append(_feature.getGetAccessor());
3934
    stringBuffer.append(_feature.getGetAccessor());
2807
    stringBuffer.append(TEXT_625);
3935
    stringBuffer.append(TEXT_893);
2808
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3936
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2809
    stringBuffer.append(TEXT_626);
3937
    stringBuffer.append(TEXT_894);
2810
    stringBuffer.append(_feature.getFeatureAccessorName());
3938
    stringBuffer.append(_feature.getFeatureAccessorName());
2811
    stringBuffer.append(TEXT_627);
3939
    stringBuffer.append(TEXT_895);
2812
    stringBuffer.append(_exceedsUpperBound);
3940
    stringBuffer.append(_exceedsUpperBound);
2813
    stringBuffer.append(TEXT_628);
3941
    stringBuffer.append(TEXT_896);
2814
    
3942
    
2815
	}
3943
	}
2816
}
3944
}
Lines 2822-2845 Link Here
2822
	String _source = "source.getElement()";
3950
	String _source = "source.getElement()";
2823
	String _target = "null";
3951
	String _target = "null";
2824
3952
2825
    stringBuffer.append(TEXT_629);
3953
    stringBuffer.append(TEXT_897);
2826
    
3954
    
2827
			if (linkConstraints != null) {
3955
			if (linkConstraints != null) {
2828
3956
2829
    stringBuffer.append(TEXT_630);
3957
    stringBuffer.append(TEXT_898);
2830
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3958
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
2831
    stringBuffer.append(TEXT_631);
3959
    stringBuffer.append(TEXT_899);
2832
    stringBuffer.append(_source);
3960
    stringBuffer.append(_source);
2833
    stringBuffer.append(TEXT_632);
3961
    stringBuffer.append(TEXT_900);
2834
    stringBuffer.append(_target);
3962
    stringBuffer.append(_target);
2835
    stringBuffer.append(TEXT_633);
3963
    stringBuffer.append(TEXT_901);
2836
    
3964
    
2837
			}
3965
			}
2838
3966
2839
    
3967
    
2840
}	//local declarations for linkConstraints.jetinc
3968
}	//local declarations for linkConstraints.jetinc
2841
3969
2842
    stringBuffer.append(TEXT_634);
3970
    stringBuffer.append(TEXT_902);
2843
    
3971
    
2844
			}
3972
			}
2845
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3973
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
Lines 2849-2881 Link Here
2849
			String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") source.getElement())";
3977
			String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") source.getElement())";
2850
			String _exceedsUpperBound = "return false;";
3978
			String _exceedsUpperBound = "return false;";
2851
3979
2852
    stringBuffer.append(TEXT_635);
3980
    stringBuffer.append(TEXT_903);
2853
    
3981
    
2854
int upperBound = _feature.getEcoreFeature().getUpperBound();
3982
int upperBound = _feature.getEcoreFeature().getUpperBound();
2855
if (upperBound > 0) {
3983
if (upperBound > 0) {
2856
	if (upperBound == 1) {
3984
	if (upperBound == 1) {
2857
3985
2858
    stringBuffer.append(TEXT_636);
3986
    stringBuffer.append(TEXT_904);
2859
    stringBuffer.append(_ownerInstance);
3987
    stringBuffer.append(_ownerInstance);
2860
    stringBuffer.append(TEXT_637);
3988
    stringBuffer.append(TEXT_905);
2861
    stringBuffer.append(_feature.getGetAccessor());
3989
    stringBuffer.append(_feature.getGetAccessor());
2862
    stringBuffer.append(TEXT_638);
3990
    stringBuffer.append(TEXT_906);
2863
    stringBuffer.append(_exceedsUpperBound);
3991
    stringBuffer.append(_exceedsUpperBound);
2864
    stringBuffer.append(TEXT_639);
3992
    stringBuffer.append(TEXT_907);
2865
    
3993
    
2866
	} else {
3994
	} else {
2867
3995
2868
    stringBuffer.append(TEXT_640);
3996
    stringBuffer.append(TEXT_908);
2869
    stringBuffer.append(_ownerInstance);
3997
    stringBuffer.append(_ownerInstance);
2870
    stringBuffer.append(TEXT_641);
3998
    stringBuffer.append(TEXT_909);
2871
    stringBuffer.append(_feature.getGetAccessor());
3999
    stringBuffer.append(_feature.getGetAccessor());
2872
    stringBuffer.append(TEXT_642);
4000
    stringBuffer.append(TEXT_910);
2873
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
4001
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
2874
    stringBuffer.append(TEXT_643);
4002
    stringBuffer.append(TEXT_911);
2875
    stringBuffer.append(_feature.getFeatureAccessorName());
4003
    stringBuffer.append(_feature.getFeatureAccessorName());
2876
    stringBuffer.append(TEXT_644);
4004
    stringBuffer.append(TEXT_912);
2877
    stringBuffer.append(_exceedsUpperBound);
4005
    stringBuffer.append(_exceedsUpperBound);
2878
    stringBuffer.append(TEXT_645);
4006
    stringBuffer.append(TEXT_913);
2879
    
4007
    
2880
	}
4008
	}
2881
}
4009
}
Lines 2886-2932 Link Here
2886
	String _source = "source.getElement()";
4014
	String _source = "source.getElement()";
2887
	String _target = "null";
4015
	String _target = "null";
2888
4016
2889
    stringBuffer.append(TEXT_646);
4017
    stringBuffer.append(TEXT_914);
2890
    
4018
    
2891
			if (linkConstraints != null) {
4019
			if (linkConstraints != null) {
2892
4020
2893
    stringBuffer.append(TEXT_647);
4021
    stringBuffer.append(TEXT_915);
2894
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
4022
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
2895
    stringBuffer.append(TEXT_648);
4023
    stringBuffer.append(TEXT_916);
2896
    stringBuffer.append(_source);
4024
    stringBuffer.append(_source);
2897
    stringBuffer.append(TEXT_649);
4025
    stringBuffer.append(TEXT_917);
2898
    stringBuffer.append(_target);
4026
    stringBuffer.append(_target);
2899
    stringBuffer.append(TEXT_650);
4027
    stringBuffer.append(TEXT_918);
2900
    
4028
    
2901
			}
4029
			}
2902
4030
2903
    
4031
    
2904
}	//local declarations for linkConstraints.jetinc
4032
}	//local declarations for linkConstraints.jetinc
2905
4033
2906
    stringBuffer.append(TEXT_651);
4034
    stringBuffer.append(TEXT_919);
2907
    
4035
    
2908
		} else {
4036
		} else {
2909
4037
2910
    stringBuffer.append(TEXT_652);
4038
    stringBuffer.append(TEXT_920);
2911
    
4039
    
2912
		}
4040
		}
2913
4041
2914
    stringBuffer.append(TEXT_653);
4042
    stringBuffer.append(TEXT_921);
2915
    stringBuffer.append(TEXT_654);
4043
    stringBuffer.append(TEXT_922);
2916
    
4044
    
2917
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4045
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
2918
4046
2919
    stringBuffer.append(TEXT_655);
4047
    stringBuffer.append(TEXT_923);
2920
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
4048
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2921
    stringBuffer.append(TEXT_656);
4049
    stringBuffer.append(TEXT_924);
2922
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
4050
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
2923
    stringBuffer.append(TEXT_657);
4051
    stringBuffer.append(TEXT_925);
2924
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
4052
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
2925
    stringBuffer.append(TEXT_658);
4053
    stringBuffer.append(TEXT_926);
2926
    
4054
    
2927
		}
4055
		}
2928
4056
2929
    stringBuffer.append(TEXT_659);
4057
    stringBuffer.append(TEXT_927);
2930
    
4058
    
2931
	}	//if there's palette 
4059
	}	//if there's palette 
2932
}	//outgoing links
4060
}	//outgoing links
Lines 2956-3157 Link Here
2956
	}
4084
	}
2957
	GenLinkConstraints linkConstraints = genLink.getCreationConstraints();
4085
	GenLinkConstraints linkConstraints = genLink.getCreationConstraints();
2958
4086
2959
    stringBuffer.append(TEXT_660);
4087
    stringBuffer.append(TEXT_928);
2960
    stringBuffer.append(reconnectCommandNameInfix);
4088
    stringBuffer.append(reconnectCommandNameInfix);
2961
    stringBuffer.append(genLink.getVisualID());
4089
    stringBuffer.append(genLink.getVisualID());
2962
    stringBuffer.append(TEXT_661);
4090
    stringBuffer.append(TEXT_929);
2963
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
4091
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
2964
    stringBuffer.append(TEXT_662);
4092
    stringBuffer.append(TEXT_930);
2965
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
4093
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2966
    stringBuffer.append(TEXT_663);
4094
    stringBuffer.append(TEXT_931);
2967
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4095
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2968
    stringBuffer.append(TEXT_664);
4096
    stringBuffer.append(TEXT_932);
2969
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4097
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2970
    stringBuffer.append(TEXT_665);
4098
    stringBuffer.append(TEXT_933);
2971
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
4099
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2972
    stringBuffer.append(TEXT_666);
4100
    stringBuffer.append(TEXT_934);
2973
    stringBuffer.append(reconnectCommandNameInfix);
4101
    stringBuffer.append(reconnectCommandNameInfix);
2974
    stringBuffer.append(genLink.getVisualID());
4102
    stringBuffer.append(genLink.getVisualID());
2975
    stringBuffer.append(TEXT_667);
4103
    stringBuffer.append(TEXT_935);
2976
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
4104
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
2977
    stringBuffer.append(TEXT_668);
4105
    stringBuffer.append(TEXT_936);
2978
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
4106
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2979
    stringBuffer.append(TEXT_669);
4107
    stringBuffer.append(TEXT_937);
2980
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4108
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2981
    stringBuffer.append(TEXT_670);
4109
    stringBuffer.append(TEXT_938);
2982
    stringBuffer.append(reconnectCommandNameInfix);
4110
    stringBuffer.append(reconnectCommandNameInfix);
2983
    stringBuffer.append(genLink.getVisualID());
4111
    stringBuffer.append(genLink.getVisualID());
2984
    stringBuffer.append(TEXT_671);
4112
    stringBuffer.append(TEXT_939);
2985
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
4113
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
2986
    stringBuffer.append(TEXT_672);
4114
    stringBuffer.append(TEXT_940);
2987
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4115
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
2988
    stringBuffer.append(TEXT_673);
4116
    stringBuffer.append(TEXT_941);
2989
    
4117
    
2990
	if (linkConstraints != null) {
4118
	if (linkConstraints != null) {
2991
4119
2992
    stringBuffer.append(TEXT_674);
4120
    stringBuffer.append(TEXT_942);
2993
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
4121
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
2994
    stringBuffer.append(TEXT_675);
4122
    stringBuffer.append(TEXT_943);
2995
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
4123
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
2996
    stringBuffer.append(TEXT_676);
4124
    stringBuffer.append(TEXT_944);
2997
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
4125
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
2998
    stringBuffer.append(TEXT_677);
4126
    stringBuffer.append(TEXT_945);
2999
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
4127
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
3000
    stringBuffer.append(TEXT_678);
4128
    stringBuffer.append(TEXT_946);
3001
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
4129
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3002
    stringBuffer.append(TEXT_679);
4130
    stringBuffer.append(TEXT_947);
3003
    
4131
    
3004
	} else {
4132
	} else {
3005
4133
3006
    stringBuffer.append(TEXT_680);
4134
    stringBuffer.append(TEXT_948);
3007
    
4135
    
3008
	}
4136
	}
3009
4137
3010
    stringBuffer.append(TEXT_681);
4138
    stringBuffer.append(TEXT_949);
3011
    
4139
    
3012
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4140
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3013
{
4141
{
3014
	String _source = "edge.getSource().getElement()";
4142
	String _source = "edge.getSource().getElement()";
3015
	String _target = "newTarget.getElement()";
4143
	String _target = "newTarget.getElement()";
3016
4144
3017
    stringBuffer.append(TEXT_682);
4145
    stringBuffer.append(TEXT_950);
3018
    
4146
    
3019
			if (linkConstraints != null) {
4147
			if (linkConstraints != null) {
3020
4148
3021
    stringBuffer.append(TEXT_683);
4149
    stringBuffer.append(TEXT_951);
3022
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
4150
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3023
    stringBuffer.append(TEXT_684);
4151
    stringBuffer.append(TEXT_952);
3024
    stringBuffer.append(_source);
4152
    stringBuffer.append(_source);
3025
    stringBuffer.append(TEXT_685);
4153
    stringBuffer.append(TEXT_953);
3026
    stringBuffer.append(_target);
4154
    stringBuffer.append(_target);
3027
    stringBuffer.append(TEXT_686);
4155
    stringBuffer.append(TEXT_954);
3028
    
4156
    
3029
			}
4157
			}
3030
4158
3031
    
4159
    
3032
}	//local declarations for linkConstraints.jetinc
4160
}	//local declarations for linkConstraints.jetinc
3033
4161
3034
    stringBuffer.append(TEXT_687);
4162
    stringBuffer.append(TEXT_955);
3035
    
4163
    
3036
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
4164
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3037
{
4165
{
3038
	String _source = "edge.getSource().getElement()";
4166
	String _source = "edge.getSource().getElement()";
3039
	String _target = "newTarget.getElement()";
4167
	String _target = "newTarget.getElement()";
3040
4168
3041
    stringBuffer.append(TEXT_688);
4169
    stringBuffer.append(TEXT_956);
3042
    
4170
    
3043
			if (linkConstraints != null) {
4171
			if (linkConstraints != null) {
3044
4172
3045
    stringBuffer.append(TEXT_689);
4173
    stringBuffer.append(TEXT_957);
3046
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
4174
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3047
    stringBuffer.append(TEXT_690);
4175
    stringBuffer.append(TEXT_958);
3048
    stringBuffer.append(_source);
4176
    stringBuffer.append(_source);
3049
    stringBuffer.append(TEXT_691);
4177
    stringBuffer.append(TEXT_959);
3050
    stringBuffer.append(_target);
4178
    stringBuffer.append(_target);
3051
    stringBuffer.append(TEXT_692);
4179
    stringBuffer.append(TEXT_960);
3052
    
4180
    
3053
			}
4181
			}
3054
4182
3055
    
4183
    
3056
}	//local declarations for linkConstraints.jetinc
4184
}	//local declarations for linkConstraints.jetinc
3057
4185
3058
    stringBuffer.append(TEXT_693);
4186
    stringBuffer.append(TEXT_961);
3059
    
4187
    
3060
		} else {
4188
		} else {
3061
4189
3062
    stringBuffer.append(TEXT_694);
4190
    stringBuffer.append(TEXT_962);
3063
    
4191
    
3064
		}
4192
		}
3065
4193
3066
    stringBuffer.append(TEXT_695);
4194
    stringBuffer.append(TEXT_963);
3067
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
4195
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3068
    stringBuffer.append(TEXT_696);
4196
    stringBuffer.append(TEXT_964);
3069
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
4197
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3070
    stringBuffer.append(TEXT_697);
4198
    stringBuffer.append(TEXT_965);
3071
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
4199
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
3072
    stringBuffer.append(TEXT_698);
4200
    stringBuffer.append(TEXT_966);
3073
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
4201
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3074
    stringBuffer.append(TEXT_699);
4202
    stringBuffer.append(TEXT_967);
3075
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
4203
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3076
    stringBuffer.append(TEXT_700);
4204
    stringBuffer.append(TEXT_968);
3077
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand"));
4205
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand"));
3078
    stringBuffer.append(TEXT_701);
4206
    stringBuffer.append(TEXT_969);
3079
    
4207
    
3080
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4208
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3081
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
4209
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3082
			GenFeature targetFeature = modelFacet.getTargetMetaFeature();
4210
			GenFeature targetFeature = modelFacet.getTargetMetaFeature();
3083
			if (targetFeature.getEcoreFeature().isMany()) {
4211
			if (targetFeature.getEcoreFeature().isMany()) {
3084
4212
3085
    stringBuffer.append(TEXT_702);
4213
    stringBuffer.append(TEXT_970);
3086
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4214
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3087
    stringBuffer.append(TEXT_703);
4215
    stringBuffer.append(TEXT_971);
3088
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4216
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3089
    stringBuffer.append(TEXT_704);
4217
    stringBuffer.append(TEXT_972);
3090
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4218
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3091
    stringBuffer.append(TEXT_705);
4219
    stringBuffer.append(TEXT_973);
3092
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
4220
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
3093
    stringBuffer.append(TEXT_706);
4221
    stringBuffer.append(TEXT_974);
3094
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4222
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3095
    stringBuffer.append(TEXT_707);
4223
    stringBuffer.append(TEXT_975);
3096
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4224
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3097
    stringBuffer.append(TEXT_708);
4225
    stringBuffer.append(TEXT_976);
3098
    
4226
    
3099
			} else {
4227
			} else {
3100
4228
3101
    stringBuffer.append(TEXT_709);
4229
    stringBuffer.append(TEXT_977);
3102
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4230
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3103
    stringBuffer.append(TEXT_710);
4231
    stringBuffer.append(TEXT_978);
3104
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4232
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3105
    stringBuffer.append(TEXT_711);
4233
    stringBuffer.append(TEXT_979);
3106
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4234
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3107
    stringBuffer.append(TEXT_712);
4235
    stringBuffer.append(TEXT_980);
3108
    
4236
    
3109
			}
4237
			}
3110
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
4238
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3111
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
4239
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3112
			if (metaFeature.getEcoreFeature().isMany()) {
4240
			if (metaFeature.getEcoreFeature().isMany()) {
3113
4241
3114
    stringBuffer.append(TEXT_713);
4242
    stringBuffer.append(TEXT_981);
3115
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4243
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3116
    stringBuffer.append(TEXT_714);
4244
    stringBuffer.append(TEXT_982);
3117
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4245
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3118
    stringBuffer.append(TEXT_715);
4246
    stringBuffer.append(TEXT_983);
3119
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4247
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3120
    stringBuffer.append(TEXT_716);
4248
    stringBuffer.append(TEXT_984);
3121
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
4249
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
3122
    stringBuffer.append(TEXT_717);
4250
    stringBuffer.append(TEXT_985);
3123
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4251
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3124
    stringBuffer.append(TEXT_718);
4252
    stringBuffer.append(TEXT_986);
3125
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4253
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3126
    stringBuffer.append(TEXT_719);
4254
    stringBuffer.append(TEXT_987);
3127
    
4255
    
3128
			} else {
4256
			} else {
3129
4257
3130
    stringBuffer.append(TEXT_720);
4258
    stringBuffer.append(TEXT_988);
3131
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4259
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3132
    stringBuffer.append(TEXT_721);
4260
    stringBuffer.append(TEXT_989);
3133
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4261
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3134
    stringBuffer.append(TEXT_722);
4262
    stringBuffer.append(TEXT_990);
3135
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4263
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3136
    stringBuffer.append(TEXT_723);
4264
    stringBuffer.append(TEXT_991);
3137
    
4265
    
3138
			}
4266
			}
3139
		}
4267
		}
3140
4268
3141
    stringBuffer.append(TEXT_724);
4269
    stringBuffer.append(TEXT_992);
3142
    
4270
    
3143
	if (linkConstraints != null) {
4271
	if (linkConstraints != null) {
3144
		String _edge = "edge";
4272
		String _edge = "edge";
3145
4273
3146
    stringBuffer.append(TEXT_725);
4274
    stringBuffer.append(TEXT_993);
3147
    
4275
    
3148
	//input: _edge : String
4276
	//input: _edge : String
3149
4277
3150
    stringBuffer.append(TEXT_726);
4278
    stringBuffer.append(TEXT_994);
3151
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
4279
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
3152
    stringBuffer.append(TEXT_727);
4280
    stringBuffer.append(TEXT_995);
3153
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
4281
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3154
    stringBuffer.append(TEXT_728);
4282
    stringBuffer.append(TEXT_996);
3155
    
4283
    
3156
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4284
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3157
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
4285
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 3178-3425 Link Here
3178
				}
4306
				}
3179
			}
4307
			}
3180
4308
3181
    stringBuffer.append(TEXT_729);
4309
    stringBuffer.append(TEXT_997);
3182
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
4310
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3183
    stringBuffer.append(TEXT_730);
4311
    stringBuffer.append(TEXT_998);
3184
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
4312
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
3185
    stringBuffer.append(TEXT_731);
4313
    stringBuffer.append(TEXT_999);
3186
    
4314
    
3187
			if (containmentFeature.getEcoreFeature().isMany()) {
4315
			if (containmentFeature.getEcoreFeature().isMany()) {
3188
4316
3189
    stringBuffer.append(TEXT_732);
4317
    stringBuffer.append(TEXT_1000);
3190
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4318
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3191
    stringBuffer.append(TEXT_733);
4319
    stringBuffer.append(TEXT_1001);
3192
    stringBuffer.append(_edge);
4320
    stringBuffer.append(_edge);
3193
    stringBuffer.append(TEXT_734);
4321
    stringBuffer.append(TEXT_1002);
3194
    stringBuffer.append(_edge);
4322
    stringBuffer.append(_edge);
3195
    stringBuffer.append(TEXT_735);
4323
    stringBuffer.append(TEXT_1003);
3196
    stringBuffer.append(_edge);
4324
    stringBuffer.append(_edge);
3197
    stringBuffer.append(TEXT_736);
4325
    stringBuffer.append(TEXT_1004);
3198
    
4326
    
3199
			} else {
4327
			} else {
3200
4328
3201
    stringBuffer.append(TEXT_737);
4329
    stringBuffer.append(TEXT_1005);
3202
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4330
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3203
    stringBuffer.append(TEXT_738);
4331
    stringBuffer.append(TEXT_1006);
3204
    stringBuffer.append(_edge);
4332
    stringBuffer.append(_edge);
3205
    stringBuffer.append(TEXT_739);
4333
    stringBuffer.append(TEXT_1007);
3206
    stringBuffer.append(_edge);
4334
    stringBuffer.append(_edge);
3207
    stringBuffer.append(TEXT_740);
4335
    stringBuffer.append(TEXT_1008);
3208
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4336
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3209
    stringBuffer.append(TEXT_741);
4337
    stringBuffer.append(TEXT_1009);
3210
    
4338
    
3211
			}
4339
			}
3212
		} else {
4340
		} else {
3213
4341
3214
    stringBuffer.append(TEXT_742);
4342
    stringBuffer.append(TEXT_1010);
3215
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
4343
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
3216
    stringBuffer.append(TEXT_743);
4344
    stringBuffer.append(TEXT_1011);
3217
    
4345
    
3218
		}
4346
		}
3219
		if (removeChild) {
4347
		if (removeChild) {
3220
			if (childFeature.getEcoreFeature().isMany()) {
4348
			if (childFeature.getEcoreFeature().isMany()) {
3221
4349
3222
    stringBuffer.append(TEXT_744);
4350
    stringBuffer.append(TEXT_1012);
3223
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3224
    stringBuffer.append(TEXT_745);
4352
    stringBuffer.append(TEXT_1013);
3225
    stringBuffer.append(_edge);
4353
    stringBuffer.append(_edge);
3226
    stringBuffer.append(TEXT_746);
4354
    stringBuffer.append(TEXT_1014);
3227
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4355
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3228
    stringBuffer.append(TEXT_747);
4356
    stringBuffer.append(TEXT_1015);
3229
    stringBuffer.append(childFeature.getFeatureAccessorName());
4357
    stringBuffer.append(childFeature.getFeatureAccessorName());
3230
    stringBuffer.append(TEXT_748);
4358
    stringBuffer.append(TEXT_1016);
3231
    stringBuffer.append(_edge);
4359
    stringBuffer.append(_edge);
3232
    stringBuffer.append(TEXT_749);
4360
    stringBuffer.append(TEXT_1017);
3233
    
4361
    
3234
			} else {
4362
			} else {
3235
4363
3236
    stringBuffer.append(TEXT_750);
4364
    stringBuffer.append(TEXT_1018);
3237
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4365
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3238
    stringBuffer.append(TEXT_751);
4366
    stringBuffer.append(TEXT_1019);
3239
    stringBuffer.append(_edge);
4367
    stringBuffer.append(_edge);
3240
    stringBuffer.append(TEXT_752);
4368
    stringBuffer.append(TEXT_1020);
3241
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4369
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3242
    stringBuffer.append(TEXT_753);
4370
    stringBuffer.append(TEXT_1021);
3243
    stringBuffer.append(childFeature.getFeatureAccessorName());
4371
    stringBuffer.append(childFeature.getFeatureAccessorName());
3244
    stringBuffer.append(TEXT_754);
4372
    stringBuffer.append(TEXT_1022);
3245
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3246
    stringBuffer.append(TEXT_755);
4374
    stringBuffer.append(TEXT_1023);
3247
    
4375
    
3248
			}
4376
			}
3249
		}
4377
		}
3250
		if (removeSource) {
4378
		if (removeSource) {
3251
			if (sourceFeature.getEcoreFeature().isMany()) {
4379
			if (sourceFeature.getEcoreFeature().isMany()) {
3252
4380
3253
    stringBuffer.append(TEXT_756);
4381
    stringBuffer.append(TEXT_1024);
3254
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4382
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3255
    stringBuffer.append(TEXT_757);
4383
    stringBuffer.append(TEXT_1025);
3256
    stringBuffer.append(_edge);
4384
    stringBuffer.append(_edge);
3257
    stringBuffer.append(TEXT_758);
4385
    stringBuffer.append(TEXT_1026);
3258
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4386
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3259
    stringBuffer.append(TEXT_759);
4387
    stringBuffer.append(TEXT_1027);
3260
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
4388
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3261
    stringBuffer.append(TEXT_760);
4389
    stringBuffer.append(TEXT_1028);
3262
    stringBuffer.append(_edge);
4390
    stringBuffer.append(_edge);
3263
    stringBuffer.append(TEXT_761);
4391
    stringBuffer.append(TEXT_1029);
3264
    
4392
    
3265
			} else {
4393
			} else {
3266
4394
3267
    stringBuffer.append(TEXT_762);
4395
    stringBuffer.append(TEXT_1030);
3268
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4396
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3269
    stringBuffer.append(TEXT_763);
4397
    stringBuffer.append(TEXT_1031);
3270
    stringBuffer.append(_edge);
4398
    stringBuffer.append(_edge);
3271
    stringBuffer.append(TEXT_764);
4399
    stringBuffer.append(TEXT_1032);
3272
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4400
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3273
    stringBuffer.append(TEXT_765);
4401
    stringBuffer.append(TEXT_1033);
3274
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
4402
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3275
    stringBuffer.append(TEXT_766);
4403
    stringBuffer.append(TEXT_1034);
3276
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3277
    stringBuffer.append(TEXT_767);
4405
    stringBuffer.append(TEXT_1035);
3278
    
4406
    
3279
			}
4407
			}
3280
		}
4408
		}
3281
		if (removeTarget) {
4409
		if (removeTarget) {
3282
			if (targetFeature.getEcoreFeature().isMany()) {
4410
			if (targetFeature.getEcoreFeature().isMany()) {
3283
4411
3284
    stringBuffer.append(TEXT_768);
4412
    stringBuffer.append(TEXT_1036);
3285
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4413
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3286
    stringBuffer.append(TEXT_769);
4414
    stringBuffer.append(TEXT_1037);
3287
    stringBuffer.append(_edge);
4415
    stringBuffer.append(_edge);
3288
    stringBuffer.append(TEXT_770);
4416
    stringBuffer.append(TEXT_1038);
3289
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4417
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3290
    stringBuffer.append(TEXT_771);
4418
    stringBuffer.append(TEXT_1039);
3291
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4419
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3292
    stringBuffer.append(TEXT_772);
4420
    stringBuffer.append(TEXT_1040);
3293
    stringBuffer.append(_edge);
4421
    stringBuffer.append(_edge);
3294
    stringBuffer.append(TEXT_773);
4422
    stringBuffer.append(TEXT_1041);
3295
    
4423
    
3296
			} else {
4424
			} else {
3297
4425
3298
    stringBuffer.append(TEXT_774);
4426
    stringBuffer.append(TEXT_1042);
3299
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4427
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3300
    stringBuffer.append(TEXT_775);
4428
    stringBuffer.append(TEXT_1043);
3301
    stringBuffer.append(_edge);
4429
    stringBuffer.append(_edge);
3302
    stringBuffer.append(TEXT_776);
4430
    stringBuffer.append(TEXT_1044);
3303
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4431
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3304
    stringBuffer.append(TEXT_777);
4432
    stringBuffer.append(TEXT_1045);
3305
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4433
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3306
    stringBuffer.append(TEXT_778);
4434
    stringBuffer.append(TEXT_1046);
3307
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4435
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3308
    stringBuffer.append(TEXT_779);
4436
    stringBuffer.append(TEXT_1047);
3309
    
4437
    
3310
			}
4438
			}
3311
		}
4439
		}
3312
4440
3313
    stringBuffer.append(TEXT_780);
4441
    stringBuffer.append(TEXT_1048);
3314
    
4442
    
3315
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
4443
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3316
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
4444
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3317
		if (metaFeature.getEcoreFeature().isMany()) {
4445
		if (metaFeature.getEcoreFeature().isMany()) {
3318
4446
3319
    stringBuffer.append(TEXT_781);
4447
    stringBuffer.append(TEXT_1049);
3320
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
4448
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
3321
    stringBuffer.append(TEXT_782);
4449
    stringBuffer.append(TEXT_1050);
3322
    stringBuffer.append(_edge);
4450
    stringBuffer.append(_edge);
3323
    stringBuffer.append(TEXT_783);
4451
    stringBuffer.append(TEXT_1051);
3324
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4452
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3325
    stringBuffer.append(TEXT_784);
4453
    stringBuffer.append(TEXT_1052);
3326
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4454
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3327
    stringBuffer.append(TEXT_785);
4455
    stringBuffer.append(TEXT_1053);
3328
    stringBuffer.append(_edge);
4456
    stringBuffer.append(_edge);
3329
    stringBuffer.append(TEXT_786);
4457
    stringBuffer.append(TEXT_1054);
3330
    
4458
    
3331
		} else {
4459
		} else {
3332
4460
3333
    stringBuffer.append(TEXT_787);
4461
    stringBuffer.append(TEXT_1055);
3334
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4462
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3335
    stringBuffer.append(TEXT_788);
4463
    stringBuffer.append(TEXT_1056);
3336
    stringBuffer.append(_edge);
4464
    stringBuffer.append(_edge);
3337
    stringBuffer.append(TEXT_789);
4465
    stringBuffer.append(TEXT_1057);
3338
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4466
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3339
    stringBuffer.append(TEXT_790);
4467
    stringBuffer.append(TEXT_1058);
3340
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4468
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3341
    stringBuffer.append(TEXT_791);
4469
    stringBuffer.append(TEXT_1059);
3342
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
4470
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
3343
    stringBuffer.append(TEXT_792);
4471
    stringBuffer.append(TEXT_1060);
3344
    
4472
    
3345
		}
4473
		}
3346
4474
3347
    
4475
    
3348
	}
4476
	}
3349
4477
3350
    stringBuffer.append(TEXT_793);
4478
    stringBuffer.append(TEXT_1061);
3351
    
4479
    
3352
	}
4480
	}
3353
4481
3354
    stringBuffer.append(TEXT_794);
4482
    stringBuffer.append(TEXT_1062);
3355
    
4483
    
3356
	if (palette != null) {
4484
	if (palette != null) {
3357
4485
3358
    stringBuffer.append(TEXT_795);
4486
    stringBuffer.append(TEXT_1063);
3359
    stringBuffer.append(createCommandNameInfix);
4487
    stringBuffer.append(createCommandNameInfix);
3360
    stringBuffer.append(genLink.getVisualID());
4488
    stringBuffer.append(genLink.getVisualID());
3361
    stringBuffer.append(TEXT_796);
4489
    stringBuffer.append(TEXT_1064);
3362
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
4490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
3363
    stringBuffer.append(TEXT_797);
4491
    stringBuffer.append(TEXT_1065);
3364
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4492
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3365
    stringBuffer.append(TEXT_798);
4493
    stringBuffer.append(TEXT_1066);
3366
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4494
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3367
    stringBuffer.append(TEXT_799);
4495
    stringBuffer.append(TEXT_1067);
3368
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
4496
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
3369
    stringBuffer.append(TEXT_800);
4497
    stringBuffer.append(TEXT_1068);
3370
    stringBuffer.append(createCommandNameInfix);
4498
    stringBuffer.append(createCommandNameInfix);
3371
    stringBuffer.append(genLink.getVisualID());
4499
    stringBuffer.append(genLink.getVisualID());
3372
    stringBuffer.append(TEXT_801);
4500
    stringBuffer.append(TEXT_1069);
3373
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
4501
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
3374
    stringBuffer.append(TEXT_802);
4502
    stringBuffer.append(TEXT_1070);
3375
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4503
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3376
    stringBuffer.append(TEXT_803);
4504
    stringBuffer.append(TEXT_1071);
3377
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4505
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3378
    stringBuffer.append(TEXT_804);
4506
    stringBuffer.append(TEXT_1072);
3379
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4507
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3380
    stringBuffer.append(TEXT_805);
4508
    stringBuffer.append(TEXT_1073);
3381
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
4509
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
3382
    stringBuffer.append(TEXT_806);
4510
    stringBuffer.append(TEXT_1074);
3383
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
4511
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
3384
    stringBuffer.append(TEXT_807);
4512
    stringBuffer.append(TEXT_1075);
3385
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
4513
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
3386
    stringBuffer.append(TEXT_808);
4514
    stringBuffer.append(TEXT_1076);
3387
    
4515
    
3388
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4516
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3389
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
4517
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3390
			GenClass linkClass = modelFacet.getMetaClass();
4518
			GenClass linkClass = modelFacet.getMetaClass();
3391
4519
3392
    stringBuffer.append(TEXT_809);
4520
    stringBuffer.append(TEXT_1077);
3393
    stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName())));
4521
    stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName())));
3394
    stringBuffer.append(TEXT_810);
4522
    stringBuffer.append(TEXT_1078);
3395
    stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName()));
4523
    stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName()));
3396
    stringBuffer.append(TEXT_811);
4524
    stringBuffer.append(TEXT_1079);
3397
    stringBuffer.append(linkClass.getClassifierAccessorName());
4525
    stringBuffer.append(linkClass.getClassifierAccessorName());
3398
    stringBuffer.append(TEXT_812);
4526
    stringBuffer.append(TEXT_1080);
3399
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
4527
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
3400
    stringBuffer.append(TEXT_813);
4528
    stringBuffer.append(TEXT_1081);
3401
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
4529
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
3402
    stringBuffer.append(TEXT_814);
4530
    stringBuffer.append(TEXT_1082);
3403
    stringBuffer.append(genLink.getUniqueIdentifier());
4531
    stringBuffer.append(genLink.getUniqueIdentifier());
3404
    stringBuffer.append(TEXT_815);
4532
    stringBuffer.append(TEXT_1083);
3405
    
4533
    
3406
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
4534
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3407
4535
3408
    stringBuffer.append(TEXT_816);
4536
    stringBuffer.append(TEXT_1084);
3409
    
4537
    
3410
		}
4538
		}
3411
4539
3412
    stringBuffer.append(TEXT_817);
4540
    stringBuffer.append(TEXT_1085);
3413
    stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName()));
4541
    stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName()));
3414
    stringBuffer.append(TEXT_818);
4542
    stringBuffer.append(TEXT_1086);
3415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
4543
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
3416
    stringBuffer.append(TEXT_819);
4544
    stringBuffer.append(TEXT_1087);
3417
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
4545
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
3418
    stringBuffer.append(TEXT_820);
4546
    stringBuffer.append(TEXT_1088);
3419
    
4547
    
3420
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4548
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3421
4549
3422
    stringBuffer.append(TEXT_821);
4550
    stringBuffer.append(TEXT_1089);
3423
    
4551
    
3424
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
4552
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
3425
			GenFeature sourceFeature = modelFacet.getSourceMetaFeature();
4553
			GenFeature sourceFeature = modelFacet.getSourceMetaFeature();
Lines 3446-3475 Link Here
3446
					}
4574
					}
3447
				}
4575
				}
3448
4576
3449
    stringBuffer.append(TEXT_822);
4577
    stringBuffer.append(TEXT_1090);
3450
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
4578
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3451
    stringBuffer.append(TEXT_823);
4579
    stringBuffer.append(TEXT_1091);
3452
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
4580
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
3453
    stringBuffer.append(TEXT_824);
4581
    stringBuffer.append(TEXT_1092);
3454
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
4582
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
3455
    stringBuffer.append(TEXT_825);
4583
    stringBuffer.append(TEXT_1093);
3456
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
4584
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3457
    stringBuffer.append(TEXT_826);
4585
    stringBuffer.append(TEXT_1094);
3458
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4586
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3459
    stringBuffer.append(TEXT_827);
4587
    stringBuffer.append(TEXT_1095);
3460
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
4588
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
3461
    stringBuffer.append(TEXT_828);
4589
    stringBuffer.append(TEXT_1096);
3462
    
4590
    
3463
			}
4591
			}
3464
			if (addChild) {
4592
			if (addChild) {
3465
4593
3466
    stringBuffer.append(TEXT_829);
4594
    stringBuffer.append(TEXT_1097);
3467
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
4595
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3468
    stringBuffer.append(TEXT_830);
4596
    stringBuffer.append(TEXT_1098);
3469
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4597
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3470
    stringBuffer.append(TEXT_831);
4598
    stringBuffer.append(TEXT_1099);
3471
    stringBuffer.append(childFeature.getFeatureAccessorName());
4599
    stringBuffer.append(childFeature.getFeatureAccessorName());
3472
    stringBuffer.append(TEXT_832);
4600
    stringBuffer.append(TEXT_1100);
3473
    
4601
    
3474
			}
4602
			}
3475
			if (addSource) {
4603
			if (addSource) {
Lines 3478-3510 Link Here
3478
					String _ownerInstance = "createdDomainElement";
4606
					String _ownerInstance = "createdDomainElement";
3479
					String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;";
4607
					String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;";
3480
4608
3481
    stringBuffer.append(TEXT_833);
4609
    stringBuffer.append(TEXT_1101);
3482
    
4610
    
3483
int upperBound = _feature.getEcoreFeature().getUpperBound();
4611
int upperBound = _feature.getEcoreFeature().getUpperBound();
3484
if (upperBound > 0) {
4612
if (upperBound > 0) {
3485
	if (upperBound == 1) {
4613
	if (upperBound == 1) {
3486
4614
3487
    stringBuffer.append(TEXT_834);
4615
    stringBuffer.append(TEXT_1102);
3488
    stringBuffer.append(_ownerInstance);
4616
    stringBuffer.append(_ownerInstance);
3489
    stringBuffer.append(TEXT_835);
4617
    stringBuffer.append(TEXT_1103);
3490
    stringBuffer.append(_feature.getGetAccessor());
4618
    stringBuffer.append(_feature.getGetAccessor());
3491
    stringBuffer.append(TEXT_836);
4619
    stringBuffer.append(TEXT_1104);
3492
    stringBuffer.append(_exceedsUpperBound);
4620
    stringBuffer.append(_exceedsUpperBound);
3493
    stringBuffer.append(TEXT_837);
4621
    stringBuffer.append(TEXT_1105);
3494
    
4622
    
3495
	} else {
4623
	} else {
3496
4624
3497
    stringBuffer.append(TEXT_838);
4625
    stringBuffer.append(TEXT_1106);
3498
    stringBuffer.append(_ownerInstance);
4626
    stringBuffer.append(_ownerInstance);
3499
    stringBuffer.append(TEXT_839);
4627
    stringBuffer.append(TEXT_1107);
3500
    stringBuffer.append(_feature.getGetAccessor());
4628
    stringBuffer.append(_feature.getGetAccessor());
3501
    stringBuffer.append(TEXT_840);
4629
    stringBuffer.append(TEXT_1108);
3502
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
4630
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3503
    stringBuffer.append(TEXT_841);
4631
    stringBuffer.append(TEXT_1109);
3504
    stringBuffer.append(_feature.getFeatureAccessorName());
4632
    stringBuffer.append(_feature.getFeatureAccessorName());
3505
    stringBuffer.append(TEXT_842);
4633
    stringBuffer.append(TEXT_1110);
3506
    stringBuffer.append(_exceedsUpperBound);
4634
    stringBuffer.append(_exceedsUpperBound);
3507
    stringBuffer.append(TEXT_843);
4635
    stringBuffer.append(TEXT_1111);
3508
    
4636
    
3509
	}
4637
	}
3510
}
4638
}
Lines 3512-3524 Link Here
3512
    
4640
    
3513
				}
4641
				}
3514
4642
3515
    stringBuffer.append(TEXT_844);
4643
    stringBuffer.append(TEXT_1112);
3516
    stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
4644
    stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3517
    stringBuffer.append(TEXT_845);
4645
    stringBuffer.append(TEXT_1113);
3518
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4646
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3519
    stringBuffer.append(TEXT_846);
4647
    stringBuffer.append(TEXT_1114);
3520
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
4648
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
3521
    stringBuffer.append(TEXT_847);
4649
    stringBuffer.append(TEXT_1115);
3522
    
4650
    
3523
			}
4651
			}
3524
			if (addTarget) {
4652
			if (addTarget) {
Lines 3527-3559 Link Here
3527
					String _ownerInstance = "createdDomainElement";
4655
					String _ownerInstance = "createdDomainElement";
3528
					String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;";
4656
					String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;";
3529
4657
3530
    stringBuffer.append(TEXT_848);
4658
    stringBuffer.append(TEXT_1116);
3531
    
4659
    
3532
int upperBound = _feature.getEcoreFeature().getUpperBound();
4660
int upperBound = _feature.getEcoreFeature().getUpperBound();
3533
if (upperBound > 0) {
4661
if (upperBound > 0) {
3534
	if (upperBound == 1) {
4662
	if (upperBound == 1) {
3535
4663
3536
    stringBuffer.append(TEXT_849);
4664
    stringBuffer.append(TEXT_1117);
3537
    stringBuffer.append(_ownerInstance);
4665
    stringBuffer.append(_ownerInstance);
3538
    stringBuffer.append(TEXT_850);
4666
    stringBuffer.append(TEXT_1118);
3539
    stringBuffer.append(_feature.getGetAccessor());
4667
    stringBuffer.append(_feature.getGetAccessor());
3540
    stringBuffer.append(TEXT_851);
4668
    stringBuffer.append(TEXT_1119);
3541
    stringBuffer.append(_exceedsUpperBound);
4669
    stringBuffer.append(_exceedsUpperBound);
3542
    stringBuffer.append(TEXT_852);
4670
    stringBuffer.append(TEXT_1120);
3543
    
4671
    
3544
	} else {
4672
	} else {
3545
4673
3546
    stringBuffer.append(TEXT_853);
4674
    stringBuffer.append(TEXT_1121);
3547
    stringBuffer.append(_ownerInstance);
4675
    stringBuffer.append(_ownerInstance);
3548
    stringBuffer.append(TEXT_854);
4676
    stringBuffer.append(TEXT_1122);
3549
    stringBuffer.append(_feature.getGetAccessor());
4677
    stringBuffer.append(_feature.getGetAccessor());
3550
    stringBuffer.append(TEXT_855);
4678
    stringBuffer.append(TEXT_1123);
3551
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
4679
    stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
3552
    stringBuffer.append(TEXT_856);
4680
    stringBuffer.append(TEXT_1124);
3553
    stringBuffer.append(_feature.getFeatureAccessorName());
4681
    stringBuffer.append(_feature.getFeatureAccessorName());
3554
    stringBuffer.append(TEXT_857);
4682
    stringBuffer.append(TEXT_1125);
3555
    stringBuffer.append(_exceedsUpperBound);
4683
    stringBuffer.append(_exceedsUpperBound);
3556
    stringBuffer.append(TEXT_858);
4684
    stringBuffer.append(TEXT_1126);
3557
    
4685
    
3558
	}
4686
	}
3559
}
4687
}
Lines 3561-3630 Link Here
3561
    
4689
    
3562
				}
4690
				}
3563
4691
3564
    stringBuffer.append(TEXT_859);
4692
    stringBuffer.append(TEXT_1127);
3565
    stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
4693
    stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3566
    stringBuffer.append(TEXT_860);
4694
    stringBuffer.append(TEXT_1128);
3567
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4695
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3568
    stringBuffer.append(TEXT_861);
4696
    stringBuffer.append(TEXT_1129);
3569
    stringBuffer.append(targetFeature.getFeatureAccessorName());
4697
    stringBuffer.append(targetFeature.getFeatureAccessorName());
3570
    stringBuffer.append(TEXT_862);
4698
    stringBuffer.append(TEXT_1130);
3571
    
4699
    
3572
			}
4700
			}
3573
4701
3574
    stringBuffer.append(TEXT_863);
4702
    stringBuffer.append(TEXT_1131);
3575
    
4703
    
3576
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
4704
		} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
3577
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
4705
			GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
3578
4706
3579
    stringBuffer.append(TEXT_864);
4707
    stringBuffer.append(TEXT_1132);
3580
    stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
4708
    stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
3581
    stringBuffer.append(TEXT_865);
4709
    stringBuffer.append(TEXT_1133);
3582
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
4710
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
3583
    stringBuffer.append(TEXT_866);
4711
    stringBuffer.append(TEXT_1134);
3584
    stringBuffer.append(metaFeature.getFeatureAccessorName());
4712
    stringBuffer.append(metaFeature.getFeatureAccessorName());
3585
    stringBuffer.append(TEXT_867);
4713
    stringBuffer.append(TEXT_1135);
3586
    
4714
    
3587
		}
4715
		}
3588
4716
3589
    stringBuffer.append(TEXT_868);
4717
    stringBuffer.append(TEXT_1136);
3590
    stringBuffer.append(TEXT_869);
4718
    stringBuffer.append(TEXT_1137);
3591
    
4719
    
3592
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
4720
		if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
3593
4721
3594
    stringBuffer.append(TEXT_870);
4722
    stringBuffer.append(TEXT_1138);
3595
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
4723
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3596
    stringBuffer.append(TEXT_871);
4724
    stringBuffer.append(TEXT_1139);
3597
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
4725
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
3598
    stringBuffer.append(TEXT_872);
4726
    stringBuffer.append(TEXT_1140);
3599
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
4727
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
3600
    stringBuffer.append(TEXT_873);
4728
    stringBuffer.append(TEXT_1141);
3601
    
4729
    
3602
		}
4730
		}
3603
4731
3604
    stringBuffer.append(TEXT_874);
4732
    stringBuffer.append(TEXT_1142);
3605
    
4733
    
3606
{
4734
{
3607
	String _source = "source.getElement()";
4735
	String _source = "source.getElement()";
3608
	String _target = "target.getElement()";
4736
	String _target = "target.getElement()";
3609
4737
3610
    stringBuffer.append(TEXT_875);
4738
    stringBuffer.append(TEXT_1143);
3611
    
4739
    
3612
			if (linkConstraints != null) {
4740
			if (linkConstraints != null) {
3613
4741
3614
    stringBuffer.append(TEXT_876);
4742
    stringBuffer.append(TEXT_1144);
3615
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
4743
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName());
3616
    stringBuffer.append(TEXT_877);
4744
    stringBuffer.append(TEXT_1145);
3617
    stringBuffer.append(_source);
4745
    stringBuffer.append(_source);
3618
    stringBuffer.append(TEXT_878);
4746
    stringBuffer.append(TEXT_1146);
3619
    stringBuffer.append(_target);
4747
    stringBuffer.append(_target);
3620
    stringBuffer.append(TEXT_879);
4748
    stringBuffer.append(TEXT_1147);
3621
    
4749
    
3622
			}
4750
			}
3623
4751
3624
    
4752
    
3625
}	//local declarations for linkConstraints.jetinc
4753
}	//local declarations for linkConstraints.jetinc
3626
4754
3627
    stringBuffer.append(TEXT_880);
4755
    stringBuffer.append(TEXT_1148);
3628
    
4756
    
3629
	}
4757
	}
3630
4758
Lines 3633-3654 Link Here
3633
if (genNode.getViewmap() instanceof InnerClassViewmap) {
4761
if (genNode.getViewmap() instanceof InnerClassViewmap) {
3634
	String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody();
4762
	String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody();
3635
4763
3636
    stringBuffer.append(TEXT_881);
4764
    stringBuffer.append(TEXT_1149);
3637
    stringBuffer.append(classBody);
4765
    stringBuffer.append(classBody);
3638
    stringBuffer.append(TEXT_882);
4766
    stringBuffer.append(TEXT_1150);
3639
    
4767
    
3640
if (classBody.indexOf("DPtoLP") != -1) {
4768
if (classBody.indexOf("DPtoLP") != -1) {
3641
4769
3642
    stringBuffer.append(TEXT_883);
4770
    stringBuffer.append(TEXT_1151);
3643
    
4771
    
3644
}
4772
}
3645
4773
3646
    
4774
    
3647
}
4775
}
3648
4776
3649
    stringBuffer.append(TEXT_884);
4777
    stringBuffer.append(TEXT_1152);
3650
    importManager.emitSortedImports();
4778
    importManager.emitSortedImports();
3651
    stringBuffer.append(TEXT_885);
4779
    stringBuffer.append(TEXT_1153);
3652
    return stringBuffer.toString();
4780
    return stringBuffer.toString();
3653
  }
4781
  }
3654
}
4782
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java (-487 / +506 lines)
Lines 35-288 Link Here
35
  protected final String TEXT_15 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
35
  protected final String TEXT_15 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
36
  protected final String TEXT_16 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
36
  protected final String TEXT_16 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
37
  protected final String TEXT_17 = " getDiagramNode() {" + NL + "\t\treturn (";
37
  protected final String TEXT_17 = " getDiagramNode() {" + NL + "\t\treturn (";
38
  protected final String TEXT_18 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!";
38
  protected final String TEXT_18 = ") getModel();" + NL + "\t}" + NL;
39
  protected final String TEXT_19 = NL;
39
  protected final String TEXT_19 = NL;
40
  protected final String TEXT_20 = "\t\tinstallEditPolicy(";
40
  protected final String TEXT_20 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
41
  protected final String TEXT_21 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
41
  protected final String TEXT_21 = " view = (";
42
  protected final String TEXT_22 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
42
  protected final String TEXT_22 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
43
  protected final String TEXT_23 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tgetLabel().setText(value);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected ";
43
  protected final String TEXT_23 = " view = (";
44
  protected final String TEXT_24 = " getDirectEditCommand(";
44
  protected final String TEXT_24 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!";
45
  protected final String TEXT_25 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tif (value == null) {" + NL + "\t\t\t\t\t\t\t//Invalid value is transformed into a null by the validator." + NL + "\t\t\t\t\t\t\t//XXX: implement validator" + NL + "\t\t\t\t\t\t\treturn ";
45
  protected final String TEXT_25 = NL;
46
  protected final String TEXT_26 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tfinal Object[] parseResult;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tparseResult = new ";
46
  protected final String TEXT_26 = "\t\tinstallEditPolicy(";
47
  protected final String TEXT_27 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
47
  protected final String TEXT_27 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
48
  protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
48
  protected final String TEXT_28 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
49
  protected final String TEXT_29 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
49
  protected final String TEXT_29 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tgetLabel().setText(value);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected ";
50
  protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
50
  protected final String TEXT_30 = " getDirectEditCommand(";
51
  protected final String TEXT_31 = " editingDomain = ";
51
  protected final String TEXT_31 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tif (value == null) {" + NL + "\t\t\t\t\t\t\t//Invalid value is transformed into a null by the validator." + NL + "\t\t\t\t\t\t\t//XXX: implement validator" + NL + "\t\t\t\t\t\t\treturn ";
52
  protected final String TEXT_32 = ".getEditingDomain(";
52
  protected final String TEXT_32 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tfinal Object[] parseResult;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tparseResult = new ";
53
  protected final String TEXT_33 = ".getDiagram().getElement());";
53
  protected final String TEXT_33 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
54
  protected final String TEXT_34 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
54
  protected final String TEXT_34 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
55
  protected final String TEXT_35 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
55
  protected final String TEXT_35 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
56
  protected final String TEXT_36 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
56
  protected final String TEXT_36 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
57
  protected final String TEXT_37 = " createDomainModelCommand(";
57
  protected final String TEXT_37 = " editingDomain = ";
58
  protected final String TEXT_38 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t";
58
  protected final String TEXT_38 = ".getEditingDomain(";
59
  protected final String TEXT_39 = " element = ";
59
  protected final String TEXT_39 = ".getDiagram().getElement());";
60
  protected final String TEXT_40 = ";" + NL + "\t\t\t\t\t\t";
60
  protected final String TEXT_40 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
61
  protected final String TEXT_41 = " feature = (";
61
  protected final String TEXT_41 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
62
  protected final String TEXT_42 = ") ";
62
  protected final String TEXT_42 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
63
  protected final String TEXT_43 = ".eINSTANCE.get";
63
  protected final String TEXT_43 = " createDomainModelCommand(";
64
  protected final String TEXT_44 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
64
  protected final String TEXT_44 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t";
65
  protected final String TEXT_45 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
65
  protected final String TEXT_45 = " element = ";
66
  protected final String TEXT_46 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
66
  protected final String TEXT_46 = ";" + NL + "\t\t\t\t\t\t";
67
  protected final String TEXT_47 = NL + "\t\t\t\t\t\t";
67
  protected final String TEXT_47 = " feature = (";
68
  protected final String TEXT_48 = " result = new ";
68
  protected final String TEXT_48 = ") ";
69
  protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t";
69
  protected final String TEXT_49 = ".eINSTANCE.get";
70
  protected final String TEXT_50 = " values = new ";
70
  protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
71
  protected final String TEXT_51 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
71
  protected final String TEXT_51 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
72
  protected final String TEXT_52 = "());" + NL + "\t\t\t\t\t\tresult.append(";
72
  protected final String TEXT_52 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
73
  protected final String TEXT_53 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
73
  protected final String TEXT_53 = NL + "\t\t\t\t\t\t";
74
  protected final String TEXT_54 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;";
74
  protected final String TEXT_54 = " result = new ";
75
  protected final String TEXT_55 = NL + "\t\t\t\t\t\treturn ";
75
  protected final String TEXT_55 = "();" + NL + "\t\t\t\t\t\t";
76
  protected final String TEXT_56 = ".create(editingDomain, element, feature, valueToSet);";
76
  protected final String TEXT_56 = " values = new ";
77
  protected final String TEXT_57 = NL + "\t\t\t\t\t}";
77
  protected final String TEXT_57 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
78
  protected final String TEXT_58 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
78
  protected final String TEXT_58 = "());" + NL + "\t\t\t\t\t\tresult.append(";
79
  protected final String TEXT_59 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
79
  protected final String TEXT_59 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
80
  protected final String TEXT_60 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
80
  protected final String TEXT_60 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;";
81
  protected final String TEXT_61 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
81
  protected final String TEXT_61 = NL + "\t\t\t\t\t\treturn ";
82
  protected final String TEXT_62 = " createDomainModelCommand(";
82
  protected final String TEXT_62 = ".create(editingDomain, element, feature, valueToSet);";
83
  protected final String TEXT_63 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t";
83
  protected final String TEXT_63 = NL + "\t\t\t\t\t}";
84
  protected final String TEXT_64 = " element = ";
84
  protected final String TEXT_64 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
85
  protected final String TEXT_65 = ";" + NL + "\t\t\t\t\t\t";
85
  protected final String TEXT_65 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
86
  protected final String TEXT_66 = " result = new ";
86
  protected final String TEXT_66 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
87
  protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;";
87
  protected final String TEXT_67 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
88
  protected final String TEXT_68 = NL + "\t\t\t\t\t\t";
88
  protected final String TEXT_68 = " createDomainModelCommand(";
89
  protected final String TEXT_69 = " ";
89
  protected final String TEXT_69 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t";
90
  protected final String TEXT_70 = "feature = (";
90
  protected final String TEXT_70 = " element = ";
91
  protected final String TEXT_71 = ") ";
91
  protected final String TEXT_71 = ";" + NL + "\t\t\t\t\t\t";
92
  protected final String TEXT_72 = ".eINSTANCE.get";
92
  protected final String TEXT_72 = " result = new ";
93
  protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
93
  protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;";
94
  protected final String TEXT_74 = ".parseValue(feature, values[";
94
  protected final String TEXT_74 = NL + "\t\t\t\t\t\t";
95
  protected final String TEXT_75 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
95
  protected final String TEXT_75 = " ";
96
  protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
96
  protected final String TEXT_76 = "feature = (";
97
  protected final String TEXT_77 = NL + "\t\t\t\t\t\t";
97
  protected final String TEXT_77 = ") ";
98
  protected final String TEXT_78 = " ";
98
  protected final String TEXT_78 = ".eINSTANCE.get";
99
  protected final String TEXT_79 = "values = new ";
99
  protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
100
  protected final String TEXT_80 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
100
  protected final String TEXT_80 = ".parseValue(feature, values[";
101
  protected final String TEXT_81 = "());" + NL + "\t\t\t\t\t\tresult.append(";
101
  protected final String TEXT_81 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
102
  protected final String TEXT_82 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
102
  protected final String TEXT_82 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
103
  protected final String TEXT_83 = ".create(editingDomain, element, feature, valueToSet));";
103
  protected final String TEXT_83 = NL + "\t\t\t\t\t\t";
104
  protected final String TEXT_84 = NL + "\t\t\t\t\t\tresult.append(";
104
  protected final String TEXT_84 = " ";
105
  protected final String TEXT_85 = ".create(editingDomain, element, feature, valueToSet));";
105
  protected final String TEXT_85 = "values = new ";
106
  protected final String TEXT_86 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
106
  protected final String TEXT_86 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
107
  protected final String TEXT_87 = NL + "\t\t\t\t});";
107
  protected final String TEXT_87 = "());" + NL + "\t\t\t\t\t\tresult.append(";
108
  protected final String TEXT_88 = NL;
108
  protected final String TEXT_88 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
109
  protected final String TEXT_89 = "\t\tinstallEditPolicy(";
109
  protected final String TEXT_89 = ".create(editingDomain, element, feature, valueToSet));";
110
  protected final String TEXT_90 = ".COMPONENT_ROLE, new ";
110
  protected final String TEXT_90 = NL + "\t\t\t\t\t\tresult.append(";
111
  protected final String TEXT_91 = "() {" + NL + "\t\t\tprotected ";
111
  protected final String TEXT_91 = ".create(editingDomain, element, feature, valueToSet));";
112
  protected final String TEXT_92 = " createDeleteCommand(";
112
  protected final String TEXT_92 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
113
  protected final String TEXT_93 = " deleteRequest) {" + NL + "\t\t\t\t";
113
  protected final String TEXT_93 = NL + "\t\t\t\t});";
114
  protected final String TEXT_94 = " editingDomain = ";
114
  protected final String TEXT_94 = NL;
115
  protected final String TEXT_95 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
115
  protected final String TEXT_95 = "\t\tinstallEditPolicy(";
116
  protected final String TEXT_96 = " cc = new ";
116
  protected final String TEXT_96 = ".COMPONENT_ROLE, new ";
117
  protected final String TEXT_97 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
117
  protected final String TEXT_97 = "() {" + NL + "\t\t\tprotected ";
118
  protected final String TEXT_98 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(";
118
  protected final String TEXT_98 = " createDeleteCommand(";
119
  protected final String TEXT_99 = " editingDomain) {";
119
  protected final String TEXT_99 = " deleteRequest) {" + NL + "\t\t\t\t";
120
  protected final String TEXT_100 = NL + "\t\t\t\t";
120
  protected final String TEXT_100 = " editingDomain = ";
121
  protected final String TEXT_101 = " result = new ";
121
  protected final String TEXT_101 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
122
  protected final String TEXT_102 = "();";
122
  protected final String TEXT_102 = " cc = new ";
123
  protected final String TEXT_103 = NL + "\t\t\t\tresult.append(";
123
  protected final String TEXT_103 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
124
  protected final String TEXT_104 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
124
  protected final String TEXT_104 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(";
125
  protected final String TEXT_105 = ".eINSTANCE.get";
125
  protected final String TEXT_105 = " editingDomain) {";
126
  protected final String TEXT_106 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
126
  protected final String TEXT_106 = NL + "\t\t\t\t";
127
  protected final String TEXT_107 = NL + "\t\t\t\tresult.append(";
127
  protected final String TEXT_107 = " result = new ";
128
  protected final String TEXT_108 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
128
  protected final String TEXT_108 = "();";
129
  protected final String TEXT_109 = ".eINSTANCE.get";
129
  protected final String TEXT_109 = NL + "\t\t\t\tresult.append(";
130
  protected final String TEXT_110 = "()," + NL + "\t\t\t\t\t";
130
  protected final String TEXT_110 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
131
  protected final String TEXT_111 = ".UNSET_VALUE));";
131
  protected final String TEXT_111 = ".eINSTANCE.get";
132
  protected final String TEXT_112 = NL + "\t\t\t\tresult.append(";
132
  protected final String TEXT_112 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
133
  protected final String TEXT_113 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
133
  protected final String TEXT_113 = NL + "\t\t\t\tresult.append(";
134
  protected final String TEXT_114 = ".eINSTANCE.get";
134
  protected final String TEXT_114 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
135
  protected final String TEXT_115 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
135
  protected final String TEXT_115 = ".eINSTANCE.get";
136
  protected final String TEXT_116 = NL + "\t\t\t\tresult.append(";
136
  protected final String TEXT_116 = "()," + NL + "\t\t\t\t\t";
137
  protected final String TEXT_117 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
137
  protected final String TEXT_117 = ".UNSET_VALUE));";
138
  protected final String TEXT_118 = ".eINSTANCE.get";
138
  protected final String TEXT_118 = NL + "\t\t\t\tresult.append(";
139
  protected final String TEXT_119 = "()," + NL + "\t\t\t\t\t";
139
  protected final String TEXT_119 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
140
  protected final String TEXT_120 = ".UNSET_VALUE));";
140
  protected final String TEXT_120 = ".eINSTANCE.get";
141
  protected final String TEXT_121 = NL + "\t\t\t\treturn result;";
141
  protected final String TEXT_121 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
142
  protected final String TEXT_122 = NL + "\t\t\t\treturn ";
142
  protected final String TEXT_122 = NL + "\t\t\t\tresult.append(";
143
  protected final String TEXT_123 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
143
  protected final String TEXT_123 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
144
  protected final String TEXT_124 = ".eINSTANCE.get";
144
  protected final String TEXT_124 = ".eINSTANCE.get";
145
  protected final String TEXT_125 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
145
  protected final String TEXT_125 = "()," + NL + "\t\t\t\t\t";
146
  protected final String TEXT_126 = NL + "\t\t\t\treturn ";
146
  protected final String TEXT_126 = ".UNSET_VALUE));";
147
  protected final String TEXT_127 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
147
  protected final String TEXT_127 = NL + "\t\t\t\treturn result;";
148
  protected final String TEXT_128 = ".eINSTANCE.get";
148
  protected final String TEXT_128 = NL + "\t\t\t\treturn ";
149
  protected final String TEXT_129 = "()," + NL + "\t\t\t\t\t";
149
  protected final String TEXT_129 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
150
  protected final String TEXT_130 = ".UNSET_VALUE);";
150
  protected final String TEXT_130 = ".eINSTANCE.get";
151
  protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t});";
151
  protected final String TEXT_131 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
152
  protected final String TEXT_132 = NL + "\t}" + NL;
152
  protected final String TEXT_132 = NL + "\t\t\t\treturn ";
153
  protected final String TEXT_133 = NL;
153
  protected final String TEXT_133 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
154
  protected final String TEXT_134 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
154
  protected final String TEXT_134 = ".eINSTANCE.get";
155
  protected final String TEXT_135 = " req) {" + NL + "\t\tif (";
155
  protected final String TEXT_135 = "()," + NL + "\t\t\t\t\t";
156
  protected final String TEXT_136 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
156
  protected final String TEXT_136 = ".UNSET_VALUE);";
157
  protected final String TEXT_137 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
157
  protected final String TEXT_137 = NL + "\t\t\t}" + NL + "\t\t});";
158
  protected final String TEXT_138 = "(this, ";
158
  protected final String TEXT_138 = NL + "\t}" + NL;
159
  protected final String TEXT_139 = ".class, new ";
159
  protected final String TEXT_139 = NL;
160
  protected final String TEXT_140 = "() {" + NL + "\t\t\t\tpublic void relocate(";
160
  protected final String TEXT_140 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
161
  protected final String TEXT_141 = " celleditor) {" + NL + "\t\t\t\t\t";
161
  protected final String TEXT_141 = " req) {" + NL + "\t\tif (";
162
  protected final String TEXT_142 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL;
162
  protected final String TEXT_142 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
163
  protected final String TEXT_143 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}";
163
  protected final String TEXT_143 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
164
  protected final String TEXT_144 = NL;
164
  protected final String TEXT_144 = "(this, ";
165
  protected final String TEXT_145 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
165
  protected final String TEXT_145 = ".class, new ";
166
  protected final String TEXT_146 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
166
  protected final String TEXT_146 = "() {" + NL + "\t\t\t\tpublic void relocate(";
167
  protected final String TEXT_147 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
167
  protected final String TEXT_147 = " celleditor) {" + NL + "\t\t\t\t\t";
168
  protected final String TEXT_148 = " element = ";
168
  protected final String TEXT_148 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL;
169
  protected final String TEXT_149 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t";
169
  protected final String TEXT_149 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}";
170
  protected final String TEXT_150 = " element = ";
170
  protected final String TEXT_150 = NL;
171
  protected final String TEXT_151 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern(";
171
  protected final String TEXT_151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
172
  protected final String TEXT_152 = " element, String pattern) {";
172
  protected final String TEXT_152 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
173
  protected final String TEXT_153 = NL + "\t\tif (element.get";
173
  protected final String TEXT_153 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
174
  protected final String TEXT_154 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
174
  protected final String TEXT_154 = " element = ";
175
  protected final String TEXT_155 = NL + "\t\treturn ";
175
  protected final String TEXT_155 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t";
176
  protected final String TEXT_156 = ".format(pattern, new Object[] {";
176
  protected final String TEXT_156 = " element = ";
177
  protected final String TEXT_157 = NL + "\t\t\t";
177
  protected final String TEXT_157 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern(";
178
  protected final String TEXT_158 = NL + "\t\t});";
178
  protected final String TEXT_158 = " element, String pattern) {";
179
  protected final String TEXT_159 = NL + "\t\treturn ";
179
  protected final String TEXT_159 = NL + "\t\tif (element.get";
180
  protected final String TEXT_160 = ".format(pattern, new Object[] {";
180
  protected final String TEXT_160 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
181
  protected final String TEXT_161 = NL + "\t\t";
181
  protected final String TEXT_161 = NL + "\t\treturn ";
182
  protected final String TEXT_162 = ",";
182
  protected final String TEXT_162 = ".format(pattern, new Object[] {";
183
  protected final String TEXT_163 = NL + "\t\t});";
183
  protected final String TEXT_163 = NL + "\t\t\t";
184
  protected final String TEXT_164 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
184
  protected final String TEXT_164 = NL + "\t\t});";
185
  protected final String TEXT_165 = NL + "\t}";
185
  protected final String TEXT_165 = NL + "\t\treturn ";
186
  protected final String TEXT_166 = NL;
186
  protected final String TEXT_166 = ".format(pattern, new Object[] {";
187
  protected final String TEXT_167 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
187
  protected final String TEXT_167 = NL + "\t\t";
188
  protected final String TEXT_168 = NL + "\t\t";
188
  protected final String TEXT_168 = ",";
189
  protected final String TEXT_169 = " style =" + NL + "\t\t\t(";
189
  protected final String TEXT_169 = NL + "\t\t});";
190
  protected final String TEXT_170 = ") ";
190
  protected final String TEXT_170 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
191
  protected final String TEXT_171 = ".getStyle(" + NL + "\t\t\t\t";
191
  protected final String TEXT_171 = NL + "\t}";
192
  protected final String TEXT_172 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
192
  protected final String TEXT_172 = NL;
193
  protected final String TEXT_173 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = ";
193
  protected final String TEXT_173 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
194
  protected final String TEXT_174 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
194
  protected final String TEXT_174 = NL + "\t\t";
195
  protected final String TEXT_175 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
195
  protected final String TEXT_175 = " style =" + NL + "\t\t\t(";
196
  protected final String TEXT_176 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
196
  protected final String TEXT_176 = ") ";
197
  protected final String TEXT_177 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
197
  protected final String TEXT_177 = ".getStyle(" + NL + "\t\t\t\t";
198
  protected final String TEXT_178 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new ";
198
  protected final String TEXT_178 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
199
  protected final String TEXT_179 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
199
  protected final String TEXT_179 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = ";
200
  protected final String TEXT_180 = "\t" + NL + "\t}";
200
  protected final String TEXT_180 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
201
  protected final String TEXT_181 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
201
  protected final String TEXT_181 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
202
  protected final String TEXT_182 = " createdFont;";
202
  protected final String TEXT_182 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
203
  protected final String TEXT_183 = "\t";
203
  protected final String TEXT_183 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
204
  protected final String TEXT_184 = NL;
204
  protected final String TEXT_184 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new ";
205
  protected final String TEXT_185 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
205
  protected final String TEXT_185 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
206
  protected final String TEXT_186 = " style = (";
206
  protected final String TEXT_186 = "\t" + NL + "\t}";
207
  protected final String TEXT_187 = ")  ";
207
  protected final String TEXT_187 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
208
  protected final String TEXT_188 = ".getStyle(";
208
  protected final String TEXT_188 = " createdFont;";
209
  protected final String TEXT_189 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
209
  protected final String TEXT_189 = "\t";
210
  protected final String TEXT_190 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
210
  protected final String TEXT_190 = NL;
211
  protected final String TEXT_191 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new ";
211
  protected final String TEXT_191 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
212
  protected final String TEXT_192 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
212
  protected final String TEXT_192 = " style = (";
213
  protected final String TEXT_193 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
213
  protected final String TEXT_193 = ")  ";
214
  protected final String TEXT_194 = " getLabelIcon() {";
214
  protected final String TEXT_194 = ".getStyle(";
215
  protected final String TEXT_195 = NL + "\t\t";
215
  protected final String TEXT_195 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
216
  protected final String TEXT_196 = " imageDescriptor = ";
216
  protected final String TEXT_196 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
217
  protected final String TEXT_197 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
217
  protected final String TEXT_197 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new ";
218
  protected final String TEXT_198 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
218
  protected final String TEXT_198 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
219
  protected final String TEXT_199 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
219
  protected final String TEXT_199 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
220
  protected final String TEXT_200 = NL;
220
  protected final String TEXT_200 = " getLabelIcon() {";
221
  protected final String TEXT_201 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
221
  protected final String TEXT_201 = NL + "\t\t";
222
  protected final String TEXT_202 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
222
  protected final String TEXT_202 = " imageDescriptor = ";
223
  protected final String TEXT_203 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
223
  protected final String TEXT_203 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}";
224
  protected final String TEXT_204 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
224
  protected final String TEXT_204 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
225
  protected final String TEXT_205 = NL;
225
  protected final String TEXT_205 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
226
  protected final String TEXT_206 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
226
  protected final String TEXT_206 = NL;
227
  protected final String TEXT_207 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
227
  protected final String TEXT_207 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
228
  protected final String TEXT_208 = " feature, ";
228
  protected final String TEXT_208 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
229
  protected final String TEXT_209 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
229
  protected final String TEXT_209 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher((";
230
  protected final String TEXT_210 = NL;
230
  protected final String TEXT_210 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
231
  protected final String TEXT_211 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
231
  protected final String TEXT_211 = NL;
232
  protected final String TEXT_212 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
232
  protected final String TEXT_212 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
233
  protected final String TEXT_213 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
233
  protected final String TEXT_213 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
234
  protected final String TEXT_214 = NL;
234
  protected final String TEXT_214 = " feature, ";
235
  protected final String TEXT_215 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
235
  protected final String TEXT_215 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
236
  protected final String TEXT_216 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t\tRefresher labelRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t};";
236
  protected final String TEXT_216 = NL;
237
  protected final String TEXT_217 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
237
  protected final String TEXT_217 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
238
  protected final String TEXT_218 = ".eINSTANCE.get";
238
  protected final String TEXT_218 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
239
  protected final String TEXT_219 = "(), labelRefresher);";
239
  protected final String TEXT_219 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
240
  protected final String TEXT_220 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
240
  protected final String TEXT_220 = NL;
241
  protected final String TEXT_221 = ".eINSTANCE.get";
241
  protected final String TEXT_221 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
242
  protected final String TEXT_222 = "(), labelRefresher);";
242
  protected final String TEXT_222 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t\tRefresher labelRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t};";
243
  protected final String TEXT_223 = NL;
243
  protected final String TEXT_223 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
244
  protected final String TEXT_224 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
244
  protected final String TEXT_224 = ".eINSTANCE.get";
245
  protected final String TEXT_225 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
245
  protected final String TEXT_225 = "(), labelRefresher);";
246
  protected final String TEXT_226 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
246
  protected final String TEXT_226 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
247
  protected final String TEXT_227 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
247
  protected final String TEXT_227 = ".eINSTANCE.get";
248
  protected final String TEXT_228 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
248
  protected final String TEXT_228 = "(), labelRefresher);";
249
  protected final String TEXT_229 = NL;
249
  protected final String TEXT_229 = NL;
250
  protected final String TEXT_230 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
250
  protected final String TEXT_230 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
251
  protected final String TEXT_231 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL;
251
  protected final String TEXT_231 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
252
  protected final String TEXT_232 = NL;
252
  protected final String TEXT_232 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
253
  protected final String TEXT_233 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
253
  protected final String TEXT_233 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
254
  protected final String TEXT_234 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
254
  protected final String TEXT_234 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
255
  protected final String TEXT_235 = " method" + NL + "\t\treturn null;" + NL + "\t}";
255
  protected final String TEXT_235 = NL;
256
  protected final String TEXT_236 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
256
  protected final String TEXT_236 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
257
  protected final String TEXT_237 = " createLabel() {";
257
  protected final String TEXT_237 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL;
258
  protected final String TEXT_238 = NL + "\t\treturn new ";
258
  protected final String TEXT_238 = NL;
259
  protected final String TEXT_239 = "();";
259
  protected final String TEXT_239 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
260
  protected final String TEXT_240 = NL + "\t\treturn ";
260
  protected final String TEXT_240 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
261
  protected final String TEXT_241 = ";";
261
  protected final String TEXT_241 = " method" + NL + "\t\treturn null;" + NL + "\t}";
262
  protected final String TEXT_242 = NL + "\t\treturn new ";
262
  protected final String TEXT_242 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
263
  protected final String TEXT_243 = "();";
263
  protected final String TEXT_243 = " createLabel() {";
264
  protected final String TEXT_244 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
264
  protected final String TEXT_244 = NL + "\t\treturn new ";
265
  protected final String TEXT_245 = " createFigure() {" + NL + "\t\t";
265
  protected final String TEXT_245 = "();";
266
  protected final String TEXT_246 = " label = createLabel();";
266
  protected final String TEXT_246 = NL + "\t\treturn ";
267
  protected final String TEXT_247 = NL + "\t\tdefaultText = label.getText();";
267
  protected final String TEXT_247 = ";";
268
  protected final String TEXT_248 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
268
  protected final String TEXT_248 = NL + "\t\treturn new ";
269
  protected final String TEXT_249 = NL + "\t\treturn label;" + NL + "\t}";
269
  protected final String TEXT_249 = "();";
270
  protected final String TEXT_250 = NL + NL + "\t/**";
270
  protected final String TEXT_250 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
271
  protected final String TEXT_251 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
271
  protected final String TEXT_251 = " createFigure() {" + NL + "\t\t";
272
  protected final String TEXT_252 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
272
  protected final String TEXT_252 = " label = createLabel();";
273
  protected final String TEXT_253 = " getLabel() {" + NL + "\t\treturn (";
273
  protected final String TEXT_253 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment(";
274
  protected final String TEXT_254 = ") getFigure();" + NL + "\t}" + NL;
274
  protected final String TEXT_254 = ".LEFT);";
275
  protected final String TEXT_255 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
275
  protected final String TEXT_255 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
276
  protected final String TEXT_256 = "(";
276
  protected final String TEXT_256 = NL + "\t\treturn label;" + NL + "\t}";
277
  protected final String TEXT_257 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
277
  protected final String TEXT_257 = NL + NL + "\t/**";
278
  protected final String TEXT_258 = NL + "\t\tdefaultText = figure.getText();";
278
  protected final String TEXT_258 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
279
  protected final String TEXT_259 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
279
  protected final String TEXT_259 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
280
  protected final String TEXT_260 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
280
  protected final String TEXT_260 = " getLabel() {" + NL + "\t\treturn (";
281
  protected final String TEXT_261 = NL;
281
  protected final String TEXT_261 = ") getFigure();" + NL + "\t}" + NL;
282
  protected final String TEXT_262 = NL;
282
  protected final String TEXT_262 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
283
  protected final String TEXT_263 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
283
  protected final String TEXT_263 = "(";
284
  protected final String TEXT_264 = NL + "}";
284
  protected final String TEXT_264 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
285
  protected final String TEXT_265 = NL;
285
  protected final String TEXT_265 = NL + "\t\tdefaultText = figure.getText();";
286
  protected final String TEXT_266 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
287
  protected final String TEXT_267 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
288
  protected final String TEXT_268 = NL;
289
  protected final String TEXT_269 = NL;
290
  protected final String TEXT_270 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}";
291
  protected final String TEXT_271 = NL + "}";
292
  protected final String TEXT_272 = NL;
286
293
287
  public String generate(Object argument)
294
  public String generate(Object argument)
288
  {
295
  {
Lines 348-353 Link Here
348
    stringBuffer.append(TEXT_17);
355
    stringBuffer.append(TEXT_17);
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
356
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
350
    stringBuffer.append(TEXT_18);
357
    stringBuffer.append(TEXT_18);
358
    stringBuffer.append(TEXT_19);
359
    stringBuffer.append(TEXT_20);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
361
    stringBuffer.append(TEXT_21);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
363
    stringBuffer.append(TEXT_22);
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
365
    stringBuffer.append(TEXT_23);
366
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
367
    stringBuffer.append(TEXT_24);
351
    
368
    
352
	String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
369
	String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
353
	final String primaryView = "getDiagramNode()";
370
	final String primaryView = "getDiagramNode()";
Lines 355-553 Link Here
355
    
372
    
356
if (!isReadOnly) {
373
if (!isReadOnly) {
357
374
358
    stringBuffer.append(TEXT_19);
375
    stringBuffer.append(TEXT_25);
359
    stringBuffer.append(TEXT_20);
376
    stringBuffer.append(TEXT_26);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
377
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
361
    stringBuffer.append(TEXT_21);
378
    stringBuffer.append(TEXT_27);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
363
    stringBuffer.append(TEXT_22);
380
    stringBuffer.append(TEXT_28);
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
365
    stringBuffer.append(TEXT_23);
382
    stringBuffer.append(TEXT_29);
366
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
367
    stringBuffer.append(TEXT_24);
384
    stringBuffer.append(TEXT_30);
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
385
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
369
    stringBuffer.append(TEXT_25);
386
    stringBuffer.append(TEXT_31);
370
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
371
    stringBuffer.append(TEXT_26);
388
    stringBuffer.append(TEXT_32);
372
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
389
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
373
    stringBuffer.append(TEXT_27);
390
    stringBuffer.append(TEXT_33);
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
391
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
375
    stringBuffer.append(TEXT_28);
392
    stringBuffer.append(TEXT_34);
376
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
393
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
377
    stringBuffer.append(TEXT_29);
394
    stringBuffer.append(TEXT_35);
378
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
395
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
379
    stringBuffer.append(TEXT_30);
396
    stringBuffer.append(TEXT_36);
380
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
381
    stringBuffer.append(TEXT_31);
398
    stringBuffer.append(TEXT_37);
382
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
383
    stringBuffer.append(TEXT_32);
400
    stringBuffer.append(TEXT_38);
384
    stringBuffer.append(primaryView);
401
    stringBuffer.append(primaryView);
385
    stringBuffer.append(TEXT_33);
402
    stringBuffer.append(TEXT_39);
386
    
403
    
387
if (labelModelFacet instanceof FeatureLabelModelFacet) {
404
if (labelModelFacet instanceof FeatureLabelModelFacet) {
388
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
405
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
389
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
406
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
390
407
391
    stringBuffer.append(TEXT_34);
408
    stringBuffer.append(TEXT_40);
392
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
393
    stringBuffer.append(TEXT_35);
410
    stringBuffer.append(TEXT_41);
394
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
395
    stringBuffer.append(TEXT_36);
412
    stringBuffer.append(TEXT_42);
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
397
    stringBuffer.append(TEXT_37);
414
    stringBuffer.append(TEXT_43);
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
399
    stringBuffer.append(TEXT_38);
416
    stringBuffer.append(TEXT_44);
400
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
417
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
401
    stringBuffer.append(TEXT_39);
418
    stringBuffer.append(TEXT_45);
402
    stringBuffer.append(resolvedSemanticElement);
419
    stringBuffer.append(resolvedSemanticElement);
403
    stringBuffer.append(TEXT_40);
420
    stringBuffer.append(TEXT_46);
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
421
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
405
    stringBuffer.append(TEXT_41);
422
    stringBuffer.append(TEXT_47);
406
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
423
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
407
    stringBuffer.append(TEXT_42);
424
    stringBuffer.append(TEXT_48);
408
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
425
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
409
    stringBuffer.append(TEXT_43);
426
    stringBuffer.append(TEXT_49);
410
    stringBuffer.append(featureToSet.getFeatureAccessorName());
427
    stringBuffer.append(featureToSet.getFeatureAccessorName());
411
    stringBuffer.append(TEXT_44);
428
    stringBuffer.append(TEXT_50);
412
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
429
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
413
    stringBuffer.append(TEXT_45);
430
    stringBuffer.append(TEXT_51);
414
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
415
    stringBuffer.append(TEXT_46);
432
    stringBuffer.append(TEXT_52);
416
    
433
    
417
	if (ecoreFeature.isMany()) {
434
	if (ecoreFeature.isMany()) {
418
435
419
    stringBuffer.append(TEXT_47);
436
    stringBuffer.append(TEXT_53);
420
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
437
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
421
    stringBuffer.append(TEXT_48);
438
    stringBuffer.append(TEXT_54);
422
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
439
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
423
    stringBuffer.append(TEXT_49);
440
    stringBuffer.append(TEXT_55);
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
441
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
425
    stringBuffer.append(TEXT_50);
442
    stringBuffer.append(TEXT_56);
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
443
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
427
    stringBuffer.append(TEXT_51);
444
    stringBuffer.append(TEXT_57);
428
    stringBuffer.append(featureToSet.getAccessorName());
445
    stringBuffer.append(featureToSet.getAccessorName());
429
    stringBuffer.append(TEXT_52);
446
    stringBuffer.append(TEXT_58);
430
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
431
    stringBuffer.append(TEXT_53);
448
    stringBuffer.append(TEXT_59);
432
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
449
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
433
    stringBuffer.append(TEXT_54);
450
    stringBuffer.append(TEXT_60);
434
    
451
    
435
	} else {
452
	} else {
436
453
437
    stringBuffer.append(TEXT_55);
454
    stringBuffer.append(TEXT_61);
438
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
455
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
439
    stringBuffer.append(TEXT_56);
456
    stringBuffer.append(TEXT_62);
440
    
457
    
441
	}
458
	}
442
459
443
    stringBuffer.append(TEXT_57);
460
    stringBuffer.append(TEXT_63);
444
    
461
    
445
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
462
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
446
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
463
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
447
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
464
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
448
465
449
    stringBuffer.append(TEXT_58);
466
    stringBuffer.append(TEXT_64);
450
    stringBuffer.append(metaFeatures.size());
467
    stringBuffer.append(metaFeatures.size());
451
    stringBuffer.append(TEXT_59);
468
    stringBuffer.append(TEXT_65);
452
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
469
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
453
    stringBuffer.append(TEXT_60);
470
    stringBuffer.append(TEXT_66);
454
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
471
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
455
    stringBuffer.append(TEXT_61);
472
    stringBuffer.append(TEXT_67);
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
473
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
457
    stringBuffer.append(TEXT_62);
474
    stringBuffer.append(TEXT_68);
458
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
475
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
459
    stringBuffer.append(TEXT_63);
476
    stringBuffer.append(TEXT_69);
460
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
477
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
461
    stringBuffer.append(TEXT_64);
478
    stringBuffer.append(TEXT_70);
462
    stringBuffer.append(resolvedSemanticElement);
479
    stringBuffer.append(resolvedSemanticElement);
463
    stringBuffer.append(TEXT_65);
480
    stringBuffer.append(TEXT_71);
464
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
481
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
465
    stringBuffer.append(TEXT_66);
482
    stringBuffer.append(TEXT_72);
466
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
483
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
467
    stringBuffer.append(TEXT_67);
484
    stringBuffer.append(TEXT_73);
468
    
485
    
469
	boolean haveDeclaredValues = false;
486
	boolean haveDeclaredValues = false;
470
	for(int i = 0; i < metaFeatures.size(); i++) {
487
	for(int i = 0; i < metaFeatures.size(); i++) {
471
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
488
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
472
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
489
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
473
490
474
    stringBuffer.append(TEXT_68);
491
    stringBuffer.append(TEXT_74);
475
    if (i == 0) {
492
    if (i == 0) {
476
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
477
    stringBuffer.append(TEXT_69);
494
    stringBuffer.append(TEXT_75);
478
    }
495
    }
479
    stringBuffer.append(TEXT_70);
496
    stringBuffer.append(TEXT_76);
480
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
497
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
481
    stringBuffer.append(TEXT_71);
498
    stringBuffer.append(TEXT_77);
482
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
499
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
483
    stringBuffer.append(TEXT_72);
500
    stringBuffer.append(TEXT_78);
484
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
501
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
485
    stringBuffer.append(TEXT_73);
502
    stringBuffer.append(TEXT_79);
486
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
503
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
487
    stringBuffer.append(TEXT_74);
504
    stringBuffer.append(TEXT_80);
488
    stringBuffer.append(i);
505
    stringBuffer.append(i);
489
    stringBuffer.append(TEXT_75);
506
    stringBuffer.append(TEXT_81);
490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
507
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
491
    stringBuffer.append(TEXT_76);
508
    stringBuffer.append(TEXT_82);
492
    
509
    
493
		if (nextEcoreFeature.isMany()) {
510
		if (nextEcoreFeature.isMany()) {
494
511
495
    stringBuffer.append(TEXT_77);
512
    stringBuffer.append(TEXT_83);
496
    if (!haveDeclaredValues) { haveDeclaredValues = true;
513
    if (!haveDeclaredValues) { haveDeclaredValues = true;
497
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
514
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
498
    stringBuffer.append(TEXT_78);
515
    stringBuffer.append(TEXT_84);
499
    }
516
    }
500
    stringBuffer.append(TEXT_79);
517
    stringBuffer.append(TEXT_85);
501
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
518
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
502
    stringBuffer.append(TEXT_80);
519
    stringBuffer.append(TEXT_86);
503
    stringBuffer.append(nextFeatureToSet.getAccessorName());
520
    stringBuffer.append(nextFeatureToSet.getAccessorName());
504
    stringBuffer.append(TEXT_81);
521
    stringBuffer.append(TEXT_87);
505
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
522
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
506
    stringBuffer.append(TEXT_82);
523
    stringBuffer.append(TEXT_88);
507
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
524
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
508
    stringBuffer.append(TEXT_83);
525
    stringBuffer.append(TEXT_89);
509
    
526
    
510
		} else {
527
		} else {
511
528
512
    stringBuffer.append(TEXT_84);
529
    stringBuffer.append(TEXT_90);
513
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
530
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
514
    stringBuffer.append(TEXT_85);
531
    stringBuffer.append(TEXT_91);
515
    
532
    
516
		}
533
		}
517
534
518
    
535
    
519
	}
536
	}
520
537
521
    stringBuffer.append(TEXT_86);
538
    stringBuffer.append(TEXT_92);
522
    
539
    
523
}
540
}
524
541
525
    stringBuffer.append(TEXT_87);
542
    stringBuffer.append(TEXT_93);
526
    
543
    
527
}
544
}
528
545
529
    stringBuffer.append(TEXT_88);
546
    stringBuffer.append(TEXT_94);
530
    stringBuffer.append(TEXT_89);
547
    stringBuffer.append(TEXT_95);
531
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
548
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
532
    stringBuffer.append(TEXT_90);
549
    stringBuffer.append(TEXT_96);
533
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
550
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
534
    stringBuffer.append(TEXT_91);
551
    stringBuffer.append(TEXT_97);
535
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
552
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
536
    stringBuffer.append(TEXT_92);
553
    stringBuffer.append(TEXT_98);
537
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
554
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
538
    stringBuffer.append(TEXT_93);
555
    stringBuffer.append(TEXT_99);
539
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
556
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
540
    stringBuffer.append(TEXT_94);
557
    stringBuffer.append(TEXT_100);
541
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
558
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
542
    stringBuffer.append(TEXT_95);
559
    stringBuffer.append(TEXT_101);
543
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
560
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
544
    stringBuffer.append(TEXT_96);
561
    stringBuffer.append(TEXT_102);
545
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
562
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
546
    stringBuffer.append(TEXT_97);
563
    stringBuffer.append(TEXT_103);
547
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
564
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
548
    stringBuffer.append(TEXT_98);
565
    stringBuffer.append(TEXT_104);
549
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
566
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
550
    stringBuffer.append(TEXT_99);
567
    stringBuffer.append(TEXT_105);
551
    
568
    
552
{
569
{
553
TypeModelFacet facet = genNode.getModelFacet();
570
TypeModelFacet facet = genNode.getModelFacet();
Lines 555-674 Link Here
555
GenFeature containmentFeature = facet.getContainmentMetaFeature();
572
GenFeature containmentFeature = facet.getContainmentMetaFeature();
556
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
573
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
557
574
558
    stringBuffer.append(TEXT_100);
575
    stringBuffer.append(TEXT_106);
559
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
576
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
560
    stringBuffer.append(TEXT_101);
577
    stringBuffer.append(TEXT_107);
561
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
562
    stringBuffer.append(TEXT_102);
579
    stringBuffer.append(TEXT_108);
563
    
580
    
564
	if (containmentFeature.getEcoreFeature().isMany()) {
581
	if (containmentFeature.getEcoreFeature().isMany()) {
565
582
566
    stringBuffer.append(TEXT_103);
583
    stringBuffer.append(TEXT_109);
567
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
584
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
568
    stringBuffer.append(TEXT_104);
585
    stringBuffer.append(TEXT_110);
569
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
586
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
570
    stringBuffer.append(TEXT_105);
587
    stringBuffer.append(TEXT_111);
571
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
588
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
572
    stringBuffer.append(TEXT_106);
589
    stringBuffer.append(TEXT_112);
573
    
590
    
574
	} else {
591
	} else {
575
592
576
    stringBuffer.append(TEXT_107);
593
    stringBuffer.append(TEXT_113);
577
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
594
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
578
    stringBuffer.append(TEXT_108);
595
    stringBuffer.append(TEXT_114);
579
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
596
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
580
    stringBuffer.append(TEXT_109);
597
    stringBuffer.append(TEXT_115);
581
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
598
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
582
    stringBuffer.append(TEXT_110);
599
    stringBuffer.append(TEXT_116);
583
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
600
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
584
    stringBuffer.append(TEXT_111);
601
    stringBuffer.append(TEXT_117);
585
    
602
    
586
	}
603
	}
587
604
588
    
605
    
589
	if (childFeature.getEcoreFeature().isMany()) {
606
	if (childFeature.getEcoreFeature().isMany()) {
590
607
591
    stringBuffer.append(TEXT_112);
608
    stringBuffer.append(TEXT_118);
592
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
593
    stringBuffer.append(TEXT_113);
610
    stringBuffer.append(TEXT_119);
594
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
611
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
595
    stringBuffer.append(TEXT_114);
612
    stringBuffer.append(TEXT_120);
596
    stringBuffer.append(childFeature.getFeatureAccessorName());
613
    stringBuffer.append(childFeature.getFeatureAccessorName());
597
    stringBuffer.append(TEXT_115);
614
    stringBuffer.append(TEXT_121);
598
    
615
    
599
	} else {
616
	} else {
600
617
601
    stringBuffer.append(TEXT_116);
618
    stringBuffer.append(TEXT_122);
602
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
619
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
603
    stringBuffer.append(TEXT_117);
620
    stringBuffer.append(TEXT_123);
604
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
621
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
605
    stringBuffer.append(TEXT_118);
622
    stringBuffer.append(TEXT_124);
606
    stringBuffer.append(childFeature.getFeatureAccessorName());
623
    stringBuffer.append(childFeature.getFeatureAccessorName());
607
    stringBuffer.append(TEXT_119);
624
    stringBuffer.append(TEXT_125);
608
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
625
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
609
    stringBuffer.append(TEXT_120);
626
    stringBuffer.append(TEXT_126);
610
    
627
    
611
	}
628
	}
612
629
613
    stringBuffer.append(TEXT_121);
630
    stringBuffer.append(TEXT_127);
614
    
631
    
615
} else {
632
} else {
616
	if (containmentFeature.getEcoreFeature().isMany()) {
633
	if (containmentFeature.getEcoreFeature().isMany()) {
617
634
618
    stringBuffer.append(TEXT_122);
635
    stringBuffer.append(TEXT_128);
619
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
636
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
620
    stringBuffer.append(TEXT_123);
637
    stringBuffer.append(TEXT_129);
621
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
638
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
622
    stringBuffer.append(TEXT_124);
639
    stringBuffer.append(TEXT_130);
623
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
640
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
624
    stringBuffer.append(TEXT_125);
641
    stringBuffer.append(TEXT_131);
625
    
642
    
626
	} else {
643
	} else {
627
644
628
    stringBuffer.append(TEXT_126);
645
    stringBuffer.append(TEXT_132);
629
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
646
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
630
    stringBuffer.append(TEXT_127);
647
    stringBuffer.append(TEXT_133);
631
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
648
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
632
    stringBuffer.append(TEXT_128);
649
    stringBuffer.append(TEXT_134);
633
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
650
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
634
    stringBuffer.append(TEXT_129);
651
    stringBuffer.append(TEXT_135);
635
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
652
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
636
    stringBuffer.append(TEXT_130);
653
    stringBuffer.append(TEXT_136);
637
    
654
    
638
	}
655
	}
639
}
656
}
640
657
641
    stringBuffer.append(TEXT_131);
658
    stringBuffer.append(TEXT_137);
642
    
659
    
643
}	/*restrict local vars used in component edit policy*/
660
}	/*restrict local vars used in component edit policy*/
644
661
645
    stringBuffer.append(TEXT_132);
662
    stringBuffer.append(TEXT_138);
646
    
663
    
647
if (!isReadOnly) {
664
if (!isReadOnly) {
648
665
649
    stringBuffer.append(TEXT_133);
666
    stringBuffer.append(TEXT_139);
650
    stringBuffer.append(TEXT_134);
667
    stringBuffer.append(TEXT_140);
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
668
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
652
    stringBuffer.append(TEXT_135);
669
    stringBuffer.append(TEXT_141);
653
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
670
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
654
    stringBuffer.append(TEXT_136);
671
    stringBuffer.append(TEXT_142);
655
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
672
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
656
    stringBuffer.append(TEXT_137);
673
    stringBuffer.append(TEXT_143);
657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
674
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
658
    stringBuffer.append(TEXT_138);
675
    stringBuffer.append(TEXT_144);
659
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
676
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
660
    stringBuffer.append(TEXT_139);
677
    stringBuffer.append(TEXT_145);
661
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
678
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
662
    stringBuffer.append(TEXT_140);
679
    stringBuffer.append(TEXT_146);
663
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
680
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
664
    stringBuffer.append(TEXT_141);
681
    stringBuffer.append(TEXT_147);
665
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
682
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
666
    stringBuffer.append(TEXT_142);
683
    stringBuffer.append(TEXT_148);
667
    
684
    
668
}
685
}
669
686
670
    stringBuffer.append(TEXT_143);
687
    stringBuffer.append(TEXT_149);
671
    stringBuffer.append(TEXT_144);
688
    stringBuffer.append(TEXT_150);
672
    
689
    
673
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
690
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
674
HashMap primitiveTypeToWrapperClassName = new HashMap();
691
HashMap primitiveTypeToWrapperClassName = new HashMap();
Lines 712-763 Link Here
712
	}
729
	}
713
}
730
}
714
731
715
    stringBuffer.append(TEXT_145);
732
    stringBuffer.append(TEXT_151);
716
    stringBuffer.append(viewPattern);
733
    stringBuffer.append(viewPattern);
717
    stringBuffer.append(TEXT_146);
734
    stringBuffer.append(TEXT_152);
718
    stringBuffer.append(editPattern);
735
    stringBuffer.append(editPattern);
719
    stringBuffer.append(TEXT_147);
736
    stringBuffer.append(TEXT_153);
720
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
737
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
721
    stringBuffer.append(TEXT_148);
738
    stringBuffer.append(TEXT_154);
722
    stringBuffer.append(resolvedSemanticElement);
739
    stringBuffer.append(resolvedSemanticElement);
723
    stringBuffer.append(TEXT_149);
740
    stringBuffer.append(TEXT_155);
724
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
741
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
725
    stringBuffer.append(TEXT_150);
742
    stringBuffer.append(TEXT_156);
726
    stringBuffer.append(resolvedSemanticElement);
743
    stringBuffer.append(resolvedSemanticElement);
727
    stringBuffer.append(TEXT_151);
744
    stringBuffer.append(TEXT_157);
728
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
745
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
729
    stringBuffer.append(TEXT_152);
746
    stringBuffer.append(TEXT_158);
730
    
747
    
731
if (labelModelFacet instanceof FeatureLabelModelFacet) {
748
if (labelModelFacet instanceof FeatureLabelModelFacet) {
732
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
749
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
733
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
750
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
734
	if (!feature.isPrimitiveType()) {
751
	if (!feature.isPrimitiveType()) {
735
752
736
    stringBuffer.append(TEXT_153);
753
    stringBuffer.append(TEXT_159);
737
    stringBuffer.append(feature.getCapName());
754
    stringBuffer.append(feature.getCapName());
738
    stringBuffer.append(TEXT_154);
755
    stringBuffer.append(TEXT_160);
739
    
756
    
740
	}
757
	}
741
758
742
    stringBuffer.append(TEXT_155);
759
    stringBuffer.append(TEXT_161);
743
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
760
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
744
    stringBuffer.append(TEXT_156);
761
    stringBuffer.append(TEXT_162);
745
    
762
    
746
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
763
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
747
		if (feature.isPrimitiveType()) {
764
		if (feature.isPrimitiveType()) {
748
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
765
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
749
		}
766
		}
750
767
751
    stringBuffer.append(TEXT_157);
768
    stringBuffer.append(TEXT_163);
752
    stringBuffer.append(value);
769
    stringBuffer.append(value);
753
    stringBuffer.append(TEXT_158);
770
    stringBuffer.append(TEXT_164);
754
    
771
    
755
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
772
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
756
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
773
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
757
774
758
    stringBuffer.append(TEXT_159);
775
    stringBuffer.append(TEXT_165);
759
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
776
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
760
    stringBuffer.append(TEXT_160);
777
    stringBuffer.append(TEXT_166);
761
    
778
    
762
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
779
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
763
		GenFeature next = (GenFeature) it.next();
780
		GenFeature next = (GenFeature) it.next();
Lines 766-789 Link Here
766
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
783
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
767
		}
784
		}
768
785
769
    stringBuffer.append(TEXT_161);
786
    stringBuffer.append(TEXT_167);
770
    stringBuffer.append(value);
787
    stringBuffer.append(value);
771
    if (it.hasNext()) {
788
    if (it.hasNext()) {
772
    stringBuffer.append(TEXT_162);
789
    stringBuffer.append(TEXT_168);
773
    }
790
    }
774
    
791
    
775
	}
792
	}
776
793
777
    stringBuffer.append(TEXT_163);
794
    stringBuffer.append(TEXT_169);
778
    
795
    
779
} else {
796
} else {
780
797
781
    stringBuffer.append(TEXT_164);
798
    stringBuffer.append(TEXT_170);
782
    
799
    
783
}
800
}
784
801
785
    stringBuffer.append(TEXT_165);
802
    stringBuffer.append(TEXT_171);
786
    stringBuffer.append(TEXT_166);
803
    stringBuffer.append(TEXT_172);
787
    
804
    
788
boolean isFixedFontSetInFigure;
805
boolean isFixedFontSetInFigure;
789
{
806
{
Lines 791-939 Link Here
791
	isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
808
	isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
792
}
809
}
793
810
794
    stringBuffer.append(TEXT_167);
811
    stringBuffer.append(TEXT_173);
795
    
812
    
796
if (!isFixedFontSetInFigure) {
813
if (!isFixedFontSetInFigure) {
797
814
798
    stringBuffer.append(TEXT_168);
815
    stringBuffer.append(TEXT_174);
799
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
816
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
800
    stringBuffer.append(TEXT_169);
817
    stringBuffer.append(TEXT_175);
801
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
818
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
802
    stringBuffer.append(TEXT_170);
819
    stringBuffer.append(TEXT_176);
803
    stringBuffer.append(primaryView);
820
    stringBuffer.append(primaryView);
804
    stringBuffer.append(TEXT_171);
821
    stringBuffer.append(TEXT_177);
805
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
822
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
806
    stringBuffer.append(TEXT_172);
823
    stringBuffer.append(TEXT_178);
807
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
824
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
808
    stringBuffer.append(TEXT_173);
825
    stringBuffer.append(TEXT_179);
809
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
826
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
810
    stringBuffer.append(TEXT_174);
827
    stringBuffer.append(TEXT_180);
811
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
828
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
812
    stringBuffer.append(TEXT_175);
829
    stringBuffer.append(TEXT_181);
813
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
830
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
814
    stringBuffer.append(TEXT_176);
831
    stringBuffer.append(TEXT_182);
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
832
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
816
    stringBuffer.append(TEXT_177);
833
    stringBuffer.append(TEXT_183);
817
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
834
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
818
    stringBuffer.append(TEXT_178);
835
    stringBuffer.append(TEXT_184);
819
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
836
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
820
    stringBuffer.append(TEXT_179);
837
    stringBuffer.append(TEXT_185);
821
    
838
    
822
}
839
}
823
840
824
    stringBuffer.append(TEXT_180);
841
    stringBuffer.append(TEXT_186);
825
    
842
    
826
if (!isFixedFontSetInFigure) {
843
if (!isFixedFontSetInFigure) {
827
844
828
    stringBuffer.append(TEXT_181);
845
    stringBuffer.append(TEXT_187);
829
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
846
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
830
    stringBuffer.append(TEXT_182);
847
    stringBuffer.append(TEXT_188);
831
    
848
    
832
}
849
}
833
850
834
    stringBuffer.append(TEXT_183);
851
    stringBuffer.append(TEXT_189);
835
    stringBuffer.append(TEXT_184);
852
    stringBuffer.append(TEXT_190);
836
    stringBuffer.append(TEXT_185);
853
    stringBuffer.append(TEXT_191);
837
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
854
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
838
    stringBuffer.append(TEXT_186);
855
    stringBuffer.append(TEXT_192);
839
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
856
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
840
    stringBuffer.append(TEXT_187);
857
    stringBuffer.append(TEXT_193);
841
    stringBuffer.append(primaryView);
858
    stringBuffer.append(primaryView);
842
    stringBuffer.append(TEXT_188);
859
    stringBuffer.append(TEXT_194);
843
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
860
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
844
    stringBuffer.append(TEXT_189);
861
    stringBuffer.append(TEXT_195);
845
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
862
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
846
    stringBuffer.append(TEXT_190);
863
    stringBuffer.append(TEXT_196);
847
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
864
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
848
    stringBuffer.append(TEXT_191);
865
    stringBuffer.append(TEXT_197);
849
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
866
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
850
    stringBuffer.append(TEXT_192);
867
    stringBuffer.append(TEXT_198);
851
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
868
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
852
    stringBuffer.append(TEXT_193);
869
    stringBuffer.append(TEXT_199);
853
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
870
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
854
    stringBuffer.append(TEXT_194);
871
    stringBuffer.append(TEXT_200);
855
    
872
    
856
if (genChildNode.isLabelElementIcon()) {
873
if (genChildNode.isLabelElementIcon()) {
857
874
858
    stringBuffer.append(TEXT_195);
875
    stringBuffer.append(TEXT_201);
859
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor"));
876
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor"));
860
    stringBuffer.append(TEXT_196);
877
    stringBuffer.append(TEXT_202);
861
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
878
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
862
    stringBuffer.append(TEXT_197);
879
    stringBuffer.append(TEXT_203);
863
    
880
    
864
}
881
}
865
882
866
    stringBuffer.append(TEXT_198);
867
    /*@ include file="adapters/propertySource.javajetinc"*/
868
    stringBuffer.append(TEXT_199);
869
    stringBuffer.append(TEXT_200);
870
    stringBuffer.append(TEXT_201);
871
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
872
    stringBuffer.append(TEXT_202);
873
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
874
    stringBuffer.append(TEXT_203);
875
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
876
    stringBuffer.append(TEXT_204);
883
    stringBuffer.append(TEXT_204);
884
    /*@ include file="adapters/propertySource.javajetinc"*/
877
    stringBuffer.append(TEXT_205);
885
    stringBuffer.append(TEXT_205);
878
    stringBuffer.append(TEXT_206);
886
    stringBuffer.append(TEXT_206);
879
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
880
    stringBuffer.append(TEXT_207);
887
    stringBuffer.append(TEXT_207);
881
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
888
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
882
    stringBuffer.append(TEXT_208);
889
    stringBuffer.append(TEXT_208);
883
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
890
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
884
    stringBuffer.append(TEXT_209);
891
    stringBuffer.append(TEXT_209);
892
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
885
    stringBuffer.append(TEXT_210);
893
    stringBuffer.append(TEXT_210);
886
    stringBuffer.append(TEXT_211);
894
    stringBuffer.append(TEXT_211);
887
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
888
    stringBuffer.append(TEXT_212);
895
    stringBuffer.append(TEXT_212);
889
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
896
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
890
    stringBuffer.append(TEXT_213);
897
    stringBuffer.append(TEXT_213);
898
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
891
    stringBuffer.append(TEXT_214);
899
    stringBuffer.append(TEXT_214);
900
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
892
    stringBuffer.append(TEXT_215);
901
    stringBuffer.append(TEXT_215);
893
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
894
    stringBuffer.append(TEXT_216);
902
    stringBuffer.append(TEXT_216);
903
    stringBuffer.append(TEXT_217);
904
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
905
    stringBuffer.append(TEXT_218);
906
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
907
    stringBuffer.append(TEXT_219);
908
    stringBuffer.append(TEXT_220);
909
    stringBuffer.append(TEXT_221);
910
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
911
    stringBuffer.append(TEXT_222);
895
    
912
    
896
if (labelModelFacet instanceof FeatureLabelModelFacet) {
913
if (labelModelFacet instanceof FeatureLabelModelFacet) {
897
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
914
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
898
915
899
    stringBuffer.append(TEXT_217);
916
    stringBuffer.append(TEXT_223);
900
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
917
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
901
    stringBuffer.append(TEXT_218);
918
    stringBuffer.append(TEXT_224);
902
    stringBuffer.append(feature.getFeatureAccessorName());
919
    stringBuffer.append(feature.getFeatureAccessorName());
903
    stringBuffer.append(TEXT_219);
920
    stringBuffer.append(TEXT_225);
904
    
921
    
905
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
922
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
906
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
923
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
907
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
924
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
908
		GenFeature next = (GenFeature) it.next();
925
		GenFeature next = (GenFeature) it.next();
909
926
910
    stringBuffer.append(TEXT_220);
927
    stringBuffer.append(TEXT_226);
911
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
928
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
912
    stringBuffer.append(TEXT_221);
929
    stringBuffer.append(TEXT_227);
913
    stringBuffer.append(next.getFeatureAccessorName());
930
    stringBuffer.append(next.getFeatureAccessorName());
914
    stringBuffer.append(TEXT_222);
931
    stringBuffer.append(TEXT_228);
915
    
932
    
916
	}
933
	}
917
}
934
}
918
935
919
    stringBuffer.append(TEXT_223);
936
    stringBuffer.append(TEXT_229);
920
    stringBuffer.append(TEXT_224);
937
    stringBuffer.append(TEXT_230);
921
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
938
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
922
    stringBuffer.append(TEXT_225);
939
    stringBuffer.append(TEXT_231);
923
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
940
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
924
    stringBuffer.append(TEXT_226);
941
    stringBuffer.append(TEXT_232);
925
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
942
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
926
    stringBuffer.append(TEXT_227);
943
    stringBuffer.append(TEXT_233);
927
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
944
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
928
    stringBuffer.append(TEXT_228);
945
    stringBuffer.append(TEXT_234);
929
    stringBuffer.append(TEXT_229);
946
    stringBuffer.append(TEXT_235);
930
    stringBuffer.append(TEXT_230);
947
    stringBuffer.append(TEXT_236);
931
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
948
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
932
    stringBuffer.append(TEXT_231);
949
    stringBuffer.append(TEXT_237);
933
    
950
    
934
final Viewmap viewmap = genChildNode.getViewmap();
951
final Viewmap viewmap = genChildNode.getViewmap();
935
952
936
    stringBuffer.append(TEXT_232);
953
    stringBuffer.append(TEXT_238);
937
    
954
    
938
final String figureQualifiedClassName;
955
final String figureQualifiedClassName;
939
if (viewmap instanceof ParentAssignedViewmap) {
956
if (viewmap instanceof ParentAssignedViewmap) {
Lines 962-1025 Link Here
962
if (viewmap instanceof ParentAssignedViewmap) {
979
if (viewmap instanceof ParentAssignedViewmap) {
963
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
980
	final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
964
981
965
    stringBuffer.append(TEXT_233);
982
    stringBuffer.append(TEXT_239);
966
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
983
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
967
    stringBuffer.append(TEXT_234);
984
    stringBuffer.append(TEXT_240);
968
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
985
    stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
969
    stringBuffer.append(TEXT_235);
986
    stringBuffer.append(TEXT_241);
970
    } else { 
987
    } else { 
971
    stringBuffer.append(TEXT_236);
988
    stringBuffer.append(TEXT_242);
972
    stringBuffer.append(figureImportedName);
989
    stringBuffer.append(figureImportedName);
973
    stringBuffer.append(TEXT_237);
990
    stringBuffer.append(TEXT_243);
974
    
991
    
975
if (viewmap instanceof FigureViewmap) {
992
if (viewmap instanceof FigureViewmap) {
976
993
977
    stringBuffer.append(TEXT_238);
994
    stringBuffer.append(TEXT_244);
978
    stringBuffer.append(figureImportedName);
995
    stringBuffer.append(figureImportedName);
979
    stringBuffer.append(TEXT_239);
996
    stringBuffer.append(TEXT_245);
980
    } // instanceof FigureViewmap
997
    } // instanceof FigureViewmap
981
 else if (viewmap instanceof SnippetViewmap) {
998
 else if (viewmap instanceof SnippetViewmap) {
982
    stringBuffer.append(TEXT_240);
999
    stringBuffer.append(TEXT_246);
983
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
1000
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
984
    stringBuffer.append(TEXT_241);
1001
    stringBuffer.append(TEXT_247);
985
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
1002
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
986
 else if (viewmap instanceof InnerClassViewmap) {
1003
 else if (viewmap instanceof InnerClassViewmap) {
987
1004
988
    stringBuffer.append(TEXT_242);
1005
    stringBuffer.append(TEXT_248);
989
    stringBuffer.append(figureImportedName);
1006
    stringBuffer.append(figureImportedName);
990
    stringBuffer.append(TEXT_243);
1007
    stringBuffer.append(TEXT_249);
991
    }
1008
    }
992
    stringBuffer.append(TEXT_244);
1009
    stringBuffer.append(TEXT_250);
993
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
1010
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
994
    stringBuffer.append(TEXT_245);
1011
    stringBuffer.append(TEXT_251);
995
    stringBuffer.append(figureImportedName);
1012
    stringBuffer.append(figureImportedName);
996
    stringBuffer.append(TEXT_246);
1013
    stringBuffer.append(TEXT_252);
997
    
1014
    
998
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
1015
if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
999
1016
1000
    stringBuffer.append(TEXT_247);
1017
    stringBuffer.append(TEXT_253);
1018
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
1019
    stringBuffer.append(TEXT_254);
1001
    
1020
    
1002
} else {
1021
} else {
1003
1022
1004
    stringBuffer.append(TEXT_248);
1023
    stringBuffer.append(TEXT_255);
1005
    
1024
    
1006
}
1025
}
1007
1026
1008
    stringBuffer.append(TEXT_249);
1027
    stringBuffer.append(TEXT_256);
1009
    }	/*not parent-assigned*/
1028
    }	/*not parent-assigned*/
1010
    stringBuffer.append(TEXT_250);
1029
    stringBuffer.append(TEXT_257);
1011
    
1030
    
1012
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
1031
if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
1013
1032
1014
    stringBuffer.append(TEXT_251);
1033
    stringBuffer.append(TEXT_258);
1015
    
1034
    
1016
}
1035
}
1017
1036
1018
    stringBuffer.append(TEXT_252);
1037
    stringBuffer.append(TEXT_259);
1019
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
1038
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
1020
    stringBuffer.append(TEXT_253);
1039
    stringBuffer.append(TEXT_260);
1021
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
1040
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
1022
    stringBuffer.append(TEXT_254);
1041
    stringBuffer.append(TEXT_261);
1023
    
1042
    
1024
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
1043
String labelSetterName = "setLabel"; // same assumption in NodeEditPart
1025
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
1044
String labelFigureClassName = "org.eclipse.draw2d.IFigure";
Lines 1033-1075 Link Here
1033
	}
1052
	}
1034
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
1053
} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
1035
1054
1036
    stringBuffer.append(TEXT_255);
1055
    stringBuffer.append(TEXT_262);
1037
    stringBuffer.append(labelSetterName);
1056
    stringBuffer.append(labelSetterName);
1038
    stringBuffer.append(TEXT_256);
1057
    stringBuffer.append(TEXT_263);
1039
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
1058
    stringBuffer.append(importManager.getImportedName(labelFigureClassName));
1040
    stringBuffer.append(TEXT_257);
1059
    stringBuffer.append(TEXT_264);
1041
    
1060
    
1042
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
1061
if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
1043
1062
1044
    stringBuffer.append(TEXT_258);
1063
    stringBuffer.append(TEXT_265);
1045
    
1064
    
1046
} else {
1065
} else {
1047
1066
1048
    stringBuffer.append(TEXT_259);
1067
    stringBuffer.append(TEXT_266);
1049
    
1068
    
1050
}
1069
}
1051
1070
1052
    stringBuffer.append(TEXT_260);
1071
    stringBuffer.append(TEXT_267);
1053
    
1072
    
1054
if (viewmap instanceof InnerClassViewmap) {
1073
if (viewmap instanceof InnerClassViewmap) {
1055
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
1074
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
1056
1075
1057
    stringBuffer.append(TEXT_261);
1076
    stringBuffer.append(TEXT_268);
1058
    stringBuffer.append(classBody);
1077
    stringBuffer.append(classBody);
1059
    stringBuffer.append(TEXT_262);
1078
    stringBuffer.append(TEXT_269);
1060
    
1079
    
1061
if (classBody.indexOf("DPtoLP") != -1) {
1080
if (classBody.indexOf("DPtoLP") != -1) {
1062
1081
1063
    stringBuffer.append(TEXT_263);
1082
    stringBuffer.append(TEXT_270);
1064
    
1083
    
1065
}
1084
}
1066
1085
1067
    
1086
    
1068
}
1087
}
1069
1088
1070
    stringBuffer.append(TEXT_264);
1089
    stringBuffer.append(TEXT_271);
1071
    importManager.emitSortedImports();
1090
    importManager.emitSortedImports();
1072
    stringBuffer.append(TEXT_265);
1091
    stringBuffer.append(TEXT_272);
1073
    return stringBuffer.toString();
1092
    return stringBuffer.toString();
1074
  }
1093
  }
1075
}
1094
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/VisualIDRegistryGenerator.java (-1 / +2 lines)
Lines 48-54 Link Here
48
  protected final String TEXT_29 = ".VISUAL_ID;" + NL + "\t\t\t}";
48
  protected final String TEXT_29 = ".VISUAL_ID;" + NL + "\t\t\t}";
49
  protected final String TEXT_30 = NL + "\t\t\treturn getUnrecognized";
49
  protected final String TEXT_30 = NL + "\t\t\treturn getUnrecognized";
50
  protected final String TEXT_31 = "ChildNodeID(domainElement);";
50
  protected final String TEXT_31 = "ChildNodeID(domainElement);";
51
  protected final String TEXT_32 = NL + "\t\t}" + NL + "\t\treturn -1;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement) {" + NL + "\t\tEClass domainElementMetaclass = domainElement.eClass();" + NL + "\t\treturn getLinkWithClassVisualID(domainElement, domainElementMetaclass);" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement, EClass domainElementMetaclass) {";
51
  protected final String TEXT_32 = NL + "\t\t}" + NL + "\t\treturn -1;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement) {" + NL + "\t\tif (domainElement == null) {" + NL + "\t\t\treturn -1;" + NL + "\t\t}" + NL + "\t\tEClass domainElementMetaclass = domainElement.eClass();" + NL + "\t\treturn getLinkWithClassVisualID(domainElement, domainElementMetaclass);" + NL + "\t}" + NL + "\t\t" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic int getLinkWithClassVisualID(EObject domainElement, EClass domainElementMetaclass) {";
52
  protected final String TEXT_33 = NL + "\t\tif (";
52
  protected final String TEXT_33 = NL + "\t\tif (";
53
  protected final String TEXT_34 = ".eINSTANCE.get";
53
  protected final String TEXT_34 = ".eINSTANCE.get";
54
  protected final String TEXT_35 = "().isSuperTypeOf(domainElementMetaclass) && isLinkWithClass";
54
  protected final String TEXT_35 = "().isSuperTypeOf(domainElementMetaclass) && isLinkWithClass";
Lines 323-328 Link Here
323
	}
323
	}
324
}
324
}
325
325
326
326
final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders();
327
final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders();
327
final List javaSelectorFacets = new ArrayList();
328
final List javaSelectorFacets = new ArrayList();
328
final Map __exprEnvVariables = Collections.EMPTY_MAP;
329
final Map __exprEnvVariables = Collections.EMPTY_MAP;
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/providers/LinkViewFactoryGenerator.java (-1 / +1 lines)
Lines 33-39 Link Here
33
  protected final String TEXT_15 = "Label(";
33
  protected final String TEXT_15 = "Label(";
34
  protected final String TEXT_16 = " view) {" + NL + "\t\t";
34
  protected final String TEXT_16 = " view) {" + NL + "\t\t";
35
  protected final String TEXT_17 = " label = ";
35
  protected final String TEXT_17 = " label = ";
36
  protected final String TEXT_18 = ".eINSTANCE.createNode();" + NL + "\t\tview.getPersistedChildren().add(label);" + NL + "\t\tlabel.setElement(null);" + NL + "\t\t";
36
  protected final String TEXT_18 = ".eINSTANCE.createNode();" + NL + "\t\tview.getPersistedChildren().add(label);" + NL + "\t\t";
37
  protected final String TEXT_19 = ".decorateView(label);" + NL + "\t}";
37
  protected final String TEXT_19 = ".decorateView(label);" + NL + "\t}";
38
  protected final String TEXT_20 = NL + "}";
38
  protected final String TEXT_20 = NL + "}";
39
  protected final String TEXT_21 = NL;
39
  protected final String TEXT_21 = NL;
(-)templates/parts/NodeLabelEditPart.javajet (-7 / +2 lines)
Lines 104-116 Link Here
104
	 * @generated
104
	 * @generated
105
	 */
105
	 */
106
	private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() {
106
	private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() {
107
		for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {
107
		View view = (View) getModel();
108
			View view = (View)editPart.getModel();
108
		return (view.getElement() instanceof <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement() : null;
109
			if (view != null && view.getElement() != null) {
110
				return (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement();
111
			}
112
		}
113
		return null;
114
	}
109
	}
115
110
116
	/**
111
	/**
(-)templates/parts/LinkLabelEditPart.javajet (-5 / +19 lines)
Lines 170-182 Link Here
170
	 * @generated
170
	 * @generated
171
	 */
171
	 */
172
	private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> resolveSemanticElement() {
172
	private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> resolveSemanticElement() {
173
		for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {
173
		<%=importManager.getImportedName(genHost.getEditPartQualifiedClassName())%> parent = getUpdatableParent();
174
			View view = (View)editPart.getModel();
174
		if (parent == null || parent.getModel() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> == false) {
175
			if (view != null && view.getElement() != null) {
175
			return null;
176
				return (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) view.getElement();
177
			}
178
		}
176
		}
177
<%
178
if (genHost.getModelFacet() instanceof TypeLinkModelFacet) {
179
%>
180
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) parent.getModel();
181
		return (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) view.getElement();
182
<%
183
} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) {
184
%>
185
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target = ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) parent.getModel()).getTarget();
186
		return (target != null && target.getElement() instanceof <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%>) target.getElement() : null;
187
<%
188
} else {
189
%>
179
		return null;
190
		return null;
191
<%
192
}
193
%>
180
	}
194
	}
181
195
182
	/**
196
	/**
(-)templates/parts/CompartmentEditPart.javajet (-7 / +2 lines)
Lines 193-205 Link Here
193
	 * @generated
193
	 * @generated
194
	 */
194
	 */
195
	private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() {
195
	private <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%> resolveSemanticElement() {
196
		for(EditPart editPart = this; editPart != null; editPart = editPart.getParent()) {
196
		View view = getDiagramNode();
197
			View view = (View)editPart.getModel();
197
		return (view.getElement() instanceof <%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) ? (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement() : null;
198
			if (view != null && view.getElement() != null) {
199
				return (<%=importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())%>) view.getElement();
200
			}
201
		}
202
		return null;
203
	}
198
	}
204
199
205
	/**
200
	/**
(-)templates/parts/NodeEditPart.javajet (+73 lines)
Lines 8-13 Link Here
8
Palette palette = genDiagram.getPalette();
8
Palette palette = genDiagram.getPalette();
9
boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode);
9
boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode);
10
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
10
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
11
importManager.registerInnerClass("LinkNotationModelRefresher");	//from linkNotationModelRefresher.jetinc
12
importManager.registerInnerClass("LinkDescriptor");	//from linkNotationModelRefresher.jetinc
11
13
12
class NodeEditPartHelper {
14
class NodeEditPartHelper {
13
	private final List myInnerLabels = new LinkedList();
15
	private final List myInnerLabels = new LinkedList();
Lines 15-20 Link Here
15
	private final List myExternalLabels = new LinkedList();
17
	private final List myExternalLabels = new LinkedList();
16
	private final List myPinnedCompartments = new LinkedList();
18
	private final List myPinnedCompartments = new LinkedList();
17
	private final List myFloatingCompartments = new LinkedList();
19
	private final List myFloatingCompartments = new LinkedList();
20
	private final List myContainedFeatureModelFacetLinks = new LinkedList();
21
	private final List myContainedTypeModelFacetLinks = new LinkedList();
18
	private GenNodeLabel myPrimaryLabel;
22
	private GenNodeLabel myPrimaryLabel;
19
	private boolean myHasChildrenInListCompartments = false;
23
	private boolean myHasChildrenInListCompartments = false;
20
	private boolean hasIncomingLinks = false;
24
	private boolean hasIncomingLinks = false;
Lines 56-79 Link Here
56
			}
60
			}
57
			GenClass incomingClass;
61
			GenClass incomingClass;
58
			GenClass outgoingClass;
62
			GenClass outgoingClass;
63
			GenClass containerClass;
59
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
64
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
60
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
65
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
61
				incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass();
66
				incomingClass = modelFacet.getTargetMetaFeature().getTypeGenClass();
62
				outgoingClass = modelFacet.getSourceMetaFeature() == null
67
				outgoingClass = modelFacet.getSourceMetaFeature() == null
63
					? modelFacet.getContainmentMetaFeature().getGenClass()
68
					? modelFacet.getContainmentMetaFeature().getGenClass()
64
					: modelFacet.getSourceMetaFeature().getTypeGenClass();
69
					: modelFacet.getSourceMetaFeature().getTypeGenClass();
70
				if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
71
					//if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
72
					containerClass = null;
73
				} else {
74
					containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
75
				}
65
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
76
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
66
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
77
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
67
				incomingClass = metaFeature.getTypeGenClass();
78
				incomingClass = metaFeature.getTypeGenClass();
68
				outgoingClass = metaFeature.getGenClass();
79
				outgoingClass = metaFeature.getGenClass();
80
				containerClass = metaFeature.getGenClass();
69
			} else {
81
			} else {
70
				continue;
82
				continue;
71
			}
83
			}
72
			hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
84
			hasIncomingLinks |= (incomingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
73
			hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
85
			hasOutgoingLinks |= (outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass()));
86
			if (containerClass != null && containerClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) {
87
				if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
88
					myContainedTypeModelFacetLinks.add(genLink);
89
				} else {
90
					myContainedFeatureModelFacetLinks.add(genLink);
91
				}
92
			}
74
		}
93
		}
75
	}
94
	}
76
95
96
	public boolean containsLinks() {
97
		return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
98
	}
99
100
	public boolean containsFeatureModelFacetLinks() {
101
		return !myContainedFeatureModelFacetLinks.isEmpty();
102
	}
103
104
	public boolean containsTypeModelFacetLinks() {
105
		return !myContainedTypeModelFacetLinks.isEmpty();
106
	}
107
77
	public boolean hasIncomingLinks() {
108
	public boolean hasIncomingLinks() {
78
		return hasIncomingLinks;
109
		return hasIncomingLinks;
79
	}
110
	}
Lines 121-126 Link Here
121
	public Iterator getAllInnerLabels() {
152
	public Iterator getAllInnerLabels() {
122
		return myAllInnerLabels.iterator();
153
		return myAllInnerLabels.iterator();
123
	}
154
	}
155
156
	public Iterator getContainedFeatureModelFacetLinks() {
157
		return myContainedFeatureModelFacetLinks.iterator();
158
	}
159
160
	public Iterator getContainedTypeModelFacetLinks() {
161
		return myContainedTypeModelFacetLinks.iterator();
162
	}
124
}
163
}
125
final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode);
164
final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode);
126
%>
165
%>
Lines 158-163 Link Here
158
		setModel(model);
197
		setModel(model);
159
	}
198
	}
160
199
200
<%@ include file="registerModel.jetinc"%>
201
161
	/**
202
	/**
162
	 * @generated
203
	 * @generated
163
	 */
204
	 */
Lines 413-418 Link Here
413
				return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
454
				return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
414
			}
455
			}
415
		});
456
		});
457
<%
458
if (myHelper.containsLinks()) {
459
%>
460
		installLinkNotationModelRefresher();
461
<%
462
}
463
%>
416
	}
464
	}
417
465
418
	/**
466
	/**
Lines 884-898 Link Here
884
	public void activate() {
932
	public void activate() {
885
		super.activate();
933
		super.activate();
886
		getDiagramNode().getElement().eAdapters().add(domainModelRefresher);
934
		getDiagramNode().getElement().eAdapters().add(domainModelRefresher);
935
<%
936
if (myHelper.containsLinks()) {
937
%>
938
		installLinkNotationModelRefresher();
939
<%
940
}
941
%>
887
	}
942
	}
888
943
889
	/**
944
	/**
890
	 * @generated
945
	 * @generated
891
	 */
946
	 */
892
	public void deactivate() {
947
	public void deactivate() {
948
<%
949
if (myHelper.containsLinks()) {
950
%>
951
		uninstallLinkNotationModelRefresher();
952
<%
953
}
954
%>
893
		getDiagramNode().getElement().eAdapters().remove(domainModelRefresher);
955
		getDiagramNode().getElement().eAdapters().remove(domainModelRefresher);
894
		super.deactivate();
956
		super.deactivate();
895
	}
957
	}
958
<%
959
{
960
	final String _getViewCode = "getDiagramNode()";
961
	final String _getDiagramCode = "getDiagramNode().getDiagram()";
962
	final String _getSemanticElementCode = "getDiagramNode().getElement()";
963
	final boolean _includeUncontainedLinks = false;
964
%>
965
<%@ include file="linkNotationModelRefresher.jetinc"%>
966
<%
967
}	//end of local declarations
968
%>
896
969
897
<%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%>
970
<%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%>
898
971
(-)templates/parts/ChildNodeEditPart.javajet (+2 lines)
Lines 49-54 Link Here
49
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel();
49
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel();
50
	}
50
	}
51
51
52
<%@ include file="registerModel.jetinc"%>
53
52
	/**
54
	/**
53
	 * @generated
55
	 * @generated
54
	 */
56
	 */
(-)templates/parts/DiagramEditPart.javajet (-2 / +102 lines)
Lines 4-10 Link Here
4
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
4
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
5
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
5
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
6
importManager.registerInnerClass("NotationModelRefresher");	//from notationModelRefresher.jetinc
6
importManager.registerInnerClass("NotationModelRefresher");	//from notationModelRefresher.jetinc
7
importManager.registerInnerClass("LinkNotationModelRefresher");	//from linkNotationModelRefresher.jetinc
8
importManager.registerInnerClass("LinkDescriptor");	//from linkNotationModelRefresher.jetinc
7
List childNodes = genDiagram.getTopLevelNodes();
9
List childNodes = genDiagram.getTopLevelNodes();
10
11
class DiagramEditPartHelper {
12
	private final List myContainedFeatureModelFacetLinks = new LinkedList();
13
	private final List myContainedTypeModelFacetLinks = new LinkedList();
14
	public DiagramEditPartHelper(GenDiagram diagram) {
15
		for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) {
16
			GenLink genLink = (GenLink)it.next();
17
			if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) {
18
				continue;
19
			}
20
			GenClass containerClass;
21
			if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
22
				TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
23
				if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
24
					//if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
25
					containerClass = null;
26
				} else {
27
					containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
28
				}
29
			} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
30
				GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
31
				containerClass = metaFeature.getGenClass();
32
			} else {
33
				continue;
34
			}
35
			if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) {
36
				if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
37
					myContainedTypeModelFacetLinks.add(genLink);
38
				} else {
39
					myContainedFeatureModelFacetLinks.add(genLink);
40
				}
41
			}
42
		}
43
	}
44
45
	public boolean containsLinks() {
46
		return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
47
	}
48
49
	public boolean containsFeatureModelFacetLinks() {
50
		return !myContainedFeatureModelFacetLinks.isEmpty();
51
	}
52
53
	public boolean containsTypeModelFacetLinks() {
54
		return !myContainedTypeModelFacetLinks.isEmpty();
55
	}
56
57
	public Iterator getContainedFeatureModelFacetLinks() {
58
		return myContainedFeatureModelFacetLinks.iterator();
59
	}
60
61
	public Iterator getContainedTypeModelFacetLinks() {
62
		return myContainedTypeModelFacetLinks.iterator();
63
	}
64
}
65
final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram);
8
%>
66
%>
9
67
10
<%
68
<%
Lines 65-70 Link Here
65
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getModel();
123
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getModel();
66
	}
124
	}
67
125
126
<%@ include file="registerModel.jetinc"%>
127
128
	/**
129
	 * @generated
130
	 */
131
	public void addNotify() {
132
		getDiagram().eAdapters().add(updateManager);
133
		getDiagram().getElement().eAdapters().add(domainModelRefresher);
134
		super.addNotify();
135
	}
136
68
	/**
137
	/**
69
	 * @generated
138
	 * @generated
70
	 */
139
	 */
Lines 143-148 Link Here
143
			}
212
			}
144
		});
213
		});
145
		installNotationModelRefresher();
214
		installNotationModelRefresher();
215
<%
216
//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
217
//if (myHelper.containsLinks()) {
218
%>
219
		installLinkNotationModelRefresher();
220
<%
221
//}
222
%>
146
	}
223
	}
147
224
148
	/**
225
	/**
Lines 250-264 Link Here
250
	 */
327
	 */
251
	public void activate() {
328
	public void activate() {
252
		super.activate();
329
		super.activate();
253
		getDiagram().eAdapters().add(updateManager);
330
		if (!getDiagram().eAdapters().contains(updateManager)) {
254
		getDiagram().getElement().eAdapters().add(domainModelRefresher);
331
			getDiagram().eAdapters().add(updateManager);
332
		}
333
		if (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {
334
			getDiagram().getElement().eAdapters().add(domainModelRefresher);
335
		}
255
		installNotationModelRefresher();
336
		installNotationModelRefresher();
337
<%
338
//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
339
//if (myHelper.containsLinks()) {
340
%>
341
		installLinkNotationModelRefresher();
342
<%
343
//}
344
%>
256
	}
345
	}
257
346
258
	/**
347
	/**
259
	 * @generated
348
	 * @generated
260
	 */
349
	 */
261
	public void deactivate() {
350
	public void deactivate() {
351
<%
352
//link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links
353
//if (myHelper.containsLinks()) {
354
%>
355
		uninstallLinkNotationModelRefresher();
356
<%
357
//}
358
%>
262
		uninstallNotationModelRefresher();
359
		uninstallNotationModelRefresher();
263
		getDiagram().getElement().eAdapters().remove(domainModelRefresher);
360
		getDiagram().getElement().eAdapters().remove(domainModelRefresher);
264
		getDiagram().eAdapters().remove(updateManager);
361
		getDiagram().eAdapters().remove(updateManager);
Lines 271-278 Link Here
271
String _getViewCode = "getDiagram()";
368
String _getViewCode = "getDiagram()";
272
String _getSemanticElementCode = "getDiagram().getElement()";
369
String _getSemanticElementCode = "getDiagram().getElement()";
273
boolean isListLayout = false;
370
boolean isListLayout = false;
371
final boolean _includeUncontainedLinks = true;
274
%>
372
%>
275
<%@ include file="notationModelRefresher.jetinc"%>
373
<%@ include file="notationModelRefresher.jetinc"%>
374
375
<%@ include file="linkNotationModelRefresher.jetinc"%>
276
<%
376
<%
277
}
377
}
278
%>
378
%>
(-)templates/parts/notationModelRefresher.jetinc (-21 / +23 lines)
Lines 88-128 Link Here
88
		 */
88
		 */
89
		private void createFilter() {
89
		private void createFilter() {
90
<%
90
<%
91
boolean hasDeclaredFilter = false;
91
{
92
Set genChildFeatures = new LinkedHashSet();
92
	boolean hasDeclaredFilter = false;
93
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
93
	Set genChildFeatures = new LinkedHashSet();
94
	GenNode nextNode = (GenNode) it.next();
94
	for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
95
	TypeModelFacet typeModelFacet = nextNode.getModelFacet();
95
		GenNode nextNode = (GenNode) it.next();
96
	if (typeModelFacet == null) {
96
		TypeModelFacet typeModelFacet = nextNode.getModelFacet();
97
		continue;
97
		if (typeModelFacet == null) {
98
	}
98
			continue;
99
	GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
99
		}
100
	if (genChildFeatures.contains(childMetaFeature)) {
100
		GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
101
		continue;
101
		if (genChildFeatures.contains(childMetaFeature)) {
102
	}
102
			continue;
103
	genChildFeatures.add(childMetaFeature);
103
		}
104
	if (!hasDeclaredFilter) {
104
		genChildFeatures.add(childMetaFeature);
105
		hasDeclaredFilter = true;
105
		if (!hasDeclaredFilter) {
106
			hasDeclaredFilter = true;
106
%>
107
%>
107
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>());
108
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>());
108
<%
109
<%
109
	} else {
110
		} else {
110
%>
111
%>
111
			filter = filter.or(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>()));
112
			filter = filter.or(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childMetaFeature.getFeatureAccessorName()%>()));
112
<%
113
<%
113
	}
114
		}
114
}	//for
115
	}	//for
115
%>
116
%>
116
<%
117
<%
117
if (hasDeclaredFilter) {
118
	if (hasDeclaredFilter) {
118
%>
119
%>
119
			filter = filter.and(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>));
120
			filter = filter.and(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>));
120
<%
121
<%
121
} else {
122
	} else {
122
%>
123
%>
123
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>);
124
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>);
124
<%
125
<%
125
}
126
	}
127
}	//local declaration of hasDeclaredFilter
126
%>
128
%>
127
<%
129
<%
128
if (hasConstraintsInChildren) {
130
if (hasConstraintsInChildren) {
(-)templates/parts/LinkEditPart.javajet (+2 lines)
Lines 36-41 Link Here
36
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getModel();
36
		return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getModel();
37
	}
37
	}
38
38
39
<%@ include file="registerModel.jetinc"%>
40
39
	/**
41
	/**
40
	 * @generated
42
	 * @generated
41
	 */
43
	 */
(-)templates/editor/VisualIDRegistry.javajet (+4 lines)
Lines 171-176 Link Here
171
	 * @generated
171
	 * @generated
172
	 */
172
	 */
173
	public int getLinkWithClassVisualID(EObject domainElement) {
173
	public int getLinkWithClassVisualID(EObject domainElement) {
174
		if (domainElement == null) {
175
			return -1;
176
		}
174
		EClass domainElementMetaclass = domainElement.eClass();
177
		EClass domainElementMetaclass = domainElement.eClass();
175
		return getLinkWithClassVisualID(domainElement, domainElementMetaclass);
178
		return getLinkWithClassVisualID(domainElement, domainElementMetaclass);
176
	}
179
	}
Lines 290-295 Link Here
290
	}
293
	}
291
}
294
}
292
295
296
293
final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders();
297
final GenExpressionProviderContainer expressionProviders = genDiagram.getEditorGen().getExpressionProviders();
294
final List javaSelectorFacets = new ArrayList();
298
final List javaSelectorFacets = new ArrayList();
295
final Map __exprEnvVariables = Collections.EMPTY_MAP;
299
final Map __exprEnvVariables = Collections.EMPTY_MAP;
(-)templates/commands/RemoveNotationalElementCommand.javajet (-2 / +61 lines)
Lines 26-31 Link Here
26
	/**
26
	/**
27
	 * @generated
27
	 * @generated
28
	 */
28
	 */
29
	private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> domainElement;
30
31
	/**
32
	 * @generated
33
	 */
34
	private <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> removeEdgeCommands;
35
36
	/**
37
	 * @generated
38
	 */
29
	public RemoveNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> childView) {
39
	public RemoveNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> childView) {
30
		this.parentView = parentView;
40
		this.parentView = parentView;
31
		this.childView = childView;
41
		this.childView = childView;
Lines 34-41 Link Here
34
	/**
44
	/**
35
	 * @generated
45
	 * @generated
36
	 */
46
	 */
37
	public boolean canExecute() {
47
	protected boolean prepare() {
38
		return parentView.getChildren().contains(childView);
48
		if (!parentView.getChildren().contains(childView)) {
49
			return false;
50
		}
51
		removeEdgeCommands = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
52
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = childView.getSourceEdges().iterator(); it.hasNext(); ) {
53
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next();
54
			removeEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));
55
		}
56
		for(Iterator it = childView.getTargetEdges().iterator(); it.hasNext(); ) {
57
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next();
58
			removeEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));
59
		}
60
		return removeEdgeCommands.canExecute();
39
	}
61
	}
40
62
41
	/**
63
	/**
Lines 50-55 Link Here
50
	 */
72
	 */
51
	public void execute() {
73
	public void execute() {
52
		parentView.removeChild(childView);
74
		parentView.removeChild(childView);
75
		removeEdgeCommands.execute();
76
		sweepElement();
77
	}
78
79
	/**
80
	 * @generated
81
	 */
82
	protected void sweepElement() {
83
		if (childView.isSetElement()) {
84
			domainElement = childView.getElement();
85
			childView.setElement(null);
86
		}
53
	}
87
	}
54
88
55
	/**
89
	/**
Lines 63-69 Link Here
63
	 * @generated
97
	 * @generated
64
	 */
98
	 */
65
	public void undo() {
99
	public void undo() {
100
		restoreElement();
101
		removeEdgeCommands.undo();
66
		parentView.insertChild(childView);
102
		parentView.insertChild(childView);
67
	}
103
	}
104
105
	/**
106
	 * @generated
107
	 */
108
	protected void restoreElement() {
109
		if (childView.isSetElement()) {
110
			childView.setElement(domainElement);
111
		}
112
	}
113
114
	/**
115
	 * @generated
116
	 */
117
	protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getChildView() {
118
		return childView;
119
	}
120
121
	/**
122
	 * @generated
123
	 */
124
	protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getParent() {
125
		return parentView;
126
	}
68
}
127
}
69
<%importManager.emitSortedImports();%>
128
<%importManager.emitSortedImports();%>
(-)templates/commands/CreateNotationalElementCommand.javajet (+7 lines)
Lines 48-53 Link Here
48
	/**
48
	/**
49
	 * @generated
49
	 * @generated
50
	 */
50
	 */
51
	protected final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> getParent() {
52
		return parent;
53
	}
54
55
	/**
56
	 * @generated
57
	 */
51
	public boolean canExecute() {
58
	public boolean canExecute() {
52
		return createdView != null;
59
		return createdView != null;
53
	}
60
	}
(-)templates/commands/ReplaceNotationalElementCommand.javajet (-12 / +18 lines)
Lines 33-39 Link Here
33
	public ReplaceNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, CreateNotationalElementCommand createCommand, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView) {
33
	public ReplaceNotationalElementCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, CreateNotationalElementCommand createCommand, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView) {
34
		this.createCommand = createCommand;
34
		this.createCommand = createCommand;
35
		this.obsoleteView = obsoleteView;
35
		this.obsoleteView = obsoleteView;
36
		this.removeCommand = new RemoveNotationalElementCommand(parentView, obsoleteView);
36
		this.removeCommand = obsoleteView instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> ? new RemoveNotationalEdgeCommand(parentView, obsoleteView) : new RemoveNotationalElementCommand(parentView, obsoleteView);
37
	}
37
	}
38
38
39
	/**
39
	/**
Lines 57-71 Link Here
57
		createCommand.execute();
57
		createCommand.execute();
58
		removeCommand.execute();
58
		removeCommand.execute();
59
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView();
59
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView();
60
		createdView.getSourceEdges().addAll(obsoleteView.getSourceEdges());
60
//		createdView.getSourceEdges().addAll(obsoleteView.getSourceEdges());
61
		createdView.getTargetEdges().addAll(obsoleteView.getTargetEdges());
61
//		createdView.getTargetEdges().addAll(obsoleteView.getTargetEdges());
62
		if (createdView == null || obsoleteView == null || !createdView.eClass().equals(obsoleteView.eClass())) {
62
		if (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {
63
			return;
63
			if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) {
64
		}
64
				copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint());
65
		if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) {
65
			} else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) {
66
			copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint());
66
				copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints());
67
		} else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) {
67
			}
68
			copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints());
69
		}
68
		}
70
	}
69
	}
71
70
Lines 89-96 Link Here
89
	 */
88
	 */
90
	public void undo() {
89
	public void undo() {
91
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView();
90
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> createdView = createCommand.getCreatedView();
92
		obsoleteView.getSourceEdges().addAll(createdView.getSourceEdges());
91
		if (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {
93
		obsoleteView.getTargetEdges().addAll(createdView.getTargetEdges());
92
			if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode().equals(createdView.eClass())) {
93
				copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getNode_LayoutConstraint());
94
			} else if (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge().equals(createdView.eClass())) {
95
				copy(obsoleteView, createdView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getEdge_Bendpoints());
96
			}
97
		}
98
//		obsoleteView.getSourceEdges().addAll(createdView.getSourceEdges());
99
//		obsoleteView.getTargetEdges().addAll(createdView.getTargetEdges());
94
		removeCommand.undo();
100
		removeCommand.undo();
95
		createCommand.undo();
101
		createCommand.undo();
96
	}
102
	}
(-)src/org/eclipse/gmf/internal/codegen/lite/Generator.java (+2 lines)
Lines 144-150 Link Here
144
			generateExpressionProviders();
144
			generateExpressionProviders();
145
		}
145
		}
146
		internalGenerateJavaClass(myEmitters.getCreateNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "CreateNotationalElementCommand", myDiagram);
146
		internalGenerateJavaClass(myEmitters.getCreateNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "CreateNotationalElementCommand", myDiagram);
147
		internalGenerateJavaClass(myEmitters.getCreateNotationalEdgeCommandGenerator(), myDiagram.getEditCommandsPackageName(), "CreateNotationalEdgeCommand", myDiagram);
147
		internalGenerateJavaClass(myEmitters.getRemoveNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "RemoveNotationalElementCommand", myDiagram);
148
		internalGenerateJavaClass(myEmitters.getRemoveNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "RemoveNotationalElementCommand", myDiagram);
149
		internalGenerateJavaClass(myEmitters.getRemoveNotationalEdgeCommandGenerator(), myDiagram.getEditCommandsPackageName(), "RemoveNotationalEdgeCommand", myDiagram);
148
		internalGenerateJavaClass(myEmitters.getReplaceNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReplaceNotationalElementCommand", myDiagram);
150
		internalGenerateJavaClass(myEmitters.getReplaceNotationalElementCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReplaceNotationalElementCommand", myDiagram);
149
		internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeSourceCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeSourceCommand", myDiagram);
151
		internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeSourceCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeSourceCommand", myDiagram);
150
		internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeTargetCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeTargetCommand", myDiagram);
152
		internalGenerateJavaClass(myEmitters.getReconnectNotationalEdgeTargetCommandGenerator(), myDiagram.getEditCommandsPackageName(), "ReconnectNotationalEdgeTargetCommand", myDiagram);
(-)src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java (+12 lines)
Lines 24-32 Link Here
24
import org.eclipse.gmf.internal.common.codegen.JETEmitterAdapter;
24
import org.eclipse.gmf.internal.common.codegen.JETEmitterAdapter;
25
import org.eclipse.gmf.internal.common.codegen.TextEmitter;
25
import org.eclipse.gmf.internal.common.codegen.TextEmitter;
26
26
27
import org.eclipse.gmf.codegen.templates.lite.commands.CreateNotationalEdgeCommandGenerator;
27
import org.eclipse.gmf.codegen.templates.lite.commands.CreateNotationalElementCommandGenerator;
28
import org.eclipse.gmf.codegen.templates.lite.commands.CreateNotationalElementCommandGenerator;
28
import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeSourceCommandGenerator;
29
import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeSourceCommandGenerator;
29
import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeTargetCommandGenerator;
30
import org.eclipse.gmf.codegen.templates.lite.commands.ReconnectNotationalEdgeTargetCommandGenerator;
31
import org.eclipse.gmf.codegen.templates.lite.commands.RemoveNotationalEdgeCommandGenerator;
30
import org.eclipse.gmf.codegen.templates.lite.commands.RemoveNotationalElementCommandGenerator;
32
import org.eclipse.gmf.codegen.templates.lite.commands.RemoveNotationalElementCommandGenerator;
31
import org.eclipse.gmf.codegen.templates.lite.commands.ReplaceNotationalElementCommandGenerator;
33
import org.eclipse.gmf.codegen.templates.lite.commands.ReplaceNotationalElementCommandGenerator;
32
import org.eclipse.gmf.codegen.templates.lite.editor.ActionBarContributorGenerator;
34
import org.eclipse.gmf.codegen.templates.lite.editor.ActionBarContributorGenerator;
Lines 129-137 Link Here
129
		put(tr, "/expressions/OCLExpressionFactory.javajet", OCLExpressionFactoryGenerator.class);
131
		put(tr, "/expressions/OCLExpressionFactory.javajet", OCLExpressionFactoryGenerator.class);
130
		put(tr, "/expressions/RegexpExpressionFactory.javajet", RegexpExpressionFactoryGenerator.class);
132
		put(tr, "/expressions/RegexpExpressionFactory.javajet", RegexpExpressionFactoryGenerator.class);
131
		put(tr, "/commands/CreateNotationalElementCommand.javajet", CreateNotationalElementCommandGenerator.class);
133
		put(tr, "/commands/CreateNotationalElementCommand.javajet", CreateNotationalElementCommandGenerator.class);
134
		put(tr, "/commands/CreateNotationalEdgeCommand.javajet", CreateNotationalEdgeCommandGenerator.class);
132
		put(tr, "/commands/ReconnectNotationalEdgeSourceCommand.javajet", ReconnectNotationalEdgeSourceCommandGenerator.class);
135
		put(tr, "/commands/ReconnectNotationalEdgeSourceCommand.javajet", ReconnectNotationalEdgeSourceCommandGenerator.class);
133
		put(tr, "/commands/ReconnectNotationalEdgeTargetCommand.javajet", ReconnectNotationalEdgeTargetCommandGenerator.class);
136
		put(tr, "/commands/ReconnectNotationalEdgeTargetCommand.javajet", ReconnectNotationalEdgeTargetCommandGenerator.class);
134
		put(tr, "/commands/RemoveNotationalElementCommand.javajet", RemoveNotationalElementCommandGenerator.class);
137
		put(tr, "/commands/RemoveNotationalElementCommand.javajet", RemoveNotationalElementCommandGenerator.class);
138
		put(tr, "/commands/RemoveNotationalEdgeCommand.javajet", RemoveNotationalEdgeCommandGenerator.class);
135
		put(tr, "/commands/ReplaceNotationalElementCommand.javajet", ReplaceNotationalElementCommandGenerator.class);
139
		put(tr, "/commands/ReplaceNotationalElementCommand.javajet", ReplaceNotationalElementCommandGenerator.class);
136
		return tr;
140
		return tr;
137
	}
141
	}
Lines 276-285 Link Here
276
		return retrieve(CreateNotationalElementCommandGenerator.class);
280
		return retrieve(CreateNotationalElementCommandGenerator.class);
277
	}
281
	}
278
282
283
	public TextEmitter getCreateNotationalEdgeCommandGenerator() throws UnexpectedBehaviourException {
284
		return retrieve(CreateNotationalEdgeCommandGenerator.class);
285
	}
286
279
	public TextEmitter getRemoveNotationalElementCommandGenerator() throws UnexpectedBehaviourException {
287
	public TextEmitter getRemoveNotationalElementCommandGenerator() throws UnexpectedBehaviourException {
280
		return retrieve(RemoveNotationalElementCommandGenerator.class);
288
		return retrieve(RemoveNotationalElementCommandGenerator.class);
281
	}
289
	}
282
290
291
	public TextEmitter getRemoveNotationalEdgeCommandGenerator() throws UnexpectedBehaviourException {
292
		return retrieve(RemoveNotationalEdgeCommandGenerator.class);
293
	}
294
283
	public TextEmitter getReplaceNotationalElementCommandGenerator() throws UnexpectedBehaviourException {
295
	public TextEmitter getReplaceNotationalElementCommandGenerator() throws UnexpectedBehaviourException {
284
		return retrieve(ReplaceNotationalElementCommandGenerator.class);
296
		return retrieve(ReplaceNotationalElementCommandGenerator.class);
285
	}
297
	}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalElementCommandGenerator.java (-7 / +37 lines)
Lines 19-28 Link Here
19
  protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class RemoveNotationalElementCommand extends ";
19
  protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class RemoveNotationalElementCommand extends ";
20
  protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
20
  protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
21
  protected final String TEXT_5 = " childView;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
21
  protected final String TEXT_5 = " childView;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
22
  protected final String TEXT_6 = " parentView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic RemoveNotationalElementCommand(";
22
  protected final String TEXT_6 = " parentView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
23
  protected final String TEXT_7 = " parentView, ";
23
  protected final String TEXT_7 = " domainElement;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
24
  protected final String TEXT_8 = " childView) {" + NL + "\t\tthis.parentView = parentView;" + NL + "\t\tthis.childView = childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn parentView.getChildren().contains(childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparentView.removeChild(childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tparentView.insertChild(childView);" + NL + "\t}" + NL + "}";
24
  protected final String TEXT_8 = " removeEdgeCommands;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic RemoveNotationalElementCommand(";
25
  protected final String TEXT_9 = NL;
25
  protected final String TEXT_9 = " parentView, ";
26
  protected final String TEXT_10 = " childView) {" + NL + "\t\tthis.parentView = parentView;" + NL + "\t\tthis.childView = childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean prepare() {" + NL + "\t\tif (!parentView.getChildren().contains(childView)) {" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\tremoveEdgeCommands = new ";
27
  protected final String TEXT_11 = "();" + NL + "\t\tfor(";
28
  protected final String TEXT_12 = " it = childView.getSourceEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
29
  protected final String TEXT_13 = " next = (";
30
  protected final String TEXT_14 = ") it.next();" + NL + "\t\t\tremoveEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));" + NL + "\t\t}" + NL + "\t\tfor(Iterator it = childView.getTargetEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
31
  protected final String TEXT_15 = " next = (";
32
  protected final String TEXT_16 = ") it.next();" + NL + "\t\t\tremoveEdgeCommands.append(new RemoveNotationalEdgeCommand(childView.getDiagram(), next));" + NL + "\t\t}" + NL + "\t\treturn removeEdgeCommands.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparentView.removeChild(childView);" + NL + "\t\tremoveEdgeCommands.execute();" + NL + "\t\tsweepElement();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void sweepElement() {" + NL + "\t\tif (childView.isSetElement()) {" + NL + "\t\t\tdomainElement = childView.getElement();" + NL + "\t\t\tchildView.setElement(null);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\trestoreElement();" + NL + "\t\tremoveEdgeCommands.undo();" + NL + "\t\tparentView.insertChild(childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void restoreElement() {" + NL + "\t\tif (childView.isSetElement()) {" + NL + "\t\t\tchildView.setElement(domainElement);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final ";
33
  protected final String TEXT_17 = " getChildView() {" + NL + "\t\treturn childView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final ";
34
  protected final String TEXT_18 = " getParent() {" + NL + "\t\treturn parentView;" + NL + "\t}" + NL + "}";
35
  protected final String TEXT_19 = NL;
26
36
27
  public String generate(Object argument)
37
  public String generate(Object argument)
28
  {
38
  {
Lines 43-54 Link Here
43
    stringBuffer.append(TEXT_5);
53
    stringBuffer.append(TEXT_5);
44
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
54
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
45
    stringBuffer.append(TEXT_6);
55
    stringBuffer.append(TEXT_6);
46
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
56
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
47
    stringBuffer.append(TEXT_7);
57
    stringBuffer.append(TEXT_7);
48
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
58
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
49
    stringBuffer.append(TEXT_8);
59
    stringBuffer.append(TEXT_8);
50
    importManager.emitSortedImports();
60
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
51
    stringBuffer.append(TEXT_9);
61
    stringBuffer.append(TEXT_9);
62
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
63
    stringBuffer.append(TEXT_10);
64
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
65
    stringBuffer.append(TEXT_11);
66
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
67
    stringBuffer.append(TEXT_12);
68
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
69
    stringBuffer.append(TEXT_13);
70
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
71
    stringBuffer.append(TEXT_14);
72
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
73
    stringBuffer.append(TEXT_15);
74
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
75
    stringBuffer.append(TEXT_16);
76
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
77
    stringBuffer.append(TEXT_17);
78
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
79
    stringBuffer.append(TEXT_18);
80
    importManager.emitSortedImports();
81
    stringBuffer.append(TEXT_19);
52
    return stringBuffer.toString();
82
    return stringBuffer.toString();
53
  }
83
  }
54
}
84
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalElementCommandGenerator.java (-3 / +6 lines)
Lines 22-29 Link Here
22
  protected final String TEXT_6 = " createdView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic CreateNotationalElementCommand(";
22
  protected final String TEXT_6 = " createdView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic CreateNotationalElementCommand(";
23
  protected final String TEXT_7 = " parent) {" + NL + "\t\tthis.parent = parent;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final void setCreatedView(";
23
  protected final String TEXT_7 = " parent) {" + NL + "\t\tthis.parent = parent;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final void setCreatedView(";
24
  protected final String TEXT_8 = " view) {" + NL + "\t\tthis.createdView = view;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
24
  protected final String TEXT_8 = " view) {" + NL + "\t\tthis.createdView = view;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
25
  protected final String TEXT_9 = " getCreatedView() {" + NL + "\t\treturn createdView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createdView != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparent.insertChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tparent.removeChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}";
25
  protected final String TEXT_9 = " getCreatedView() {" + NL + "\t\treturn createdView;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected final ";
26
  protected final String TEXT_10 = NL;
26
  protected final String TEXT_10 = " getParent() {" + NL + "\t\treturn parent;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createdView != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn true;" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tparent.insertChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\tparent.removeChild(createdView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}";
27
  protected final String TEXT_11 = NL;
27
28
28
  public String generate(Object argument)
29
  public String generate(Object argument)
29
  {
30
  {
Lines 50-57 Link Here
50
    stringBuffer.append(TEXT_8);
51
    stringBuffer.append(TEXT_8);
51
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
52
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
52
    stringBuffer.append(TEXT_9);
53
    stringBuffer.append(TEXT_9);
53
    importManager.emitSortedImports();
54
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
54
    stringBuffer.append(TEXT_10);
55
    stringBuffer.append(TEXT_10);
56
    importManager.emitSortedImports();
57
    stringBuffer.append(TEXT_11);
55
    return stringBuffer.toString();
58
    return stringBuffer.toString();
56
  }
59
  }
57
}
60
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/commands/ReplaceNotationalElementCommandGenerator.java (-22 / +37 lines)
Lines 20-40 Link Here
20
  protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final CreateNotationalElementCommand createCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final RemoveNotationalElementCommand removeCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
20
  protected final String TEXT_4 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final CreateNotationalElementCommand createCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final RemoveNotationalElementCommand removeCommand;" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
21
  protected final String TEXT_5 = " obsoleteView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ReplaceNotationalElementCommand(";
21
  protected final String TEXT_5 = " obsoleteView;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ReplaceNotationalElementCommand(";
22
  protected final String TEXT_6 = " parentView, CreateNotationalElementCommand createCommand, ";
22
  protected final String TEXT_6 = " parentView, CreateNotationalElementCommand createCommand, ";
23
  protected final String TEXT_7 = " obsoleteView) {" + NL + "\t\tthis.createCommand = createCommand;" + NL + "\t\tthis.obsoleteView = obsoleteView;" + NL + "\t\tthis.removeCommand = new RemoveNotationalElementCommand(parentView, obsoleteView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createCommand != null && createCommand.canExecute() && removeCommand != null && removeCommand.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn createCommand != null && createCommand.canUndo() && removeCommand != null && removeCommand.canUndo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tcreateCommand.execute();" + NL + "\t\tremoveCommand.execute();" + NL + "\t\t";
23
  protected final String TEXT_7 = " obsoleteView) {" + NL + "\t\tthis.createCommand = createCommand;" + NL + "\t\tthis.obsoleteView = obsoleteView;" + NL + "\t\tthis.removeCommand = obsoleteView instanceof ";
24
  protected final String TEXT_8 = " createdView = createCommand.getCreatedView();" + NL + "\t\tcreatedView.getSourceEdges().addAll(obsoleteView.getSourceEdges());" + NL + "\t\tcreatedView.getTargetEdges().addAll(obsoleteView.getTargetEdges());" + NL + "\t\tif (createdView == null || obsoleteView == null || !createdView.eClass().equals(obsoleteView.eClass())) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (";
24
  protected final String TEXT_8 = " ? new RemoveNotationalEdgeCommand(parentView, obsoleteView) : new RemoveNotationalElementCommand(parentView, obsoleteView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn createCommand != null && createCommand.canExecute() && removeCommand != null && removeCommand.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn createCommand != null && createCommand.canUndo() && removeCommand != null && removeCommand.canUndo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\tcreateCommand.execute();" + NL + "\t\tremoveCommand.execute();" + NL + "\t\t";
25
  protected final String TEXT_9 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\tcopy(obsoleteView, createdView, ";
25
  protected final String TEXT_9 = " createdView = createCommand.getCreatedView();" + NL + "//\t\tcreatedView.getSourceEdges().addAll(obsoleteView.getSourceEdges());" + NL + "//\t\tcreatedView.getTargetEdges().addAll(obsoleteView.getTargetEdges());" + NL + "\t\tif (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {" + NL + "\t\t\tif (";
26
  protected final String TEXT_10 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t} else if (";
26
  protected final String TEXT_10 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, ";
27
  protected final String TEXT_11 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\tcopy(obsoleteView, createdView, ";
27
  protected final String TEXT_11 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t\t} else if (";
28
  protected final String TEXT_12 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void copy(";
28
  protected final String TEXT_12 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, ";
29
  protected final String TEXT_13 = " source, ";
29
  protected final String TEXT_13 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void copy(";
30
  protected final String TEXT_14 = " target, ";
30
  protected final String TEXT_14 = " source, ";
31
  protected final String TEXT_15 = " feature) {" + NL + "\t\t";
31
  protected final String TEXT_15 = " target, ";
32
  protected final String TEXT_16 = " oldValue = (";
32
  protected final String TEXT_16 = " feature) {" + NL + "\t\t";
33
  protected final String TEXT_17 = ") source.eGet(feature);" + NL + "\t\tif (oldValue == null) {" + NL + "\t\t\treturn;\t//nothing to copy" + NL + "\t\t}" + NL + "\t\t";
33
  protected final String TEXT_17 = " oldValue = (";
34
  protected final String TEXT_18 = " newValue = (";
34
  protected final String TEXT_18 = ") source.eGet(feature);" + NL + "\t\tif (oldValue == null) {" + NL + "\t\t\treturn;\t//nothing to copy" + NL + "\t\t}" + NL + "\t\t";
35
  protected final String TEXT_19 = ") target.eGet(feature);" + NL + "\t\tif (newValue != null && !newValue.eClass().equals(oldValue.eClass())) {" + NL + "\t\t\treturn;\t//incompatible instances." + NL + "\t\t}" + NL + "\t\ttarget.eSet(feature, oldValue);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\t";
35
  protected final String TEXT_19 = " newValue = (";
36
  protected final String TEXT_20 = " createdView = createCommand.getCreatedView();" + NL + "\t\tobsoleteView.getSourceEdges().addAll(createdView.getSourceEdges());" + NL + "\t\tobsoleteView.getTargetEdges().addAll(createdView.getTargetEdges());" + NL + "\t\tremoveCommand.undo();" + NL + "\t\tcreateCommand.undo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}";
36
  protected final String TEXT_20 = ") target.eGet(feature);" + NL + "\t\tif (newValue != null && !newValue.eClass().equals(oldValue.eClass())) {" + NL + "\t\t\treturn;\t//incompatible instances." + NL + "\t\t}" + NL + "\t\ttarget.eSet(feature, oldValue);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\t";
37
  protected final String TEXT_21 = NL;
37
  protected final String TEXT_21 = " createdView = createCommand.getCreatedView();" + NL + "\t\tif (createdView != null && obsoleteView != null && createdView.eClass().equals(obsoleteView.eClass())) {" + NL + "\t\t\tif (";
38
  protected final String TEXT_22 = ".eINSTANCE.getNode().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, ";
39
  protected final String TEXT_23 = ".eINSTANCE.getNode_LayoutConstraint());" + NL + "\t\t\t} else if (";
40
  protected final String TEXT_24 = ".eINSTANCE.getEdge().equals(createdView.eClass())) {" + NL + "\t\t\t\tcopy(obsoleteView, createdView, ";
41
  protected final String TEXT_25 = ".eINSTANCE.getEdge_Bendpoints());" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "//\t\tobsoleteView.getSourceEdges().addAll(createdView.getSourceEdges());" + NL + "//\t\tobsoleteView.getTargetEdges().addAll(createdView.getTargetEdges());" + NL + "\t\tremoveCommand.undo();" + NL + "\t\tcreateCommand.undo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\texecute();" + NL + "\t}" + NL + "}";
42
  protected final String TEXT_26 = NL;
38
43
39
  public String generate(Object argument)
44
  public String generate(Object argument)
40
  {
45
  {
Lines 57-65 Link Here
57
    stringBuffer.append(TEXT_6);
62
    stringBuffer.append(TEXT_6);
58
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
63
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
59
    stringBuffer.append(TEXT_7);
64
    stringBuffer.append(TEXT_7);
60
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
65
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
61
    stringBuffer.append(TEXT_8);
66
    stringBuffer.append(TEXT_8);
62
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
67
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
63
    stringBuffer.append(TEXT_9);
68
    stringBuffer.append(TEXT_9);
64
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
69
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
65
    stringBuffer.append(TEXT_10);
70
    stringBuffer.append(TEXT_10);
Lines 67-79 Link Here
67
    stringBuffer.append(TEXT_11);
72
    stringBuffer.append(TEXT_11);
68
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
73
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
69
    stringBuffer.append(TEXT_12);
74
    stringBuffer.append(TEXT_12);
70
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
75
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
71
    stringBuffer.append(TEXT_13);
76
    stringBuffer.append(TEXT_13);
72
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
77
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
73
    stringBuffer.append(TEXT_14);
78
    stringBuffer.append(TEXT_14);
74
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
75
    stringBuffer.append(TEXT_15);
76
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
79
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
80
    stringBuffer.append(TEXT_15);
81
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
77
    stringBuffer.append(TEXT_16);
82
    stringBuffer.append(TEXT_16);
78
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
83
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
79
    stringBuffer.append(TEXT_17);
84
    stringBuffer.append(TEXT_17);
Lines 81-90 Link Here
81
    stringBuffer.append(TEXT_18);
86
    stringBuffer.append(TEXT_18);
82
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
87
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
83
    stringBuffer.append(TEXT_19);
88
    stringBuffer.append(TEXT_19);
84
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
89
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
85
    stringBuffer.append(TEXT_20);
90
    stringBuffer.append(TEXT_20);
86
    importManager.emitSortedImports();
91
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
87
    stringBuffer.append(TEXT_21);
92
    stringBuffer.append(TEXT_21);
93
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
94
    stringBuffer.append(TEXT_22);
95
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
96
    stringBuffer.append(TEXT_23);
97
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
98
    stringBuffer.append(TEXT_24);
99
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
100
    stringBuffer.append(TEXT_25);
101
    importManager.emitSortedImports();
102
    stringBuffer.append(TEXT_26);
88
    return stringBuffer.toString();
103
    return stringBuffer.toString();
89
  }
104
  }
90
}
105
}
(-)templates/parts/linkNotationModelRefresher.jetinc (+526 lines)
Added Link Here
1
<%
2
if (myHelper.containsLinks() || _includeUncontainedLinks) {
3
%>
4
	/**
5
	 * @generated
6
	 */
7
	private void installLinkNotationModelRefresher() {
8
		LinkNotationModelRefresher refresher = getLinkNotationModelRefresher();
9
		if (refresher.isInstalled()) {
10
			return;
11
		}
12
		<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=_getDiagramCode%>.getElement());
13
		refresher.install(domainModelEditDomain);
14
		refreshLinkNotationModel();
15
	}
16
17
	/**
18
	 * @generated
19
	 */
20
	private void uninstallLinkNotationModelRefresher() {
21
		getLinkNotationModelRefresher().uninstall();
22
	}
23
24
	/**
25
	 * @generated
26
	 */
27
	private LinkNotationModelRefresher linkNotationModelRefresher;
28
29
	/**
30
	 * @generated
31
	 */
32
	private LinkNotationModelRefresher getLinkNotationModelRefresher() {
33
		if (linkNotationModelRefresher == null) {
34
			linkNotationModelRefresher = new LinkNotationModelRefresher();
35
		}
36
		return linkNotationModelRefresher;
37
	}
38
39
	/**
40
	 * @generated
41
	 */
42
	private class LinkNotationModelRefresher extends <%=importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")%> {
43
		/**
44
		 * @generated
45
		 */
46
		private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> filter;
47
		/**
48
		 * @generated
49
		 */
50
		private <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain;
51
52
		/**
53
		 * @generated
54
		 */
55
		public LinkNotationModelRefresher() {
56
			createFilter();
57
		}
58
<%
59
	boolean hasConstraintsInContainedLinks = false;
60
	for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
61
		GenLink nextLink = (GenLink) it.next();
62
		TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
63
		if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
64
			hasConstraintsInContainedLinks = true;
65
			break;
66
		}
67
	}
68
	if (hasConstraintsInContainedLinks) {
69
%>
70
71
		/**
72
		 * NB: Child links of this element are selected based on constraint declared in <%=genDiagram.getVisualIDRegistryQualifiedClassName()%>. 
73
		 * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in 
74
		 * notational model having to be updated.
75
		 * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications
76
		 * result in such an update.
77
		 * @generated
78
		 */
79
		private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> getConstrainedChildLinksFilter() {
80
			return <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.NOT_TOUCH;
81
		}
82
<%
83
	}
84
	if (_includeUncontainedLinks) {
85
%>
86
		/**
87
		 * Creates a notification filter which filters notifications that may possibly result in uncontained links. 
88
		 * @generated
89
		 */
90
		private <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> createUncontainedLinksFilter() {
91
			return <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.SET).or(
92
				<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.UNSET).or(
93
				<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.REMOVE).or(
94
				<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createEventTypeFilter(<%=importManager.getImportedName("org.eclipse.emf.common.notify.Notification")%>.REMOVE_MANY)
95
			)));
96
		}
97
<%
98
	}
99
%>
100
		/**
101
		 * Creates a notification filter which filters notifications that may possibly affect the notational model
102
		 * @generated
103
		 */
104
		private void createFilter() {
105
<%
106
	{
107
		boolean hasDeclaredFilter = false;
108
		Set genAffectingFeatures = new LinkedHashSet();
109
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
110
			GenLink nextLink = (GenLink) it.next();
111
			TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
112
			if (modelFacet == null) {
113
				continue;
114
			}
115
			GenFeature _feature = modelFacet.getChildMetaFeature();
116
%>
117
<%@ include file="notificationFilter.jetinc" %>
118
<%
119
			_feature = modelFacet.getSourceMetaFeature();
120
%>
121
<%@ include file="notificationFilter.jetinc" %>
122
<%
123
			_feature = modelFacet.getTargetMetaFeature();
124
%>
125
<%@ include file="notificationFilter.jetinc" %>
126
<%
127
		}
128
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
129
			GenLink nextLink = (GenLink) it.next();
130
			GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature();
131
%>
132
<%@ include file="notificationFilter.jetinc" %>
133
<%
134
		}
135
		if (hasConstraintsInContainedLinks) {
136
			if (hasDeclaredFilter) {
137
%>
138
			filter = getConstrainedChildLinksFilter().or(filter);
139
<%
140
			} else {
141
				hasDeclaredFilter = true;
142
%>
143
			filter = getConstrainedChildLinksFilter();
144
<%
145
			}
146
		}
147
		if (_includeUncontainedLinks) {
148
			if (hasDeclaredFilter) {
149
%>
150
			filter = filter.or(createUncontainedLinksFilter());
151
<%
152
			} else {
153
				hasDeclaredFilter = true;
154
%>
155
			filter = createUncontainedLinksFilter();
156
<%
157
			}
158
		}
159
		if (!hasDeclaredFilter) {
160
%>
161
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.ANY.negated();
162
<%
163
		}
164
	}	//local declaration of hasDeclaredFilter
165
%>
166
		}
167
		/**
168
		 * @generated
169
		 */
170
		public void install(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) {
171
			if (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {
172
				throw new IllegalStateException("Already listening to another editing domain");
173
			}
174
			this.editingDomain = editingDomain;
175
			this.editingDomain.addResourceSetListener(this);
176
		}
177
		/**
178
		 * @generated
179
		 */
180
		public boolean isInstalled() {
181
			return editingDomain != null;
182
		}
183
184
		/**
185
		 * @generated
186
		 */
187
		public void uninstall() {
188
			if (isInstalled()) {
189
				editingDomain.removeResourceSetListener(this);
190
				editingDomain = null;
191
			}
192
		}
193
194
		/**
195
		 * @generated
196
		 */
197
		public boolean isPrecommitOnly() {
198
			return true;
199
		}
200
		/**
201
		 * @generated
202
		 */
203
		public <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> transactionAboutToCommit(<%=importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")%> event) {
204
			return getRefreshLinkNotationModelCommand();
205
		}
206
		/**
207
		 * @generated
208
		 */
209
		public <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%> getFilter() {
210
			return filter;
211
		}
212
	}
213
214
	/**
215
	 * @generated
216
	 */
217
	protected void refreshLinkNotationModel() {
218
		<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> command = getRefreshLinkNotationModelCommand();
219
		if (command == null) {
220
			return;
221
		}
222
		<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=_getDiagramCode%>.getElement());
223
		getViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));
224
	}
225
226
<%@include file="linkDescriptor.jetinc"%>
227
228
	/**
229
	 * @generated
230
	 */
231
	private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> getRefreshLinkNotationModelCommand() {
232
		<%=importManager.getImportedName("java.util.List")%>/*<LinkDescriptor>*/ semanticChildLinks = getSemanticChildLinks();
233
		<%=importManager.getImportedName("java.util.List")%>/*<Edge>*/ notationalChildLinks = getNotationalChildLinks();
234
		final <%=importManager.getImportedName("java.util.Map")%> semanticToNotationalTypeBasedLinks = new <%=importManager.getImportedName("java.util.HashMap")%>();
235
		final <%=importManager.getImportedName("java.util.Map")%>/*<EObject, List<Edge>>*/ semanticToNotationalFeatureBasedLinks = new <%=importManager.getImportedName("java.util.HashMap")%>();
236
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = notationalChildLinks.iterator(); it.hasNext(); ) {
237
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next();
238
			<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextSemantic = next.getElement();
239
			if (nextSemantic != null) {
240
				semanticToNotationalTypeBasedLinks.put(nextSemantic, next);
241
			} else {
242
				<%=importManager.getImportedName("java.util.List")%> featureBasedLinksForSource = (<%=importManager.getImportedName("java.util.List")%>) semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());
243
				if (featureBasedLinksForSource == null) {
244
					featureBasedLinksForSource = new <%=importManager.getImportedName("java.util.LinkedList")%>();
245
					semanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);
246
				}
247
				featureBasedLinksForSource.add(next);
248
			}
249
		}
250
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView = <%=_getDiagramCode%>;
251
		<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> command = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
252
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticChildLinks.iterator(); it.hasNext(); ) {
253
			LinkDescriptor next = (LinkDescriptor) it.next();
254
			<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextLinkElement = next.getLinkElement();
255
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> currentEdge;
256
			if (nextLinkElement != null) {
257
				currentEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) semanticToNotationalTypeBasedLinks.remove(nextLinkElement);
258
			} else {
259
				<%=importManager.getImportedName("java.util.List")%> featureBasedLinksForSource = (<%=importManager.getImportedName("java.util.List")%>) semanticToNotationalFeatureBasedLinks.get(next.getSource());
260
				if (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {
261
					currentEdge = null;
262
				} else {
263
					currentEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) featureBasedLinksForSource.remove(0);
264
				}
265
			}
266
			int linkVisualID = next.getVisualID();
267
			if (currentEdge == null) {
268
				if (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {
269
					command.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));
270
				}
271
			} else {
272
				boolean changedSource = currentEdge.getSource().getElement() != next.getSource();
273
				boolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();
274
				boolean changedVID = linkVisualID != <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(currentEdge);
275
				if (!changedSource && !changedTarget) {
276
					if (changedVID) {
277
						<%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%> notationalCommand = getCreateNotationalEdgeCommand(parentView, next);
278
						if (notationalCommand != null) {
279
							command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")%>(parentView, notationalCommand, currentEdge));
280
						} else {
281
							command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, currentEdge));
282
						}
283
					}
284
				} else {
285
					if (changedVID) {
286
						command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, currentEdge));
287
						command.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));
288
					} else {
289
						<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> newSourceView = findView(next.getSource());
290
						if (changedSource && newSourceView != null) {
291
							command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")%>(currentEdge, newSourceView));
292
						}
293
						<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> newTargetView = findView(next.getDestination());
294
						if (changedTarget && newTargetView != null) {
295
							command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")%>(currentEdge, newTargetView));
296
						}
297
					}
298
				}
299
			}
300
		}
301
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {
302
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next();
303
			command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, obsoleteView));
304
		}
305
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {
306
			<%=importManager.getImportedName("java.util.List")%> obsoleteViews = (<%=importManager.getImportedName("java.util.List")%>) it.next();
307
			for(<%=importManager.getImportedName("java.util.Iterator")%> obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {
308
				<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> obsoleteView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) obsoleteViewsIt.next();
309
				command.appendIfCanExecute(new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")%>(parentView, obsoleteView));
310
			}
311
		}
312
		return command.getCommandList().isEmpty() ? null : command;
313
	}
314
315
	/**
316
	 * Finds a notational element that corresponds to the given underlying domain element. 
317
	 * @generated
318
	 */
319
	private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findView(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) {
320
		if (modelElement == null) {
321
			return null;
322
		}
323
		<%=importManager.getImportedName("org.eclipse.gef.EditPart")%> editPart = (<%=importManager.getImportedName("org.eclipse.gef.EditPart")%>) getViewer().getEditPartRegistry().get(modelElement);
324
		if (editPart != null && editPart.getModel() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) {
325
			return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) editPart.getModel();
326
		}
327
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView = findView(modelElement.eContainer());
328
		if (parentView != null) {
329
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> result = findNode(parentView, modelElement);
330
			if (result != null) {
331
				return result;
332
			}
333
		}
334
		return findEdge(modelElement);
335
	}
336
	
337
	/**
338
	 * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. 
339
	 * @generated
340
	 */
341
	private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findNode(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) {
342
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = parentView.getChildren().iterator(); it.hasNext(); ) {
343
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next();
344
			if (!next.isSetElement() || next.getElement() == parentView) {
345
				<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> result = findNode(next, modelElement);
346
				if (result != null) {
347
					return result;
348
				}
349
			}
350
			if (next.isSetElement() && next.getElement() == modelElement) {
351
				return next;
352
			}
353
		}
354
		return null;
355
	}
356
357
	/**
358
	 * Finds a notational edge that corresponds to the given underlying domain element. 
359
	 * @generated
360
	 */
361
	private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> findEdge(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelElement) {
362
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%=_getDiagramCode%>.getEdges().iterator(); it.hasNext(); ) {
363
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next();
364
			if (next.isSetElement() && next.getElement() == modelElement) {
365
				return next;
366
			}
367
		}
368
		return null;
369
	}
370
371
	/**
372
	 * @generated
373
	 */
374
	private <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%> getCreateNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, LinkDescriptor linkDescriptor) {
375
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> sourceView = findView(linkDescriptor.getSource());
376
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> targetView = findView(linkDescriptor.getDestination());
377
		if (sourceView == null || targetView == null) {
378
			return null;
379
		}
380
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createEdge();
381
		switch (linkDescriptor.getVisualID()) {
382
<%
383
	for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
384
		GenLink nextLink = (GenLink) it.next();
385
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
386
		if (modelFacet == null) {
387
			continue;
388
		}
389
%>
390
		case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
391
			if (linkDescriptor.getLinkElement() instanceof <%=importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())%>) {
392
				createdEdge.setElement(linkDescriptor.getLinkElement());
393
				<%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge);
394
			}
395
			break;
396
<%
397
	}
398
	for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
399
		GenLink nextLink = (GenLink) it.next();
400
%>
401
		case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
402
			if (linkDescriptor.getLinkElement() == null) {
403
				createdEdge.setElement(null);
404
				<%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge);
405
			}
406
			break;
407
<%
408
	}
409
%>
410
		}
411
		if (createdEdge.getType() == null) {
412
			return null;
413
		}
414
		return new <%=importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")%>(parentView, createdEdge, sourceView, targetView);
415
	}
416
417
	/**
418
	 * @generated
419
	 */
420
	private <%=importManager.getImportedName("java.util.List")%> getSemanticChildLinks() {
421
<%@include file="semanticChildLinks.jetinc"%>
422
	}
423
424
	/**
425
	 * @generated
426
	 */
427
	private <%=importManager.getImportedName("java.util.List")%> getNotationalChildLinks() {
428
		<%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>();
429
		<%=importManager.getImportedName("java.util.List")%> allLinks = <%=_getDiagramCode%>.getEdges();
430
		for(<%=importManager.getImportedName("java.util.Iterator")%> it = allLinks.iterator(); it.hasNext(); ) {
431
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) it.next();
432
<%
433
	if (_includeUncontainedLinks) {
434
%>
435
			if (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {
436
				result.add(next);
437
				continue;
438
			}
439
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source = next.getSource();
440
			if (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {
441
				result.add(next);
442
				continue;
443
			}
444
			<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target = next.getTarget();
445
			if (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {
446
				result.add(next);
447
				continue;
448
			}
449
<%
450
	}
451
%>
452
<%
453
	if (myHelper.containsFeatureModelFacetLinks()) {
454
%>
455
			if (!next.isSetElement() || next.getElement() == null) {
456
				if (next.getSource() == <%=_getViewCode%>) {
457
					int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next);
458
					switch (linkVID) {
459
<%
460
		for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
461
			GenLink nextLink = (GenLink) it.next();
462
%>
463
					case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
464
<%
465
		}
466
%>
467
						result.add(next);
468
						break;
469
					}
470
				}
471
<%
472
		if (myHelper.containsTypeModelFacetLinks()) {
473
%>
474
			} else {
475
<%
476
		} else {
477
%>
478
			}
479
<%
480
		}
481
	}
482
	
483
%>
484
<%
485
	if (myHelper.containsTypeModelFacetLinks()) {
486
		if (!myHelper.containsFeatureModelFacetLinks()) {
487
%>
488
			if (next.isSetElement() && next.getElement() != null) {
489
<%
490
		}
491
%>
492
				if (next.getElement().eContainer() == <%=_getSemanticElementCode%>) {
493
					int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next);
494
					switch (linkVID) {
495
<%
496
		for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
497
			GenLink nextLink = (GenLink) it.next();
498
%>
499
					case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
500
<%
501
		}
502
%>
503
						result.add(next);
504
						break;
505
					}
506
				}
507
			}
508
<%
509
	}
510
%>
511
		}
512
		return result;
513
	}
514
515
	/**
516
	 * Returns whether a notational edge should be created for the given domain element. 
517
	 * The generated code always returns <%=genDiagram.isSynchronized()%>. 
518
	 * User can change implementation of this method to handle a more sophisticated logic.
519
	 * @generated
520
	 */
521
	private boolean shouldCreateEdge(EObject domainElement) {
522
		return <%=genDiagram.isSynchronized()%>;
523
	}
524
<%
525
}
526
%>
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/commands/CreateNotationalEdgeCommandGenerator.java (+81 lines)
Added Link Here
1
package org.eclipse.gmf.codegen.templates.lite.commands;
2
3
import org.eclipse.gmf.common.codegen.*;
4
5
public class CreateNotationalEdgeCommandGenerator
6
{
7
  protected static String nl;
8
  public static synchronized CreateNotationalEdgeCommandGenerator create(String lineSeparator)
9
  {
10
    nl = lineSeparator;
11
    CreateNotationalEdgeCommandGenerator result = new CreateNotationalEdgeCommandGenerator();
12
    nl = null;
13
    return result;
14
  }
15
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL;
19
  protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class CreateNotationalEdgeCommand extends CreateNotationalElementCommand {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
20
  protected final String TEXT_4 = " source;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final ";
21
  protected final String TEXT_5 = " target;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic CreateNotationalEdgeCommand(";
22
  protected final String TEXT_6 = " parent, ";
23
  protected final String TEXT_7 = " createdEdge, ";
24
  protected final String TEXT_8 = " source, ";
25
  protected final String TEXT_9 = " target) {" + NL + "\t\tsuper(parent);" + NL + "\t\tthis.source = source;" + NL + "\t\tthis.target = target;" + NL + "\t\tsetCreatedView(createdEdge);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn super.canExecute() && getParent() instanceof ";
26
  protected final String TEXT_10 = " && getCreatedView() instanceof ";
27
  protected final String TEXT_11 = " && this.source != null && this.target != null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\t";
28
  protected final String TEXT_12 = " createdEdge = (";
29
  protected final String TEXT_13 = ") getCreatedView();" + NL + "\t\t((";
30
  protected final String TEXT_14 = ")getParent()).insertEdge(createdEdge);" + NL + "\t\tcreatedEdge.setSource(source);" + NL + "\t\tcreatedEdge.setTarget(target);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\t";
31
  protected final String TEXT_15 = " createdEdge = (";
32
  protected final String TEXT_16 = ") getCreatedView();" + NL + "\t\t((";
33
  protected final String TEXT_17 = ")getParent()).removeEdge(createdEdge);" + NL + "\t\tcreatedEdge.setSource(null);" + NL + "\t\tcreatedEdge.setTarget(null);" + NL + "\t}" + NL + "}";
34
  protected final String TEXT_18 = NL;
35
36
  public String generate(Object argument)
37
  {
38
    final StringBuffer stringBuffer = new StringBuffer();
39
    stringBuffer.append(TEXT_1);
40
    
41
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
42
43
    stringBuffer.append(TEXT_2);
44
    
45
importManager.emitPackageStatement(stringBuffer);
46
importManager.markImportLocation(stringBuffer);
47
48
    stringBuffer.append(TEXT_3);
49
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
50
    stringBuffer.append(TEXT_4);
51
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
52
    stringBuffer.append(TEXT_5);
53
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
54
    stringBuffer.append(TEXT_6);
55
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
56
    stringBuffer.append(TEXT_7);
57
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
58
    stringBuffer.append(TEXT_8);
59
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
60
    stringBuffer.append(TEXT_9);
61
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
62
    stringBuffer.append(TEXT_10);
63
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
64
    stringBuffer.append(TEXT_11);
65
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
66
    stringBuffer.append(TEXT_12);
67
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
68
    stringBuffer.append(TEXT_13);
69
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
70
    stringBuffer.append(TEXT_14);
71
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
72
    stringBuffer.append(TEXT_15);
73
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
74
    stringBuffer.append(TEXT_16);
75
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
76
    stringBuffer.append(TEXT_17);
77
    importManager.emitSortedImports();
78
    stringBuffer.append(TEXT_18);
79
    return stringBuffer.toString();
80
  }
81
}
(-)templates/parts/notificationFilter.jetinc (+21 lines)
Added Link Here
1
<%
2
	/*
3
	 * input: 
4
	 * 		_feature: GenFeature
5
	 * 		genAffectingFeatures : Set
6
	 */
7
	if (_feature == null || genAffectingFeatures.contains(_feature)) {
8
		continue;
9
	}
10
	genAffectingFeatures.add(_feature);
11
	if (!hasDeclaredFilter) {
12
		hasDeclaredFilter = true;
13
%>
14
			filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>());
15
<%
16
	} else {
17
%>
18
			filter = filter.or(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createFeatureFilter(<%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>()));
19
<%
20
	}
21
%>
(-)templates/commands/RemoveNotationalEdgeCommand.javajet (+66 lines)
Added Link Here
1
<%@ jet package="org.eclipse.gmf.codegen.templates.lite.commands" class="RemoveNotationalEdgeCommandGenerator"
2
	imports="org.eclipse.gmf.common.codegen.*"%>
3
4
<%
5
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
6
%>
7
8
<%
9
importManager.emitPackageStatement(stringBuffer);
10
importManager.markImportLocation(stringBuffer);
11
%>
12
13
/**
14
 * @generated
15
 */
16
public class RemoveNotationalEdgeCommand extends RemoveNotationalElementCommand {
17
	/**
18
	 * @generated
19
	 */
20
	private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source;
21
22
	/**
23
	 * @generated
24
	 */
25
	private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target;
26
27
	/**
28
	 * @generated
29
	 */
30
	public RemoveNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> childView) {
31
		super(parentView, childView);
32
	}
33
34
	/**
35
	 * @generated
36
	 */
37
	public boolean canExecute() {
38
		return getParent() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> && getChildView() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>
39
			&& ((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getParent()).getEdges().contains(getChildView());
40
	}
41
42
	/**
43
	 * @generated
44
	 */
45
	public void execute() {
46
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> edgeToRemove = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>)getChildView();
47
		source = edgeToRemove.getSource();
48
		target = edgeToRemove.getTarget();
49
		edgeToRemove.setSource(null);
50
		edgeToRemove.setTarget(null);
51
		((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).removeEdge(edgeToRemove);
52
		sweepElement();
53
	}
54
55
	/**
56
	 * @generated
57
	 */
58
	public void undo() {
59
		restoreElement();
60
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> edge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>)getChildView();
61
		((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).insertEdge(edge);
62
		edge.setSource(source);
63
		edge.setTarget(target);
64
	}
65
}
66
<%importManager.emitSortedImports();%>
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/commands/RemoveNotationalEdgeCommandGenerator.java (+78 lines)
Added Link Here
1
package org.eclipse.gmf.codegen.templates.lite.commands;
2
3
import org.eclipse.gmf.common.codegen.*;
4
5
public class RemoveNotationalEdgeCommandGenerator
6
{
7
  protected static String nl;
8
  public static synchronized RemoveNotationalEdgeCommandGenerator create(String lineSeparator)
9
  {
10
    nl = lineSeparator;
11
    RemoveNotationalEdgeCommandGenerator result = new RemoveNotationalEdgeCommandGenerator();
12
    nl = null;
13
    return result;
14
  }
15
16
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
17
  protected final String TEXT_1 = "";
18
  protected final String TEXT_2 = NL;
19
  protected final String TEXT_3 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class RemoveNotationalEdgeCommand extends RemoveNotationalElementCommand {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
20
  protected final String TEXT_4 = " source;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
21
  protected final String TEXT_5 = " target;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic RemoveNotationalEdgeCommand(";
22
  protected final String TEXT_6 = " parentView, ";
23
  protected final String TEXT_7 = " childView) {" + NL + "\t\tsuper(parentView, childView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn getParent() instanceof ";
24
  protected final String TEXT_8 = " && getChildView() instanceof ";
25
  protected final String TEXT_9 = NL + "\t\t\t&& ((";
26
  protected final String TEXT_10 = ") getParent()).getEdges().contains(getChildView());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\t";
27
  protected final String TEXT_11 = " edgeToRemove = (";
28
  protected final String TEXT_12 = ")getChildView();" + NL + "\t\tsource = edgeToRemove.getSource();" + NL + "\t\ttarget = edgeToRemove.getTarget();" + NL + "\t\tedgeToRemove.setSource(null);" + NL + "\t\tedgeToRemove.setTarget(null);" + NL + "\t\t((";
29
  protected final String TEXT_13 = ")getParent()).removeEdge(edgeToRemove);" + NL + "\t\tsweepElement();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\trestoreElement();" + NL + "\t\t";
30
  protected final String TEXT_14 = " edge = (";
31
  protected final String TEXT_15 = ")getChildView();" + NL + "\t\t((";
32
  protected final String TEXT_16 = ")getParent()).insertEdge(edge);" + NL + "\t\tedge.setSource(source);" + NL + "\t\tedge.setTarget(target);" + NL + "\t}" + NL + "}";
33
  protected final String TEXT_17 = NL;
34
35
  public String generate(Object argument)
36
  {
37
    final StringBuffer stringBuffer = new StringBuffer();
38
    stringBuffer.append(TEXT_1);
39
    
40
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
41
42
    stringBuffer.append(TEXT_2);
43
    
44
importManager.emitPackageStatement(stringBuffer);
45
importManager.markImportLocation(stringBuffer);
46
47
    stringBuffer.append(TEXT_3);
48
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
49
    stringBuffer.append(TEXT_4);
50
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
51
    stringBuffer.append(TEXT_5);
52
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
53
    stringBuffer.append(TEXT_6);
54
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
55
    stringBuffer.append(TEXT_7);
56
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
57
    stringBuffer.append(TEXT_8);
58
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
59
    stringBuffer.append(TEXT_9);
60
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
61
    stringBuffer.append(TEXT_10);
62
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
63
    stringBuffer.append(TEXT_11);
64
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
65
    stringBuffer.append(TEXT_12);
66
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
67
    stringBuffer.append(TEXT_13);
68
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
69
    stringBuffer.append(TEXT_14);
70
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
71
    stringBuffer.append(TEXT_15);
72
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
73
    stringBuffer.append(TEXT_16);
74
    importManager.emitSortedImports();
75
    stringBuffer.append(TEXT_17);
76
    return stringBuffer.toString();
77
  }
78
}
(-)templates/parts/linkDescriptor.jetinc (+71 lines)
Added Link Here
1
<%/*inner class*/%>
2
/**
3
 * @generated
4
 */
5
private static class LinkDescriptor {
6
7
	/**
8
   	 * @generated
9
     */
10
	private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> mySource;
11
12
	/**
13
   	 * @generated
14
     */
15
	private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> myDestination;
16
17
	/**
18
   	 * @generated
19
     */
20
	private <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> myLinkElement;
21
22
	/**
23
   	 * @generated
24
     */
25
	private int myVisualID;
26
27
	/**
28
   	 * @generated
29
     */
30
	protected LinkDescriptor(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> destination, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> linkElement, int linkVID) {
31
		this(source, destination, linkVID);
32
		myLinkElement = linkElement;
33
	}
34
35
	/**
36
   	 * @generated
37
     */
38
	private LinkDescriptor(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source, <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> destination, int linkVID) {
39
		mySource = source;
40
		myDestination = destination;
41
		myVisualID = linkVID;
42
	}
43
44
	/**
45
   	 * @generated
46
     */
47
	protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getSource() {
48
		return mySource;
49
	}
50
51
	/**
52
   	 * @generated
53
     */
54
	protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getDestination() {
55
		return myDestination;
56
	}
57
58
	/**
59
   	 * @generated
60
     */
61
	protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getLinkElement() {
62
		return myLinkElement;
63
	}
64
65
	/**
66
   	 * @generated
67
     */
68
	protected int getVisualID() {
69
		return myVisualID;
70
	}
71
}
(-)templates/parts/registerModel.jetinc (+21 lines)
Added Link Here
1
	/**
2
	 * @generated
3
	 */
4
	protected void registerModel() {
5
		super.registerModel();
6
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) getModel();
7
		if (view != null && view.isSetElement() && view.getElement() != null) {
8
			getViewer().getEditPartRegistry().put(view.getElement(), this);	
9
		}
10
	}
11
12
	/**
13
	 * @generated
14
	 */
15
	protected void unregisterModel() {
16
		super.unregisterModel();
17
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) getModel();
18
		if (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {
19
			getViewer().getEditPartRegistry().remove(view.getElement());
20
		}
21
	}
(-)templates/commands/CreateNotationalEdgeCommand.javajet (+64 lines)
Added Link Here
1
<%@ jet package="org.eclipse.gmf.codegen.templates.lite.commands" class="CreateNotationalEdgeCommandGenerator"
2
	imports="org.eclipse.gmf.common.codegen.*"%>
3
4
<%
5
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
6
%>
7
8
<%
9
importManager.emitPackageStatement(stringBuffer);
10
importManager.markImportLocation(stringBuffer);
11
%>
12
13
/**
14
 * @generated
15
 */
16
public class CreateNotationalEdgeCommand extends CreateNotationalElementCommand {
17
	/**
18
	 * @generated
19
	 */
20
	private final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source;
21
22
	/**
23
	 * @generated
24
	 */
25
	private final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target;
26
27
	/**
28
	 * @generated
29
	 */
30
	public CreateNotationalEdgeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parent, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source, <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> target) {
31
		super(parent);
32
		this.source = source;
33
		this.target = target;
34
		setCreatedView(createdEdge);
35
	}
36
37
	/**
38
	 * @generated
39
	 */
40
	public boolean canExecute() {
41
		return super.canExecute() && getParent() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> && getCreatedView() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> && this.source != null && this.target != null;
42
	}
43
44
	/**
45
	 * @generated
46
	 */
47
	public void execute() {
48
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getCreatedView();
49
		((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).insertEdge(createdEdge);
50
		createdEdge.setSource(source);
51
		createdEdge.setTarget(target);
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	public void undo() {
58
		<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> createdEdge = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getCreatedView();
59
		((<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>)getParent()).removeEdge(createdEdge);
60
		createdEdge.setSource(null);
61
		createdEdge.setTarget(null);
62
	}
63
}
64
<%importManager.emitSortedImports();%>
(-)templates/parts/semanticChildLinks.jetinc (+148 lines)
Added Link Here
1
	<%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>();
2
<%
3
Map genFeature2genLinkMap = new LinkedHashMap();
4
for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
5
	GenLink genLink = (GenLink)it.next();
6
	TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
7
	GenFeature metaFeature = modelFacet.getChildMetaFeature();
8
	if (!genFeature2genLinkMap.containsKey(metaFeature)) {
9
		genFeature2genLinkMap.put(metaFeature, new ArrayList());
10
	}
11
	((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
12
}
13
Map genFeature2featureGenLinkMap = new LinkedHashMap();
14
for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
15
	GenLink genLink = (GenLink)it.next();
16
	GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
17
	if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
18
		genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
19
	}
20
	((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
21
}
22
if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
23
%>
24
	<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getSemanticElementCode%>;
25
	<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue;
26
<%
27
}
28
if (!genFeature2genLinkMap.isEmpty()) {
29
%>
30
	int linkVID;
31
<%
32
}
33
for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
34
	Map.Entry nextEntry = (Map.Entry) entries.next();
35
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
36
	Collection genLinksCollection = (Collection) nextEntry.getValue();
37
	if (metaFeature.isListType()) {
38
%>
39
	for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) {
40
		nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
41
<%
42
	} else {
43
%>
44
	nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>();
45
<%
46
	}
47
%>
48
	linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextValue);
49
<%
50
	boolean generateSwitch = genLinksCollection.size() != 1;
51
	if (generateSwitch) {
52
%>
53
	switch (linkVID) {
54
<%
55
	}
56
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
57
		GenLink nextLink = (GenLink) genLinksIterator.next();
58
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
59
		if (generateSwitch) {
60
%>
61
	case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: {
62
<%
63
		} else {
64
%>
65
	if (<%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID == linkVID) {
66
<%
67
		}
68
		if (modelFacet.getSourceMetaFeature() != null) {
69
%>
70
		<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = ((<%=importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getSourceMetaFeature().getGetAccessor()%>();
71
<%
72
		} else {
73
%>
74
		<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = <%=_getSemanticElementCode%>;
75
<%
76
		}
77
		if (modelFacet.getTargetMetaFeature() != null) {
78
%>
79
		<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = ((<%=importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getTargetMetaFeature().getGetAccessor()%>();
80
<%
81
		} else {
82
%>
83
		<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = <%=_getSemanticElementCode%>;
84
<%
85
		}
86
%>
87
		if (source != null && target != null) {
88
			result.add(new LinkDescriptor(source, target, nextValue, linkVID));
89
		}
90
<%
91
		if (generateSwitch) {
92
%>
93
		break;
94
	}
95
<%
96
		} else {
97
%>
98
	}
99
<%
100
		}
101
%>
102
<%
103
	}	//iterate over genLinksCollection
104
	if (generateSwitch) {
105
%>
106
	}
107
<%
108
	}
109
	if (metaFeature.isListType()) {
110
%>
111
	}
112
<%
113
	}
114
}
115
for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
116
	Map.Entry nextEntry = (Map.Entry) entries.next();
117
	GenFeature metaFeature = (GenFeature) nextEntry.getKey();
118
	Collection genLinksCollection = (Collection) nextEntry.getValue();
119
	if (metaFeature.isListType()) {
120
%>
121
	for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) {
122
		nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
123
<%
124
	} else {
125
%>
126
	nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>();
127
<%
128
	}
129
%>
130
	if (nextValue != null) {
131
<%
132
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
133
		GenLink nextLink = (GenLink) genLinksIterator.next();
134
%>
135
		result.add(new LinkDescriptor(modelObject, nextValue, null, <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID));
136
<%
137
	}
138
%>
139
	}
140
<%
141
	if (metaFeature.isListType()) {
142
%>
143
	}
144
<%
145
	}
146
}
147
%>
148
	return result;

Return to bug 146009