View | Details | Raw Unified | Return to bug 138430
Collapse All | Expand All

(-)templates/editor/Editor.javajet (-7 / +6 lines)
Lines 33-44 Link Here
33
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
33
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
34
importManager.addImport("org.eclipse.core.runtime.Status");
34
importManager.addImport("org.eclipse.core.runtime.Status");
35
importManager.addImport("org.eclipse.draw2d.PositionConstants");
35
importManager.addImport("org.eclipse.draw2d.PositionConstants");
36
importManager.addImport("org.eclipse.emf.common.command.BasicCommandStack");
37
importManager.addImport("org.eclipse.emf.common.util.URI");
36
importManager.addImport("org.eclipse.emf.common.util.URI");
38
importManager.addImport("org.eclipse.emf.ecore.resource.Resource");
37
importManager.addImport("org.eclipse.emf.ecore.resource.Resource");
39
importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet");
38
importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet");
40
importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain");
39
importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain");
41
importManager.addImport("org.eclipse.emf.edit.domain.EditingDomain");
40
importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain");
42
importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory");
41
importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory");
43
importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory");
42
importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory");
44
importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory");
43
importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory");
Lines 560-566 Link Here
560
	/**
559
	/**
561
	 * @generated
560
	 * @generated
562
	 */
561
	 */
563
	private EditingDomain editingDomain;
562
	private TransactionalEditingDomain editingDomain;
564
563
565
	/**
564
	/**
566
	 * @generated
565
	 * @generated
Lines 1004-1013 Link Here
1004
	/**
1003
	/**
1005
	 * @generated
1004
	 * @generated
1006
	 */
1005
	 */
1007
	protected EditingDomain getEditingDomain() {
1006
	protected TransactionalEditingDomain getEditingDomain() {
1008
		if (editingDomain == null) {
1007
		if (editingDomain == null) {
1009
			BasicCommandStack commandStack = new BasicCommandStack();
1008
			editingDomain = <%=importManager.getImportedName("org.eclipse.emf.workspace.WorkspaceEditingDomainFactory")%>.INSTANCE.createEditingDomain();
1010
			editingDomain = new AdapterFactoryEditingDomain(getDomainAdapterFactory(), commandStack, new HashMap());
1009
			//editingDomain.setAdapterFactory(getDomainAdapterFactory());
1011
			editingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain));
1010
			editingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain));
1012
		}
1011
		}
1013
		return editingDomain;
1012
		return editingDomain;
Lines 1043-1049 Link Here
1043
		if (diagramFile == null) {
1042
		if (diagramFile == null) {
1044
			return;
1043
			return;
1045
		}
1044
		}
1046
		EditingDomain editingDomain = getEditingDomain();
1045
		TransactionalEditingDomain editingDomain = getEditingDomain();
1047
		ResourceSet resourceSet = editingDomain.getResourceSet();
1046
		ResourceSet resourceSet = editingDomain.getResourceSet();
1048
		Resource diagramResource = resourceSet.getResource(diagramFile, true);
1047
		Resource diagramResource = resourceSet.getResource(diagramFile, true);
1049
		if (diagramResource == null) {
1048
		if (diagramResource == null) {
(-)templates/editor/manifest.mfjet (+1 lines)
Lines 36-41 Link Here
36
 org.eclipse.ui.workbench,
36
 org.eclipse.ui.workbench,
37
 org.eclipse.emf.ecore,
37
 org.eclipse.emf.ecore,
38
 org.eclipse.emf.edit.ui,
38
 org.eclipse.emf.edit.ui,
39
 org.eclipse.emf.workspace,<%/*XXX: introduces dependency on org.eclipse.core.resources which may be problematic for RCP*/%>
39
 org.eclipse.gef;visibility:=reexport,
40
 org.eclipse.gef;visibility:=reexport,
40
 org.eclipse.gmf.runtime.notation,
41
 org.eclipse.gmf.runtime.notation,
41
 org.eclipse.gmf.runtime.notation.edit<%while(requiredBundleIterator.hasNext()) {%>,
42
 org.eclipse.gmf.runtime.notation.edit<%while(requiredBundleIterator.hasNext()) {%>,
(-)templates/parts/directEditPolicy.javajetinc (-55 / +42 lines)
Lines 19-61 Link Here
19
						} catch (<%=importManager.getImportedName("java.text.ParseException")%> e) {
19
						} catch (<%=importManager.getImportedName("java.text.ParseException")%> e) {
20
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
20
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
21
						}
21
						}
22
						<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=primaryView%>.getDiagram().getElement());
22
<%
23
<%
23
if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) {
24
if (labelModelFacet instanceof FeatureLabelModelFacet) {
24
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
25
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
25
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
26
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
26
%>
27
%>
27
						if (parseResult.length != 1) {
28
						if (parseResult.length != 1) {
28
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
29
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
29
						}
30
						}
30
						return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() {
31
						<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);
31
							private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>;
32
						return new WrappingCommand(editingDomain, domainModelCommand);
32
							private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand();
33
					}
33
							private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand() {
34
					<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain, Object value) {
34
								<%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(<%=primaryView%>.getDiagram().getElement());
35
						<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>;
35
								<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=featureToSet.getFeatureAccessorName()%>();
36
						<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=featureToSet.getFeatureAccessorName()%>();
36
								Object valueToSet;
37
						Object valueToSet;
37
								try {
38
						try {
38
									valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, parseResult[0]);
39
							valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, value);
39
								} catch (IllegalArgumentException e) {
40
						} catch (IllegalArgumentException e) {
40
									return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
41
							return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
41
								}
42
						}
42
<%
43
<%
43
	if (ecoreFeature.isMany()) {
44
	if (ecoreFeature.isMany()) {
44
%>
45
%>
45
								<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
46
						<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
46
								<%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>();
47
						<%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>();
47
								values.addAll(element.get<%=featureToSet.getAccessorName()%>());
48
						values.addAll(element.get<%=featureToSet.getAccessorName()%>());
48
								result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(domainModelEditDomain, element, feature, values));
49
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, element, feature, values));
49
								result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(domainModelEditDomain, element, feature, valueToSet));
50
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(editingDomain, element, feature, valueToSet));
50
								return result;
51
						return result;
51
<%
52
<%
52
	} else {
53
	} else {
53
%>
54
%>
54
								return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, element, feature, valueToSet);
55
						return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(editingDomain, element, feature, valueToSet);
55
<%
56
<%
56
	}
57
	}
57
%>
58
%>
58
							}
59
					}
59
<%
60
<%
60
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
61
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
61
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
62
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
Lines 64-122 Link Here
64
						if (parseResult.length != <%=metaFeatures.size()%>) {
65
						if (parseResult.length != <%=metaFeatures.size()%>) {
65
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
66
							return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
66
						}
67
						}
67
						return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() {
68
						<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(editingDomain, parseResult);
68
							private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>;
69
						return new WrappingCommand(editingDomain, domainModelCommand);
69
							private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand();
70
					}
70
							private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand() {
71
					<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain, Object[] values) {
71
								<%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(<%=primaryView%>.getDiagram().getElement());
72
						<%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>;
72
								<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
73
						<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
73
								Object valueToSet;
74
						Object valueToSet;
74
<%
75
<%
75
	boolean haveDeclaredValues = false;
76
	boolean haveDeclaredValues = false;
76
	for(int i = 0; i < metaFeatures.size(); i++) {
77
	for(int i = 0; i < metaFeatures.size(); i++) {
77
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
78
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
78
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
79
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
79
%>
80
%>
80
								<%if (i == 0) {%><%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> <%}%>feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=nextFeatureToSet.getFeatureAccessorName()%>();
81
						<%if (i == 0) {%><%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> <%}%>feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=nextFeatureToSet.getFeatureAccessorName()%>();
81
								try {
82
						try {
82
									valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, parseResult[<%=i%>]);
83
							valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, values[<%=i%>]);
83
								} catch (IllegalArgumentException e) {
84
						} catch (IllegalArgumentException e) {
84
									return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
85
							return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
85
								}
86
						}
86
<%
87
<%
87
		if (nextEcoreFeature.isMany()) {
88
		if (nextEcoreFeature.isMany()) {
88
%>
89
%>
89
								<%if (!haveDeclaredValues) { haveDeclaredValues = true;%><%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> <%}%>values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>();
90
						<%if (!haveDeclaredValues) { haveDeclaredValues = true;%><%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> <%}%>values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>();
90
								values.addAll(element.get<%=nextFeatureToSet.getAccessorName()%>());
91
						values.addAll(element.get<%=nextFeatureToSet.getAccessorName()%>());
91
								result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(domainModelEditDomain, element, feature, values));
92
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, element, feature, values));
92
								result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(domainModelEditDomain, element, feature, valueToSet));
93
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(editingDomain, element, feature, valueToSet));
93
<%
94
<%
94
		} else {
95
		} else {
95
%>
96
%>
96
								result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, element, feature, valueToSet));
97
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(editingDomain, element, feature, valueToSet));
97
<%
98
<%
98
		}
99
		}
99
%>
100
%>
100
<%
101
<%
101
	}
102
	}
102
%>
103
%>
103
								return result;
104
						return result;
104
							}
105
					}
105
<%
106
<%
106
}
107
}
107
%>
108
%>
108
							public void undo() {
109
								domainModelCommand.undo();
110
							}
111
							public void execute() {
112
								domainModelCommand.execute();
113
							}
114
							public boolean canUndo() {
115
								return element != null && domainModelCommand != null && domainModelCommand.canUndo();
116
							}
117
							public boolean canExecute() {
118
								return element != null && domainModelCommand != null && domainModelCommand.canExecute();
119
							}
120
						};
121
					}
122
				});
109
				});
(-)templates/parts/NodeEditPart.javajet (-6 / +17 lines)
Lines 140-146 Link Here
140
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) {
140
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) {
141
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) request;
141
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) request;
142
					int[] visualIds = requestEx.getVisualIds();
142
					int[] visualIds = requestEx.getVisualIds();
143
					<%=importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")%>();
143
					<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
144
					for (int i = 0; i < visualIds.length; i++) {
144
					for (int i = 0; i < visualIds.length; i++) {
145
						int nextVisualId = visualIds[i];
145
						int nextVisualId = visualIds[i];
146
						switch (nextVisualId) {
146
						switch (nextVisualId) {
Lines 168-185 Link Here
168
	}
168
	}
169
%>
169
%>
170
						case <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
170
						case <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
171
							result.add(new Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command(requestEx));
171
							result.append(new Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command(requestEx));
172
							break;
172
							break;
173
<%
173
<%
174
}
174
}
175
%>
175
%>
176
						}
176
						}
177
					}
177
					}
178
					if (result.getChildren().length != 1) {
178
					if (result.getCommandList().size() != 1) {
179
						//Cannot create several connections at once.
179
						//Cannot create several connections at once.
180
						return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
180
						return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
181
					}
181
					}
182
					return result.unwrap();
182
					return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramNode().getDiagram().getElement()), result);
183
				}
183
				}
184
<%}/*when there's palette*/%>
184
<%}/*when there's palette*/%>
185
				return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
185
				return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE;
Lines 629-635 Link Here
629
	/**
629
	/**
630
	 * @generated
630
	 * @generated
631
	 */
631
	 */
632
	private static class Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> {
632
	private static class Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%> {
633
		/**
633
		/**
634
		 * @generated
634
		 * @generated
635
		 */
635
		 */
Lines 660-665 Link Here
660
			} else {
660
			} else {
661
				target = null;
661
				target = null;
662
			}
662
			}
663
			if (source == null || target == null) {
664
				createdEdge = null;
665
				domainModelAddCommand = <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
666
				return;
667
			}
663
			createdEdge = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createEdge();
668
			createdEdge = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createEdge();
664
<%
669
<%
665
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
670
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
Lines 678-684 Link Here
678
	}
683
	}
679
%>
684
%>
680
			<%=importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge);
685
			<%=importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge);
681
			<%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(source.getDiagram().getElement());
686
			<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(source.getDiagram().getElement());
682
<%
687
<%
683
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
688
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
684
%>
689
%>
Lines 802-807 Link Here
802
			createdEdge.setSource(null);
807
			createdEdge.setSource(null);
803
			createdEdge.setTarget(null);
808
			createdEdge.setTarget(null);
804
		}
809
		}
810
		/**
811
		 * @generated
812
		 */
813
		public void redo() {
814
			execute();
815
		}
805
	}
816
	}
806
<%
817
<%
807
}
818
}
(-)templates/parts/ChildNodeEditPart.javajet (-3 / +8 lines)
Lines 8-13 Link Here
8
GenDiagram genDiagram = genChildNode.getDiagram();
8
GenDiagram genDiagram = genChildNode.getDiagram();
9
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
9
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
10
LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
10
LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
11
final boolean isReadOnly = genChildNode.isLabelReadOnly();
11
%>
12
%>
12
<%@ include file="../copyright4java.jetinc"%>
13
<%@ include file="../copyright4java.jetinc"%>
13
14
Lines 57-64 Link Here
57
	final String primaryView = "getDiagramNode()";
58
	final String primaryView = "getDiagramNode()";
58
%>
59
%>
59
<%
60
<%
60
{
61
if (!isReadOnly) {
61
boolean isReadOnly = genChildNode.isLabelReadOnly();
62
%>
62
%>
63
<%@ include file="directEditPolicy.javajetinc"%>
63
<%@ include file="directEditPolicy.javajetinc"%>
64
<%
64
<%
Lines 67-74 Link Here
67
<%@ include file="componentEditPolicy.javajetinc"%>
67
<%@ include file="componentEditPolicy.javajetinc"%>
68
	}
68
	}
69
69
70
<%
71
if (!isReadOnly) {
72
%>
70
<%@ include file="directEdit.javajetinc"%>
73
<%@ include file="directEdit.javajetinc"%>
71
74
<%
75
}
76
%>
72
	/**
77
	/**
73
	 * @generated
78
	 * @generated
74
	 */
79
	 */
(-)templates/parts/textAwareFields.jetinc (+6 lines)
Lines 1-9 Link Here
1
1
2
<%
3
if (!isReadOnly) {
4
%>
2
	/**
5
	/**
3
	 * @generated
6
	 * @generated
4
	 */
7
	 */
5
	private <%=importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")%> manager;
8
	private <%=importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")%> manager;
6
9
10
<%
11
}
12
%>
7
	/**
13
	/**
8
	 * @generated
14
	 * @generated
9
	 */
15
	 */
(-)templates/parts/NodeLabelEditPart.javajet (-1 / +11 lines)
Lines 7-12 Link Here
7
GenClass underlyingMetaClass = genHost.getDomainMetaClass();
7
GenClass underlyingMetaClass = genHost.getDomainMetaClass();
8
GenDiagram genDiagram = genLabel.getDiagram();
8
GenDiagram genDiagram = genLabel.getDiagram();
9
LabelModelFacet labelModelFacet = genLabel.getModelFacet();
9
LabelModelFacet labelModelFacet = genLabel.getModelFacet();
10
final boolean isReadOnly = genLabel.isReadOnly();
10
%>
11
%>
11
<%@ include file="../copyright4java.jetinc"%>
12
<%@ include file="../copyright4java.jetinc"%>
12
<%importManager.emitPackageStatement(stringBuffer);%>
13
<%importManager.emitPackageStatement(stringBuffer);%>
Lines 42-53 Link Here
42
<%
43
<%
43
	final String primaryView = "getUpdatableParent().getDiagramNode()";
44
	final String primaryView = "getUpdatableParent().getDiagramNode()";
44
	final String resolvedSemanticElement = "resolveSemanticElement()";
45
	final String resolvedSemanticElement = "resolveSemanticElement()";
45
	final boolean isReadOnly = genLabel.isReadOnly();
46
	if (!isReadOnly) {
46
%>
47
%>
47
<%@ include file="directEditPolicy.javajetinc"%>
48
<%@ include file="directEditPolicy.javajetinc"%>
49
<%
50
	}
51
%>
48
	}
52
	}
49
53
54
<%
55
	if (!isReadOnly) {
56
%>
50
<%@ include file="directEdit.javajetinc"%>
57
<%@ include file="directEdit.javajetinc"%>
58
<%
59
	}
60
%>
51
61
52
	/**
62
	/**
53
	 * @generated
63
	 * @generated
(-)templates/parts/LinkLabelEditPart.javajet (-3 / +3 lines)
Lines 16-21 Link Here
16
} else {
16
} else {
17
	underlyingMetaClass = null;
17
	underlyingMetaClass = null;
18
}
18
}
19
final boolean isReadOnly = genLabel.isReadOnly();
19
%>
20
%>
20
<%@ include file="../copyright4java.jetinc"%>
21
<%@ include file="../copyright4java.jetinc"%>
21
<%importManager.emitPackageStatement(stringBuffer);
22
<%importManager.emitPackageStatement(stringBuffer);
Lines 69-76 Link Here
69
			}
70
			}
70
		});
71
		});
71
<%
72
<%
72
if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
73
if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) {
73
	boolean isReadOnly = genLabel.isReadOnly();
74
%>
74
%>
75
<%@ include file="directEditPolicy.javajetinc"%>
75
<%@ include file="directEditPolicy.javajetinc"%>
76
<%
76
<%
Lines 79-85 Link Here
79
	}
79
	}
80
80
81
<%
81
<%
82
if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
82
if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) {
83
%>
83
%>
84
<%@ include file="directEdit.javajetinc"%>
84
<%@ include file="directEdit.javajetinc"%>
85
<%
85
<%
(-)templates/parts/DiagramEditPart.javajet (-4 / +8 lines)
Lines 76-82 Link Here
76
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) {
76
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) {
77
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request;
77
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request;
78
					int[] visualIds = requestEx.getVisualIds();
78
					int[] visualIds = requestEx.getVisualIds();
79
					CompoundCommand result = new CompoundCommand();
79
					<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
80
					for(int i = 0; i < visualIds.length; i++) {
80
					for(int i = 0; i < visualIds.length; i++) {
81
						int nextVisualId = visualIds[i];
81
						int nextVisualId = visualIds[i];
82
						switch (nextVisualId) {
82
						switch (nextVisualId) {
Lines 85-105 Link Here
85
	GenTopLevelNode next = (GenTopLevelNode)it.next();
85
	GenTopLevelNode next = (GenTopLevelNode)it.next();
86
%>
86
%>
87
						case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID:
87
						case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID:
88
							result.add(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command(getDiagram(), requestEx, (<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request)));
88
							result.append(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command(getDiagram(), requestEx, (<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request)));
89
							break;
89
							break;
90
<%
90
<%
91
}
91
}
92
%>
92
%>
93
						}
93
						}
94
					}
94
					}
95
					return result.unwrap();
95
					return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagram().getElement()), result);
96
				}
96
				}
97
<%}/*when there's palette*/%>
97
<%}/*when there's palette*/%>
98
				return null;
98
				return null;
99
			}
99
			}
100
			protected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {
100
			protected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {
101
				final Node node = (Node) child.getModel();
101
				final Node node = (Node) child.getModel();
102
				return new Command("Change node position/size") {
102
				<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> emfCommand = new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>("Change node position/size") {
103
					private Point moveDelta = request.getMoveDelta();
103
					private Point moveDelta = request.getMoveDelta();
104
					private Dimension resizeDelta = request.getSizeDelta();
104
					private Dimension resizeDelta = request.getSizeDelta();
105
105
Lines 115-120 Link Here
115
					public void execute() {
115
					public void execute() {
116
						execute(moveDelta, resizeDelta);
116
						execute(moveDelta, resizeDelta);
117
					}
117
					}
118
					public void redo() {
119
						execute();
120
					}
118
					private void execute(Point move, Dimension resize) {
121
					private void execute(Point move, Dimension resize) {
119
						Bounds bounds = (Bounds) node.getLayoutConstraint();
122
						Bounds bounds = (Bounds) node.getLayoutConstraint();
120
						bounds.setX(bounds.getX() + move.x);
123
						bounds.setX(bounds.getX() + move.x);
Lines 123-128 Link Here
123
						bounds.setHeight(bounds.getHeight() + resize.height);
126
						bounds.setHeight(bounds.getHeight() + resize.height);
124
					}
127
					}
125
				};
128
				};
129
				return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagram().getElement()), emfCommand);
126
			}
130
			}
127
			protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
131
			protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
128
				assert false;
132
				assert false;
(-)templates/parts/CompartmentEditPart.javajet (-4 / +8 lines)
Lines 49-55 Link Here
49
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.LAYOUT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")%>() {
49
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.LAYOUT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")%>() {
50
			protected Command createChangeConstraintCommand(final <%=importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")%> request, EditPart child, Object constraint) {
50
			protected Command createChangeConstraintCommand(final <%=importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")%> request, EditPart child, Object constraint) {
51
				final Node node = (Node) child.getModel();
51
				final Node node = (Node) child.getModel();
52
				return new Command("Change node position/size") {
52
				<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> emfCommand = new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>("Change node position/size") {
53
					private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> moveDelta = request.getMoveDelta();
53
					private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> moveDelta = request.getMoveDelta();
54
					private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resizeDelta = request.getSizeDelta();
54
					private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resizeDelta = request.getSizeDelta();
55
55
Lines 65-70 Link Here
65
					public void execute() {
65
					public void execute() {
66
						execute(moveDelta, resizeDelta);
66
						execute(moveDelta, resizeDelta);
67
					}
67
					}
68
					public void redo() {
69
						execute();
70
					}
68
					private void execute(<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> move, <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resize) {
71
					private void execute(<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> move, <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resize) {
69
						Bounds bounds = (Bounds) node.getLayoutConstraint();
72
						Bounds bounds = (Bounds) node.getLayoutConstraint();
70
						bounds.setX(bounds.getX() + move.x);
73
						bounds.setX(bounds.getX() + move.x);
Lines 73-78 Link Here
73
						bounds.setHeight(bounds.getHeight() + resize.height);
76
						bounds.setHeight(bounds.getHeight() + resize.height);
74
					}
77
					}
75
				};
78
				};
79
				return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(node.getDiagram().getElement()), emfCommand);
76
			}
80
			}
77
			protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
81
			protected Command createChangeConstraintCommand(EditPart child, Object constraint) {
78
				assert false;
82
				assert false;
Lines 96-102 Link Here
96
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) {
100
				if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) {
97
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request;
101
					<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request;
98
					int[] visualIds = requestEx.getVisualIds();
102
					int[] visualIds = requestEx.getVisualIds();
99
					CompoundCommand result = new CompoundCommand();
103
					<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
100
					for(int i = 0; i < visualIds.length; i++) {
104
					for(int i = 0; i < visualIds.length; i++) {
101
						int nextVisualId = visualIds[i];
105
						int nextVisualId = visualIds[i];
102
						switch (nextVisualId) {
106
						switch (nextVisualId) {
Lines 105-111 Link Here
105
	GenChildNode next = (GenChildNode)it.next();
109
	GenChildNode next = (GenChildNode)it.next();
106
%>
110
%>
107
						case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID:
111
						case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID:
108
							result.add(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command((View) getModel(), requestEx<%if (!genCompartment.isListLayout()) {%>, 
112
							result.append(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command((View) getModel(), requestEx<%if (!genCompartment.isListLayout()) {%>, 
109
								(<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request)<%}%>));
113
								(<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request)<%}%>));
110
							break;
114
							break;
111
<%
115
<%
Lines 113-119 Link Here
113
%>
117
%>
114
						}
118
						}
115
					}
119
					}
116
					return result.unwrap();
120
					return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(((View) getModel()).getDiagram().getElement()), result);
117
				}
121
				}
118
<%}/*when there's palette*/%>
122
<%}/*when there's palette*/%>
119
				return null;
123
				return null;
(-)templates/parts/createNodeCommand.javajetinc (-2 / +8 lines)
Lines 1-7 Link Here
1
	/**
1
	/**
2
	 * @generated
2
	 * @generated
3
	 */
3
	 */
4
	private <%if (isStatic) {%>static <%}%>class Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> {
4
	private <%if (isStatic) {%>static <%}%>class Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%> {
5
		/**
5
		/**
6
		 * @generated
6
		 * @generated
7
		 */
7
		 */
Lines 54-60 Link Here
54
<%
54
<%
55
	}
55
	}
56
%>
56
%>
57
			<%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(parent.getDiagram().getElement());
57
			<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(parent.getDiagram().getElement());
58
<%
58
<%
59
	TypeModelFacet facet = next.getModelFacet();
59
	TypeModelFacet facet = next.getModelFacet();
60
	GenFeature childFeature = facet.getChildMetaFeature();
60
	GenFeature childFeature = facet.getChildMetaFeature();
Lines 112-115 Link Here
112
			parent.getPersistedChildren().remove(createdNode);
112
			parent.getPersistedChildren().remove(createdNode);
113
			domainModelAddCommand.undo();
113
			domainModelAddCommand.undo();
114
		}
114
		}
115
		/**
116
		 * @generated
117
		 */
118
		public void redo() {
119
			execute();
120
		}
115
	}
121
	}
(-)templates/parts/componentEditPolicy.javajetinc (-48 / +34 lines)
Lines 1-6 Link Here
1
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() {
1
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() {
2
			protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) {
2
			protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) {
3
				return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() {
3
				<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramNode().getDiagram().getElement());
4
				<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
5
				cc.append(getDomainModelRemoveCommand(editingDomain));
6
				cc.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, getDiagramNode()));
7
				return new WrappingCommand(editingDomain, cc);
8
			}
9
10
			private org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) {
4
<%
11
<%
5
{
12
{
6
TypeModelFacet facet = genNode.getModelFacet();
13
TypeModelFacet facet = genNode.getModelFacet();
Lines 8-89 Link Here
8
GenFeature containmentFeature = facet.getContainmentMetaFeature();
15
GenFeature containmentFeature = facet.getContainmentMetaFeature();
9
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
16
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
10
%>
17
%>
11
					private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = getDomainModelRemoveCommand();
18
				<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
12
					private org.eclipse.emf.common.command.Command getDomainModelRemoveCommand() {
13
						<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
14
<%
19
<%
15
	if (containmentFeature.getEcoreFeature().isMany()) {
20
	if (containmentFeature.getEcoreFeature().isMany()) {
16
%>
21
%>
17
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
22
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
18
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
23
					editingDomain, 
19
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
24
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
20
							getDiagramNode().getElement()));
25
					getDiagramNode().getElement()));
21
<%
26
<%
22
	} else {
27
	} else {
23
%>
28
%>
24
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
29
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
25
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
30
					editingDomain, 
26
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
31
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
27
							<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
32
					<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
28
<%
33
<%
29
	}
34
	}
30
%>
35
%>
31
<%
36
<%
32
	if (childFeature.getEcoreFeature().isMany()) {
37
	if (childFeature.getEcoreFeature().isMany()) {
33
%>
38
%>
34
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
39
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
35
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
40
					editingDomain, 
36
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
41
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
37
							getDiagramNode().getElement()));
42
					getDiagramNode().getElement()));
38
<%
43
<%
39
	} else {
44
	} else {
40
%>
45
%>
41
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
46
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
42
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
47
					editingDomain, 
43
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
48
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
44
							<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
49
					<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
45
<%
50
<%
46
	}
51
	}
47
%>
52
%>
48
						return result;
53
				return result;
49
					}
50
<%
54
<%
51
} else {
55
} else {
52
	if (containmentFeature.getEcoreFeature().isMany()) {
56
	if (containmentFeature.getEcoreFeature().isMany()) {
53
%>
57
%>
54
						private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
58
				return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
55
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
59
					editingDomain, 
56
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
60
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
57
							getDiagramNode().getElement());
61
					getDiagramNode().getElement());
58
<%
62
<%
59
	} else {
63
	} else {
60
%>
64
%>
61
						private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
65
				return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
62
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), 
66
					editingDomain, 
63
							getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
67
					getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(),
64
							<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE);
68
					<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE);
65
<%
69
<%
66
	}
70
	}
67
}
71
}
68
%>
72
%>
69
					private final org.eclipse.emf.common.command.Command viewRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
70
						<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram()), 
71
						getDiagramNode());
72
					public boolean canExecute() {
73
						return domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute() && viewRemoveCommand != null && viewRemoveCommand.canExecute();
74
					}
75
					public void execute() {
76
						domainModelRemoveCommand.execute();
77
						viewRemoveCommand.execute();
78
					}
79
					public boolean canUndo() {
80
						return domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo() && viewRemoveCommand != null && viewRemoveCommand.canUndo();
81
					}
82
					public void undo() {
83
						domainModelRemoveCommand.undo();
84
						viewRemoveCommand.undo();
85
					}
86
				};
87
			}
73
			}
88
		});
74
		});
89
<%
75
<%
(-)templates/parts/linkComponentEditPolicy.javajetinc (-62 / +65 lines)
Lines 1-11 Link Here
1
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() {
1
		installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() {
2
			protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) {
2
			protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) {
3
				return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() {
3
				final Edge edgeToRemove = getDiagramEdge();
4
					private final Edge edgeToRemove = getDiagramEdge();
4
				final View source = edgeToRemove.getSource();
5
					private final View source = edgeToRemove.getSource();
5
				final View target = edgeToRemove.getTarget();
6
					private final View target = edgeToRemove.getTarget();
6
				<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramEdge().getDiagram().getElement());
7
					private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = createDomainModelRemoveCommand();
7
				<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
8
					private org.eclipse.emf.common.command.Command createDomainModelRemoveCommand() {
8
				cc.append(createDomainModelRemoveCommand(editingDomain));
9
				cc.append(new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>() {
10
					public boolean canExecute() {
11
						return source != null && edgeToRemove != null;
12
					}
13
					public boolean canUndo() {
14
						return source != null && edgeToRemove != null;
15
					}
16
					public void undo() {
17
						source.getDiagram().insertEdge(edgeToRemove);
18
						edgeToRemove.setSource(source);
19
						edgeToRemove.setTarget(target);
20
					}
21
					public void redo() {
22
						execute();
23
					}
24
					public void execute() {
25
						source.getDiagram().removeEdge(edgeToRemove);
26
						edgeToRemove.setSource(null);
27
						edgeToRemove.setTarget(null);
28
					}
29
				});
30
				return new WrappingCommand(editingDomain, cc);
31
			}
32
			private org.eclipse.emf.common.command.Command createDomainModelRemoveCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) {
9
<%
33
<%
10
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
34
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
11
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
35
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 32-146 Link Here
32
				}
56
				}
33
			}
57
			}
34
%>
58
%>
35
						<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
59
				<%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>();
36
<%
60
<%
37
			if (containmentFeature.getEcoreFeature().isMany()) {
61
			if (containmentFeature.getEcoreFeature().isMany()) {
38
%>
62
%>
39
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
63
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
40
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
64
					editingDomain,
41
							edgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), edgeToRemove.getElement()));
65
					getDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), getDiagramEdge().getElement()));
42
<%
66
<%
43
			} else {
67
			} else {
44
%>
68
%>
45
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
69
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
46
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
70
					editingDomain,
47
							edgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
71
					getDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
48
<%
72
<%
49
			}
73
			}
50
		} else {
74
		} else {
51
%>
75
%>
52
			return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
76
				return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE;
53
<%
77
<%
54
		}
78
		}
55
		if (removeChild) {
79
		if (removeChild) {
56
			if (childFeature.getEcoreFeature().isMany()) {
80
			if (childFeature.getEcoreFeature().isMany()) {
57
%>
81
%>
58
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
82
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
59
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
83
					editingDomain,
60
							edgeToRemove.getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
84
					getDiagramEdge().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
61
							edgeToRemove.getElement()));
85
					getDiagramEdge().getElement()));
62
<%
86
<%
63
			} else {
87
			} else {
64
%>
88
%>
65
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
89
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
66
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
90
					editingDomain,
67
							edgeToRemove.getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
91
					getDiagramEdge().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(),
68
							<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
92
					<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
69
<%
93
<%
70
			}
94
			}
71
		}
95
		}
72
		if (removeSource) {
96
		if (removeSource) {
73
			if (sourceFeature.getEcoreFeature().isMany()) {
97
			if (sourceFeature.getEcoreFeature().isMany()) {
74
%>
98
%>
75
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
99
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
76
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
100
					editingDomain,
77
							edgeToRemove.getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), source.getElement()));
101
					getDiagramEdge().getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), getDiagramEdge().getSource().getElement()));
78
<%
102
<%
79
			} else {
103
			} else {
80
%>
104
%>
81
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
105
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
82
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
106
					editingDomain,
83
							edgeToRemove.getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
107
					getDiagramEdge().getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
84
<%
108
<%
85
			}
109
			}
86
		}
110
		}
87
		if (removeTarget) {
111
		if (removeTarget) {
88
			if (targetFeature.getEcoreFeature().isMany()) {
112
			if (targetFeature.getEcoreFeature().isMany()) {
89
%>
113
%>
90
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
114
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
91
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
115
					editingDomain,
92
							edgeToRemove.getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), target.getElement()));
116
					getDiagramEdge().getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), getDiagramEdge().getTarget().getElement()));
93
<%
117
<%
94
			} else {
118
			} else {
95
%>
119
%>
96
						result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
120
				result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
97
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
121
					editingDomain,
98
							edgeToRemove.getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
122
					getDiagramEdge().getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE));
99
<%
123
<%
100
			}
124
			}
101
		}
125
		}
102
%>
126
%>
103
						return result;
127
				return result;
104
<%
128
<%
105
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
129
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
106
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
130
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
107
		if (metaFeature.getEcoreFeature().isMany()) {
131
		if (metaFeature.getEcoreFeature().isMany()) {
108
%>
132
%>
109
						return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
133
				return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(
110
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
134
					editingDomain,
111
							source.getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), target.getElement());
135
					getDiagramEdge().getSource().getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), getDiagramEdge().getTarget().getElement());
112
<%
136
<%
113
		} else {
137
		} else {
114
%>
138
%>
115
						return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
139
				return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(
116
							<%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()),
140
					editingDomain,
117
							source.getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE);
141
					getDiagramEdge().getSource().getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE);
118
<%
142
<%
119
		}
143
		}
120
%>
144
%>
121
<%
145
<%
122
	}
146
	}
123
%>
147
%>
124
					}
125
126
					public boolean canExecute() {
127
						return domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute();
128
					}
129
					public void execute() {
130
						domainModelRemoveCommand.execute();
131
						source.getDiagram().removeEdge(edgeToRemove);
132
						edgeToRemove.setSource(null);
133
						edgeToRemove.setTarget(null);
134
					}
135
					public boolean canUndo() {
136
						return domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo();
137
					}
138
					public void undo() {
139
						domainModelRemoveCommand.undo();
140
						source.getDiagram().insertEdge(edgeToRemove);
141
						edgeToRemove.setSource(source);
142
						edgeToRemove.setTarget(target);
143
					}
144
				};
145
			}
148
			}
146
		});
149
		});
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java (-208 / +193 lines)
Lines 37-150 Link Here
37
  protected final String TEXT_18 = ".COMPONENT_ROLE, new ";
37
  protected final String TEXT_18 = ".COMPONENT_ROLE, new ";
38
  protected final String TEXT_19 = "() {" + NL + "\t\t\tprotected ";
38
  protected final String TEXT_19 = "() {" + NL + "\t\t\tprotected ";
39
  protected final String TEXT_20 = " createDeleteCommand(";
39
  protected final String TEXT_20 = " createDeleteCommand(";
40
  protected final String TEXT_21 = " deleteRequest) {" + NL + "\t\t\t\treturn new ";
40
  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_22 = "() {" + NL + "\t\t\t\t\tprivate final Edge edgeToRemove = getDiagramEdge();" + NL + "\t\t\t\t\tprivate final View source = edgeToRemove.getSource();" + NL + "\t\t\t\t\tprivate final View target = edgeToRemove.getTarget();" + NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = createDomainModelRemoveCommand();" + NL + "\t\t\t\t\tprivate org.eclipse.emf.common.command.Command createDomainModelRemoveCommand() {";
41
  protected final String TEXT_22 = " editingDomain = ";
42
  protected final String TEXT_23 = NL + "\t\t\t\t\t\t";
42
  protected final String TEXT_23 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t";
43
  protected final String TEXT_24 = " result = new ";
43
  protected final String TEXT_24 = " cc = new ";
44
  protected final String TEXT_25 = "();";
44
  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_26 = NL + "\t\t\t\t\t\tresult.append(";
45
  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}" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command createDomainModelRemoveCommand(";
46
  protected final String TEXT_27 = ".create(" + NL + "\t\t\t\t\t\t\t";
46
  protected final String TEXT_27 = " editingDomain) {";
47
  protected final String TEXT_28 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), edgeToRemove.getElement()));";
47
  protected final String TEXT_28 = NL + "\t\t\t\t";
48
  protected final String TEXT_29 = NL + "\t\t\t\t\t\tresult.append(";
48
  protected final String TEXT_29 = " result = new ";
49
  protected final String TEXT_30 = ".create(" + NL + "\t\t\t\t\t\t\t";
49
  protected final String TEXT_30 = "();";
50
  protected final String TEXT_31 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), ";
50
  protected final String TEXT_31 = NL + "\t\t\t\tresult.append(";
51
  protected final String TEXT_32 = ".UNSET_VALUE));";
51
  protected final String TEXT_32 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), getDiagramEdge().getElement()));";
52
  protected final String TEXT_33 = NL + "\t\t\treturn ";
52
  protected final String TEXT_33 = NL + "\t\t\t\tresult.append(";
53
  protected final String TEXT_34 = ".INSTANCE;";
53
  protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), ";
54
  protected final String TEXT_35 = NL + "\t\t\t\t\t\tresult.append(";
54
  protected final String TEXT_35 = ".UNSET_VALUE));";
55
  protected final String TEXT_36 = ".create(" + NL + "\t\t\t\t\t\t\t";
55
  protected final String TEXT_36 = NL + "\t\t\t\treturn ";
56
  protected final String TEXT_37 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), ";
56
  protected final String TEXT_37 = ".INSTANCE;";
57
  protected final String TEXT_38 = ".eINSTANCE.get";
57
  protected final String TEXT_38 = NL + "\t\t\t\tresult.append(";
58
  protected final String TEXT_39 = "()," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement()));";
58
  protected final String TEXT_39 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), ";
59
  protected final String TEXT_40 = NL + "\t\t\t\t\t\tresult.append(";
59
  protected final String TEXT_40 = ".eINSTANCE.get";
60
  protected final String TEXT_41 = ".create(" + NL + "\t\t\t\t\t\t\t";
60
  protected final String TEXT_41 = "()," + NL + "\t\t\t\t\tgetDiagramEdge().getElement()));";
61
  protected final String TEXT_42 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), ";
61
  protected final String TEXT_42 = NL + "\t\t\t\tresult.append(";
62
  protected final String TEXT_43 = ".eINSTANCE.get";
62
  protected final String TEXT_43 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), ";
63
  protected final String TEXT_44 = "()," + NL + "\t\t\t\t\t\t\t";
63
  protected final String TEXT_44 = ".eINSTANCE.get";
64
  protected final String TEXT_45 = ".UNSET_VALUE));";
64
  protected final String TEXT_45 = "()," + NL + "\t\t\t\t\t";
65
  protected final String TEXT_46 = NL + "\t\t\t\t\t\tresult.append(";
65
  protected final String TEXT_46 = ".UNSET_VALUE));";
66
  protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\t\t\t";
66
  protected final String TEXT_47 = NL + "\t\t\t\tresult.append(";
67
  protected final String TEXT_48 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), ";
67
  protected final String TEXT_48 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), ";
68
  protected final String TEXT_49 = ".eINSTANCE.get";
68
  protected final String TEXT_49 = ".eINSTANCE.get";
69
  protected final String TEXT_50 = "(), source.getElement()));";
69
  protected final String TEXT_50 = "(), getDiagramEdge().getSource().getElement()));";
70
  protected final String TEXT_51 = NL + "\t\t\t\t\t\tresult.append(";
70
  protected final String TEXT_51 = NL + "\t\t\t\tresult.append(";
71
  protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\t\t\t";
71
  protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), ";
72
  protected final String TEXT_53 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), ";
72
  protected final String TEXT_53 = ".eINSTANCE.get";
73
  protected final String TEXT_54 = ".eINSTANCE.get";
73
  protected final String TEXT_54 = "(), ";
74
  protected final String TEXT_55 = "(), ";
74
  protected final String TEXT_55 = ".UNSET_VALUE));";
75
  protected final String TEXT_56 = ".UNSET_VALUE));";
75
  protected final String TEXT_56 = NL + "\t\t\t\tresult.append(";
76
  protected final String TEXT_57 = NL + "\t\t\t\t\t\tresult.append(";
76
  protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), ";
77
  protected final String TEXT_58 = ".create(" + NL + "\t\t\t\t\t\t\t";
77
  protected final String TEXT_58 = ".eINSTANCE.get";
78
  protected final String TEXT_59 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), ";
78
  protected final String TEXT_59 = "(), getDiagramEdge().getTarget().getElement()));";
79
  protected final String TEXT_60 = ".eINSTANCE.get";
79
  protected final String TEXT_60 = NL + "\t\t\t\tresult.append(";
80
  protected final String TEXT_61 = "(), target.getElement()));";
80
  protected final String TEXT_61 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), ";
81
  protected final String TEXT_62 = NL + "\t\t\t\t\t\tresult.append(";
81
  protected final String TEXT_62 = ".eINSTANCE.get";
82
  protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\t\t\t";
82
  protected final String TEXT_63 = "(), ";
83
  protected final String TEXT_64 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), ";
83
  protected final String TEXT_64 = ".UNSET_VALUE));";
84
  protected final String TEXT_65 = ".eINSTANCE.get";
84
  protected final String TEXT_65 = NL + "\t\t\t\treturn result;";
85
  protected final String TEXT_66 = "(), ";
85
  protected final String TEXT_66 = NL + "\t\t\t\treturn ";
86
  protected final String TEXT_67 = ".UNSET_VALUE));";
86
  protected final String TEXT_67 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getSource().getElement(), ";
87
  protected final String TEXT_68 = NL + "\t\t\t\t\t\treturn result;";
87
  protected final String TEXT_68 = ".eINSTANCE.get";
88
  protected final String TEXT_69 = NL + "\t\t\t\t\t\treturn ";
88
  protected final String TEXT_69 = "(), getDiagramEdge().getTarget().getElement());";
89
  protected final String TEXT_70 = ".create(" + NL + "\t\t\t\t\t\t\t";
89
  protected final String TEXT_70 = NL + "\t\t\t\treturn ";
90
  protected final String TEXT_71 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tsource.getElement(), ";
90
  protected final String TEXT_71 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getSource().getElement(), ";
91
  protected final String TEXT_72 = ".eINSTANCE.get";
91
  protected final String TEXT_72 = ".eINSTANCE.get";
92
  protected final String TEXT_73 = "(), target.getElement());";
92
  protected final String TEXT_73 = "(), ";
93
  protected final String TEXT_74 = NL + "\t\t\t\t\t\treturn ";
93
  protected final String TEXT_74 = ".UNSET_VALUE);";
94
  protected final String TEXT_75 = ".create(" + NL + "\t\t\t\t\t\t\t";
94
  protected final String TEXT_75 = NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
95
  protected final String TEXT_76 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tsource.getElement(), ";
95
  protected final String TEXT_76 = ".CONNECTION_ENDPOINTS_ROLE, new ";
96
  protected final String TEXT_77 = ".eINSTANCE.get";
96
  protected final String TEXT_77 = "());" + NL + "\t}" + NL;
97
  protected final String TEXT_78 = "(), ";
97
  protected final String TEXT_78 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
98
  protected final String TEXT_79 = ".UNSET_VALUE);";
98
  protected final String TEXT_79 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
99
  protected final String TEXT_80 = NL + "\t\t\t\t\t}" + NL + "" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.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\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.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};" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy(";
99
  protected final String TEXT_80 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
100
  protected final String TEXT_81 = ".CONNECTION_ENDPOINTS_ROLE, new ";
100
  protected final String TEXT_81 = " nextChild = (";
101
  protected final String TEXT_82 = "());" + NL + "\t}" + NL;
101
  protected final String TEXT_82 = ")it.next();" + NL + "\t\t\tif (";
102
  protected final String TEXT_83 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
102
  protected final String TEXT_83 = ".getVisualID(nextChild) == ";
103
  protected final String TEXT_84 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
103
  protected final String TEXT_84 = ".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(";
104
  protected final String TEXT_85 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
104
  protected final String TEXT_85 = " req) {" + NL + "\t\tif (";
105
  protected final String TEXT_86 = " nextChild = (";
105
  protected final String TEXT_86 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
106
  protected final String TEXT_87 = ")it.next();" + NL + "\t\t\tif (";
106
  protected final String TEXT_87 = " primaryLabel = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabel != null) {" + NL + "\t\t\t\tprimaryLabel.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
107
  protected final String TEXT_88 = ".getVisualID(nextChild) == ";
107
  protected final String TEXT_88 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL;
108
  protected final String TEXT_89 = ".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(";
108
  protected final String TEXT_89 = NL;
109
  protected final String TEXT_90 = " req) {" + NL + "\t\tif (";
109
  protected final String TEXT_90 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
110
  protected final String TEXT_91 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
110
  protected final String TEXT_91 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
111
  protected final String TEXT_92 = " primaryLabel = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabel != null) {" + NL + "\t\t\t\tprimaryLabel.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
111
  protected final String TEXT_92 = " feature, ";
112
  protected final String TEXT_93 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL;
112
  protected final String TEXT_93 = " 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 + "\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;
113
  protected final String TEXT_94 = NL;
113
  protected final String TEXT_94 = NL;
114
  protected final String TEXT_95 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
114
  protected final String TEXT_95 = "\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 ";
115
  protected final String TEXT_96 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
115
  protected final String TEXT_96 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
116
  protected final String TEXT_97 = " feature, ";
116
  protected final String TEXT_97 = " 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((";
117
  protected final String TEXT_98 = " 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 + "\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;
117
  protected final String TEXT_98 = ") 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;
118
  protected final String TEXT_99 = NL;
118
  protected final String TEXT_99 = NL;
119
  protected final String TEXT_100 = "\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 ";
119
  protected final String TEXT_100 = "\tpublic void addRefresher(";
120
  protected final String TEXT_101 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
120
  protected final String TEXT_101 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher(";
121
  protected final String TEXT_102 = " 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((";
121
  protected final String TEXT_102 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
122
  protected final String TEXT_103 = ") 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;
122
  protected final String TEXT_103 = " 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();";
123
  protected final String TEXT_104 = NL;
123
  protected final String TEXT_104 = NL;
124
  protected final String TEXT_105 = "\tpublic void addRefresher(";
124
  protected final String TEXT_105 = "\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(";
125
  protected final String TEXT_106 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher(";
125
  protected final String TEXT_106 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
126
  protected final String TEXT_107 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
126
  protected final String TEXT_107 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
127
  protected final String TEXT_108 = " 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();";
127
  protected final String TEXT_108 = NL;
128
  protected final String TEXT_109 = NL;
128
  protected final String TEXT_109 = "\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(";
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 = ".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 + "" + 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 ";
130
  protected final String TEXT_111 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
130
  protected final String TEXT_111 = " createFigure() {";
131
  protected final String TEXT_112 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
131
  protected final String TEXT_112 = NL + "\t\treturn new ";
132
  protected final String TEXT_113 = NL;
132
  protected final String TEXT_113 = "();";
133
  protected final String TEXT_114 = "\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(";
133
  protected final String TEXT_114 = NL + "\t\treturn ";
134
  protected final String TEXT_115 = ".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 + "" + 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 ";
134
  protected final String TEXT_115 = ";";
135
  protected final String TEXT_116 = " createFigure() {";
135
  protected final String TEXT_116 = NL + " \t\treturn new ";
136
  protected final String TEXT_117 = NL + "\t\treturn new ";
136
  protected final String TEXT_117 = "();";
137
  protected final String TEXT_118 = "();";
137
  protected final String TEXT_118 = NL + "\t}" + NL;
138
  protected final String TEXT_119 = NL + "\t\treturn ";
138
  protected final String TEXT_119 = NL;
139
  protected final String TEXT_120 = ";";
139
  protected final String TEXT_120 = NL;
140
  protected final String TEXT_121 = NL + " \t\treturn new ";
140
  protected final String TEXT_121 = 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}";
141
  protected final String TEXT_122 = "();";
141
  protected final String TEXT_122 = NL + "}";
142
  protected final String TEXT_123 = NL + "\t}" + NL;
142
  protected final String TEXT_123 = NL;
143
  protected final String TEXT_124 = NL;
144
  protected final String TEXT_125 = NL;
145
  protected final String TEXT_126 = 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}";
146
  protected final String TEXT_127 = NL + "}";
147
  protected final String TEXT_128 = NL;
148
143
149
  public String generate(Object argument)
144
  public String generate(Object argument)
150
  {
145
  {
Lines 201-208 Link Here
201
    stringBuffer.append(TEXT_20);
196
    stringBuffer.append(TEXT_20);
202
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
197
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
203
    stringBuffer.append(TEXT_21);
198
    stringBuffer.append(TEXT_21);
204
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
199
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
205
    stringBuffer.append(TEXT_22);
200
    stringBuffer.append(TEXT_22);
201
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
202
    stringBuffer.append(TEXT_23);
203
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
204
    stringBuffer.append(TEXT_24);
205
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
206
    stringBuffer.append(TEXT_25);
207
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
208
    stringBuffer.append(TEXT_26);
209
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
210
    stringBuffer.append(TEXT_27);
206
    
211
    
207
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
212
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
208
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
213
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
Lines 229-302 Link Here
229
				}
234
				}
230
			}
235
			}
231
236
232
    stringBuffer.append(TEXT_23);
237
    stringBuffer.append(TEXT_28);
233
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
238
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
234
    stringBuffer.append(TEXT_24);
239
    stringBuffer.append(TEXT_29);
235
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
240
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
236
    stringBuffer.append(TEXT_25);
241
    stringBuffer.append(TEXT_30);
237
    
242
    
238
			if (containmentFeature.getEcoreFeature().isMany()) {
243
			if (containmentFeature.getEcoreFeature().isMany()) {
239
244
240
    stringBuffer.append(TEXT_26);
245
    stringBuffer.append(TEXT_31);
241
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
246
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
242
    stringBuffer.append(TEXT_27);
247
    stringBuffer.append(TEXT_32);
243
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
244
    stringBuffer.append(TEXT_28);
245
    
248
    
246
			} else {
249
			} else {
247
250
248
    stringBuffer.append(TEXT_29);
251
    stringBuffer.append(TEXT_33);
249
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
252
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
250
    stringBuffer.append(TEXT_30);
253
    stringBuffer.append(TEXT_34);
251
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
252
    stringBuffer.append(TEXT_31);
253
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
254
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
254
    stringBuffer.append(TEXT_32);
255
    stringBuffer.append(TEXT_35);
255
    
256
    
256
			}
257
			}
257
		} else {
258
		} else {
258
259
259
    stringBuffer.append(TEXT_33);
260
    stringBuffer.append(TEXT_36);
260
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
261
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
261
    stringBuffer.append(TEXT_34);
262
    stringBuffer.append(TEXT_37);
262
    
263
    
263
		}
264
		}
264
		if (removeChild) {
265
		if (removeChild) {
265
			if (childFeature.getEcoreFeature().isMany()) {
266
			if (childFeature.getEcoreFeature().isMany()) {
266
267
267
    stringBuffer.append(TEXT_35);
268
    stringBuffer.append(TEXT_38);
268
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
269
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
269
    stringBuffer.append(TEXT_36);
270
    stringBuffer.append(TEXT_39);
270
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
271
    stringBuffer.append(TEXT_37);
272
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
271
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
273
    stringBuffer.append(TEXT_38);
272
    stringBuffer.append(TEXT_40);
274
    stringBuffer.append(childFeature.getFeatureAccessorName());
273
    stringBuffer.append(childFeature.getFeatureAccessorName());
275
    stringBuffer.append(TEXT_39);
274
    stringBuffer.append(TEXT_41);
276
    
275
    
277
			} else {
276
			} else {
278
277
279
    stringBuffer.append(TEXT_40);
280
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
281
    stringBuffer.append(TEXT_41);
282
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
283
    stringBuffer.append(TEXT_42);
278
    stringBuffer.append(TEXT_42);
284
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
279
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
285
    stringBuffer.append(TEXT_43);
280
    stringBuffer.append(TEXT_43);
286
    stringBuffer.append(childFeature.getFeatureAccessorName());
281
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
287
    stringBuffer.append(TEXT_44);
282
    stringBuffer.append(TEXT_44);
288
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
283
    stringBuffer.append(childFeature.getFeatureAccessorName());
289
    stringBuffer.append(TEXT_45);
284
    stringBuffer.append(TEXT_45);
285
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
286
    stringBuffer.append(TEXT_46);
290
    
287
    
291
			}
288
			}
292
		}
289
		}
293
		if (removeSource) {
290
		if (removeSource) {
294
			if (sourceFeature.getEcoreFeature().isMany()) {
291
			if (sourceFeature.getEcoreFeature().isMany()) {
295
292
296
    stringBuffer.append(TEXT_46);
297
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
298
    stringBuffer.append(TEXT_47);
293
    stringBuffer.append(TEXT_47);
299
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
294
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
300
    stringBuffer.append(TEXT_48);
295
    stringBuffer.append(TEXT_48);
301
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
296
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
302
    stringBuffer.append(TEXT_49);
297
    stringBuffer.append(TEXT_49);
Lines 308-457 Link Here
308
    stringBuffer.append(TEXT_51);
303
    stringBuffer.append(TEXT_51);
309
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
304
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
310
    stringBuffer.append(TEXT_52);
305
    stringBuffer.append(TEXT_52);
311
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
312
    stringBuffer.append(TEXT_53);
313
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
306
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
314
    stringBuffer.append(TEXT_54);
307
    stringBuffer.append(TEXT_53);
315
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
308
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
316
    stringBuffer.append(TEXT_55);
309
    stringBuffer.append(TEXT_54);
317
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
310
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
318
    stringBuffer.append(TEXT_56);
311
    stringBuffer.append(TEXT_55);
319
    
312
    
320
			}
313
			}
321
		}
314
		}
322
		if (removeTarget) {
315
		if (removeTarget) {
323
			if (targetFeature.getEcoreFeature().isMany()) {
316
			if (targetFeature.getEcoreFeature().isMany()) {
324
317
325
    stringBuffer.append(TEXT_57);
318
    stringBuffer.append(TEXT_56);
326
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
319
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
327
    stringBuffer.append(TEXT_58);
320
    stringBuffer.append(TEXT_57);
328
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
329
    stringBuffer.append(TEXT_59);
330
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
321
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
331
    stringBuffer.append(TEXT_60);
322
    stringBuffer.append(TEXT_58);
332
    stringBuffer.append(targetFeature.getFeatureAccessorName());
323
    stringBuffer.append(targetFeature.getFeatureAccessorName());
333
    stringBuffer.append(TEXT_61);
324
    stringBuffer.append(TEXT_59);
334
    
325
    
335
			} else {
326
			} else {
336
327
337
    stringBuffer.append(TEXT_62);
328
    stringBuffer.append(TEXT_60);
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
329
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
339
    stringBuffer.append(TEXT_63);
330
    stringBuffer.append(TEXT_61);
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
341
    stringBuffer.append(TEXT_64);
342
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
331
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
343
    stringBuffer.append(TEXT_65);
332
    stringBuffer.append(TEXT_62);
344
    stringBuffer.append(targetFeature.getFeatureAccessorName());
333
    stringBuffer.append(targetFeature.getFeatureAccessorName());
345
    stringBuffer.append(TEXT_66);
334
    stringBuffer.append(TEXT_63);
346
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
347
    stringBuffer.append(TEXT_67);
336
    stringBuffer.append(TEXT_64);
348
    
337
    
349
			}
338
			}
350
		}
339
		}
351
340
352
    stringBuffer.append(TEXT_68);
341
    stringBuffer.append(TEXT_65);
353
    
342
    
354
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
343
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
355
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
344
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
356
		if (metaFeature.getEcoreFeature().isMany()) {
345
		if (metaFeature.getEcoreFeature().isMany()) {
357
346
358
    stringBuffer.append(TEXT_69);
347
    stringBuffer.append(TEXT_66);
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
348
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
360
    stringBuffer.append(TEXT_70);
349
    stringBuffer.append(TEXT_67);
361
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
362
    stringBuffer.append(TEXT_71);
363
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
350
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
364
    stringBuffer.append(TEXT_72);
351
    stringBuffer.append(TEXT_68);
365
    stringBuffer.append(metaFeature.getFeatureAccessorName());
352
    stringBuffer.append(metaFeature.getFeatureAccessorName());
366
    stringBuffer.append(TEXT_73);
353
    stringBuffer.append(TEXT_69);
367
    
354
    
368
		} else {
355
		} else {
369
356
370
    stringBuffer.append(TEXT_74);
357
    stringBuffer.append(TEXT_70);
371
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
358
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
372
    stringBuffer.append(TEXT_75);
359
    stringBuffer.append(TEXT_71);
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
374
    stringBuffer.append(TEXT_76);
375
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
360
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
376
    stringBuffer.append(TEXT_77);
361
    stringBuffer.append(TEXT_72);
377
    stringBuffer.append(metaFeature.getFeatureAccessorName());
362
    stringBuffer.append(metaFeature.getFeatureAccessorName());
378
    stringBuffer.append(TEXT_78);
363
    stringBuffer.append(TEXT_73);
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
380
    stringBuffer.append(TEXT_79);
365
    stringBuffer.append(TEXT_74);
381
    
366
    
382
		}
367
		}
383
368
384
    
369
    
385
	}
370
	}
386
371
387
    stringBuffer.append(TEXT_80);
372
    stringBuffer.append(TEXT_75);
388
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
389
    stringBuffer.append(TEXT_81);
374
    stringBuffer.append(TEXT_76);
390
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
391
    stringBuffer.append(TEXT_82);
376
    stringBuffer.append(TEXT_77);
392
    
377
    
393
if (genLink.getLabels().size() > 0) {
378
if (genLink.getLabels().size() > 0) {
394
	GenLinkLabel primaryLabel = (GenLinkLabel)genLink.getLabels().get(0);
379
	GenLinkLabel primaryLabel = (GenLinkLabel)genLink.getLabels().get(0);
395
380
396
    stringBuffer.append(TEXT_83);
381
    stringBuffer.append(TEXT_78);
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
382
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
398
    stringBuffer.append(TEXT_84);
383
    stringBuffer.append(TEXT_79);
399
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
384
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
400
    stringBuffer.append(TEXT_85);
385
    stringBuffer.append(TEXT_80);
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
386
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
402
    stringBuffer.append(TEXT_86);
387
    stringBuffer.append(TEXT_81);
403
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
388
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
404
    stringBuffer.append(TEXT_87);
389
    stringBuffer.append(TEXT_82);
405
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
390
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
406
    stringBuffer.append(TEXT_88);
391
    stringBuffer.append(TEXT_83);
407
    stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
392
    stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
408
    stringBuffer.append(TEXT_89);
393
    stringBuffer.append(TEXT_84);
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
394
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
410
    stringBuffer.append(TEXT_90);
395
    stringBuffer.append(TEXT_85);
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
412
    stringBuffer.append(TEXT_91);
397
    stringBuffer.append(TEXT_86);
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
414
    stringBuffer.append(TEXT_92);
399
    stringBuffer.append(TEXT_87);
415
    
400
    
416
}	//if (genLink.getLabels().size() > 0)
401
}	//if (genLink.getLabels().size() > 0)
417
402
403
    stringBuffer.append(TEXT_88);
404
    stringBuffer.append(TEXT_89);
405
    stringBuffer.append(TEXT_90);
406
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
407
    stringBuffer.append(TEXT_91);
408
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
409
    stringBuffer.append(TEXT_92);
410
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
418
    stringBuffer.append(TEXT_93);
411
    stringBuffer.append(TEXT_93);
419
    stringBuffer.append(TEXT_94);
412
    stringBuffer.append(TEXT_94);
420
    stringBuffer.append(TEXT_95);
413
    stringBuffer.append(TEXT_95);
421
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
414
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
422
    stringBuffer.append(TEXT_96);
415
    stringBuffer.append(TEXT_96);
423
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
424
    stringBuffer.append(TEXT_97);
425
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
416
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
417
    stringBuffer.append(TEXT_97);
418
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
426
    stringBuffer.append(TEXT_98);
419
    stringBuffer.append(TEXT_98);
427
    stringBuffer.append(TEXT_99);
420
    stringBuffer.append(TEXT_99);
428
    stringBuffer.append(TEXT_100);
421
    stringBuffer.append(TEXT_100);
429
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
422
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
430
    stringBuffer.append(TEXT_101);
423
    stringBuffer.append(TEXT_101);
431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
432
    stringBuffer.append(TEXT_102);
425
    stringBuffer.append(TEXT_102);
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
434
    stringBuffer.append(TEXT_103);
427
    stringBuffer.append(TEXT_103);
435
    stringBuffer.append(TEXT_104);
428
    stringBuffer.append(TEXT_104);
436
    stringBuffer.append(TEXT_105);
429
    stringBuffer.append(TEXT_105);
437
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
430
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
438
    stringBuffer.append(TEXT_106);
431
    stringBuffer.append(TEXT_106);
439
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
432
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
440
    stringBuffer.append(TEXT_107);
433
    stringBuffer.append(TEXT_107);
441
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
442
    stringBuffer.append(TEXT_108);
434
    stringBuffer.append(TEXT_108);
443
    stringBuffer.append(TEXT_109);
435
    stringBuffer.append(TEXT_109);
444
    stringBuffer.append(TEXT_110);
445
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
446
    stringBuffer.append(TEXT_111);
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
436
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
448
    stringBuffer.append(TEXT_112);
437
    stringBuffer.append(TEXT_110);
449
    stringBuffer.append(TEXT_113);
450
    stringBuffer.append(TEXT_114);
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
452
    stringBuffer.append(TEXT_115);
453
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
438
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
454
    stringBuffer.append(TEXT_116);
439
    stringBuffer.append(TEXT_111);
455
    
440
    
456
Viewmap viewmap = genLink.getViewmap();
441
Viewmap viewmap = genLink.getViewmap();
457
if (viewmap instanceof FigureViewmap) {
442
if (viewmap instanceof FigureViewmap) {
Lines 461-501 Link Here
461
		figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
446
		figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
462
	}
447
	}
463
448
464
    stringBuffer.append(TEXT_117);
449
    stringBuffer.append(TEXT_112);
465
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
450
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
466
    stringBuffer.append(TEXT_118);
451
    stringBuffer.append(TEXT_113);
467
    } // instanceof FigureViewmap
452
    } // instanceof FigureViewmap
468
	else if (viewmap instanceof SnippetViewmap) {
453
	else if (viewmap instanceof SnippetViewmap) {
469
    stringBuffer.append(TEXT_119);
454
    stringBuffer.append(TEXT_114);
470
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
455
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
471
    stringBuffer.append(TEXT_120);
456
    stringBuffer.append(TEXT_115);
472
    } // instanceof SnippetViewmap 
457
    } // instanceof SnippetViewmap 
473
	else if (viewmap instanceof InnerClassViewmap) {
458
	else if (viewmap instanceof InnerClassViewmap) {
474
    stringBuffer.append(TEXT_121);
459
    stringBuffer.append(TEXT_116);
475
    stringBuffer.append(((InnerClassViewmap) viewmap).getClassName());
460
    stringBuffer.append(((InnerClassViewmap) viewmap).getClassName());
476
    stringBuffer.append(TEXT_122);
461
    stringBuffer.append(TEXT_117);
477
    }
462
    }
478
    stringBuffer.append(TEXT_123);
463
    stringBuffer.append(TEXT_118);
479
    
464
    
480
if (genLink.getViewmap() instanceof InnerClassViewmap) {
465
if (genLink.getViewmap() instanceof InnerClassViewmap) {
481
	String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
466
	String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
482
467
483
    stringBuffer.append(TEXT_124);
468
    stringBuffer.append(TEXT_119);
484
    stringBuffer.append(classBody);
469
    stringBuffer.append(classBody);
485
    stringBuffer.append(TEXT_125);
470
    stringBuffer.append(TEXT_120);
486
    
471
    
487
if (classBody.indexOf("DPtoLP") != -1) {
472
if (classBody.indexOf("DPtoLP") != -1) {
488
473
489
    stringBuffer.append(TEXT_126);
474
    stringBuffer.append(TEXT_121);
490
    
475
    
491
}
476
}
492
477
493
    
478
    
494
}
479
}
495
480
496
    stringBuffer.append(TEXT_127);
481
    stringBuffer.append(TEXT_122);
497
    importManager.emitSortedImports();
482
    importManager.emitSortedImports();
498
    stringBuffer.append(TEXT_128);
483
    stringBuffer.append(TEXT_123);
499
    return stringBuffer.toString();
484
    return stringBuffer.toString();
500
  }
485
  }
501
}
486
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java (-373 / +372 lines)
Lines 30-228 Link Here
30
  protected final String TEXT_10 = NL;
30
  protected final String TEXT_10 = NL;
31
  protected final String TEXT_11 = NL;
31
  protected final String TEXT_11 = NL;
32
  protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
32
  protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
33
  protected final String TEXT_13 = " manager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
33
  protected final String TEXT_13 = " manager;" + NL;
34
  protected final String TEXT_14 = "(View view) {" + NL + "\t\tassert view instanceof Node;" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Node getDiagramNode() {" + NL + "\t\treturn (Node)getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
34
  protected final String TEXT_14 = 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\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ";
35
  protected final String TEXT_15 = "(View view) {" + NL + "\t\tassert view instanceof Node;" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Node getDiagramNode() {" + NL + "\t\treturn (Node)getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
36
  protected final String TEXT_16 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});";
36
  protected final String TEXT_16 = NL + "\t\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ";
37
  protected final String TEXT_17 = NL;
37
  protected final String TEXT_17 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});";
38
  protected final String TEXT_18 = "\t\tinstallEditPolicy(";
38
  protected final String TEXT_18 = NL;
39
  protected final String TEXT_19 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
39
  protected final String TEXT_19 = "\t\tinstallEditPolicy(";
40
  protected final String TEXT_20 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
40
  protected final String TEXT_20 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
41
  protected final String TEXT_21 = " 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 ";
41
  protected final String TEXT_21 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
42
  protected final String TEXT_22 = " getDirectEditCommand(";
42
  protected final String TEXT_22 = " 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 = " 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 ";
43
  protected final String TEXT_23 = " getDirectEditCommand(";
44
  protected final String TEXT_24 = ".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 ";
44
  protected final String TEXT_24 = " 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 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
45
  protected final String TEXT_25 = ".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 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
46
  protected final String TEXT_26 = "(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 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
47
  protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
48
  protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
48
  protected final String TEXT_28 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
49
  protected final String TEXT_29 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
49
  protected final String TEXT_29 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
50
  protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
50
  protected final String TEXT_30 = " editingDomain = ";
51
  protected final String TEXT_31 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
51
  protected final String TEXT_31 = ".getEditingDomain(";
52
  protected final String TEXT_32 = " element = ";
52
  protected final String TEXT_32 = ".getDiagram().getElement());";
53
  protected final String TEXT_33 = ";" + NL + "\t\t\t\t\t\t\tprivate ";
53
  protected final String TEXT_33 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
54
  protected final String TEXT_34 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
54
  protected final String TEXT_34 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
55
  protected final String TEXT_35 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
55
  protected final String TEXT_35 = " 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 = " domainModelEditDomain = ";
56
  protected final String TEXT_36 = " createDomainModelCommand(";
57
  protected final String TEXT_37 = ".getEditingDomainFor(";
57
  protected final String TEXT_37 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t";
58
  protected final String TEXT_38 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
58
  protected final String TEXT_38 = " element = ";
59
  protected final String TEXT_39 = " feature = (";
59
  protected final String TEXT_39 = ";" + NL + "\t\t\t\t\t\t";
60
  protected final String TEXT_40 = ") ";
60
  protected final String TEXT_40 = " feature = (";
61
  protected final String TEXT_41 = ".eINSTANCE.get";
61
  protected final String TEXT_41 = ") ";
62
  protected final String TEXT_42 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
62
  protected final String TEXT_42 = ".eINSTANCE.get";
63
  protected final String TEXT_43 = ".parseValue(feature, parseResult[0]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
63
  protected final String TEXT_43 = "();" + 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 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}";
64
  protected final String TEXT_44 = ".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 = NL + "\t\t\t\t\t\t\t\t";
65
  protected final String TEXT_45 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
66
  protected final String TEXT_46 = " result = new ";
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\t\t";
67
  protected final String TEXT_47 = " result = new ";
68
  protected final String TEXT_48 = " values = new ";
68
  protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\t";
69
  protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get";
69
  protected final String TEXT_49 = " values = new ";
70
  protected final String TEXT_50 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
70
  protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
71
  protected final String TEXT_51 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
71
  protected final String TEXT_51 = "());" + NL + "\t\t\t\t\t\tresult.append(";
72
  protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;";
72
  protected final String TEXT_52 = ".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\t\treturn ";
73
  protected final String TEXT_53 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;";
74
  protected final String TEXT_54 = ".create(domainModelEditDomain, element, feature, valueToSet);";
74
  protected final String TEXT_54 = NL + "\t\t\t\t\t\treturn ";
75
  protected final String TEXT_55 = NL + "\t\t\t\t\t\t\t}";
75
  protected final String TEXT_55 = ".create(editingDomain, element, feature, valueToSet);";
76
  protected final String TEXT_56 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
76
  protected final String TEXT_56 = NL + "\t\t\t\t\t}";
77
  protected final String TEXT_57 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
77
  protected final String TEXT_57 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
78
  protected final String TEXT_58 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
78
  protected final String TEXT_58 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
79
  protected final String TEXT_59 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
79
  protected final String TEXT_59 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
80
  protected final String TEXT_60 = " element = ";
80
  protected final String TEXT_60 = " 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\t\tprivate ";
81
  protected final String TEXT_61 = " createDomainModelCommand(";
82
  protected final String TEXT_62 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
82
  protected final String TEXT_62 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t";
83
  protected final String TEXT_63 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
83
  protected final String TEXT_63 = " element = ";
84
  protected final String TEXT_64 = " domainModelEditDomain = ";
84
  protected final String TEXT_64 = ";" + NL + "\t\t\t\t\t\t";
85
  protected final String TEXT_65 = ".getEditingDomainFor(";
85
  protected final String TEXT_65 = " result = new ";
86
  protected final String TEXT_66 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
86
  protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;";
87
  protected final String TEXT_67 = " result = new ";
87
  protected final String TEXT_67 = NL + "\t\t\t\t\t\t";
88
  protected final String TEXT_68 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;";
88
  protected final String TEXT_68 = " ";
89
  protected final String TEXT_69 = NL + "\t\t\t\t\t\t\t\t";
89
  protected final String TEXT_69 = "feature = (";
90
  protected final String TEXT_70 = " ";
90
  protected final String TEXT_70 = ") ";
91
  protected final String TEXT_71 = "feature = (";
91
  protected final String TEXT_71 = ".eINSTANCE.get";
92
  protected final String TEXT_72 = ") ";
92
  protected final String TEXT_72 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
93
  protected final String TEXT_73 = ".eINSTANCE.get";
93
  protected final String TEXT_73 = ".parseValue(feature, values[";
94
  protected final String TEXT_74 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
94
  protected final String TEXT_74 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
95
  protected final String TEXT_75 = ".parseValue(feature, parseResult[";
95
  protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
96
  protected final String TEXT_76 = "]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
96
  protected final String TEXT_76 = NL + "\t\t\t\t\t\t";
97
  protected final String TEXT_77 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}";
97
  protected final String TEXT_77 = " ";
98
  protected final String TEXT_78 = NL + "\t\t\t\t\t\t\t\t";
98
  protected final String TEXT_78 = "values = new ";
99
  protected final String TEXT_79 = " ";
99
  protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
100
  protected final String TEXT_80 = "values = new ";
100
  protected final String TEXT_80 = "());" + NL + "\t\t\t\t\t\tresult.append(";
101
  protected final String TEXT_81 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get";
101
  protected final String TEXT_81 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
102
  protected final String TEXT_82 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
102
  protected final String TEXT_82 = ".create(editingDomain, element, feature, valueToSet));";
103
  protected final String TEXT_83 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
103
  protected final String TEXT_83 = NL + "\t\t\t\t\t\tresult.append(";
104
  protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, valueToSet));";
104
  protected final String TEXT_84 = ".create(editingDomain, element, feature, valueToSet));";
105
  protected final String TEXT_85 = NL + "\t\t\t\t\t\t\t\tresult.append(";
105
  protected final String TEXT_85 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
106
  protected final String TEXT_86 = ".create(domainModelEditDomain, element, feature, valueToSet));";
106
  protected final String TEXT_86 = NL + "\t\t\t\t});";
107
  protected final String TEXT_87 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}";
107
  protected final String TEXT_87 = NL + "\t}" + NL;
108
  protected final String TEXT_88 = NL + "\t\t\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.undo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.execute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canUndo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canExecute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t};" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});";
108
  protected final String TEXT_88 = NL;
109
  protected final String TEXT_89 = NL + "\t}" + NL;
109
  protected final String TEXT_89 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
110
  protected final String TEXT_90 = NL;
110
  protected final String TEXT_90 = " req) {" + NL + "\t\tif (";
111
  protected final String TEXT_91 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
111
  protected final String TEXT_91 = ".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 ";
112
  protected final String TEXT_92 = " req) {" + NL + "\t\tif (";
112
  protected final String TEXT_92 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
113
  protected final String TEXT_93 = ".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 ";
113
  protected final String TEXT_93 = "(this, ";
114
  protected final String TEXT_94 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
114
  protected final String TEXT_94 = ".class, new ";
115
  protected final String TEXT_95 = "(this, ";
115
  protected final String TEXT_95 = "() {" + NL + "\t\t\t\tpublic void relocate(";
116
  protected final String TEXT_96 = ".class, new ";
116
  protected final String TEXT_96 = " celleditor) {" + NL + "\t\t\t\t\t";
117
  protected final String TEXT_97 = "() {" + NL + "\t\t\t\tpublic void relocate(";
117
  protected final String TEXT_97 = " 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;
118
  protected final String TEXT_98 = " celleditor) {" + NL + "\t\t\t\t\t";
118
  protected final String TEXT_98 = 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\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tNode node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof Location;" + NL + "\t\tfinal Location location = (Location) node.getLayoutConstraint();" + NL + "\t\t((";
119
  protected final String TEXT_99 = " 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;
119
  protected final String TEXT_99 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new ";
120
  protected final String TEXT_100 = 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\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tNode node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof Location;" + NL + "\t\tfinal Location location = (Location) node.getLayoutConstraint();" + NL + "\t\t((";
120
  protected final String TEXT_100 = "() {" + NL + "\t\t\t\t\tprotected ";
121
  protected final String TEXT_101 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new ";
121
  protected final String TEXT_101 = " getReferencePoint() {" + NL + "\t\t\t\t\t\t";
122
  protected final String TEXT_102 = "() {" + NL + "\t\t\t\t\tprotected ";
122
  protected final String TEXT_102 = " parent = getUpdatableParent();" + NL + "\t\t\t\t\t\t";
123
  protected final String TEXT_103 = " getReferencePoint() {" + NL + "\t\t\t\t\t\t";
123
  protected final String TEXT_103 = " connection = (";
124
  protected final String TEXT_104 = " parent = getUpdatableParent();" + NL + "\t\t\t\t\t\t";
124
  protected final String TEXT_104 = ") parent.getFigure();" + NL + "\t\t\t\t\t\t";
125
  protected final String TEXT_105 = " connection = (";
125
  protected final String TEXT_105 = " midPoint = connection.getPoints().getMidpoint().getCopy();" + NL + "\t\t\t\t\t\tconnection.translateToAbsolute(midPoint);" + NL + "\t\t\t\t\t\treturn midPoint.translate(new ";
126
  protected final String TEXT_106 = ") parent.getFigure();" + NL + "\t\t\t\t\t\t";
126
  protected final String TEXT_106 = "(location.getX(), location.getY()));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t}" + NL;
127
  protected final String TEXT_107 = " midPoint = connection.getPoints().getMidpoint().getCopy();" + NL + "\t\t\t\t\t\tconnection.translateToAbsolute(midPoint);" + NL + "\t\t\t\t\t\treturn midPoint.translate(new ";
127
  protected final String TEXT_107 = NL;
128
  protected final String TEXT_108 = "(location.getX(), location.getY()));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t}" + NL;
128
  protected final String TEXT_108 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
129
  protected final String TEXT_109 = NL;
129
  protected final String TEXT_109 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
130
  protected final String TEXT_110 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
130
  protected final String TEXT_110 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
131
  protected final String TEXT_111 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
131
  protected final String TEXT_111 = " element = ";
132
  protected final String TEXT_112 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
132
  protected final String TEXT_112 = ";" + 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";
133
  protected final String TEXT_113 = " element = ";
133
  protected final String TEXT_113 = " element = ";
134
  protected final String TEXT_114 = ";" + 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";
134
  protected final String TEXT_114 = ";" + 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(";
135
  protected final String TEXT_115 = " element = ";
135
  protected final String TEXT_115 = " element, String pattern) {";
136
  protected final String TEXT_116 = ";" + 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(";
136
  protected final String TEXT_116 = NL + "\t\tif (element.get";
137
  protected final String TEXT_117 = " element, String pattern) {";
137
  protected final String TEXT_117 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
138
  protected final String TEXT_118 = NL + "\t\tif (element.get";
138
  protected final String TEXT_118 = NL + "\t\treturn ";
139
  protected final String TEXT_119 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
139
  protected final String TEXT_119 = ".format(pattern, new Object[] {";
140
  protected final String TEXT_120 = NL + "\t\treturn ";
140
  protected final String TEXT_120 = NL + "\t\t\t";
141
  protected final String TEXT_121 = ".format(pattern, new Object[] {";
141
  protected final String TEXT_121 = NL + "\t\t});";
142
  protected final String TEXT_122 = NL + "\t\t\t";
142
  protected final String TEXT_122 = NL + "\t\treturn ";
143
  protected final String TEXT_123 = NL + "\t\t});";
143
  protected final String TEXT_123 = ".format(pattern, new Object[] {";
144
  protected final String TEXT_124 = NL + "\t\treturn ";
144
  protected final String TEXT_124 = NL + "\t\t";
145
  protected final String TEXT_125 = ".format(pattern, new Object[] {";
145
  protected final String TEXT_125 = ",";
146
  protected final String TEXT_126 = NL + "\t\t";
146
  protected final String TEXT_126 = NL + "\t\t});";
147
  protected final String TEXT_127 = ",";
147
  protected final String TEXT_127 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
148
  protected final String TEXT_128 = NL + "\t\t});";
148
  protected final String TEXT_128 = NL + "\t}";
149
  protected final String TEXT_129 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
149
  protected final String TEXT_129 = NL;
150
  protected final String TEXT_130 = NL + "\t}";
150
  protected final String TEXT_130 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
151
  protected final String TEXT_131 = NL;
151
  protected final String TEXT_131 = " style =" + NL + "\t\t\t(";
152
  protected final String TEXT_132 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
152
  protected final String TEXT_132 = ") ";
153
  protected final String TEXT_133 = " style =" + NL + "\t\t\t(";
153
  protected final String TEXT_133 = ".getStyle(" + NL + "\t\t\t\t";
154
  protected final String TEXT_134 = ") ";
154
  protected final String TEXT_134 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
155
  protected final String TEXT_135 = ".getStyle(" + NL + "\t\t\t\t";
155
  protected final String TEXT_135 = " 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 = ";
156
  protected final String TEXT_136 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
156
  protected final String TEXT_136 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
157
  protected final String TEXT_137 = " 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 = ";
157
  protected final String TEXT_137 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
158
  protected final String TEXT_138 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
158
  protected final String TEXT_138 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
159
  protected final String TEXT_139 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
159
  protected final String TEXT_139 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
160
  protected final String TEXT_140 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
160
  protected final String TEXT_140 = " 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 ";
161
  protected final String TEXT_141 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
161
  protected final String TEXT_141 = "(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}" + NL + "\t}" + 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 ";
162
  protected final String TEXT_142 = " 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 ";
162
  protected final String TEXT_142 = " createdFont;";
163
  protected final String TEXT_143 = "(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}" + NL + "\t}" + 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 ";
163
  protected final String TEXT_143 = NL;
164
  protected final String TEXT_144 = " createdFont;";
164
  protected final String TEXT_144 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
165
  protected final String TEXT_145 = NL;
165
  protected final String TEXT_145 = " style = (";
166
  protected final String TEXT_146 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
166
  protected final String TEXT_146 = ")  ";
167
  protected final String TEXT_147 = " style = (";
167
  protected final String TEXT_147 = ".getStyle(";
168
  protected final String TEXT_148 = ")  ";
168
  protected final String TEXT_148 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
169
  protected final String TEXT_149 = ".getStyle(";
169
  protected final String TEXT_149 = " 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";
170
  protected final String TEXT_150 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
170
  protected final String TEXT_150 = " 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 ";
171
  protected final String TEXT_151 = " 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";
171
  protected final String TEXT_151 = "(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 ";
172
  protected final String TEXT_152 = " 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 ";
172
  protected final String TEXT_152 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
173
  protected final String TEXT_153 = "(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 ";
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 (";
174
  protected final String TEXT_154 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
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 ";
175
  protected final String TEXT_155 = " 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 (";
175
  protected final String TEXT_155 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
176
  protected final String TEXT_156 = ") 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 ";
176
  protected final String TEXT_156 = ") {" + NL + "\t\t\t\treturn (";
177
  protected final String TEXT_157 = " 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";
178
  protected final String TEXT_158 = ") {" + NL + "\t\t\t\treturn (";
178
  protected final String TEXT_158 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
179
  protected final String TEXT_159 = ") 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(";
180
  protected final String TEXT_160 = " 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(";
181
  protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
181
  protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
182
  protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
182
  protected final String TEXT_162 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
183
  protected final String TEXT_163 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
183
  protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
184
  protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
184
  protected final String TEXT_164 = NL + "\t\t\tupdatableParent.addRefresher(";
185
  protected final String TEXT_165 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
185
  protected final String TEXT_165 = ".eINSTANCE.get";
186
  protected final String TEXT_166 = NL + "\t\t\tupdatableParent.addRefresher(";
186
  protected final String TEXT_166 = "(), labelRefresher);";
187
  protected final String TEXT_167 = ".eINSTANCE.get";
187
  protected final String TEXT_167 = NL + "\t\t\tupdatableParent.addRefresher(";
188
  protected final String TEXT_168 = "(), labelRefresher);";
188
  protected final String TEXT_168 = ".eINSTANCE.get";
189
  protected final String TEXT_169 = NL + "\t\t\tupdatableParent.addRefresher(";
189
  protected final String TEXT_169 = "(), labelRefresher);";
190
  protected final String TEXT_170 = ".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";
191
  protected final String TEXT_171 = "(), labelRefresher);";
191
  protected final String TEXT_171 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
192
  protected final String TEXT_172 = 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(";
193
  protected final String TEXT_173 = " 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(";
194
  protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
194
  protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
195
  protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
195
  protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
196
  protected final String TEXT_176 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
196
  protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
197
  protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
197
  protected final String TEXT_177 = NL + "\t\t\tupdatableParent.removeRefresher(";
198
  protected final String TEXT_178 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
198
  protected final String TEXT_178 = ".eINSTANCE.get";
199
  protected final String TEXT_179 = NL + "\t\t\tupdatableParent.removeRefresher(";
199
  protected final String TEXT_179 = "(), labelRefresher);";
200
  protected final String TEXT_180 = ".eINSTANCE.get";
200
  protected final String TEXT_180 = NL + "\t\t\tupdatableParent.removeRefresher(";
201
  protected final String TEXT_181 = "(), labelRefresher);";
201
  protected final String TEXT_181 = ".eINSTANCE.get";
202
  protected final String TEXT_182 = NL + "\t\t\tupdatableParent.removeRefresher(";
202
  protected final String TEXT_182 = "(), labelRefresher);";
203
  protected final String TEXT_183 = ".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};" + NL;
204
  protected final String TEXT_184 = "(), labelRefresher);";
204
  protected final String TEXT_184 = NL;
205
  protected final String TEXT_185 = 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;
205
  protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
206
  protected final String TEXT_186 = NL;
206
  protected final String TEXT_186 = " createFigure() {" + NL + "\t\t";
207
  protected final String TEXT_187 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
207
  protected final String TEXT_187 = " label = createLabel();" + NL + "\t\tdefaultText = label.getText();" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
208
  protected final String TEXT_188 = " createFigure() {" + NL + "\t\t";
208
  protected final String TEXT_188 = " createLabel() {";
209
  protected final String TEXT_189 = " label = createLabel();" + NL + "\t\tdefaultText = label.getText();" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
209
  protected final String TEXT_189 = NL + "\t\treturn new ";
210
  protected final String TEXT_190 = " createLabel() {";
210
  protected final String TEXT_190 = "();";
211
  protected final String TEXT_191 = NL + "\t\treturn new ";
211
  protected final String TEXT_191 = NL + "\t\treturn ";
212
  protected final String TEXT_192 = "();";
212
  protected final String TEXT_192 = ";";
213
  protected final String TEXT_193 = NL + "\t\treturn ";
213
  protected final String TEXT_193 = NL + "\t\treturn new ";
214
  protected final String TEXT_194 = ";";
214
  protected final String TEXT_194 = "();";
215
  protected final String TEXT_195 = NL + "\t\treturn new ";
215
  protected final String TEXT_195 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
216
  protected final String TEXT_196 = "();";
216
  protected final String TEXT_196 = " getLabel() {" + NL + "\t\treturn (";
217
  protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
217
  protected final String TEXT_197 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel(";
218
  protected final String TEXT_198 = " getLabel() {" + NL + "\t\treturn (";
218
  protected final String TEXT_198 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);" + NL + "\t\tdefaultText = figure.getText();" + NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
219
  protected final String TEXT_199 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel(";
219
  protected final String TEXT_199 = NL;
220
  protected final String TEXT_200 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);" + NL + "\t\tdefaultText = figure.getText();" + NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
220
  protected final String TEXT_200 = NL;
221
  protected final String TEXT_201 = NL;
221
  protected final String TEXT_201 = 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}";
222
  protected final String TEXT_202 = NL;
222
  protected final String TEXT_202 = NL + "}";
223
  protected final String TEXT_203 = 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}";
223
  protected final String TEXT_203 = NL;
224
  protected final String TEXT_204 = NL + "}";
225
  protected final String TEXT_205 = NL;
226
224
227
  public String generate(Object argument)
225
  public String generate(Object argument)
228
  {
226
  {
Lines 243-248 Link Here
243
} else {
241
} else {
244
	underlyingMetaClass = null;
242
	underlyingMetaClass = null;
245
}
243
}
244
final boolean isReadOnly = genLabel.isReadOnly();
246
245
247
    stringBuffer.append(TEXT_1);
246
    stringBuffer.append(TEXT_1);
248
    
247
    
Lines 277-518 Link Here
277
    }
276
    }
278
    stringBuffer.append(TEXT_10);
277
    stringBuffer.append(TEXT_10);
279
    stringBuffer.append(TEXT_11);
278
    stringBuffer.append(TEXT_11);
279
    
280
if (!isReadOnly) {
281
280
    stringBuffer.append(TEXT_12);
282
    stringBuffer.append(TEXT_12);
281
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
282
    stringBuffer.append(TEXT_13);
284
    stringBuffer.append(TEXT_13);
283
    stringBuffer.append(genLabel.getEditPartClassName());
285
    
286
}
287
284
    stringBuffer.append(TEXT_14);
288
    stringBuffer.append(TEXT_14);
289
    stringBuffer.append(genLabel.getEditPartClassName());
290
    stringBuffer.append(TEXT_15);
285
    
291
    
286
final String primaryView = "getUpdatableParent().getDiagramEdge()";
292
final String primaryView = "getUpdatableParent().getDiagramEdge()";
287
final String resolvedSemanticElement = "resolveSemanticElement()";
293
final String resolvedSemanticElement = "resolveSemanticElement()";
288
294
289
    stringBuffer.append(TEXT_15);
290
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
291
    stringBuffer.append(TEXT_16);
295
    stringBuffer.append(TEXT_16);
296
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
297
    stringBuffer.append(TEXT_17);
292
    
298
    
293
if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
299
if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) {
294
	boolean isReadOnly = genLabel.isReadOnly();
295
300
296
    stringBuffer.append(TEXT_17);
297
    stringBuffer.append(TEXT_18);
301
    stringBuffer.append(TEXT_18);
298
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
299
    stringBuffer.append(TEXT_19);
302
    stringBuffer.append(TEXT_19);
300
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
301
    stringBuffer.append(TEXT_20);
304
    stringBuffer.append(TEXT_20);
302
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
305
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
303
    stringBuffer.append(TEXT_21);
306
    stringBuffer.append(TEXT_21);
304
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
305
    stringBuffer.append(TEXT_22);
306
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
307
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
308
    stringBuffer.append(TEXT_22);
309
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
307
    stringBuffer.append(TEXT_23);
310
    stringBuffer.append(TEXT_23);
308
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
311
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
309
    stringBuffer.append(TEXT_24);
312
    stringBuffer.append(TEXT_24);
310
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
311
    stringBuffer.append(TEXT_25);
312
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
313
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
314
    stringBuffer.append(TEXT_25);
315
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
313
    stringBuffer.append(TEXT_26);
316
    stringBuffer.append(TEXT_26);
314
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
315
    stringBuffer.append(TEXT_27);
316
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
317
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
318
    stringBuffer.append(TEXT_27);
319
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
317
    stringBuffer.append(TEXT_28);
320
    stringBuffer.append(TEXT_28);
318
    
319
if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) {
320
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
321
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
322
323
    stringBuffer.append(TEXT_29);
324
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
321
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
322
    stringBuffer.append(TEXT_29);
323
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
325
    stringBuffer.append(TEXT_30);
324
    stringBuffer.append(TEXT_30);
326
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
325
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
327
    stringBuffer.append(TEXT_31);
326
    stringBuffer.append(TEXT_31);
328
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
327
    stringBuffer.append(primaryView);
329
    stringBuffer.append(TEXT_32);
328
    stringBuffer.append(TEXT_32);
330
    stringBuffer.append(resolvedSemanticElement);
329
    
330
if (labelModelFacet instanceof FeatureLabelModelFacet) {
331
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
332
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
333
331
    stringBuffer.append(TEXT_33);
334
    stringBuffer.append(TEXT_33);
332
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
333
    stringBuffer.append(TEXT_34);
336
    stringBuffer.append(TEXT_34);
334
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
337
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
335
    stringBuffer.append(TEXT_35);
338
    stringBuffer.append(TEXT_35);
336
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
339
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
337
    stringBuffer.append(TEXT_36);
340
    stringBuffer.append(TEXT_36);
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
341
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
339
    stringBuffer.append(TEXT_37);
342
    stringBuffer.append(TEXT_37);
340
    stringBuffer.append(primaryView);
343
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
341
    stringBuffer.append(TEXT_38);
344
    stringBuffer.append(TEXT_38);
342
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
345
    stringBuffer.append(resolvedSemanticElement);
343
    stringBuffer.append(TEXT_39);
346
    stringBuffer.append(TEXT_39);
344
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
345
    stringBuffer.append(TEXT_40);
348
    stringBuffer.append(TEXT_40);
346
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
347
    stringBuffer.append(TEXT_41);
350
    stringBuffer.append(TEXT_41);
348
    stringBuffer.append(featureToSet.getFeatureAccessorName());
351
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
349
    stringBuffer.append(TEXT_42);
352
    stringBuffer.append(TEXT_42);
350
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
353
    stringBuffer.append(featureToSet.getFeatureAccessorName());
351
    stringBuffer.append(TEXT_43);
354
    stringBuffer.append(TEXT_43);
352
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
355
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
353
    stringBuffer.append(TEXT_44);
356
    stringBuffer.append(TEXT_44);
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
358
    stringBuffer.append(TEXT_45);
354
    
359
    
355
	if (ecoreFeature.isMany()) {
360
	if (ecoreFeature.isMany()) {
356
361
357
    stringBuffer.append(TEXT_45);
358
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
359
    stringBuffer.append(TEXT_46);
362
    stringBuffer.append(TEXT_46);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
363
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
361
    stringBuffer.append(TEXT_47);
364
    stringBuffer.append(TEXT_47);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
363
    stringBuffer.append(TEXT_48);
366
    stringBuffer.append(TEXT_48);
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
367
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
365
    stringBuffer.append(TEXT_49);
368
    stringBuffer.append(TEXT_49);
366
    stringBuffer.append(featureToSet.getAccessorName());
369
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
367
    stringBuffer.append(TEXT_50);
370
    stringBuffer.append(TEXT_50);
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
371
    stringBuffer.append(featureToSet.getAccessorName());
369
    stringBuffer.append(TEXT_51);
372
    stringBuffer.append(TEXT_51);
370
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
371
    stringBuffer.append(TEXT_52);
374
    stringBuffer.append(TEXT_52);
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
376
    stringBuffer.append(TEXT_53);
372
    
377
    
373
	} else {
378
	} else {
374
379
375
    stringBuffer.append(TEXT_53);
376
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
377
    stringBuffer.append(TEXT_54);
380
    stringBuffer.append(TEXT_54);
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
382
    stringBuffer.append(TEXT_55);
378
    
383
    
379
	}
384
	}
380
385
381
    stringBuffer.append(TEXT_55);
386
    stringBuffer.append(TEXT_56);
382
    
387
    
383
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
388
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
384
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
389
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
385
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
390
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
386
391
387
    stringBuffer.append(TEXT_56);
388
    stringBuffer.append(metaFeatures.size());
389
    stringBuffer.append(TEXT_57);
392
    stringBuffer.append(TEXT_57);
390
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
393
    stringBuffer.append(metaFeatures.size());
391
    stringBuffer.append(TEXT_58);
394
    stringBuffer.append(TEXT_58);
392
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
395
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
393
    stringBuffer.append(TEXT_59);
396
    stringBuffer.append(TEXT_59);
394
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
395
    stringBuffer.append(TEXT_60);
398
    stringBuffer.append(TEXT_60);
396
    stringBuffer.append(resolvedSemanticElement);
397
    stringBuffer.append(TEXT_61);
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
400
    stringBuffer.append(TEXT_61);
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
399
    stringBuffer.append(TEXT_62);
402
    stringBuffer.append(TEXT_62);
400
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
403
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
401
    stringBuffer.append(TEXT_63);
404
    stringBuffer.append(TEXT_63);
402
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
405
    stringBuffer.append(resolvedSemanticElement);
403
    stringBuffer.append(TEXT_64);
406
    stringBuffer.append(TEXT_64);
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
405
    stringBuffer.append(TEXT_65);
406
    stringBuffer.append(primaryView);
407
    stringBuffer.append(TEXT_66);
408
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
407
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
409
    stringBuffer.append(TEXT_67);
408
    stringBuffer.append(TEXT_65);
410
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
411
    stringBuffer.append(TEXT_68);
410
    stringBuffer.append(TEXT_66);
412
    
411
    
413
	boolean haveDeclaredValues = false;
412
	boolean haveDeclaredValues = false;
414
	for(int i = 0; i < metaFeatures.size(); i++) {
413
	for(int i = 0; i < metaFeatures.size(); i++) {
415
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
414
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
416
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
415
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
417
416
418
    stringBuffer.append(TEXT_69);
417
    stringBuffer.append(TEXT_67);
419
    if (i == 0) {
418
    if (i == 0) {
420
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
419
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
421
    stringBuffer.append(TEXT_70);
420
    stringBuffer.append(TEXT_68);
422
    }
421
    }
423
    stringBuffer.append(TEXT_71);
422
    stringBuffer.append(TEXT_69);
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
423
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
425
    stringBuffer.append(TEXT_72);
424
    stringBuffer.append(TEXT_70);
426
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
425
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
427
    stringBuffer.append(TEXT_73);
426
    stringBuffer.append(TEXT_71);
428
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
427
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
429
    stringBuffer.append(TEXT_74);
428
    stringBuffer.append(TEXT_72);
430
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
429
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
431
    stringBuffer.append(TEXT_75);
430
    stringBuffer.append(TEXT_73);
432
    stringBuffer.append(i);
431
    stringBuffer.append(i);
433
    stringBuffer.append(TEXT_76);
432
    stringBuffer.append(TEXT_74);
434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
435
    stringBuffer.append(TEXT_77);
434
    stringBuffer.append(TEXT_75);
436
    
435
    
437
		if (nextEcoreFeature.isMany()) {
436
		if (nextEcoreFeature.isMany()) {
438
437
439
    stringBuffer.append(TEXT_78);
438
    stringBuffer.append(TEXT_76);
440
    if (!haveDeclaredValues) { haveDeclaredValues = true;
439
    if (!haveDeclaredValues) { haveDeclaredValues = true;
441
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
440
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
442
    stringBuffer.append(TEXT_79);
441
    stringBuffer.append(TEXT_77);
443
    }
442
    }
444
    stringBuffer.append(TEXT_80);
443
    stringBuffer.append(TEXT_78);
445
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
444
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
446
    stringBuffer.append(TEXT_81);
445
    stringBuffer.append(TEXT_79);
447
    stringBuffer.append(nextFeatureToSet.getAccessorName());
446
    stringBuffer.append(nextFeatureToSet.getAccessorName());
448
    stringBuffer.append(TEXT_82);
447
    stringBuffer.append(TEXT_80);
449
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
448
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
450
    stringBuffer.append(TEXT_83);
449
    stringBuffer.append(TEXT_81);
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
450
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
452
    stringBuffer.append(TEXT_84);
451
    stringBuffer.append(TEXT_82);
453
    
452
    
454
		} else {
453
		} else {
455
454
456
    stringBuffer.append(TEXT_85);
455
    stringBuffer.append(TEXT_83);
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
458
    stringBuffer.append(TEXT_86);
457
    stringBuffer.append(TEXT_84);
459
    
458
    
460
		}
459
		}
461
460
462
    
461
    
463
	}
462
	}
464
463
465
    stringBuffer.append(TEXT_87);
464
    stringBuffer.append(TEXT_85);
466
    
465
    
467
}
466
}
468
467
469
    stringBuffer.append(TEXT_88);
468
    stringBuffer.append(TEXT_86);
470
    
469
    
471
}
470
}
472
471
473
    stringBuffer.append(TEXT_89);
472
    stringBuffer.append(TEXT_87);
474
    
473
    
475
if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
474
if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) {
476
475
477
    stringBuffer.append(TEXT_90);
476
    stringBuffer.append(TEXT_88);
478
    stringBuffer.append(TEXT_91);
477
    stringBuffer.append(TEXT_89);
479
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
478
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
480
    stringBuffer.append(TEXT_92);
479
    stringBuffer.append(TEXT_90);
481
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
480
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
482
    stringBuffer.append(TEXT_93);
481
    stringBuffer.append(TEXT_91);
483
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
482
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
484
    stringBuffer.append(TEXT_94);
483
    stringBuffer.append(TEXT_92);
485
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
484
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
486
    stringBuffer.append(TEXT_95);
485
    stringBuffer.append(TEXT_93);
487
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
486
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
488
    stringBuffer.append(TEXT_96);
487
    stringBuffer.append(TEXT_94);
489
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
488
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
490
    stringBuffer.append(TEXT_97);
489
    stringBuffer.append(TEXT_95);
491
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
490
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
492
    stringBuffer.append(TEXT_98);
491
    stringBuffer.append(TEXT_96);
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
492
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
494
    stringBuffer.append(TEXT_99);
493
    stringBuffer.append(TEXT_97);
495
    
494
    
496
}
495
}
497
496
498
    stringBuffer.append(TEXT_100);
497
    stringBuffer.append(TEXT_98);
499
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
498
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
500
    stringBuffer.append(TEXT_101);
499
    stringBuffer.append(TEXT_99);
501
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.AbstractLocator"));
500
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.AbstractLocator"));
502
    stringBuffer.append(TEXT_102);
501
    stringBuffer.append(TEXT_100);
503
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
502
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
504
    stringBuffer.append(TEXT_103);
503
    stringBuffer.append(TEXT_101);
505
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
504
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
506
    stringBuffer.append(TEXT_104);
505
    stringBuffer.append(TEXT_102);
507
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
506
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
508
    stringBuffer.append(TEXT_105);
507
    stringBuffer.append(TEXT_103);
509
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
508
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
510
    stringBuffer.append(TEXT_106);
509
    stringBuffer.append(TEXT_104);
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
510
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
512
    stringBuffer.append(TEXT_107);
511
    stringBuffer.append(TEXT_105);
513
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
512
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
514
    stringBuffer.append(TEXT_108);
513
    stringBuffer.append(TEXT_106);
515
    stringBuffer.append(TEXT_109);
514
    stringBuffer.append(TEXT_107);
516
    
515
    
517
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
516
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
518
HashMap primitiveTypeToWrapperClassName = new HashMap();
517
HashMap primitiveTypeToWrapperClassName = new HashMap();
Lines 556-565 Link Here
556
	}
555
	}
557
}
556
}
558
557
559
    stringBuffer.append(TEXT_110);
558
    stringBuffer.append(TEXT_108);
560
    stringBuffer.append(viewPattern);
559
    stringBuffer.append(viewPattern);
561
    stringBuffer.append(TEXT_111);
560
    stringBuffer.append(TEXT_109);
562
    stringBuffer.append(editPattern);
561
    stringBuffer.append(editPattern);
562
    stringBuffer.append(TEXT_110);
563
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
564
    stringBuffer.append(TEXT_111);
565
    stringBuffer.append(resolvedSemanticElement);
563
    stringBuffer.append(TEXT_112);
566
    stringBuffer.append(TEXT_112);
564
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
567
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
565
    stringBuffer.append(TEXT_113);
568
    stringBuffer.append(TEXT_113);
Lines 567-607 Link Here
567
    stringBuffer.append(TEXT_114);
570
    stringBuffer.append(TEXT_114);
568
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
571
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
569
    stringBuffer.append(TEXT_115);
572
    stringBuffer.append(TEXT_115);
570
    stringBuffer.append(resolvedSemanticElement);
571
    stringBuffer.append(TEXT_116);
572
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
573
    stringBuffer.append(TEXT_117);
574
    
573
    
575
if (labelModelFacet instanceof FeatureLabelModelFacet) {
574
if (labelModelFacet instanceof FeatureLabelModelFacet) {
576
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
575
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
577
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
576
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
578
	if (!feature.isPrimitiveType()) {
577
	if (!feature.isPrimitiveType()) {
579
578
580
    stringBuffer.append(TEXT_118);
579
    stringBuffer.append(TEXT_116);
581
    stringBuffer.append(feature.getCapName());
580
    stringBuffer.append(feature.getCapName());
582
    stringBuffer.append(TEXT_119);
581
    stringBuffer.append(TEXT_117);
583
    
582
    
584
	}
583
	}
585
584
586
    stringBuffer.append(TEXT_120);
585
    stringBuffer.append(TEXT_118);
587
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
586
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
588
    stringBuffer.append(TEXT_121);
587
    stringBuffer.append(TEXT_119);
589
    
588
    
590
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
589
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
591
		if (feature.isPrimitiveType()) {
590
		if (feature.isPrimitiveType()) {
592
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
591
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
593
		}
592
		}
594
593
595
    stringBuffer.append(TEXT_122);
594
    stringBuffer.append(TEXT_120);
596
    stringBuffer.append(value);
595
    stringBuffer.append(value);
597
    stringBuffer.append(TEXT_123);
596
    stringBuffer.append(TEXT_121);
598
    
597
    
599
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
598
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
600
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
599
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
601
600
602
    stringBuffer.append(TEXT_124);
601
    stringBuffer.append(TEXT_122);
603
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
602
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
604
    stringBuffer.append(TEXT_125);
603
    stringBuffer.append(TEXT_123);
605
    
604
    
606
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
605
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
607
		GenFeature next = (GenFeature) it.next();
606
		GenFeature next = (GenFeature) it.next();
Lines 610-687 Link Here
610
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
609
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
611
		}
610
		}
612
611
613
    stringBuffer.append(TEXT_126);
612
    stringBuffer.append(TEXT_124);
614
    stringBuffer.append(value);
613
    stringBuffer.append(value);
615
    if (it.hasNext()) {
614
    if (it.hasNext()) {
616
    stringBuffer.append(TEXT_127);
615
    stringBuffer.append(TEXT_125);
617
    }
616
    }
618
    
617
    
619
	}
618
	}
620
619
621
    stringBuffer.append(TEXT_128);
620
    stringBuffer.append(TEXT_126);
622
    
621
    
623
} else {
622
} else {
624
623
625
    stringBuffer.append(TEXT_129);
624
    stringBuffer.append(TEXT_127);
626
    
625
    
627
}
626
}
628
627
628
    stringBuffer.append(TEXT_128);
629
    stringBuffer.append(TEXT_129);
629
    stringBuffer.append(TEXT_130);
630
    stringBuffer.append(TEXT_130);
631
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
630
    stringBuffer.append(TEXT_131);
632
    stringBuffer.append(TEXT_131);
631
    stringBuffer.append(TEXT_132);
632
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
633
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
634
    stringBuffer.append(TEXT_132);
635
    stringBuffer.append(primaryView);
633
    stringBuffer.append(TEXT_133);
636
    stringBuffer.append(TEXT_133);
634
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
637
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
635
    stringBuffer.append(TEXT_134);
638
    stringBuffer.append(TEXT_134);
636
    stringBuffer.append(primaryView);
639
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
637
    stringBuffer.append(TEXT_135);
640
    stringBuffer.append(TEXT_135);
638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
641
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
639
    stringBuffer.append(TEXT_136);
642
    stringBuffer.append(TEXT_136);
640
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
643
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
641
    stringBuffer.append(TEXT_137);
644
    stringBuffer.append(TEXT_137);
642
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
645
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
643
    stringBuffer.append(TEXT_138);
646
    stringBuffer.append(TEXT_138);
644
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
647
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
645
    stringBuffer.append(TEXT_139);
648
    stringBuffer.append(TEXT_139);
646
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
649
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
647
    stringBuffer.append(TEXT_140);
650
    stringBuffer.append(TEXT_140);
648
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
649
    stringBuffer.append(TEXT_141);
652
    stringBuffer.append(TEXT_141);
650
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
651
    stringBuffer.append(TEXT_142);
652
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
653
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
654
    stringBuffer.append(TEXT_142);
653
    stringBuffer.append(TEXT_143);
655
    stringBuffer.append(TEXT_143);
654
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
655
    stringBuffer.append(TEXT_144);
656
    stringBuffer.append(TEXT_144);
657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
656
    stringBuffer.append(TEXT_145);
658
    stringBuffer.append(TEXT_145);
657
    stringBuffer.append(TEXT_146);
658
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
659
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
660
    stringBuffer.append(TEXT_146);
661
    stringBuffer.append(primaryView);
659
    stringBuffer.append(TEXT_147);
662
    stringBuffer.append(TEXT_147);
660
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
663
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
661
    stringBuffer.append(TEXT_148);
664
    stringBuffer.append(TEXT_148);
662
    stringBuffer.append(primaryView);
665
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
663
    stringBuffer.append(TEXT_149);
666
    stringBuffer.append(TEXT_149);
664
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
667
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
665
    stringBuffer.append(TEXT_150);
668
    stringBuffer.append(TEXT_150);
666
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
669
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
667
    stringBuffer.append(TEXT_151);
670
    stringBuffer.append(TEXT_151);
668
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
671
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
669
    stringBuffer.append(TEXT_152);
672
    stringBuffer.append(TEXT_152);
670
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
673
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
671
    stringBuffer.append(TEXT_153);
674
    stringBuffer.append(TEXT_153);
672
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
673
    stringBuffer.append(TEXT_154);
674
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
675
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
676
    stringBuffer.append(TEXT_154);
677
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
675
    stringBuffer.append(TEXT_155);
678
    stringBuffer.append(TEXT_155);
676
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
679
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
677
    stringBuffer.append(TEXT_156);
680
    stringBuffer.append(TEXT_156);
678
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
681
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
679
    stringBuffer.append(TEXT_157);
682
    stringBuffer.append(TEXT_157);
680
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
683
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
681
    stringBuffer.append(TEXT_158);
684
    stringBuffer.append(TEXT_158);
682
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
685
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
683
    stringBuffer.append(TEXT_159);
686
    stringBuffer.append(TEXT_159);
684
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
687
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
685
    stringBuffer.append(TEXT_160);
688
    stringBuffer.append(TEXT_160);
686
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
689
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
687
    stringBuffer.append(TEXT_161);
690
    stringBuffer.append(TEXT_161);
Lines 689-724 Link Here
689
    stringBuffer.append(TEXT_162);
692
    stringBuffer.append(TEXT_162);
690
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
693
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
691
    stringBuffer.append(TEXT_163);
694
    stringBuffer.append(TEXT_163);
692
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
693
    stringBuffer.append(TEXT_164);
694
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
695
    stringBuffer.append(TEXT_165);
696
    
695
    
697
if (labelModelFacet instanceof FeatureLabelModelFacet) {
696
if (labelModelFacet instanceof FeatureLabelModelFacet) {
698
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
697
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
699
698
700
    stringBuffer.append(TEXT_166);
699
    stringBuffer.append(TEXT_164);
701
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
700
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
702
    stringBuffer.append(TEXT_167);
701
    stringBuffer.append(TEXT_165);
703
    stringBuffer.append(feature.getFeatureAccessorName());
702
    stringBuffer.append(feature.getFeatureAccessorName());
704
    stringBuffer.append(TEXT_168);
703
    stringBuffer.append(TEXT_166);
705
    
704
    
706
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
705
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
707
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
706
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
708
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
707
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
709
		GenFeature next = (GenFeature) it.next();
708
		GenFeature next = (GenFeature) it.next();
710
709
711
    stringBuffer.append(TEXT_169);
710
    stringBuffer.append(TEXT_167);
712
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
711
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
713
    stringBuffer.append(TEXT_170);
712
    stringBuffer.append(TEXT_168);
714
    stringBuffer.append(next.getFeatureAccessorName());
713
    stringBuffer.append(next.getFeatureAccessorName());
715
    stringBuffer.append(TEXT_171);
714
    stringBuffer.append(TEXT_169);
716
    
715
    
717
	}
716
	}
718
}
717
}
719
718
720
    stringBuffer.append(TEXT_172);
719
    stringBuffer.append(TEXT_170);
721
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
720
    stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
721
    stringBuffer.append(TEXT_171);
722
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
723
    stringBuffer.append(TEXT_172);
724
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
722
    stringBuffer.append(TEXT_173);
725
    stringBuffer.append(TEXT_173);
723
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
726
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
724
    stringBuffer.append(TEXT_174);
727
    stringBuffer.append(TEXT_174);
Lines 726-771 Link Here
726
    stringBuffer.append(TEXT_175);
729
    stringBuffer.append(TEXT_175);
727
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
730
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
728
    stringBuffer.append(TEXT_176);
731
    stringBuffer.append(TEXT_176);
729
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
730
    stringBuffer.append(TEXT_177);
731
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
732
    stringBuffer.append(TEXT_178);
733
    
732
    
734
if (labelModelFacet instanceof FeatureLabelModelFacet) {
733
if (labelModelFacet instanceof FeatureLabelModelFacet) {
735
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
734
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
736
735
737
    stringBuffer.append(TEXT_179);
736
    stringBuffer.append(TEXT_177);
738
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
737
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
739
    stringBuffer.append(TEXT_180);
738
    stringBuffer.append(TEXT_178);
740
    stringBuffer.append(feature.getFeatureAccessorName());
739
    stringBuffer.append(feature.getFeatureAccessorName());
741
    stringBuffer.append(TEXT_181);
740
    stringBuffer.append(TEXT_179);
742
    
741
    
743
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
742
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
744
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
743
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
745
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
744
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
746
		GenFeature next = (GenFeature) it.next();
745
		GenFeature next = (GenFeature) it.next();
747
746
748
    stringBuffer.append(TEXT_182);
747
    stringBuffer.append(TEXT_180);
749
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
748
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
750
    stringBuffer.append(TEXT_183);
749
    stringBuffer.append(TEXT_181);
751
    stringBuffer.append(next.getFeatureAccessorName());
750
    stringBuffer.append(next.getFeatureAccessorName());
752
    stringBuffer.append(TEXT_184);
751
    stringBuffer.append(TEXT_182);
753
    
752
    
754
	}
753
	}
755
}
754
}
756
755
757
    stringBuffer.append(TEXT_185);
756
    stringBuffer.append(TEXT_183);
758
    
757
    
759
final Viewmap viewmap = genLabel.getViewmap();
758
final Viewmap viewmap = genLabel.getViewmap();
760
759
761
    stringBuffer.append(TEXT_186);
760
    stringBuffer.append(TEXT_184);
762
    stringBuffer.append(TEXT_187);
761
    stringBuffer.append(TEXT_185);
763
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
762
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
764
    stringBuffer.append(TEXT_188);
763
    stringBuffer.append(TEXT_186);
765
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
764
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
766
    stringBuffer.append(TEXT_189);
765
    stringBuffer.append(TEXT_187);
767
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
766
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
768
    stringBuffer.append(TEXT_190);
767
    stringBuffer.append(TEXT_188);
769
    
768
    
770
String figureQualifiedClassName = null;
769
String figureQualifiedClassName = null;
771
if (viewmap instanceof FigureViewmap) {
770
if (viewmap instanceof FigureViewmap) {
Lines 774-822 Link Here
774
		figureQualifiedClassName = "org.eclipse.draw2d.Label";
773
		figureQualifiedClassName = "org.eclipse.draw2d.Label";
775
	}
774
	}
776
775
777
    stringBuffer.append(TEXT_191);
776
    stringBuffer.append(TEXT_189);
778
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
777
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
779
    stringBuffer.append(TEXT_192);
778
    stringBuffer.append(TEXT_190);
780
    } // instanceof FigureViewmap
779
    } // instanceof FigureViewmap
781
 else if (viewmap instanceof SnippetViewmap) {
780
 else if (viewmap instanceof SnippetViewmap) {
782
    stringBuffer.append(TEXT_193);
781
    stringBuffer.append(TEXT_191);
783
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
782
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
784
    stringBuffer.append(TEXT_194);
783
    stringBuffer.append(TEXT_192);
785
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
784
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
786
 else if (viewmap instanceof InnerClassViewmap) {
785
 else if (viewmap instanceof InnerClassViewmap) {
787
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
786
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
788
787
789
    stringBuffer.append(TEXT_195);
788
    stringBuffer.append(TEXT_193);
790
    stringBuffer.append(figureQualifiedClassName);
789
    stringBuffer.append(figureQualifiedClassName);
791
    stringBuffer.append(TEXT_196);
790
    stringBuffer.append(TEXT_194);
792
    }
791
    }
793
    stringBuffer.append(TEXT_197);
792
    stringBuffer.append(TEXT_195);
794
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
795
    stringBuffer.append(TEXT_198);
794
    stringBuffer.append(TEXT_196);
796
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
795
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
797
    stringBuffer.append(TEXT_199);
796
    stringBuffer.append(TEXT_197);
798
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
797
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
799
    stringBuffer.append(TEXT_200);
798
    stringBuffer.append(TEXT_198);
800
    
799
    
801
if (viewmap instanceof InnerClassViewmap) {
800
if (viewmap instanceof InnerClassViewmap) {
802
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
801
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
803
802
804
    stringBuffer.append(TEXT_201);
803
    stringBuffer.append(TEXT_199);
805
    stringBuffer.append(classBody);
804
    stringBuffer.append(classBody);
806
    stringBuffer.append(TEXT_202);
805
    stringBuffer.append(TEXT_200);
807
    
806
    
808
if (classBody.indexOf("DPtoLP") != -1) {
807
if (classBody.indexOf("DPtoLP") != -1) {
809
808
810
    stringBuffer.append(TEXT_203);
809
    stringBuffer.append(TEXT_201);
811
    
810
    
812
}
811
}
813
812
814
    
813
    
815
}
814
}
816
815
817
    stringBuffer.append(TEXT_204);
816
    stringBuffer.append(TEXT_202);
818
    importManager.emitSortedImports();
817
    importManager.emitSortedImports();
819
    stringBuffer.append(TEXT_205);
818
    stringBuffer.append(TEXT_203);
820
    return stringBuffer.toString();
819
    return stringBuffer.toString();
821
  }
820
  }
822
}
821
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java (-166 / +179 lines)
Lines 30-119 Link Here
30
  protected final String TEXT_10 = ";";
30
  protected final String TEXT_10 = ";";
31
  protected final String TEXT_11 = NL;
31
  protected final String TEXT_11 = NL;
32
  protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
32
  protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
33
  protected final String TEXT_13 = " manager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
33
  protected final String TEXT_13 = " manager;" + NL;
34
  protected final String TEXT_14 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
34
  protected final String TEXT_14 = 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;
35
  protected final String TEXT_15 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
36
  protected final String TEXT_16 = "\t\tinstallEditPolicy(";
36
  protected final String TEXT_16 = NL;
37
  protected final String TEXT_17 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
37
  protected final String TEXT_17 = "\t\tinstallEditPolicy(";
38
  protected final String TEXT_18 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
38
  protected final String TEXT_18 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
39
  protected final String TEXT_19 = " 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 ";
39
  protected final String TEXT_19 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
40
  protected final String TEXT_20 = " getDirectEditCommand(";
40
  protected final String TEXT_20 = " 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 ";
41
  protected final String TEXT_21 = " 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 ";
41
  protected final String TEXT_21 = " getDirectEditCommand(";
42
  protected final String TEXT_22 = ".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 ";
42
  protected final String TEXT_22 = " 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 ";
43
  protected final String TEXT_23 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
43
  protected final String TEXT_23 = ".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 ";
44
  protected final String TEXT_24 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
44
  protected final String TEXT_24 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
45
  protected final String TEXT_25 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
45
  protected final String TEXT_25 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
46
  protected final String TEXT_26 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
46
  protected final String TEXT_26 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
47
  protected final String TEXT_27 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
47
  protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
48
  protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
48
  protected final String TEXT_28 = " editingDomain = ";
49
  protected final String TEXT_29 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
49
  protected final String TEXT_29 = ".getEditingDomain(";
50
  protected final String TEXT_30 = " element = ";
50
  protected final String TEXT_30 = ".getDiagram().getElement());";
51
  protected final String TEXT_31 = ";" + NL + "\t\t\t\t\t\t\tprivate ";
51
  protected final String TEXT_31 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
52
  protected final String TEXT_32 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
52
  protected final String TEXT_32 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
53
  protected final String TEXT_33 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
53
  protected final String TEXT_33 = " 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";
54
  protected final String TEXT_34 = " domainModelEditDomain = ";
54
  protected final String TEXT_34 = " createDomainModelCommand(";
55
  protected final String TEXT_35 = ".getEditingDomainFor(";
55
  protected final String TEXT_35 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t";
56
  protected final String TEXT_36 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
56
  protected final String TEXT_36 = " element = ";
57
  protected final String TEXT_37 = " feature = (";
57
  protected final String TEXT_37 = ";" + NL + "\t\t\t\t\t\t";
58
  protected final String TEXT_38 = ") ";
58
  protected final String TEXT_38 = " feature = (";
59
  protected final String TEXT_39 = ".eINSTANCE.get";
59
  protected final String TEXT_39 = ") ";
60
  protected final String TEXT_40 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
60
  protected final String TEXT_40 = ".eINSTANCE.get";
61
  protected final String TEXT_41 = ".parseValue(feature, parseResult[0]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
61
  protected final String TEXT_41 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
62
  protected final String TEXT_42 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}";
62
  protected final String TEXT_42 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
63
  protected final String TEXT_43 = NL + "\t\t\t\t\t\t\t\t";
63
  protected final String TEXT_43 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
64
  protected final String TEXT_44 = " result = new ";
64
  protected final String TEXT_44 = NL + "\t\t\t\t\t\t";
65
  protected final String TEXT_45 = "();" + NL + "\t\t\t\t\t\t\t\t";
65
  protected final String TEXT_45 = " result = new ";
66
  protected final String TEXT_46 = " values = new ";
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\t\tvalues.addAll(element.get";
67
  protected final String TEXT_47 = " values = new ";
68
  protected final String TEXT_48 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
68
  protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
69
  protected final String TEXT_49 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
69
  protected final String TEXT_49 = "());" + NL + "\t\t\t\t\t\tresult.append(";
70
  protected final String TEXT_50 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;";
70
  protected final String TEXT_50 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
71
  protected final String TEXT_51 = NL + "\t\t\t\t\t\t\t\treturn ";
71
  protected final String TEXT_51 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;";
72
  protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, valueToSet);";
72
  protected final String TEXT_52 = NL + "\t\t\t\t\t\treturn ";
73
  protected final String TEXT_53 = NL + "\t\t\t\t\t\t\t}";
73
  protected final String TEXT_53 = ".create(editingDomain, element, feature, valueToSet);";
74
  protected final String TEXT_54 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
74
  protected final String TEXT_54 = NL + "\t\t\t\t\t}";
75
  protected final String TEXT_55 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
75
  protected final String TEXT_55 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
76
  protected final String TEXT_56 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
76
  protected final String TEXT_56 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
77
  protected final String TEXT_57 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
77
  protected final String TEXT_57 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
78
  protected final String TEXT_58 = " element = ";
78
  protected final String TEXT_58 = " 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";
79
  protected final String TEXT_59 = ";" + NL + "\t\t\t\t\t\t\tprivate ";
79
  protected final String TEXT_59 = " createDomainModelCommand(";
80
  protected final String TEXT_60 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
80
  protected final String TEXT_60 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t";
81
  protected final String TEXT_61 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
81
  protected final String TEXT_61 = " element = ";
82
  protected final String TEXT_62 = " domainModelEditDomain = ";
82
  protected final String TEXT_62 = ";" + NL + "\t\t\t\t\t\t";
83
  protected final String TEXT_63 = ".getEditingDomainFor(";
83
  protected final String TEXT_63 = " result = new ";
84
  protected final String TEXT_64 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
84
  protected final String TEXT_64 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;";
85
  protected final String TEXT_65 = " result = new ";
85
  protected final String TEXT_65 = NL + "\t\t\t\t\t\t";
86
  protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;";
86
  protected final String TEXT_66 = " ";
87
  protected final String TEXT_67 = NL + "\t\t\t\t\t\t\t\t";
87
  protected final String TEXT_67 = "feature = (";
88
  protected final String TEXT_68 = " ";
88
  protected final String TEXT_68 = ") ";
89
  protected final String TEXT_69 = "feature = (";
89
  protected final String TEXT_69 = ".eINSTANCE.get";
90
  protected final String TEXT_70 = ") ";
90
  protected final String TEXT_70 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
91
  protected final String TEXT_71 = ".eINSTANCE.get";
91
  protected final String TEXT_71 = ".parseValue(feature, values[";
92
  protected final String TEXT_72 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
92
  protected final String TEXT_72 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
93
  protected final String TEXT_73 = ".parseValue(feature, parseResult[";
93
  protected final String TEXT_73 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
94
  protected final String TEXT_74 = "]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
94
  protected final String TEXT_74 = NL + "\t\t\t\t\t\t";
95
  protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}";
95
  protected final String TEXT_75 = " ";
96
  protected final String TEXT_76 = NL + "\t\t\t\t\t\t\t\t";
96
  protected final String TEXT_76 = "values = new ";
97
  protected final String TEXT_77 = " ";
97
  protected final String TEXT_77 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
98
  protected final String TEXT_78 = "values = new ";
98
  protected final String TEXT_78 = "());" + NL + "\t\t\t\t\t\tresult.append(";
99
  protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get";
99
  protected final String TEXT_79 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
100
  protected final String TEXT_80 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
100
  protected final String TEXT_80 = ".create(editingDomain, element, feature, valueToSet));";
101
  protected final String TEXT_81 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
101
  protected final String TEXT_81 = NL + "\t\t\t\t\t\tresult.append(";
102
  protected final String TEXT_82 = ".create(domainModelEditDomain, element, feature, valueToSet));";
102
  protected final String TEXT_82 = ".create(editingDomain, element, feature, valueToSet));";
103
  protected final String TEXT_83 = NL + "\t\t\t\t\t\t\t\tresult.append(";
103
  protected final String TEXT_83 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
104
  protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, valueToSet));";
104
  protected final String TEXT_84 = NL + "\t\t\t\t});";
105
  protected final String TEXT_85 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}";
105
  protected final String TEXT_85 = NL + "\t}" + NL;
106
  protected final String TEXT_86 = NL + "\t\t\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.undo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.execute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canUndo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canExecute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t};" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL;
106
  protected final String TEXT_86 = NL;
107
  protected final String TEXT_87 = NL;
107
  protected final String TEXT_87 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
108
  protected final String TEXT_88 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
108
  protected final String TEXT_88 = " req) {" + NL + "\t\tif (";
109
  protected final String TEXT_89 = " req) {" + NL + "\t\tif (";
109
  protected final String TEXT_89 = ".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 ";
110
  protected final String TEXT_90 = ".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 ";
110
  protected final String TEXT_90 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
111
  protected final String TEXT_91 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
111
  protected final String TEXT_91 = "(this, ";
112
  protected final String TEXT_92 = "(this, ";
112
  protected final String TEXT_92 = ".class, new ";
113
  protected final String TEXT_93 = ".class, new ";
113
  protected final String TEXT_93 = "() {" + NL + "\t\t\t\tpublic void relocate(";
114
  protected final String TEXT_94 = "() {" + NL + "\t\t\t\tpublic void relocate(";
114
  protected final String TEXT_94 = " celleditor) {" + NL + "\t\t\t\t\t";
115
  protected final String TEXT_95 = " celleditor) {" + NL + "\t\t\t\t\t";
115
  protected final String TEXT_95 = " 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;
116
  protected final String TEXT_96 = " 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 + "" + 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}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL;
116
  protected final String TEXT_96 = 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}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL;
117
  protected final String TEXT_97 = NL;
117
  protected final String TEXT_97 = NL;
118
  protected final String TEXT_98 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
118
  protected final String TEXT_98 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
119
  protected final String TEXT_99 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
119
  protected final String TEXT_99 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
Lines 227-232 Link Here
227
GenClass underlyingMetaClass = genHost.getDomainMetaClass();
227
GenClass underlyingMetaClass = genHost.getDomainMetaClass();
228
GenDiagram genDiagram = genLabel.getDiagram();
228
GenDiagram genDiagram = genLabel.getDiagram();
229
LabelModelFacet labelModelFacet = genLabel.getModelFacet();
229
LabelModelFacet labelModelFacet = genLabel.getModelFacet();
230
final boolean isReadOnly = genLabel.isReadOnly();
230
231
231
    stringBuffer.append(TEXT_1);
232
    stringBuffer.append(TEXT_1);
232
    
233
    
Lines 258-464 Link Here
258
    stringBuffer.append(TEXT_10);
259
    stringBuffer.append(TEXT_10);
259
    }
260
    }
260
    stringBuffer.append(TEXT_11);
261
    stringBuffer.append(TEXT_11);
262
    
263
if (!isReadOnly) {
264
261
    stringBuffer.append(TEXT_12);
265
    stringBuffer.append(TEXT_12);
262
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
266
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
263
    stringBuffer.append(TEXT_13);
267
    stringBuffer.append(TEXT_13);
264
    stringBuffer.append(genLabel.getEditPartClassName());
268
    
269
}
270
265
    stringBuffer.append(TEXT_14);
271
    stringBuffer.append(TEXT_14);
272
    stringBuffer.append(genLabel.getEditPartClassName());
273
    stringBuffer.append(TEXT_15);
266
    
274
    
267
	final String primaryView = "getUpdatableParent().getDiagramNode()";
275
	final String primaryView = "getUpdatableParent().getDiagramNode()";
268
	final String resolvedSemanticElement = "resolveSemanticElement()";
276
	final String resolvedSemanticElement = "resolveSemanticElement()";
269
	final boolean isReadOnly = genLabel.isReadOnly();
277
	if (!isReadOnly) {
270
278
271
    stringBuffer.append(TEXT_15);
272
    stringBuffer.append(TEXT_16);
279
    stringBuffer.append(TEXT_16);
273
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
274
    stringBuffer.append(TEXT_17);
280
    stringBuffer.append(TEXT_17);
275
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
281
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
276
    stringBuffer.append(TEXT_18);
282
    stringBuffer.append(TEXT_18);
277
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
278
    stringBuffer.append(TEXT_19);
284
    stringBuffer.append(TEXT_19);
279
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
280
    stringBuffer.append(TEXT_20);
281
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
285
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
286
    stringBuffer.append(TEXT_20);
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
282
    stringBuffer.append(TEXT_21);
288
    stringBuffer.append(TEXT_21);
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
289
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
284
    stringBuffer.append(TEXT_22);
290
    stringBuffer.append(TEXT_22);
285
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
286
    stringBuffer.append(TEXT_23);
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
291
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
292
    stringBuffer.append(TEXT_23);
293
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
288
    stringBuffer.append(TEXT_24);
294
    stringBuffer.append(TEXT_24);
289
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
290
    stringBuffer.append(TEXT_25);
291
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
295
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
296
    stringBuffer.append(TEXT_25);
297
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
292
    stringBuffer.append(TEXT_26);
298
    stringBuffer.append(TEXT_26);
293
    
294
if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) {
295
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
296
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
297
298
    stringBuffer.append(TEXT_27);
299
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
299
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
300
    stringBuffer.append(TEXT_27);
301
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
300
    stringBuffer.append(TEXT_28);
302
    stringBuffer.append(TEXT_28);
301
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
302
    stringBuffer.append(TEXT_29);
304
    stringBuffer.append(TEXT_29);
303
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
305
    stringBuffer.append(primaryView);
304
    stringBuffer.append(TEXT_30);
306
    stringBuffer.append(TEXT_30);
305
    stringBuffer.append(resolvedSemanticElement);
307
    
308
if (labelModelFacet instanceof FeatureLabelModelFacet) {
309
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
310
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
311
306
    stringBuffer.append(TEXT_31);
312
    stringBuffer.append(TEXT_31);
307
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
313
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
308
    stringBuffer.append(TEXT_32);
314
    stringBuffer.append(TEXT_32);
309
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
315
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
310
    stringBuffer.append(TEXT_33);
316
    stringBuffer.append(TEXT_33);
311
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
317
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
312
    stringBuffer.append(TEXT_34);
318
    stringBuffer.append(TEXT_34);
313
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
319
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
314
    stringBuffer.append(TEXT_35);
320
    stringBuffer.append(TEXT_35);
315
    stringBuffer.append(primaryView);
321
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
316
    stringBuffer.append(TEXT_36);
322
    stringBuffer.append(TEXT_36);
317
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
323
    stringBuffer.append(resolvedSemanticElement);
318
    stringBuffer.append(TEXT_37);
324
    stringBuffer.append(TEXT_37);
319
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
325
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
320
    stringBuffer.append(TEXT_38);
326
    stringBuffer.append(TEXT_38);
321
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
327
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
322
    stringBuffer.append(TEXT_39);
328
    stringBuffer.append(TEXT_39);
323
    stringBuffer.append(featureToSet.getFeatureAccessorName());
329
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
324
    stringBuffer.append(TEXT_40);
330
    stringBuffer.append(TEXT_40);
325
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
331
    stringBuffer.append(featureToSet.getFeatureAccessorName());
326
    stringBuffer.append(TEXT_41);
332
    stringBuffer.append(TEXT_41);
327
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
333
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
328
    stringBuffer.append(TEXT_42);
334
    stringBuffer.append(TEXT_42);
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
336
    stringBuffer.append(TEXT_43);
329
    
337
    
330
	if (ecoreFeature.isMany()) {
338
	if (ecoreFeature.isMany()) {
331
339
332
    stringBuffer.append(TEXT_43);
333
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
334
    stringBuffer.append(TEXT_44);
340
    stringBuffer.append(TEXT_44);
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
341
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
336
    stringBuffer.append(TEXT_45);
342
    stringBuffer.append(TEXT_45);
337
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
338
    stringBuffer.append(TEXT_46);
344
    stringBuffer.append(TEXT_46);
339
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
345
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
340
    stringBuffer.append(TEXT_47);
346
    stringBuffer.append(TEXT_47);
341
    stringBuffer.append(featureToSet.getAccessorName());
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
342
    stringBuffer.append(TEXT_48);
348
    stringBuffer.append(TEXT_48);
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
349
    stringBuffer.append(featureToSet.getAccessorName());
344
    stringBuffer.append(TEXT_49);
350
    stringBuffer.append(TEXT_49);
345
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
346
    stringBuffer.append(TEXT_50);
352
    stringBuffer.append(TEXT_50);
353
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
354
    stringBuffer.append(TEXT_51);
347
    
355
    
348
	} else {
356
	} else {
349
357
350
    stringBuffer.append(TEXT_51);
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
352
    stringBuffer.append(TEXT_52);
358
    stringBuffer.append(TEXT_52);
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
360
    stringBuffer.append(TEXT_53);
353
    
361
    
354
	}
362
	}
355
363
356
    stringBuffer.append(TEXT_53);
364
    stringBuffer.append(TEXT_54);
357
    
365
    
358
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
366
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
359
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
367
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
360
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
368
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
361
369
362
    stringBuffer.append(TEXT_54);
363
    stringBuffer.append(metaFeatures.size());
364
    stringBuffer.append(TEXT_55);
370
    stringBuffer.append(TEXT_55);
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
371
    stringBuffer.append(metaFeatures.size());
366
    stringBuffer.append(TEXT_56);
372
    stringBuffer.append(TEXT_56);
367
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
368
    stringBuffer.append(TEXT_57);
374
    stringBuffer.append(TEXT_57);
369
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
370
    stringBuffer.append(TEXT_58);
376
    stringBuffer.append(TEXT_58);
371
    stringBuffer.append(resolvedSemanticElement);
372
    stringBuffer.append(TEXT_59);
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
377
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
378
    stringBuffer.append(TEXT_59);
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
374
    stringBuffer.append(TEXT_60);
380
    stringBuffer.append(TEXT_60);
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
381
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
376
    stringBuffer.append(TEXT_61);
382
    stringBuffer.append(TEXT_61);
377
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
383
    stringBuffer.append(resolvedSemanticElement);
378
    stringBuffer.append(TEXT_62);
384
    stringBuffer.append(TEXT_62);
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
380
    stringBuffer.append(TEXT_63);
381
    stringBuffer.append(primaryView);
382
    stringBuffer.append(TEXT_64);
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
385
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
384
    stringBuffer.append(TEXT_65);
386
    stringBuffer.append(TEXT_63);
385
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
386
    stringBuffer.append(TEXT_66);
388
    stringBuffer.append(TEXT_64);
387
    
389
    
388
	boolean haveDeclaredValues = false;
390
	boolean haveDeclaredValues = false;
389
	for(int i = 0; i < metaFeatures.size(); i++) {
391
	for(int i = 0; i < metaFeatures.size(); i++) {
390
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
392
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
391
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
393
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
392
394
393
    stringBuffer.append(TEXT_67);
395
    stringBuffer.append(TEXT_65);
394
    if (i == 0) {
396
    if (i == 0) {
395
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
396
    stringBuffer.append(TEXT_68);
398
    stringBuffer.append(TEXT_66);
397
    }
399
    }
398
    stringBuffer.append(TEXT_69);
400
    stringBuffer.append(TEXT_67);
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
400
    stringBuffer.append(TEXT_70);
402
    stringBuffer.append(TEXT_68);
401
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
403
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
402
    stringBuffer.append(TEXT_71);
404
    stringBuffer.append(TEXT_69);
403
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
405
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
404
    stringBuffer.append(TEXT_72);
406
    stringBuffer.append(TEXT_70);
405
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
407
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
406
    stringBuffer.append(TEXT_73);
408
    stringBuffer.append(TEXT_71);
407
    stringBuffer.append(i);
409
    stringBuffer.append(i);
408
    stringBuffer.append(TEXT_74);
410
    stringBuffer.append(TEXT_72);
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
410
    stringBuffer.append(TEXT_75);
412
    stringBuffer.append(TEXT_73);
411
    
413
    
412
		if (nextEcoreFeature.isMany()) {
414
		if (nextEcoreFeature.isMany()) {
413
415
414
    stringBuffer.append(TEXT_76);
416
    stringBuffer.append(TEXT_74);
415
    if (!haveDeclaredValues) { haveDeclaredValues = true;
417
    if (!haveDeclaredValues) { haveDeclaredValues = true;
416
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
418
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
417
    stringBuffer.append(TEXT_77);
419
    stringBuffer.append(TEXT_75);
418
    }
420
    }
419
    stringBuffer.append(TEXT_78);
421
    stringBuffer.append(TEXT_76);
420
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
422
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
421
    stringBuffer.append(TEXT_79);
423
    stringBuffer.append(TEXT_77);
422
    stringBuffer.append(nextFeatureToSet.getAccessorName());
424
    stringBuffer.append(nextFeatureToSet.getAccessorName());
423
    stringBuffer.append(TEXT_80);
425
    stringBuffer.append(TEXT_78);
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
425
    stringBuffer.append(TEXT_81);
427
    stringBuffer.append(TEXT_79);
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
428
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
427
    stringBuffer.append(TEXT_82);
429
    stringBuffer.append(TEXT_80);
428
    
430
    
429
		} else {
431
		} else {
430
432
431
    stringBuffer.append(TEXT_83);
433
    stringBuffer.append(TEXT_81);
432
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
433
    stringBuffer.append(TEXT_84);
435
    stringBuffer.append(TEXT_82);
434
    
436
    
435
		}
437
		}
436
438
437
    
439
    
438
	}
440
	}
439
441
440
    stringBuffer.append(TEXT_85);
442
    stringBuffer.append(TEXT_83);
441
    
443
    
442
}
444
}
443
445
446
    stringBuffer.append(TEXT_84);
447
    
448
	}
449
450
    stringBuffer.append(TEXT_85);
451
    
452
	if (!isReadOnly) {
453
444
    stringBuffer.append(TEXT_86);
454
    stringBuffer.append(TEXT_86);
445
    stringBuffer.append(TEXT_87);
455
    stringBuffer.append(TEXT_87);
446
    stringBuffer.append(TEXT_88);
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
448
    stringBuffer.append(TEXT_89);
457
    stringBuffer.append(TEXT_88);
449
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
458
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
459
    stringBuffer.append(TEXT_89);
460
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
450
    stringBuffer.append(TEXT_90);
461
    stringBuffer.append(TEXT_90);
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
462
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
452
    stringBuffer.append(TEXT_91);
463
    stringBuffer.append(TEXT_91);
453
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
454
    stringBuffer.append(TEXT_92);
455
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
464
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
456
    stringBuffer.append(TEXT_93);
465
    stringBuffer.append(TEXT_92);
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
466
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
458
    stringBuffer.append(TEXT_94);
467
    stringBuffer.append(TEXT_93);
459
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
468
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
460
    stringBuffer.append(TEXT_95);
469
    stringBuffer.append(TEXT_94);
461
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
470
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
471
    stringBuffer.append(TEXT_95);
472
    
473
	}
474
462
    stringBuffer.append(TEXT_96);
475
    stringBuffer.append(TEXT_96);
463
    stringBuffer.append(TEXT_97);
476
    stringBuffer.append(TEXT_97);
464
    
477
    
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java (-649 / +646 lines)
Lines 41-392 Link Here
41
  protected final String TEXT_20 = ".COMPONENT_ROLE, new ";
41
  protected final String TEXT_20 = ".COMPONENT_ROLE, new ";
42
  protected final String TEXT_21 = "() {" + NL + "\t\t\tprotected ";
42
  protected final String TEXT_21 = "() {" + NL + "\t\t\tprotected ";
43
  protected final String TEXT_22 = " createDeleteCommand(";
43
  protected final String TEXT_22 = " createDeleteCommand(";
44
  protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\treturn new ";
44
  protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\t";
45
  protected final String TEXT_24 = "() {";
45
  protected final String TEXT_24 = " editingDomain = ";
46
  protected final String TEXT_25 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = getDomainModelRemoveCommand();" + NL + "\t\t\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand() {" + NL + "\t\t\t\t\t\t";
46
  protected final String TEXT_25 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
47
  protected final String TEXT_26 = " result = new ";
47
  protected final String TEXT_26 = " cc = new ";
48
  protected final String TEXT_27 = "();";
48
  protected final String TEXT_27 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
49
  protected final String TEXT_28 = NL + "\t\t\t\t\t\tresult.append(";
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(";
50
  protected final String TEXT_29 = ".create(" + NL + "\t\t\t\t\t\t\t";
50
  protected final String TEXT_29 = " editingDomain) {";
51
  protected final String TEXT_30 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
51
  protected final String TEXT_30 = NL + "\t\t\t\t";
52
  protected final String TEXT_31 = ".eINSTANCE.get";
52
  protected final String TEXT_31 = " result = new ";
53
  protected final String TEXT_32 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));";
53
  protected final String TEXT_32 = "();";
54
  protected final String TEXT_33 = NL + "\t\t\t\t\t\tresult.append(";
54
  protected final String TEXT_33 = NL + "\t\t\t\tresult.append(";
55
  protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\t\t\t";
55
  protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
56
  protected final String TEXT_35 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
56
  protected final String TEXT_35 = ".eINSTANCE.get";
57
  protected final String TEXT_36 = ".eINSTANCE.get";
57
  protected final String TEXT_36 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
58
  protected final String TEXT_37 = "()," + NL + "\t\t\t\t\t\t\t";
58
  protected final String TEXT_37 = NL + "\t\t\t\tresult.append(";
59
  protected final String TEXT_38 = ".UNSET_VALUE));";
59
  protected final String TEXT_38 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
60
  protected final String TEXT_39 = NL + "\t\t\t\t\t\tresult.append(";
60
  protected final String TEXT_39 = ".eINSTANCE.get";
61
  protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\t\t\t";
61
  protected final String TEXT_40 = "()," + NL + "\t\t\t\t\t";
62
  protected final String TEXT_41 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
62
  protected final String TEXT_41 = ".UNSET_VALUE));";
63
  protected final String TEXT_42 = ".eINSTANCE.get";
63
  protected final String TEXT_42 = NL + "\t\t\t\tresult.append(";
64
  protected final String TEXT_43 = "()," + NL + "\t\t\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(), ";
65
  protected final String TEXT_44 = NL + "\t\t\t\t\t\tresult.append(";
65
  protected final String TEXT_44 = ".eINSTANCE.get";
66
  protected final String TEXT_45 = ".create(" + NL + "\t\t\t\t\t\t\t";
66
  protected final String TEXT_45 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
67
  protected final String TEXT_46 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
67
  protected final String TEXT_46 = NL + "\t\t\t\tresult.append(";
68
  protected final String TEXT_47 = ".eINSTANCE.get";
68
  protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
69
  protected final String TEXT_48 = "()," + NL + "\t\t\t\t\t\t\t";
69
  protected final String TEXT_48 = ".eINSTANCE.get";
70
  protected final String TEXT_49 = ".UNSET_VALUE));";
70
  protected final String TEXT_49 = "()," + NL + "\t\t\t\t\t";
71
  protected final String TEXT_50 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
71
  protected final String TEXT_50 = ".UNSET_VALUE));";
72
  protected final String TEXT_51 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = ";
72
  protected final String TEXT_51 = NL + "\t\t\t\treturn result;";
73
  protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\t\t\t";
73
  protected final String TEXT_52 = NL + "\t\t\t\treturn ";
74
  protected final String TEXT_53 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\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\t\t\tgetDiagramNode().getElement());";
76
  protected final String TEXT_55 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
77
  protected final String TEXT_56 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = ";
77
  protected final String TEXT_56 = NL + "\t\t\t\treturn ";
78
  protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\t\t\t";
78
  protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
79
  protected final String TEXT_58 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
79
  protected final String TEXT_58 = ".eINSTANCE.get";
80
  protected final String TEXT_59 = ".eINSTANCE.get";
80
  protected final String TEXT_59 = "()," + NL + "\t\t\t\t\t";
81
  protected final String TEXT_60 = "()," + NL + "\t\t\t\t\t\t\t";
81
  protected final String TEXT_60 = ".UNSET_VALUE);";
82
  protected final String TEXT_61 = ".UNSET_VALUE);";
82
  protected final String TEXT_61 = NL + "\t\t\t}" + NL + "\t\t});";
83
  protected final String TEXT_62 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command viewRemoveCommand = ";
83
  protected final String TEXT_62 = NL + "\t\tinstallEditPolicy(";
84
  protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\t\t";
84
  protected final String TEXT_63 = ".LAYOUT_ROLE, new ";
85
  protected final String TEXT_64 = ".getEditingDomainFor(getDiagramNode().getDiagram()), " + NL + "\t\t\t\t\t\tgetDiagramNode());" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute() && viewRemoveCommand != null && viewRemoveCommand.canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.execute();" + NL + "\t\t\t\t\t\tviewRemoveCommand.execute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo() && viewRemoveCommand != null && viewRemoveCommand.canUndo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.undo();" + NL + "\t\t\t\t\t\tviewRemoveCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\t\t});";
85
  protected final String TEXT_64 = "() {" + NL + "\t\t\tprotected ";
86
  protected final String TEXT_65 = NL + "\t\tinstallEditPolicy(";
86
  protected final String TEXT_65 = " getCreateCommand(";
87
  protected final String TEXT_66 = ".LAYOUT_ROLE, new ";
87
  protected final String TEXT_66 = " request) {" + NL + "\t\t\t\treturn ";
88
  protected final String TEXT_67 = "() {" + NL + "\t\t\tprotected ";
88
  protected final String TEXT_67 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
89
  protected final String TEXT_68 = " getCreateCommand(";
89
  protected final String TEXT_68 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
90
  protected final String TEXT_69 = " request) {" + NL + "\t\t\t\treturn ";
90
  protected final String TEXT_69 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
91
  protected final String TEXT_70 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
91
  protected final String TEXT_70 = " createChangeConstraintCommand(";
92
  protected final String TEXT_71 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
92
  protected final String TEXT_71 = " child, Object constraint) {" + NL + "\t\t\t\treturn ";
93
  protected final String TEXT_72 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
93
  protected final String TEXT_72 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
94
  protected final String TEXT_73 = " createChangeConstraintCommand(";
94
  protected final String TEXT_73 = " createChildEditPolicy(";
95
  protected final String TEXT_74 = " child, Object constraint) {" + NL + "\t\t\t\treturn ";
95
  protected final String TEXT_74 = " child) {" + NL + "\t\t\t\treturn new ";
96
  protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
96
  protected final String TEXT_75 = "() {" + NL + "\t\t\t\t\tpublic ";
97
  protected final String TEXT_76 = " createChildEditPolicy(";
97
  protected final String TEXT_76 = " getTargetEditPart(";
98
  protected final String TEXT_77 = " child) {" + NL + "\t\t\t\treturn new ";
98
  protected final String TEXT_77 = " request) {" + NL + "\t\t\t\t\t\tif (";
99
  protected final String TEXT_78 = "() {" + NL + "\t\t\t\t\tpublic ";
99
  protected final String TEXT_78 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn ";
100
  protected final String TEXT_79 = " getTargetEditPart(";
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(";
101
  protected final String TEXT_80 = " request) {" + NL + "\t\t\t\t\t\tif (";
101
  protected final String TEXT_80 = ".GRAPHICAL_NODE_ROLE, new ";
102
  protected final String TEXT_81 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn ";
102
  protected final String TEXT_81 = "() {" + NL + "\t\t\tprotected ";
103
  protected final String TEXT_82 = ".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(";
103
  protected final String TEXT_82 = " getReconnectTargetCommand(";
104
  protected final String TEXT_83 = ".GRAPHICAL_NODE_ROLE, new ";
104
  protected final String TEXT_83 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn ";
105
  protected final String TEXT_84 = "() {" + NL + "\t\t\tprotected ";
105
  protected final String TEXT_84 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
106
  protected final String TEXT_85 = " getReconnectTargetCommand(";
106
  protected final String TEXT_85 = " getReconnectSourceCommand(";
107
  protected final String TEXT_86 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn ";
107
  protected final String TEXT_86 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn ";
108
  protected final String TEXT_87 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
108
  protected final String TEXT_87 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
109
  protected final String TEXT_88 = " getReconnectSourceCommand(";
109
  protected final String TEXT_88 = " getConnectionCreateCommand(";
110
  protected final String TEXT_89 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn ";
110
  protected final String TEXT_89 = " request) {";
111
  protected final String TEXT_90 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
111
  protected final String TEXT_90 = NL + "\t\t\t\tif (request instanceof ";
112
  protected final String TEXT_91 = " getConnectionCreateCommand(";
112
  protected final String TEXT_91 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
113
  protected final String TEXT_92 = " request) {";
113
  protected final String TEXT_92 = ".CreateConnectionRequestEx requestEx = (";
114
  protected final String TEXT_93 = NL + "\t\t\t\tif (request instanceof ";
114
  protected final String TEXT_93 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\tint matchingVisualIdsCount = 0;" + 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) {";
115
  protected final String TEXT_94 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
115
  protected final String TEXT_94 = NL + "\t\t\t\t\t\tcase ";
116
  protected final String TEXT_95 = ".CreateConnectionRequestEx requestEx = (";
116
  protected final String TEXT_95 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tmatchingVisualIdsCount++;" + NL + "\t\t\t\t\t\t\tbreak;";
117
  protected final String TEXT_96 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\tint matchingVisualIdsCount = 0;" + 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) {";
117
  protected final String TEXT_96 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (matchingVisualIdsCount != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn ";
118
  protected final String TEXT_97 = NL + "\t\t\t\t\t\tcase ";
118
  protected final String TEXT_97 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
119
  protected final String TEXT_98 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tmatchingVisualIdsCount++;" + NL + "\t\t\t\t\t\t\tbreak;";
119
  protected final String TEXT_98 = " result = new ";
120
  protected final String TEXT_99 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (matchingVisualIdsCount != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn ";
120
  protected final String TEXT_99 = "() {" + NL + "\t\t\t\t\t\t//XXX: check multiplicity requirements etc." + NL + "\t\t\t\t\t};" + NL + "\t\t\t\t\trequest.setStartCommand(result);" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}";
121
  protected final String TEXT_100 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t";
121
  protected final String TEXT_100 = NL + "\t\t\t\treturn ";
122
  protected final String TEXT_101 = " result = new ";
122
  protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
123
  protected final String TEXT_102 = "() {" + NL + "\t\t\t\t\t\t//XXX: check multiplicity requirements etc." + NL + "\t\t\t\t\t};" + NL + "\t\t\t\t\trequest.setStartCommand(result);" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}";
123
  protected final String TEXT_102 = " getConnectionCompleteCommand(";
124
  protected final String TEXT_103 = NL + "\t\t\t\treturn ";
124
  protected final String TEXT_103 = " request) {";
125
  protected final String TEXT_104 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected ";
125
  protected final String TEXT_104 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn ";
126
  protected final String TEXT_105 = " getConnectionCompleteCommand(";
126
  protected final String TEXT_105 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof ";
127
  protected final String TEXT_106 = " request) {";
127
  protected final String TEXT_106 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
128
  protected final String TEXT_107 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn ";
128
  protected final String TEXT_107 = ".CreateConnectionRequestEx requestEx = (";
129
  protected final String TEXT_108 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof ";
129
  protected final String TEXT_108 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
130
  protected final String TEXT_109 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t";
130
  protected final String TEXT_109 = " result = new ";
131
  protected final String TEXT_110 = ".CreateConnectionRequestEx requestEx = (";
131
  protected final String TEXT_110 = "();" + 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) {";
132
  protected final String TEXT_111 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
132
  protected final String TEXT_111 = NL + "\t\t\t\t\t\tcase ";
133
  protected final String TEXT_112 = " result = new ";
133
  protected final String TEXT_112 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
134
  protected final String TEXT_113 = "();" + 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) {";
134
  protected final String TEXT_113 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
135
  protected final String TEXT_114 = NL + "\t\t\t\t\t\tcase ";
135
  protected final String TEXT_114 = 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 ";
136
  protected final String TEXT_115 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create";
136
  protected final String TEXT_115 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
137
  protected final String TEXT_116 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;";
137
  protected final String TEXT_116 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
138
  protected final String TEXT_117 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getChildren().length != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn ";
138
  protected final String TEXT_117 = NL + "\t\t\t\treturn ";
139
  protected final String TEXT_118 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn result.unwrap();" + NL + "\t\t\t\t}";
139
  protected final String TEXT_118 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
140
  protected final String TEXT_119 = NL + "\t\t\t\treturn ";
140
  protected final String TEXT_119 = " createFigure() {" + NL + "\t\t";
141
  protected final String TEXT_120 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
141
  protected final String TEXT_120 = " invisibleRectangle = new ";
142
  protected final String TEXT_121 = " createFigure() {" + NL + "\t\t";
142
  protected final String TEXT_121 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new ";
143
  protected final String TEXT_122 = " invisibleRectangle = new ";
143
  protected final String TEXT_122 = "());" + NL + "\t\t";
144
  protected final String TEXT_123 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new ";
144
  protected final String TEXT_123 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t";
145
  protected final String TEXT_124 = "());" + NL + "\t\t";
145
  protected final String TEXT_124 = " 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 ";
146
  protected final String TEXT_125 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t";
146
  protected final String TEXT_125 = " createNodeShape() {";
147
  protected final String TEXT_126 = " 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 ";
147
  protected final String TEXT_126 = NL + "\t\tprimaryShape = new ";
148
  protected final String TEXT_127 = " createNodeShape() {";
148
  protected final String TEXT_127 = "()";
149
  protected final String TEXT_128 = NL + "\t\tprimaryShape = new ";
149
  protected final String TEXT_128 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}";
150
  protected final String TEXT_129 = "()";
150
  protected final String TEXT_129 = ";";
151
  protected final String TEXT_130 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}";
151
  protected final String TEXT_130 = NL + "\t\tprimaryShape = ";
152
  protected final String TEXT_131 = ";";
152
  protected final String TEXT_131 = ";";
153
  protected final String TEXT_132 = NL + "\t\tprimaryShape = ";
153
  protected final String TEXT_132 = NL + "\t\t";
154
  protected final String TEXT_133 = ";";
154
  protected final String TEXT_133 = " figure = new ";
155
  protected final String TEXT_134 = NL + "\t\t";
155
  protected final String TEXT_134 = "();" + NL + " \t\tfigure.setUseLocalCoordinates(";
156
  protected final String TEXT_135 = " figure = new ";
156
  protected final String TEXT_135 = ");" + NL + " \t\tprimaryShape = figure;";
157
  protected final String TEXT_136 = "();" + NL + " \t\tfigure.setUseLocalCoordinates(";
157
  protected final String TEXT_136 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
158
  protected final String TEXT_137 = ");" + NL + " \t\tprimaryShape = figure;";
158
  protected final String TEXT_137 = " createDecorationPane() {" + NL + "\t\t";
159
  protected final String TEXT_138 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
159
  protected final String TEXT_138 = " view = (";
160
  protected final String TEXT_139 = " createDecorationPane() {" + NL + "\t\t";
160
  protected final String TEXT_139 = ") getModel();" + NL + "\t\t";
161
  protected final String TEXT_140 = " view = (";
161
  protected final String TEXT_140 = " 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";
162
  protected final String TEXT_141 = ") getModel();" + NL + "\t\t";
162
  protected final String TEXT_141 = " decorationPane = new ";
163
  protected final String TEXT_142 = " 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";
163
  protected final String TEXT_142 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new ";
164
  protected final String TEXT_143 = " decorationPane = new ";
164
  protected final String TEXT_143 = "());" + NL + "" + NL + "\t\t";
165
  protected final String TEXT_144 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new ";
165
  protected final String TEXT_144 = " imageFigure = new ";
166
  protected final String TEXT_145 = "());" + NL + "" + NL + "\t\t";
166
  protected final String TEXT_145 = "(";
167
  protected final String TEXT_146 = " imageFigure = new ";
167
  protected final String TEXT_146 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), ";
168
  protected final String TEXT_147 = "(";
168
  protected final String TEXT_147 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, ";
169
  protected final String TEXT_148 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), ";
169
  protected final String TEXT_148 = ".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 ";
170
  protected final String TEXT_149 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, ";
170
  protected final String TEXT_149 = " setupContentPane(";
171
  protected final String TEXT_150 = ".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 ";
171
  protected final String TEXT_150 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {";
172
  protected final String TEXT_151 = " setupContentPane(";
172
  protected final String TEXT_151 = NL + "\t\t\t";
173
  protected final String TEXT_152 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {";
173
  protected final String TEXT_152 = " layout = new ";
174
  protected final String TEXT_153 = NL + "\t\t\t";
174
  protected final String TEXT_153 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);";
175
  protected final String TEXT_154 = " layout = new ";
175
  protected final String TEXT_154 = NL + "\t\tnodeShape.setLayoutManager(new ";
176
  protected final String TEXT_155 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);";
176
  protected final String TEXT_155 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(";
177
  protected final String TEXT_156 = NL + "\t\tnodeShape.setLayoutManager(new ";
177
  protected final String TEXT_156 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new ";
178
  protected final String TEXT_157 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(";
178
  protected final String TEXT_157 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});";
179
  protected final String TEXT_158 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new ";
179
  protected final String TEXT_158 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
180
  protected final String TEXT_159 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});";
180
  protected final String TEXT_159 = " 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 ";
181
  protected final String TEXT_160 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
181
  protected final String TEXT_160 = " getDiagramNode() {" + NL + "\t\treturn (";
182
  protected final String TEXT_161 = " 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 ";
182
  protected final String TEXT_161 = ") getModel();" + NL + "\t}" + NL;
183
  protected final String TEXT_162 = " getDiagramNode() {" + NL + "\t\treturn (";
183
  protected final String TEXT_162 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild(";
184
  protected final String TEXT_163 = ") getModel();" + NL + "\t}" + NL;
184
  protected final String TEXT_163 = " childEditPart) {";
185
  protected final String TEXT_164 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild(";
185
  protected final String TEXT_164 = NL + "\t\tif (childEditPart instanceof ";
186
  protected final String TEXT_165 = " childEditPart) {";
186
  protected final String TEXT_165 = ") {";
187
  protected final String TEXT_166 = NL + "\t\tif (childEditPart instanceof ";
187
  protected final String TEXT_166 = NL + "\t\t\t((";
188
  protected final String TEXT_167 = ") {";
188
  protected final String TEXT_167 = ") childEditPart).setLabel(((";
189
  protected final String TEXT_168 = NL + "\t\t\t((";
189
  protected final String TEXT_168 = ") primaryShape).getFigure";
190
  protected final String TEXT_169 = ") childEditPart).setLabel(((";
190
  protected final String TEXT_169 = "());";
191
  protected final String TEXT_170 = ") primaryShape).getFigure";
191
  protected final String TEXT_170 = NL + "\t\t\t((";
192
  protected final String TEXT_171 = "());";
192
  protected final String TEXT_171 = ") childEditPart).setLabel(new ";
193
  protected final String TEXT_172 = NL + "\t\t\t((";
193
  protected final String TEXT_172 = "());";
194
  protected final String TEXT_173 = ") childEditPart).setLabel(new ";
194
  protected final String TEXT_173 = NL + "\t\t\treturn true;" + NL + "\t\t}";
195
  protected final String TEXT_174 = "());";
195
  protected final String TEXT_174 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
196
  protected final String TEXT_175 = NL + "\t\t\treturn true;" + NL + "\t\t}";
196
  protected final String TEXT_175 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
197
  protected final String TEXT_176 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
197
  protected final String TEXT_176 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
198
  protected final String TEXT_177 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
198
  protected final String TEXT_177 = " nextChild = (";
199
  protected final String TEXT_178 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
199
  protected final String TEXT_178 = ")it.next();" + NL + "\t\t\tif (";
200
  protected final String TEXT_179 = " nextChild = (";
200
  protected final String TEXT_179 = ".getVisualID(nextChild) == ";
201
  protected final String TEXT_180 = ")it.next();" + NL + "\t\t\tif (";
201
  protected final String TEXT_180 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (";
202
  protected final String TEXT_181 = ".getVisualID(nextChild) == ";
202
  protected final String TEXT_181 = ") 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(";
203
  protected final String TEXT_182 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (";
203
  protected final String TEXT_182 = " req) {" + NL + "\t\tif (";
204
  protected final String TEXT_183 = ") 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(";
204
  protected final String TEXT_183 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
205
  protected final String TEXT_184 = " req) {" + NL + "\t\tif (";
205
  protected final String TEXT_184 = " primaryLabel = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabel != null) {" + NL + "\t\t\t\tprimaryLabel.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
206
  protected final String TEXT_185 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t";
206
  protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
207
  protected final String TEXT_186 = " primaryLabel = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabel != null) {" + NL + "\t\t\t\tprimaryLabel.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
207
  protected final String TEXT_186 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
208
  protected final String TEXT_187 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
208
  protected final String TEXT_187 = " labelFigure = ((";
209
  protected final String TEXT_188 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
209
  protected final String TEXT_188 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {";
210
  protected final String TEXT_189 = " labelFigure = ((";
210
  protected final String TEXT_189 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}";
211
  protected final String TEXT_190 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {";
211
  protected final String TEXT_190 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);";
212
  protected final String TEXT_191 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}";
212
  protected final String TEXT_191 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual(";
213
  protected final String TEXT_192 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);";
213
  protected final String TEXT_192 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
214
  protected final String TEXT_193 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual(";
214
  protected final String TEXT_193 = " labelFigure = ((";
215
  protected final String TEXT_194 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
215
  protected final String TEXT_194 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel(";
216
  protected final String TEXT_195 = " labelFigure = ((";
216
  protected final String TEXT_195 = " childEditPart) {";
217
  protected final String TEXT_196 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel(";
217
  protected final String TEXT_196 = NL + "\t\tif (childEditPart instanceof ";
218
  protected final String TEXT_197 = " childEditPart) {";
218
  protected final String TEXT_197 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
219
  protected final String TEXT_198 = NL + "\t\tif (childEditPart instanceof ";
219
  protected final String TEXT_198 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
220
  protected final String TEXT_199 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
220
  protected final String TEXT_199 = " getExternalLabelsContainer() {" + NL + "\t\t";
221
  protected final String TEXT_200 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
221
  protected final String TEXT_200 = " root = (";
222
  protected final String TEXT_201 = " getExternalLabelsContainer() {" + NL + "\t\t";
222
  protected final String TEXT_201 = ") getRoot();" + NL + "\t\treturn root.getLayer(";
223
  protected final String TEXT_202 = " root = (";
223
  protected final String TEXT_202 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL;
224
  protected final String TEXT_203 = ") getRoot();" + NL + "\t\treturn root.getLayer(";
224
  protected final String TEXT_203 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
225
  protected final String TEXT_204 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL;
225
  protected final String TEXT_204 = " childEditPart, int index) {" + NL + "\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t}" + NL + "\t}";
226
  protected final String TEXT_205 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual(";
226
  protected final String TEXT_205 = 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";
227
  protected final String TEXT_206 = " childEditPart, int index) {" + NL + "\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t}" + NL + "\t}";
227
  protected final String TEXT_206 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
228
  protected final String TEXT_207 = 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";
228
  protected final String TEXT_207 = ";" + NL + "\t\t";
229
  protected final String TEXT_208 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
229
  protected final String TEXT_208 = " bounds = (";
230
  protected final String TEXT_209 = ";" + NL + "\t\t";
230
  protected final String TEXT_209 = ") node.getLayoutConstraint();" + NL + "\t\t((";
231
  protected final String TEXT_210 = " bounds = (";
231
  protected final String TEXT_210 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew ";
232
  protected final String TEXT_211 = ") node.getLayoutConstraint();" + NL + "\t\t((";
232
  protected final String TEXT_211 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
233
  protected final String TEXT_212 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew ";
233
  protected final String TEXT_212 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
234
  protected final String TEXT_213 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
234
  protected final String TEXT_213 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
235
  protected final String TEXT_214 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
235
  protected final String TEXT_214 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
236
  protected final String TEXT_215 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
236
  protected final String TEXT_215 = " getSourceConnectionAnchor(";
237
  protected final String TEXT_216 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
237
  protected final String TEXT_216 = " connection) {" + NL + "\t\treturn new ";
238
  protected final String TEXT_217 = " getSourceConnectionAnchor(";
238
  protected final String TEXT_217 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
239
  protected final String TEXT_218 = " connection) {" + NL + "\t\treturn new ";
239
  protected final String TEXT_218 = " getSourceConnectionAnchor(";
240
  protected final String TEXT_219 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
240
  protected final String TEXT_219 = " request) {" + NL + "\t\treturn new ";
241
  protected final String TEXT_220 = " getSourceConnectionAnchor(";
241
  protected final String TEXT_220 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
242
  protected final String TEXT_221 = " request) {" + NL + "\t\treturn new ";
242
  protected final String TEXT_221 = "  getTargetConnectionAnchor(";
243
  protected final String TEXT_222 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
243
  protected final String TEXT_222 = " connection) {" + NL + "\t\treturn new ";
244
  protected final String TEXT_223 = "  getTargetConnectionAnchor(";
244
  protected final String TEXT_223 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
245
  protected final String TEXT_224 = " connection) {" + NL + "\t\treturn new ";
245
  protected final String TEXT_224 = "  getTargetConnectionAnchor(";
246
  protected final String TEXT_225 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
246
  protected final String TEXT_225 = " request) {" + NL + "\t\treturn new ";
247
  protected final String TEXT_226 = "  getTargetConnectionAnchor(";
247
  protected final String TEXT_226 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
248
  protected final String TEXT_227 = " request) {" + NL + "\t\treturn new ";
248
  protected final String TEXT_227 = 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;
249
  protected final String TEXT_228 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
249
  protected final String TEXT_228 = NL;
250
  protected final String TEXT_229 = 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;
250
  protected final String TEXT_229 = "\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 ";
251
  protected final String TEXT_230 = NL;
251
  protected final String TEXT_230 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
252
  protected final String TEXT_231 = "\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 ";
252
  protected final String TEXT_231 = " 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((";
253
  protected final String TEXT_232 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
253
  protected final String TEXT_232 = ") 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;
254
  protected final String TEXT_233 = " 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((";
254
  protected final String TEXT_233 = NL;
255
  protected final String TEXT_234 = ") 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;
255
  protected final String TEXT_234 = "\tpublic void addRefresher(";
256
  protected final String TEXT_235 = NL;
256
  protected final String TEXT_235 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher(";
257
  protected final String TEXT_236 = "\tpublic void addRefresher(";
257
  protected final String TEXT_236 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
258
  protected final String TEXT_237 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher(";
258
  protected final String TEXT_237 = " 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;
259
  protected final String TEXT_238 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
259
  protected final String TEXT_238 = NL;
260
  protected final String TEXT_239 = " 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;
260
  protected final String TEXT_239 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
261
  protected final String TEXT_240 = NL;
261
  protected final String TEXT_240 = " style =" + NL + "\t\t\t(";
262
  protected final String TEXT_241 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
262
  protected final String TEXT_241 = ") ";
263
  protected final String TEXT_242 = " style =" + NL + "\t\t\t(";
263
  protected final String TEXT_242 = ".getStyle(" + NL + "\t\t\t\t";
264
  protected final String TEXT_243 = ") ";
264
  protected final String TEXT_243 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
265
  protected final String TEXT_244 = ".getStyle(" + NL + "\t\t\t\t";
265
  protected final String TEXT_244 = " 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 = ";
266
  protected final String TEXT_245 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
266
  protected final String TEXT_245 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
267
  protected final String TEXT_246 = " 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 = ";
267
  protected final String TEXT_246 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
268
  protected final String TEXT_247 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
268
  protected final String TEXT_247 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
269
  protected final String TEXT_248 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
269
  protected final String TEXT_248 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
270
  protected final String TEXT_249 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
270
  protected final String TEXT_249 = " 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 ";
271
  protected final String TEXT_250 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
271
  protected final String TEXT_250 = "(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}" + NL + "\t}" + 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 ";
272
  protected final String TEXT_251 = " 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 ";
272
  protected final String TEXT_251 = " createdFont;" + NL;
273
  protected final String TEXT_252 = "(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}" + NL + "\t}" + 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 ";
273
  protected final String TEXT_252 = NL;
274
  protected final String TEXT_253 = " createdFont;" + NL;
274
  protected final String TEXT_253 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t";
275
  protected final String TEXT_254 = NL;
275
  protected final String TEXT_254 = " style = (";
276
  protected final String TEXT_255 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t";
276
  protected final String TEXT_255 = ")  ";
277
  protected final String TEXT_256 = " style = (";
277
  protected final String TEXT_256 = ".getStyle(";
278
  protected final String TEXT_257 = ")  ";
278
  protected final String TEXT_257 = ".eINSTANCE.getLineStyle());" + NL + "\t\t";
279
  protected final String TEXT_258 = ".getStyle(";
279
  protected final String TEXT_258 = " 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";
280
  protected final String TEXT_259 = ".eINSTANCE.getLineStyle());" + NL + "\t\t";
280
  protected final String TEXT_259 = " 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 ";
281
  protected final String TEXT_260 = " 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";
281
  protected final String TEXT_260 = "(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 ";
282
  protected final String TEXT_261 = " 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 ";
282
  protected final String TEXT_261 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t";
283
  protected final String TEXT_262 = "(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 ";
283
  protected final String TEXT_262 = " style = (";
284
  protected final String TEXT_263 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t";
284
  protected final String TEXT_263 = ")  ";
285
  protected final String TEXT_264 = " style = (";
285
  protected final String TEXT_264 = ".getStyle(";
286
  protected final String TEXT_265 = ")  ";
286
  protected final String TEXT_265 = ".eINSTANCE.getFillStyle());" + NL + "\t\t";
287
  protected final String TEXT_266 = ".getStyle(";
287
  protected final String TEXT_266 = " 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";
288
  protected final String TEXT_267 = ".eINSTANCE.getFillStyle());" + NL + "\t\t";
288
  protected final String TEXT_267 = " 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 ";
289
  protected final String TEXT_268 = " 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";
289
  protected final String TEXT_268 = "(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 ";
290
  protected final String TEXT_269 = " 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 ";
290
  protected final String TEXT_269 = " createdBackgroundColor;" + NL;
291
  protected final String TEXT_270 = "(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 ";
291
  protected final String TEXT_270 = NL;
292
  protected final String TEXT_271 = " createdBackgroundColor;" + NL;
292
  protected final String TEXT_271 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
293
  protected final String TEXT_272 = NL;
293
  protected final String TEXT_272 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
294
  protected final String TEXT_273 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
294
  protected final String TEXT_273 = " feature, ";
295
  protected final String TEXT_274 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
295
  protected final String TEXT_274 = " 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 ";
296
  protected final String TEXT_275 = " feature, ";
296
  protected final String TEXT_275 = "();";
297
  protected final String TEXT_276 = " 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 ";
297
  protected final String TEXT_276 = NL;
298
  protected final String TEXT_277 = "();";
298
  protected final String TEXT_277 = "\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(";
299
  protected final String TEXT_278 = NL;
299
  protected final String TEXT_278 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
300
  protected final String TEXT_279 = "\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(";
300
  protected final String TEXT_279 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
301
  protected final String TEXT_280 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
301
  protected final String TEXT_280 = NL;
302
  protected final String TEXT_281 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
302
  protected final String TEXT_281 = "\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(";
303
  protected final String TEXT_282 = NL;
303
  protected final String TEXT_282 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
304
  protected final String TEXT_283 = "\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(";
304
  protected final String TEXT_283 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
305
  protected final String TEXT_284 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
305
  protected final String TEXT_284 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
306
  protected final String TEXT_285 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
306
  protected final String TEXT_285 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
307
  protected final String TEXT_286 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
307
  protected final String TEXT_286 = ".eINSTANCE.getLocation_Y(), boundsRefresher);";
308
  protected final String TEXT_287 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
308
  protected final String TEXT_287 = NL;
309
  protected final String TEXT_288 = ".eINSTANCE.getLocation_Y(), boundsRefresher);";
309
  protected final String TEXT_288 = "\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(";
310
  protected final String TEXT_289 = NL;
310
  protected final String TEXT_289 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
311
  protected final String TEXT_290 = "\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(";
311
  protected final String TEXT_290 = NL;
312
  protected final String TEXT_291 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
312
  protected final String TEXT_291 = "\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(";
313
  protected final String TEXT_292 = NL;
313
  protected final String TEXT_292 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);";
314
  protected final String TEXT_293 = "\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(";
314
  protected final String TEXT_293 = NL;
315
  protected final String TEXT_294 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);";
315
  protected final String TEXT_294 = "\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(";
316
  protected final String TEXT_295 = NL;
316
  protected final String TEXT_295 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);";
317
  protected final String TEXT_296 = "\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(";
317
  protected final String TEXT_296 = NL;
318
  protected final String TEXT_297 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);";
318
  protected final String TEXT_297 = "\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(";
319
  protected final String TEXT_298 = NL;
319
  protected final String TEXT_298 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
320
  protected final String TEXT_299 = "\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(";
320
  protected final String TEXT_299 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
321
  protected final String TEXT_300 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
321
  protected final String TEXT_300 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
322
  protected final String TEXT_301 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
322
  protected final String TEXT_301 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
323
  protected final String TEXT_302 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
323
  protected final String TEXT_302 = NL;
324
  protected final String TEXT_303 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
324
  protected final String TEXT_303 = "\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(";
325
  protected final String TEXT_304 = NL;
325
  protected final String TEXT_304 = ".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(";
326
  protected final String TEXT_305 = "\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(";
326
  protected final String TEXT_305 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL;
327
  protected final String TEXT_306 = ".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(";
327
  protected final String TEXT_306 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
328
  protected final String TEXT_307 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL;
328
  protected final String TEXT_307 = "Command extends ";
329
  protected final String TEXT_308 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create";
329
  protected final String TEXT_308 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
330
  protected final String TEXT_309 = "Command extends ";
330
  protected final String TEXT_309 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
331
  protected final String TEXT_310 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
331
  protected final String TEXT_310 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
332
  protected final String TEXT_311 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
332
  protected final String TEXT_311 = " 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";
333
  protected final String TEXT_312 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
333
  protected final String TEXT_312 = "Command(";
334
  protected final String TEXT_313 = " 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";
334
  protected final String TEXT_313 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof ";
335
  protected final String TEXT_314 = "Command(";
335
  protected final String TEXT_314 = ") {" + NL + "\t\t\t\tsource = (";
336
  protected final String TEXT_315 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof ";
336
  protected final String TEXT_315 = ")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 ";
337
  protected final String TEXT_316 = ") {" + NL + "\t\t\t\tsource = (";
337
  protected final String TEXT_316 = ") {" + NL + "\t\t\t\ttarget = (";
338
  protected final String TEXT_317 = ")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 ";
338
  protected final String TEXT_317 = ")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 = ";
339
  protected final String TEXT_318 = ") {" + NL + "\t\t\t\ttarget = (";
339
  protected final String TEXT_318 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = ";
340
  protected final String TEXT_319 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = ";
340
  protected final String TEXT_319 = ".eINSTANCE.createEdge();";
341
  protected final String TEXT_320 = ".eINSTANCE.createEdge();";
341
  protected final String TEXT_320 = NL + "\t\t\t";
342
  protected final String TEXT_321 = NL + "\t\t\t";
342
  protected final String TEXT_321 = " createdDomainElement = ";
343
  protected final String TEXT_322 = " createdDomainElement = ";
343
  protected final String TEXT_322 = ".eINSTANCE.create";
344
  protected final String TEXT_323 = ".eINSTANCE.create";
344
  protected final String TEXT_323 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t";
345
  protected final String TEXT_324 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t";
345
  protected final String TEXT_324 = NL + "\t\t\t";
346
  protected final String TEXT_325 = NL + "\t\t\t";
346
  protected final String TEXT_325 = ".";
347
  protected final String TEXT_326 = ".";
347
  protected final String TEXT_326 = ".initializeElement(createdDomainElement);";
348
  protected final String TEXT_327 = ".initializeElement(createdDomainElement);";
348
  protected final String TEXT_327 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?";
349
  protected final String TEXT_328 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?";
349
  protected final String TEXT_328 = NL + "\t\t\t";
350
  protected final String TEXT_329 = NL + "\t\t\t";
350
  protected final String TEXT_329 = ".decorateView(createdEdge);" + NL + "\t\t\t";
351
  protected final String TEXT_330 = ".decorateView(createdEdge);" + NL + "\t\t\t";
351
  protected final String TEXT_330 = " domainModelEditDomain = ";
352
  protected final String TEXT_331 = " domainModelEditDomain = ";
352
  protected final String TEXT_331 = ".getEditingDomain(source.getDiagram().getElement());";
353
  protected final String TEXT_332 = ".getEditingDomainFor(source.getDiagram().getElement());";
353
  protected final String TEXT_332 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();";
354
  protected final String TEXT_333 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();";
354
  protected final String TEXT_333 = NL + "\t\t\t";
355
  protected final String TEXT_334 = NL + "\t\t\t";
355
  protected final String TEXT_334 = " container = getRelationshipContainer(source.getElement(), ";
356
  protected final String TEXT_335 = " container = getRelationshipContainer(source.getElement(), ";
356
  protected final String TEXT_335 = ".eINSTANCE.get";
357
  protected final String TEXT_336 = ".eINSTANCE.get";
357
  protected final String TEXT_336 = "());" + 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(";
358
  protected final String TEXT_337 = "());" + 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(";
358
  protected final String TEXT_337 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, ";
359
  protected final String TEXT_338 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, ";
359
  protected final String TEXT_338 = ".eINSTANCE.get";
360
  protected final String TEXT_339 = ".eINSTANCE.get";
360
  protected final String TEXT_339 = "(), createdDomainElement));";
361
  protected final String TEXT_340 = "(), createdDomainElement));";
361
  protected final String TEXT_340 = NL + "\t\t\taddLinkEndsCommand.append(";
362
  protected final String TEXT_341 = NL + "\t\t\taddLinkEndsCommand.append(";
362
  protected final String TEXT_341 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, ";
363
  protected final String TEXT_342 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, ";
363
  protected final String TEXT_342 = ".eINSTANCE.get";
364
  protected final String TEXT_343 = ".eINSTANCE.get";
364
  protected final String TEXT_343 = "(), createdDomainElement));";
365
  protected final String TEXT_344 = "(), createdDomainElement));";
365
  protected final String TEXT_344 = NL + "\t\t\taddLinkEndsCommand.append(";
366
  protected final String TEXT_345 = NL + "\t\t\taddLinkEndsCommand.append(";
366
  protected final String TEXT_345 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
367
  protected final String TEXT_346 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
367
  protected final String TEXT_346 = ".eINSTANCE.get";
368
  protected final String TEXT_347 = ".eINSTANCE.get";
368
  protected final String TEXT_347 = "(), source.getElement()));";
369
  protected final String TEXT_348 = "(), source.getElement()));";
369
  protected final String TEXT_348 = NL + "\t\t\taddLinkEndsCommand.append(";
370
  protected final String TEXT_349 = NL + "\t\t\taddLinkEndsCommand.append(";
370
  protected final String TEXT_349 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
371
  protected final String TEXT_350 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, ";
371
  protected final String TEXT_350 = ".eINSTANCE.get";
372
  protected final String TEXT_351 = ".eINSTANCE.get";
372
  protected final String TEXT_351 = "(), target.getElement()));";
373
  protected final String TEXT_352 = "(), target.getElement()));";
373
  protected final String TEXT_352 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;";
374
  protected final String TEXT_353 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;";
374
  protected final String TEXT_353 = NL + "\t\t\tdomainModelAddCommand = ";
375
  protected final String TEXT_354 = NL + "\t\t\tdomainModelAddCommand = ";
375
  protected final String TEXT_354 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t";
376
  protected final String TEXT_355 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t";
376
  protected final String TEXT_355 = ".eINSTANCE.get";
377
  protected final String TEXT_356 = ".eINSTANCE.get";
377
  protected final String TEXT_356 = "(), target.getElement());";
378
  protected final String TEXT_357 = "(), target.getElement());";
378
  protected final String TEXT_357 = NL + "\t\t}" + NL;
379
  protected final String TEXT_358 = NL + "\t\t}" + NL;
379
  protected final String TEXT_358 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the new 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 ";
380
  protected final String TEXT_359 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the new 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 ";
380
  protected final String TEXT_359 = " getRelationshipContainer(";
381
  protected final String TEXT_360 = " getRelationshipContainer(";
381
  protected final String TEXT_360 = " element, ";
382
  protected final String TEXT_361 = " element, ";
382
  protected final String TEXT_361 = " 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}";
383
  protected final String TEXT_362 = " 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}";
383
  protected final String TEXT_362 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canExecute();" + 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}";
384
  protected final String TEXT_363 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canExecute();" + 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}";
384
  protected final String TEXT_363 = NL;
385
  protected final String TEXT_364 = NL;
385
  protected final String TEXT_364 = NL;
386
  protected final String TEXT_365 = NL;
386
  protected final String TEXT_365 = 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}";
387
  protected final String TEXT_366 = 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}";
387
  protected final String TEXT_366 = NL + "}";
388
  protected final String TEXT_367 = NL + "}";
388
  protected final String TEXT_367 = NL;
389
  protected final String TEXT_368 = NL;
390
389
391
  public String generate(Object argument)
390
  public String generate(Object argument)
392
  {
391
  {
Lines 447-454 Link Here
447
    stringBuffer.append(TEXT_22);
446
    stringBuffer.append(TEXT_22);
448
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
449
    stringBuffer.append(TEXT_23);
448
    stringBuffer.append(TEXT_23);
450
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
449
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
451
    stringBuffer.append(TEXT_24);
450
    stringBuffer.append(TEXT_24);
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
452
    stringBuffer.append(TEXT_25);
453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
454
    stringBuffer.append(TEXT_26);
455
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
456
    stringBuffer.append(TEXT_27);
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
458
    stringBuffer.append(TEXT_28);
459
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
460
    stringBuffer.append(TEXT_29);
452
    
461
    
453
{
462
{
454
TypeModelFacet facet = genNode.getModelFacet();
463
TypeModelFacet facet = genNode.getModelFacet();
Lines 456-533 Link Here
456
GenFeature containmentFeature = facet.getContainmentMetaFeature();
465
GenFeature containmentFeature = facet.getContainmentMetaFeature();
457
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
466
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
458
467
459
    stringBuffer.append(TEXT_25);
468
    stringBuffer.append(TEXT_30);
460
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
469
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
461
    stringBuffer.append(TEXT_26);
470
    stringBuffer.append(TEXT_31);
462
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
471
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
463
    stringBuffer.append(TEXT_27);
472
    stringBuffer.append(TEXT_32);
464
    
473
    
465
	if (containmentFeature.getEcoreFeature().isMany()) {
474
	if (containmentFeature.getEcoreFeature().isMany()) {
466
475
467
    stringBuffer.append(TEXT_28);
476
    stringBuffer.append(TEXT_33);
468
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
477
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
469
    stringBuffer.append(TEXT_29);
478
    stringBuffer.append(TEXT_34);
470
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
471
    stringBuffer.append(TEXT_30);
472
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
479
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
473
    stringBuffer.append(TEXT_31);
480
    stringBuffer.append(TEXT_35);
474
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
481
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
475
    stringBuffer.append(TEXT_32);
482
    stringBuffer.append(TEXT_36);
476
    
483
    
477
	} else {
484
	} else {
478
485
479
    stringBuffer.append(TEXT_33);
486
    stringBuffer.append(TEXT_37);
480
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
487
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
481
    stringBuffer.append(TEXT_34);
488
    stringBuffer.append(TEXT_38);
482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
483
    stringBuffer.append(TEXT_35);
484
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
489
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
485
    stringBuffer.append(TEXT_36);
490
    stringBuffer.append(TEXT_39);
486
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
491
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
487
    stringBuffer.append(TEXT_37);
492
    stringBuffer.append(TEXT_40);
488
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
489
    stringBuffer.append(TEXT_38);
494
    stringBuffer.append(TEXT_41);
490
    
495
    
491
	}
496
	}
492
497
493
    
498
    
494
	if (childFeature.getEcoreFeature().isMany()) {
499
	if (childFeature.getEcoreFeature().isMany()) {
495
500
496
    stringBuffer.append(TEXT_39);
501
    stringBuffer.append(TEXT_42);
497
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
502
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
498
    stringBuffer.append(TEXT_40);
503
    stringBuffer.append(TEXT_43);
499
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
500
    stringBuffer.append(TEXT_41);
501
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
504
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
502
    stringBuffer.append(TEXT_42);
505
    stringBuffer.append(TEXT_44);
503
    stringBuffer.append(childFeature.getFeatureAccessorName());
506
    stringBuffer.append(childFeature.getFeatureAccessorName());
504
    stringBuffer.append(TEXT_43);
507
    stringBuffer.append(TEXT_45);
505
    
508
    
506
	} else {
509
	} else {
507
510
508
    stringBuffer.append(TEXT_44);
509
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
510
    stringBuffer.append(TEXT_45);
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
512
    stringBuffer.append(TEXT_46);
511
    stringBuffer.append(TEXT_46);
513
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
512
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
514
    stringBuffer.append(TEXT_47);
513
    stringBuffer.append(TEXT_47);
515
    stringBuffer.append(childFeature.getFeatureAccessorName());
514
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
516
    stringBuffer.append(TEXT_48);
515
    stringBuffer.append(TEXT_48);
517
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
516
    stringBuffer.append(childFeature.getFeatureAccessorName());
518
    stringBuffer.append(TEXT_49);
517
    stringBuffer.append(TEXT_49);
518
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
519
    stringBuffer.append(TEXT_50);
519
    
520
    
520
	}
521
	}
521
522
522
    stringBuffer.append(TEXT_50);
523
    stringBuffer.append(TEXT_51);
523
    
524
    
524
} else {
525
} else {
525
	if (containmentFeature.getEcoreFeature().isMany()) {
526
	if (containmentFeature.getEcoreFeature().isMany()) {
526
527
527
    stringBuffer.append(TEXT_51);
528
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
529
    stringBuffer.append(TEXT_52);
528
    stringBuffer.append(TEXT_52);
530
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
529
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
531
    stringBuffer.append(TEXT_53);
530
    stringBuffer.append(TEXT_53);
532
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
531
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
533
    stringBuffer.append(TEXT_54);
532
    stringBuffer.append(TEXT_54);
Lines 539-602 Link Here
539
    stringBuffer.append(TEXT_56);
538
    stringBuffer.append(TEXT_56);
540
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
539
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
541
    stringBuffer.append(TEXT_57);
540
    stringBuffer.append(TEXT_57);
542
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
543
    stringBuffer.append(TEXT_58);
544
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
541
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
545
    stringBuffer.append(TEXT_59);
542
    stringBuffer.append(TEXT_58);
546
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
543
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
547
    stringBuffer.append(TEXT_60);
544
    stringBuffer.append(TEXT_59);
548
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
545
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
549
    stringBuffer.append(TEXT_61);
546
    stringBuffer.append(TEXT_60);
550
    
547
    
551
	}
548
	}
552
}
549
}
553
550
554
    stringBuffer.append(TEXT_62);
551
    stringBuffer.append(TEXT_61);
555
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
556
    stringBuffer.append(TEXT_63);
557
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
558
    stringBuffer.append(TEXT_64);
559
    
552
    
560
}	/*restrict local vars used in component edit policy*/
553
}	/*restrict local vars used in component edit policy*/
561
554
562
    stringBuffer.append(TEXT_65);
555
    stringBuffer.append(TEXT_62);
563
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
556
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
564
    stringBuffer.append(TEXT_66);
557
    stringBuffer.append(TEXT_63);
565
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
558
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
566
    stringBuffer.append(TEXT_67);
559
    stringBuffer.append(TEXT_64);
567
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
560
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
568
    stringBuffer.append(TEXT_68);
561
    stringBuffer.append(TEXT_65);
569
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest"));
562
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest"));
570
    stringBuffer.append(TEXT_69);
563
    stringBuffer.append(TEXT_66);
571
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
564
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
572
    stringBuffer.append(TEXT_70);
565
    stringBuffer.append(TEXT_67);
573
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
566
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
574
    stringBuffer.append(TEXT_71);
567
    stringBuffer.append(TEXT_68);
575
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
568
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
576
    stringBuffer.append(TEXT_72);
569
    stringBuffer.append(TEXT_69);
577
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
570
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
571
    stringBuffer.append(TEXT_70);
572
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
573
    stringBuffer.append(TEXT_71);
574
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
575
    stringBuffer.append(TEXT_72);
576
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
578
    stringBuffer.append(TEXT_73);
577
    stringBuffer.append(TEXT_73);
579
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
580
    stringBuffer.append(TEXT_74);
579
    stringBuffer.append(TEXT_74);
581
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
580
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
582
    stringBuffer.append(TEXT_75);
581
    stringBuffer.append(TEXT_75);
583
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
584
    stringBuffer.append(TEXT_76);
585
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
582
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
583
    stringBuffer.append(TEXT_76);
584
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
586
    stringBuffer.append(TEXT_77);
585
    stringBuffer.append(TEXT_77);
587
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
586
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
588
    stringBuffer.append(TEXT_78);
587
    stringBuffer.append(TEXT_78);
589
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
588
    stringBuffer.append(genNode.getEditPartClassName());
590
    stringBuffer.append(TEXT_79);
589
    stringBuffer.append(TEXT_79);
591
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
590
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
592
    stringBuffer.append(TEXT_80);
591
    stringBuffer.append(TEXT_80);
593
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
592
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy"));
594
    stringBuffer.append(TEXT_81);
593
    stringBuffer.append(TEXT_81);
595
    stringBuffer.append(genNode.getEditPartClassName());
594
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
596
    stringBuffer.append(TEXT_82);
595
    stringBuffer.append(TEXT_82);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
596
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
598
    stringBuffer.append(TEXT_83);
597
    stringBuffer.append(TEXT_83);
599
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy"));
598
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
600
    stringBuffer.append(TEXT_84);
599
    stringBuffer.append(TEXT_84);
601
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
600
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
602
    stringBuffer.append(TEXT_85);
601
    stringBuffer.append(TEXT_85);
Lines 606-627 Link Here
606
    stringBuffer.append(TEXT_87);
605
    stringBuffer.append(TEXT_87);
607
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
606
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
608
    stringBuffer.append(TEXT_88);
607
    stringBuffer.append(TEXT_88);
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest"));
610
    stringBuffer.append(TEXT_89);
611
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
612
    stringBuffer.append(TEXT_90);
613
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
614
    stringBuffer.append(TEXT_91);
615
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
608
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
616
    stringBuffer.append(TEXT_92);
609
    stringBuffer.append(TEXT_89);
617
    if (palette != null) {
610
    if (palette != null) {
618
    stringBuffer.append(TEXT_93);
611
    stringBuffer.append(TEXT_90);
619
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
612
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
620
    stringBuffer.append(TEXT_94);
613
    stringBuffer.append(TEXT_91);
621
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
614
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
622
    stringBuffer.append(TEXT_95);
615
    stringBuffer.append(TEXT_92);
623
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
616
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
624
    stringBuffer.append(TEXT_96);
617
    stringBuffer.append(TEXT_93);
625
    
618
    
626
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
619
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
627
	GenLink genLink = (GenLink)it.next();
620
	GenLink genLink = (GenLink)it.next();
Lines 644-684 Link Here
644
		continue;
637
		continue;
645
	}
638
	}
646
639
647
    stringBuffer.append(TEXT_97);
640
    stringBuffer.append(TEXT_94);
648
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
641
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
649
    stringBuffer.append(TEXT_98);
642
    stringBuffer.append(TEXT_95);
650
    
643
    
651
}
644
}
652
645
653
    stringBuffer.append(TEXT_99);
646
    stringBuffer.append(TEXT_96);
654
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
647
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
655
    stringBuffer.append(TEXT_100);
648
    stringBuffer.append(TEXT_97);
656
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
649
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
650
    stringBuffer.append(TEXT_98);
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
652
    stringBuffer.append(TEXT_99);
653
    }/*when there's palette*/
654
    stringBuffer.append(TEXT_100);
655
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
657
    stringBuffer.append(TEXT_101);
656
    stringBuffer.append(TEXT_101);
658
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
659
    stringBuffer.append(TEXT_102);
658
    stringBuffer.append(TEXT_102);
660
    }/*when there's palette*/
659
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
661
    stringBuffer.append(TEXT_103);
660
    stringBuffer.append(TEXT_103);
662
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
661
    if (palette != null) {
663
    stringBuffer.append(TEXT_104);
662
    stringBuffer.append(TEXT_104);
664
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
663
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
665
    stringBuffer.append(TEXT_105);
664
    stringBuffer.append(TEXT_105);
666
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest"));
665
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
667
    stringBuffer.append(TEXT_106);
666
    stringBuffer.append(TEXT_106);
668
    if (palette != null) {
667
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
669
    stringBuffer.append(TEXT_107);
668
    stringBuffer.append(TEXT_107);
670
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
671
    stringBuffer.append(TEXT_108);
672
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
669
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
670
    stringBuffer.append(TEXT_108);
671
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
673
    stringBuffer.append(TEXT_109);
672
    stringBuffer.append(TEXT_109);
674
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
673
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
675
    stringBuffer.append(TEXT_110);
674
    stringBuffer.append(TEXT_110);
676
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
677
    stringBuffer.append(TEXT_111);
678
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand"));
679
    stringBuffer.append(TEXT_112);
680
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand"));
681
    stringBuffer.append(TEXT_113);
682
    
675
    
683
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
676
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
684
	GenLink genLink = (GenLink)it.next();
677
	GenLink genLink = (GenLink)it.next();
Lines 702-737 Link Here
702
		continue;
695
		continue;
703
	}
696
	}
704
697
705
    stringBuffer.append(TEXT_114);
698
    stringBuffer.append(TEXT_111);
706
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
699
    stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName()));
707
    stringBuffer.append(TEXT_115);
700
    stringBuffer.append(TEXT_112);
708
    stringBuffer.append(createCommandNameInfix);
701
    stringBuffer.append(createCommandNameInfix);
709
    stringBuffer.append(genLink.getVisualID());
702
    stringBuffer.append(genLink.getVisualID());
710
    stringBuffer.append(TEXT_116);
703
    stringBuffer.append(TEXT_113);
711
    
704
    
712
}
705
}
713
706
707
    stringBuffer.append(TEXT_114);
708
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
709
    stringBuffer.append(TEXT_115);
710
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
711
    stringBuffer.append(TEXT_116);
712
    }/*when there's palette*/
714
    stringBuffer.append(TEXT_117);
713
    stringBuffer.append(TEXT_117);
715
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
714
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
716
    stringBuffer.append(TEXT_118);
715
    stringBuffer.append(TEXT_118);
717
    }/*when there's palette*/
716
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
718
    stringBuffer.append(TEXT_119);
717
    stringBuffer.append(TEXT_119);
719
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
720
    stringBuffer.append(TEXT_120);
721
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
718
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
719
    stringBuffer.append(TEXT_120);
720
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
722
    stringBuffer.append(TEXT_121);
721
    stringBuffer.append(TEXT_121);
723
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
722
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
724
    stringBuffer.append(TEXT_122);
723
    stringBuffer.append(TEXT_122);
725
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
724
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
726
    stringBuffer.append(TEXT_123);
725
    stringBuffer.append(TEXT_123);
727
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
726
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
728
    stringBuffer.append(TEXT_124);
727
    stringBuffer.append(TEXT_124);
729
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
728
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
730
    stringBuffer.append(TEXT_125);
729
    stringBuffer.append(TEXT_125);
731
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
732
    stringBuffer.append(TEXT_126);
733
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
734
    stringBuffer.append(TEXT_127);
735
    
730
    
736
String figureQualifiedClassName = null;
731
String figureQualifiedClassName = null;
737
Viewmap viewmap = genNode.getViewmap();
732
Viewmap viewmap = genNode.getViewmap();
Lines 741-822 Link Here
741
		figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure";
736
		figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure";
742
	}
737
	}
743
738
744
    stringBuffer.append(TEXT_128);
739
    stringBuffer.append(TEXT_126);
745
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
740
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
746
    stringBuffer.append(TEXT_129);
741
    stringBuffer.append(TEXT_127);
747
    if (useFlowLayout) {
742
    if (useFlowLayout) {
748
    stringBuffer.append(TEXT_130);
743
    stringBuffer.append(TEXT_128);
749
    } /* use flow layout*/ 
744
    } /* use flow layout*/ 
750
    stringBuffer.append(TEXT_131);
745
    stringBuffer.append(TEXT_129);
751
    } else if (viewmap instanceof SnippetViewmap) {
746
    } else if (viewmap instanceof SnippetViewmap) {
752
    stringBuffer.append(TEXT_132);
747
    stringBuffer.append(TEXT_130);
753
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
748
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
754
    stringBuffer.append(TEXT_133);
749
    stringBuffer.append(TEXT_131);
755
    } else if (viewmap instanceof InnerClassViewmap) {
750
    } else if (viewmap instanceof InnerClassViewmap) {
756
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
751
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
757
752
758
    stringBuffer.append(TEXT_134);
753
    stringBuffer.append(TEXT_132);
759
    stringBuffer.append(figureQualifiedClassName);
754
    stringBuffer.append(figureQualifiedClassName);
760
    stringBuffer.append(TEXT_135);
755
    stringBuffer.append(TEXT_133);
761
    stringBuffer.append(figureQualifiedClassName);
756
    stringBuffer.append(figureQualifiedClassName);
762
    stringBuffer.append(TEXT_136);
757
    stringBuffer.append(TEXT_134);
763
    stringBuffer.append(useFlowLayout ? "true" : "false");
758
    stringBuffer.append(useFlowLayout ? "true" : "false");
764
    stringBuffer.append(TEXT_137);
759
    stringBuffer.append(TEXT_135);
765
    }
760
    }
766
    stringBuffer.append(TEXT_138);
761
    stringBuffer.append(TEXT_136);
767
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
762
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
768
    stringBuffer.append(TEXT_139);
763
    stringBuffer.append(TEXT_137);
769
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
764
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
770
    stringBuffer.append(TEXT_140);
765
    stringBuffer.append(TEXT_138);
771
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
766
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
772
    stringBuffer.append(TEXT_141);
767
    stringBuffer.append(TEXT_139);
773
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
768
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation"));
774
    stringBuffer.append(TEXT_142);
769
    stringBuffer.append(TEXT_140);
775
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
770
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
776
    stringBuffer.append(TEXT_143);
771
    stringBuffer.append(TEXT_141);
777
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
772
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
778
    stringBuffer.append(TEXT_144);
773
    stringBuffer.append(TEXT_142);
779
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
774
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
780
    stringBuffer.append(TEXT_145);
775
    stringBuffer.append(TEXT_143);
781
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
776
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
782
    stringBuffer.append(TEXT_146);
777
    stringBuffer.append(TEXT_144);
783
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
778
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure"));
784
    stringBuffer.append(TEXT_147);
779
    stringBuffer.append(TEXT_145);
785
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
780
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
786
    stringBuffer.append(TEXT_148);
781
    stringBuffer.append(TEXT_146);
787
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
782
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
788
    stringBuffer.append(TEXT_149);
783
    stringBuffer.append(TEXT_147);
789
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
784
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout"));
790
    stringBuffer.append(TEXT_150);
785
    stringBuffer.append(TEXT_148);
791
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
786
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
792
    stringBuffer.append(TEXT_151);
787
    stringBuffer.append(TEXT_149);
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
788
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
794
    stringBuffer.append(TEXT_152);
789
    stringBuffer.append(TEXT_150);
795
    
790
    
796
if (!useFlowLayout) {
791
if (!useFlowLayout) {
797
	String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout");
792
	String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout");
798
793
799
    stringBuffer.append(TEXT_153);
794
    stringBuffer.append(TEXT_151);
800
    stringBuffer.append(layoutClassName);
795
    stringBuffer.append(layoutClassName);
801
    stringBuffer.append(TEXT_154);
796
    stringBuffer.append(TEXT_152);
802
    stringBuffer.append(layoutClassName);
797
    stringBuffer.append(layoutClassName);
803
    stringBuffer.append(TEXT_155);
798
    stringBuffer.append(TEXT_153);
804
    } else {
799
    } else {
805
    stringBuffer.append(TEXT_156);
800
    stringBuffer.append(TEXT_154);
806
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
801
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
807
    stringBuffer.append(TEXT_157);
802
    stringBuffer.append(TEXT_155);
808
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
803
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
809
    stringBuffer.append(TEXT_158);
804
    stringBuffer.append(TEXT_156);
810
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
805
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
811
    stringBuffer.append(TEXT_159);
806
    stringBuffer.append(TEXT_157);
812
    }
807
    }
813
    stringBuffer.append(TEXT_160);
808
    stringBuffer.append(TEXT_158);
814
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
809
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
815
    stringBuffer.append(TEXT_161);
810
    stringBuffer.append(TEXT_159);
816
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
811
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
817
    stringBuffer.append(TEXT_162);
812
    stringBuffer.append(TEXT_160);
818
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
813
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
819
    stringBuffer.append(TEXT_163);
814
    stringBuffer.append(TEXT_161);
820
    
815
    
821
	boolean hasFixedChildren = false;
816
	boolean hasFixedChildren = false;
822
	List innerLabels = new ArrayList(genNode.getLabels().size());
817
	List innerLabels = new ArrayList(genNode.getLabels().size());
Lines 829-837 Link Here
829
	if (!innerLabels.isEmpty()) {
824
	if (!innerLabels.isEmpty()) {
830
		hasFixedChildren = true;
825
		hasFixedChildren = true;
831
826
832
    stringBuffer.append(TEXT_164);
827
    stringBuffer.append(TEXT_162);
833
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
828
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
834
    stringBuffer.append(TEXT_165);
829
    stringBuffer.append(TEXT_163);
835
    
830
    
836
		for (Iterator it = innerLabels.iterator(); it.hasNext(); ) {
831
		for (Iterator it = innerLabels.iterator(); it.hasNext(); ) {
837
			GenNodeLabel genLabel = (GenNodeLabel) it.next();
832
			GenNodeLabel genLabel = (GenNodeLabel) it.next();
Lines 850-896 Link Here
850
				isAccessor = false;
845
				isAccessor = false;
851
			}
846
			}
852
847
853
    stringBuffer.append(TEXT_166);
848
    stringBuffer.append(TEXT_164);
854
    stringBuffer.append(labelEditPart);
849
    stringBuffer.append(labelEditPart);
855
    stringBuffer.append(TEXT_167);
850
    stringBuffer.append(TEXT_165);
856
    			if (isAccessor) {
851
    			if (isAccessor) {
857
    stringBuffer.append(TEXT_168);
852
    stringBuffer.append(TEXT_166);
858
    stringBuffer.append(labelEditPart);
853
    stringBuffer.append(labelEditPart);
859
    stringBuffer.append(TEXT_169);
854
    stringBuffer.append(TEXT_167);
860
    stringBuffer.append(figureQualifiedClassName);
855
    stringBuffer.append(figureQualifiedClassName);
861
    stringBuffer.append(TEXT_170);
856
    stringBuffer.append(TEXT_168);
862
    stringBuffer.append(labelFigureClassName);
857
    stringBuffer.append(labelFigureClassName);
863
    stringBuffer.append(TEXT_171);
858
    stringBuffer.append(TEXT_169);
864
    			} else {
859
    			} else {
865
    stringBuffer.append(TEXT_172);
860
    stringBuffer.append(TEXT_170);
866
    stringBuffer.append(labelEditPart);
861
    stringBuffer.append(labelEditPart);
867
    stringBuffer.append(TEXT_173);
862
    stringBuffer.append(TEXT_171);
868
    stringBuffer.append(labelFigureClassName);
863
    stringBuffer.append(labelFigureClassName);
869
    stringBuffer.append(TEXT_174);
864
    stringBuffer.append(TEXT_172);
870
    			}
865
    			}
871
    stringBuffer.append(TEXT_175);
866
    stringBuffer.append(TEXT_173);
872
    		}
867
    		}
873
    stringBuffer.append(TEXT_176);
868
    stringBuffer.append(TEXT_174);
874
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
869
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
875
    stringBuffer.append(TEXT_177);
870
    stringBuffer.append(TEXT_175);
876
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
871
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
877
    stringBuffer.append(TEXT_178);
872
    stringBuffer.append(TEXT_176);
878
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
873
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
879
    stringBuffer.append(TEXT_179);
874
    stringBuffer.append(TEXT_177);
880
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
875
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
881
    stringBuffer.append(TEXT_180);
876
    stringBuffer.append(TEXT_178);
882
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
877
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
883
    stringBuffer.append(TEXT_181);
878
    stringBuffer.append(TEXT_179);
884
    stringBuffer.append(importManager.getImportedName(((GenNodeLabel)innerLabels.get(0)).getEditPartQualifiedClassName()));
879
    stringBuffer.append(importManager.getImportedName(((GenNodeLabel)innerLabels.get(0)).getEditPartQualifiedClassName()));
885
    stringBuffer.append(TEXT_182);
880
    stringBuffer.append(TEXT_180);
886
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
881
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
887
    stringBuffer.append(TEXT_183);
882
    stringBuffer.append(TEXT_181);
888
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
883
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
889
    stringBuffer.append(TEXT_184);
884
    stringBuffer.append(TEXT_182);
890
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
885
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
891
    stringBuffer.append(TEXT_185);
886
    stringBuffer.append(TEXT_183);
892
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
887
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
893
    stringBuffer.append(TEXT_186);
888
    stringBuffer.append(TEXT_184);
894
    
889
    
895
	}
890
	}
896
891
Lines 905-1103 Link Here
905
}
900
}
906
if (hasExternalLabels) {
901
if (hasExternalLabels) {
907
902
908
    stringBuffer.append(TEXT_187);
903
    stringBuffer.append(TEXT_185);
909
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
904
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
910
    stringBuffer.append(TEXT_188);
905
    stringBuffer.append(TEXT_186);
911
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
906
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
912
    stringBuffer.append(TEXT_189);
907
    stringBuffer.append(TEXT_187);
913
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
908
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
914
    stringBuffer.append(TEXT_190);
909
    stringBuffer.append(TEXT_188);
915
    	if (hasFixedChildren) {
910
    	if (hasFixedChildren) {
916
    stringBuffer.append(TEXT_191);
911
    stringBuffer.append(TEXT_189);
917
    	} else {
912
    	} else {
918
    stringBuffer.append(TEXT_192);
913
    stringBuffer.append(TEXT_190);
919
    	}
914
    	}
920
    stringBuffer.append(TEXT_193);
915
    stringBuffer.append(TEXT_191);
921
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
916
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
922
    stringBuffer.append(TEXT_194);
917
    stringBuffer.append(TEXT_192);
923
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
918
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
924
    stringBuffer.append(TEXT_195);
919
    stringBuffer.append(TEXT_193);
925
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
920
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
926
    stringBuffer.append(TEXT_196);
921
    stringBuffer.append(TEXT_194);
927
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
922
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
928
    stringBuffer.append(TEXT_197);
923
    stringBuffer.append(TEXT_195);
929
    
924
    
930
	for (Iterator labels = genNode.getLabels().iterator(); labels.hasNext();) {
925
	for (Iterator labels = genNode.getLabels().iterator(); labels.hasNext();) {
931
		GenNodeLabel label = (GenNodeLabel) labels.next();
926
		GenNodeLabel label = (GenNodeLabel) labels.next();
932
		if (label instanceof GenExternalNodeLabel) {
927
		if (label instanceof GenExternalNodeLabel) {
933
928
934
    stringBuffer.append(TEXT_198);
929
    stringBuffer.append(TEXT_196);
935
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
930
    stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName()));
936
    stringBuffer.append(TEXT_199);
931
    stringBuffer.append(TEXT_197);
937
    
932
    
938
		}
933
		}
939
	}
934
	}
940
935
941
    stringBuffer.append(TEXT_200);
936
    stringBuffer.append(TEXT_198);
942
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
937
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
943
    stringBuffer.append(TEXT_201);
938
    stringBuffer.append(TEXT_199);
944
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
939
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
945
    stringBuffer.append(TEXT_202);
940
    stringBuffer.append(TEXT_200);
946
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
941
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
947
    stringBuffer.append(TEXT_203);
942
    stringBuffer.append(TEXT_201);
948
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
943
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
949
    stringBuffer.append(TEXT_204);
944
    stringBuffer.append(TEXT_202);
950
    
945
    
951
} else {
946
} else {
952
	if (hasFixedChildren) {
947
	if (hasFixedChildren) {
953
    stringBuffer.append(TEXT_205);
948
    stringBuffer.append(TEXT_203);
954
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
949
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
955
    stringBuffer.append(TEXT_206);
950
    stringBuffer.append(TEXT_204);
956
    
951
    
957
	}
952
	}
958
}
953
}
959
954
960
    stringBuffer.append(TEXT_207);
955
    stringBuffer.append(TEXT_205);
961
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
956
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
957
    stringBuffer.append(TEXT_206);
958
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
959
    stringBuffer.append(TEXT_207);
960
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
962
    stringBuffer.append(TEXT_208);
961
    stringBuffer.append(TEXT_208);
963
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
962
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
964
    stringBuffer.append(TEXT_209);
963
    stringBuffer.append(TEXT_209);
965
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
964
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
966
    stringBuffer.append(TEXT_210);
965
    stringBuffer.append(TEXT_210);
967
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
966
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
968
    stringBuffer.append(TEXT_211);
967
    stringBuffer.append(TEXT_211);
969
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
968
    stringBuffer.append(importManager.getImportedName("java.util.List"));
970
    stringBuffer.append(TEXT_212);
969
    stringBuffer.append(TEXT_212);
971
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
970
    stringBuffer.append(importManager.getImportedName("java.util.List"));
972
    stringBuffer.append(TEXT_213);
971
    stringBuffer.append(TEXT_213);
973
    stringBuffer.append(importManager.getImportedName("java.util.List"));
972
    stringBuffer.append(importManager.getImportedName("java.util.List"));
974
    stringBuffer.append(TEXT_214);
973
    stringBuffer.append(TEXT_214);
975
    stringBuffer.append(importManager.getImportedName("java.util.List"));
974
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
976
    stringBuffer.append(TEXT_215);
975
    stringBuffer.append(TEXT_215);
977
    stringBuffer.append(importManager.getImportedName("java.util.List"));
976
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
978
    stringBuffer.append(TEXT_216);
977
    stringBuffer.append(TEXT_216);
979
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
978
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
980
    stringBuffer.append(TEXT_217);
979
    stringBuffer.append(TEXT_217);
981
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
980
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
982
    stringBuffer.append(TEXT_218);
981
    stringBuffer.append(TEXT_218);
983
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
982
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
984
    stringBuffer.append(TEXT_219);
983
    stringBuffer.append(TEXT_219);
985
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
984
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
986
    stringBuffer.append(TEXT_220);
985
    stringBuffer.append(TEXT_220);
987
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
986
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
988
    stringBuffer.append(TEXT_221);
987
    stringBuffer.append(TEXT_221);
989
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
988
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
990
    stringBuffer.append(TEXT_222);
989
    stringBuffer.append(TEXT_222);
991
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
990
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
992
    stringBuffer.append(TEXT_223);
991
    stringBuffer.append(TEXT_223);
993
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
992
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
994
    stringBuffer.append(TEXT_224);
993
    stringBuffer.append(TEXT_224);
995
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
994
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
996
    stringBuffer.append(TEXT_225);
995
    stringBuffer.append(TEXT_225);
997
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
996
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
998
    stringBuffer.append(TEXT_226);
997
    stringBuffer.append(TEXT_226);
999
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
998
    /*@ include file="adapters/propertySource.javajetinc"*/
1000
    stringBuffer.append(TEXT_227);
999
    stringBuffer.append(TEXT_227);
1001
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
1002
    stringBuffer.append(TEXT_228);
1000
    stringBuffer.append(TEXT_228);
1003
    /*@ include file="adapters/propertySource.javajetinc"*/
1004
    stringBuffer.append(TEXT_229);
1001
    stringBuffer.append(TEXT_229);
1002
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
1005
    stringBuffer.append(TEXT_230);
1003
    stringBuffer.append(TEXT_230);
1004
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1006
    stringBuffer.append(TEXT_231);
1005
    stringBuffer.append(TEXT_231);
1007
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
1006
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1008
    stringBuffer.append(TEXT_232);
1007
    stringBuffer.append(TEXT_232);
1009
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1010
    stringBuffer.append(TEXT_233);
1008
    stringBuffer.append(TEXT_233);
1011
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1012
    stringBuffer.append(TEXT_234);
1009
    stringBuffer.append(TEXT_234);
1010
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1013
    stringBuffer.append(TEXT_235);
1011
    stringBuffer.append(TEXT_235);
1012
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1014
    stringBuffer.append(TEXT_236);
1013
    stringBuffer.append(TEXT_236);
1015
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1014
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1016
    stringBuffer.append(TEXT_237);
1015
    stringBuffer.append(TEXT_237);
1017
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1018
    stringBuffer.append(TEXT_238);
1019
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1020
    stringBuffer.append(TEXT_239);
1021
    
1016
    
1022
	final String primaryView = "getDiagramNode()";
1017
	final String primaryView = "getDiagramNode()";
1023
1018
1019
    stringBuffer.append(TEXT_238);
1020
    stringBuffer.append(TEXT_239);
1021
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
1024
    stringBuffer.append(TEXT_240);
1022
    stringBuffer.append(TEXT_240);
1025
    stringBuffer.append(TEXT_241);
1026
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
1023
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
1024
    stringBuffer.append(TEXT_241);
1025
    stringBuffer.append(primaryView);
1027
    stringBuffer.append(TEXT_242);
1026
    stringBuffer.append(TEXT_242);
1028
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
1027
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1029
    stringBuffer.append(TEXT_243);
1028
    stringBuffer.append(TEXT_243);
1030
    stringBuffer.append(primaryView);
1029
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1031
    stringBuffer.append(TEXT_244);
1030
    stringBuffer.append(TEXT_244);
1032
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1031
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1033
    stringBuffer.append(TEXT_245);
1032
    stringBuffer.append(TEXT_245);
1034
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1033
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1035
    stringBuffer.append(TEXT_246);
1034
    stringBuffer.append(TEXT_246);
1036
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1035
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1037
    stringBuffer.append(TEXT_247);
1036
    stringBuffer.append(TEXT_247);
1038
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1037
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1039
    stringBuffer.append(TEXT_248);
1038
    stringBuffer.append(TEXT_248);
1040
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1039
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
1041
    stringBuffer.append(TEXT_249);
1040
    stringBuffer.append(TEXT_249);
1042
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1041
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1043
    stringBuffer.append(TEXT_250);
1042
    stringBuffer.append(TEXT_250);
1044
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
1045
    stringBuffer.append(TEXT_251);
1046
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1043
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1044
    stringBuffer.append(TEXT_251);
1047
    stringBuffer.append(TEXT_252);
1045
    stringBuffer.append(TEXT_252);
1048
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
1049
    stringBuffer.append(TEXT_253);
1046
    stringBuffer.append(TEXT_253);
1047
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
1050
    stringBuffer.append(TEXT_254);
1048
    stringBuffer.append(TEXT_254);
1051
    stringBuffer.append(TEXT_255);
1052
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
1049
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
1050
    stringBuffer.append(TEXT_255);
1051
    stringBuffer.append(primaryView);
1053
    stringBuffer.append(TEXT_256);
1052
    stringBuffer.append(TEXT_256);
1054
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
1053
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1055
    stringBuffer.append(TEXT_257);
1054
    stringBuffer.append(TEXT_257);
1056
    stringBuffer.append(primaryView);
1055
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1057
    stringBuffer.append(TEXT_258);
1056
    stringBuffer.append(TEXT_258);
1058
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1057
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1059
    stringBuffer.append(TEXT_259);
1058
    stringBuffer.append(TEXT_259);
1060
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1059
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1061
    stringBuffer.append(TEXT_260);
1060
    stringBuffer.append(TEXT_260);
1062
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1061
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1063
    stringBuffer.append(TEXT_261);
1062
    stringBuffer.append(TEXT_261);
1064
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1063
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
1065
    stringBuffer.append(TEXT_262);
1064
    stringBuffer.append(TEXT_262);
1066
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1067
    stringBuffer.append(TEXT_263);
1068
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
1065
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
1066
    stringBuffer.append(TEXT_263);
1067
    stringBuffer.append(primaryView);
1069
    stringBuffer.append(TEXT_264);
1068
    stringBuffer.append(TEXT_264);
1070
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
1069
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1071
    stringBuffer.append(TEXT_265);
1070
    stringBuffer.append(TEXT_265);
1072
    stringBuffer.append(primaryView);
1071
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1073
    stringBuffer.append(TEXT_266);
1072
    stringBuffer.append(TEXT_266);
1074
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1073
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1075
    stringBuffer.append(TEXT_267);
1074
    stringBuffer.append(TEXT_267);
1076
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1075
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1077
    stringBuffer.append(TEXT_268);
1076
    stringBuffer.append(TEXT_268);
1078
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1077
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1079
    stringBuffer.append(TEXT_269);
1078
    stringBuffer.append(TEXT_269);
1080
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1081
    stringBuffer.append(TEXT_270);
1079
    stringBuffer.append(TEXT_270);
1082
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
1083
    stringBuffer.append(TEXT_271);
1080
    stringBuffer.append(TEXT_271);
1081
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1084
    stringBuffer.append(TEXT_272);
1082
    stringBuffer.append(TEXT_272);
1083
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1085
    stringBuffer.append(TEXT_273);
1084
    stringBuffer.append(TEXT_273);
1086
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1085
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1087
    stringBuffer.append(TEXT_274);
1086
    stringBuffer.append(TEXT_274);
1088
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
1087
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1089
    stringBuffer.append(TEXT_275);
1088
    stringBuffer.append(TEXT_275);
1090
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
1091
    stringBuffer.append(TEXT_276);
1089
    stringBuffer.append(TEXT_276);
1092
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
1093
    stringBuffer.append(TEXT_277);
1090
    stringBuffer.append(TEXT_277);
1091
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1094
    stringBuffer.append(TEXT_278);
1092
    stringBuffer.append(TEXT_278);
1095
    stringBuffer.append(TEXT_279);
1096
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1093
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1094
    stringBuffer.append(TEXT_279);
1097
    stringBuffer.append(TEXT_280);
1095
    stringBuffer.append(TEXT_280);
1098
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1099
    stringBuffer.append(TEXT_281);
1096
    stringBuffer.append(TEXT_281);
1097
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1100
    stringBuffer.append(TEXT_282);
1098
    stringBuffer.append(TEXT_282);
1099
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1101
    stringBuffer.append(TEXT_283);
1100
    stringBuffer.append(TEXT_283);
1102
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1101
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1103
    stringBuffer.append(TEXT_284);
1102
    stringBuffer.append(TEXT_284);
Lines 1105-1142 Link Here
1105
    stringBuffer.append(TEXT_285);
1104
    stringBuffer.append(TEXT_285);
1106
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1105
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1107
    stringBuffer.append(TEXT_286);
1106
    stringBuffer.append(TEXT_286);
1108
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1109
    stringBuffer.append(TEXT_287);
1107
    stringBuffer.append(TEXT_287);
1110
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1111
    stringBuffer.append(TEXT_288);
1108
    stringBuffer.append(TEXT_288);
1109
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1112
    stringBuffer.append(TEXT_289);
1110
    stringBuffer.append(TEXT_289);
1113
    stringBuffer.append(TEXT_290);
1111
    stringBuffer.append(TEXT_290);
1114
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1115
    stringBuffer.append(TEXT_291);
1112
    stringBuffer.append(TEXT_291);
1113
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1116
    stringBuffer.append(TEXT_292);
1114
    stringBuffer.append(TEXT_292);
1117
    stringBuffer.append(TEXT_293);
1115
    stringBuffer.append(TEXT_293);
1118
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1119
    stringBuffer.append(TEXT_294);
1116
    stringBuffer.append(TEXT_294);
1117
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1120
    stringBuffer.append(TEXT_295);
1118
    stringBuffer.append(TEXT_295);
1121
    stringBuffer.append(TEXT_296);
1119
    stringBuffer.append(TEXT_296);
1122
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1123
    stringBuffer.append(TEXT_297);
1120
    stringBuffer.append(TEXT_297);
1121
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1124
    stringBuffer.append(TEXT_298);
1122
    stringBuffer.append(TEXT_298);
1123
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1125
    stringBuffer.append(TEXT_299);
1124
    stringBuffer.append(TEXT_299);
1126
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1125
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1127
    stringBuffer.append(TEXT_300);
1126
    stringBuffer.append(TEXT_300);
1128
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1127
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1129
    stringBuffer.append(TEXT_301);
1128
    stringBuffer.append(TEXT_301);
1130
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1131
    stringBuffer.append(TEXT_302);
1129
    stringBuffer.append(TEXT_302);
1132
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1133
    stringBuffer.append(TEXT_303);
1130
    stringBuffer.append(TEXT_303);
1134
    stringBuffer.append(TEXT_304);
1135
    stringBuffer.append(TEXT_305);
1136
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1131
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1137
    stringBuffer.append(TEXT_306);
1132
    stringBuffer.append(TEXT_304);
1138
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1133
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
1139
    stringBuffer.append(TEXT_307);
1134
    stringBuffer.append(TEXT_305);
1140
    /*XXX: probably, this should go to a separate jet-template along with GraphicalNodeEditPolicy*/
1135
    /*XXX: probably, this should go to a separate jet-template along with GraphicalNodeEditPolicy*/
1141
    
1136
    
1142
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
1137
for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
Lines 1162-1230 Link Here
1162
	}
1157
	}
1163
1158
1164
    if (palette != null) {
1159
    if (palette != null) {
1165
    stringBuffer.append(TEXT_308);
1160
    stringBuffer.append(TEXT_306);
1166
    stringBuffer.append(createCommandNameInfix);
1161
    stringBuffer.append(createCommandNameInfix);
1167
    stringBuffer.append(genLink.getVisualID());
1162
    stringBuffer.append(genLink.getVisualID());
1168
    stringBuffer.append(TEXT_309);
1163
    stringBuffer.append(TEXT_307);
1169
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
1164
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
1170
    stringBuffer.append(TEXT_310);
1165
    stringBuffer.append(TEXT_308);
1171
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1166
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1172
    stringBuffer.append(TEXT_311);
1167
    stringBuffer.append(TEXT_309);
1173
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1168
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1174
    stringBuffer.append(TEXT_312);
1169
    stringBuffer.append(TEXT_310);
1175
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1170
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
1176
    stringBuffer.append(TEXT_313);
1171
    stringBuffer.append(TEXT_311);
1177
    stringBuffer.append(createCommandNameInfix);
1172
    stringBuffer.append(createCommandNameInfix);
1178
    stringBuffer.append(genLink.getVisualID());
1173
    stringBuffer.append(genLink.getVisualID());
1179
    stringBuffer.append(TEXT_314);
1174
    stringBuffer.append(TEXT_312);
1180
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1175
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
1176
    stringBuffer.append(TEXT_313);
1177
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1178
    stringBuffer.append(TEXT_314);
1179
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1181
    stringBuffer.append(TEXT_315);
1180
    stringBuffer.append(TEXT_315);
1182
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1181
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1183
    stringBuffer.append(TEXT_316);
1182
    stringBuffer.append(TEXT_316);
1184
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1183
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1185
    stringBuffer.append(TEXT_317);
1184
    stringBuffer.append(TEXT_317);
1186
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1185
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
1187
    stringBuffer.append(TEXT_318);
1186
    stringBuffer.append(TEXT_318);
1188
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1189
    stringBuffer.append(TEXT_319);
1190
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
1187
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
1191
    stringBuffer.append(TEXT_320);
1188
    stringBuffer.append(TEXT_319);
1192
    
1189
    
1193
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1190
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1194
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1191
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1195
		GenClass linkClass = modelFacet.getMetaClass();
1192
		GenClass linkClass = modelFacet.getMetaClass();
1196
1193
1197
    stringBuffer.append(TEXT_321);
1194
    stringBuffer.append(TEXT_320);
1198
    stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName())));
1195
    stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName())));
1199
    stringBuffer.append(TEXT_322);
1196
    stringBuffer.append(TEXT_321);
1200
    stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName()));
1197
    stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName()));
1201
    stringBuffer.append(TEXT_323);
1198
    stringBuffer.append(TEXT_322);
1202
    stringBuffer.append(linkClass.getClassifierAccessorName());
1199
    stringBuffer.append(linkClass.getClassifierAccessorName());
1203
    stringBuffer.append(TEXT_324);
1200
    stringBuffer.append(TEXT_323);
1204
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
1201
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
1205
    stringBuffer.append(TEXT_325);
1202
    stringBuffer.append(TEXT_324);
1206
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
1203
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
1207
    stringBuffer.append(TEXT_326);
1204
    stringBuffer.append(TEXT_325);
1208
    stringBuffer.append(genLink.getUniqueIdentifier());
1205
    stringBuffer.append(genLink.getUniqueIdentifier());
1209
    stringBuffer.append(TEXT_327);
1206
    stringBuffer.append(TEXT_326);
1210
    
1207
    
1211
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
1208
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
1212
1209
1213
    stringBuffer.append(TEXT_328);
1210
    stringBuffer.append(TEXT_327);
1214
    
1211
    
1215
	}
1212
	}
1216
1213
1217
    stringBuffer.append(TEXT_329);
1214
    stringBuffer.append(TEXT_328);
1218
    stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName()));
1215
    stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName()));
1216
    stringBuffer.append(TEXT_329);
1217
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
1219
    stringBuffer.append(TEXT_330);
1218
    stringBuffer.append(TEXT_330);
1220
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
1219
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
1221
    stringBuffer.append(TEXT_331);
1220
    stringBuffer.append(TEXT_331);
1222
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
1223
    stringBuffer.append(TEXT_332);
1224
    
1221
    
1225
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1222
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1226
1223
1227
    stringBuffer.append(TEXT_333);
1224
    stringBuffer.append(TEXT_332);
1228
    
1225
    
1229
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1226
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
1230
		GenFeature sourceFeature = modelFacet.getSourceMetaFeature();
1227
		GenFeature sourceFeature = modelFacet.getSourceMetaFeature();
Lines 1251-1335 Link Here
1251
				}
1248
				}
1252
			}
1249
			}
1253
1250
1254
    stringBuffer.append(TEXT_334);
1251
    stringBuffer.append(TEXT_333);
1255
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1252
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1256
    stringBuffer.append(TEXT_335);
1253
    stringBuffer.append(TEXT_334);
1257
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
1254
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName()));
1258
    stringBuffer.append(TEXT_336);
1255
    stringBuffer.append(TEXT_335);
1259
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
1256
    stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName());
1260
    stringBuffer.append(TEXT_337);
1257
    stringBuffer.append(TEXT_336);
1261
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1258
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1262
    stringBuffer.append(TEXT_338);
1259
    stringBuffer.append(TEXT_337);
1263
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1260
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1264
    stringBuffer.append(TEXT_339);
1261
    stringBuffer.append(TEXT_338);
1265
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1262
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
1266
    stringBuffer.append(TEXT_340);
1263
    stringBuffer.append(TEXT_339);
1267
    
1264
    
1268
		}
1265
		}
1269
		if (addChild) {
1266
		if (addChild) {
1270
1267
1271
    stringBuffer.append(TEXT_341);
1268
    stringBuffer.append(TEXT_340);
1272
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1269
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1273
    stringBuffer.append(TEXT_342);
1270
    stringBuffer.append(TEXT_341);
1274
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1271
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1275
    stringBuffer.append(TEXT_343);
1272
    stringBuffer.append(TEXT_342);
1276
    stringBuffer.append(childFeature.getFeatureAccessorName());
1273
    stringBuffer.append(childFeature.getFeatureAccessorName());
1277
    stringBuffer.append(TEXT_344);
1274
    stringBuffer.append(TEXT_343);
1278
    
1275
    
1279
		}
1276
		}
1280
		if (addSource) {
1277
		if (addSource) {
1281
1278
1282
    stringBuffer.append(TEXT_345);
1279
    stringBuffer.append(TEXT_344);
1283
    stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1280
    stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1284
    stringBuffer.append(TEXT_346);
1281
    stringBuffer.append(TEXT_345);
1285
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1282
    stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1286
    stringBuffer.append(TEXT_347);
1283
    stringBuffer.append(TEXT_346);
1287
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
1284
    stringBuffer.append(sourceFeature.getFeatureAccessorName());
1288
    stringBuffer.append(TEXT_348);
1285
    stringBuffer.append(TEXT_347);
1289
    
1286
    
1290
		}
1287
		}
1291
		if (addTarget) {
1288
		if (addTarget) {
1292
1289
1293
    stringBuffer.append(TEXT_349);
1290
    stringBuffer.append(TEXT_348);
1294
    stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1291
    stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1295
    stringBuffer.append(TEXT_350);
1292
    stringBuffer.append(TEXT_349);
1296
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1293
    stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1297
    stringBuffer.append(TEXT_351);
1294
    stringBuffer.append(TEXT_350);
1298
    stringBuffer.append(targetFeature.getFeatureAccessorName());
1295
    stringBuffer.append(targetFeature.getFeatureAccessorName());
1299
    stringBuffer.append(TEXT_352);
1296
    stringBuffer.append(TEXT_351);
1300
    
1297
    
1301
		}
1298
		}
1302
1299
1303
    stringBuffer.append(TEXT_353);
1300
    stringBuffer.append(TEXT_352);
1304
    
1301
    
1305
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
1302
	} else if (genLink.getModelFacet() instanceof FeatureModelFacet) {
1306
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
1303
		GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature();
1307
1304
1308
    stringBuffer.append(TEXT_354);
1305
    stringBuffer.append(TEXT_353);
1309
    stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1306
    stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
1310
    stringBuffer.append(TEXT_355);
1307
    stringBuffer.append(TEXT_354);
1311
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1308
    stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
1312
    stringBuffer.append(TEXT_356);
1309
    stringBuffer.append(TEXT_355);
1313
    stringBuffer.append(metaFeature.getFeatureAccessorName());
1310
    stringBuffer.append(metaFeature.getFeatureAccessorName());
1314
    stringBuffer.append(TEXT_357);
1311
    stringBuffer.append(TEXT_356);
1315
    
1312
    
1316
	}
1313
	}
1317
1314
1318
    stringBuffer.append(TEXT_358);
1315
    stringBuffer.append(TEXT_357);
1319
    
1316
    
1320
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1317
	if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
1321
1318
1319
    stringBuffer.append(TEXT_358);
1320
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1322
    stringBuffer.append(TEXT_359);
1321
    stringBuffer.append(TEXT_359);
1323
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1322
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1324
    stringBuffer.append(TEXT_360);
1323
    stringBuffer.append(TEXT_360);
1325
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1326
    stringBuffer.append(TEXT_361);
1327
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
1324
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass"));
1328
    stringBuffer.append(TEXT_362);
1325
    stringBuffer.append(TEXT_361);
1329
    
1326
    
1330
	}
1327
	}
1331
1328
1332
    stringBuffer.append(TEXT_363);
1329
    stringBuffer.append(TEXT_362);
1333
    
1330
    
1334
}
1331
}
1335
1332
Lines 1338-1359 Link Here
1338
if (genNode.getViewmap() instanceof InnerClassViewmap) {
1335
if (genNode.getViewmap() instanceof InnerClassViewmap) {
1339
	String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody();
1336
	String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody();
1340
1337
1341
    stringBuffer.append(TEXT_364);
1338
    stringBuffer.append(TEXT_363);
1342
    stringBuffer.append(classBody);
1339
    stringBuffer.append(classBody);
1343
    stringBuffer.append(TEXT_365);
1340
    stringBuffer.append(TEXT_364);
1344
    
1341
    
1345
if (classBody.indexOf("DPtoLP") != -1) {
1342
if (classBody.indexOf("DPtoLP") != -1) {
1346
1343
1347
    stringBuffer.append(TEXT_366);
1344
    stringBuffer.append(TEXT_365);
1348
    
1345
    
1349
}
1346
}
1350
1347
1351
    
1348
    
1352
}
1349
}
1353
1350
1354
    stringBuffer.append(TEXT_367);
1351
    stringBuffer.append(TEXT_366);
1355
    importManager.emitSortedImports();
1352
    importManager.emitSortedImports();
1356
    stringBuffer.append(TEXT_368);
1353
    stringBuffer.append(TEXT_367);
1357
    return stringBuffer.toString();
1354
    return stringBuffer.toString();
1358
  }
1355
  }
1359
}
1356
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java (-225 / +243 lines)
Lines 32-151 Link Here
32
  protected final String TEXT_13 = NL + "\t\tinstallEditPolicy(";
32
  protected final String TEXT_13 = NL + "\t\tinstallEditPolicy(";
33
  protected final String TEXT_14 = ".LAYOUT_ROLE, new ";
33
  protected final String TEXT_14 = ".LAYOUT_ROLE, new ";
34
  protected final String TEXT_15 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ";
34
  protected final String TEXT_15 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ";
35
  protected final String TEXT_16 = " request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\treturn new Command(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate ";
35
  protected final String TEXT_16 = " request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t";
36
  protected final String TEXT_17 = " moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate ";
36
  protected final String TEXT_17 = " emfCommand = new ";
37
  protected final String TEXT_18 = " resizeDelta = request.getSizeDelta();" + 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\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn node.getLayoutConstraint() instanceof Bounds;" + 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\tprivate void execute(";
37
  protected final String TEXT_18 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate ";
38
  protected final String TEXT_19 = " move, ";
38
  protected final String TEXT_19 = " moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate ";
39
  protected final String TEXT_20 = " 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}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn ";
39
  protected final String TEXT_20 = " resizeDelta = request.getSizeDelta();" + 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\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn node.getLayoutConstraint() instanceof Bounds;" + 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(";
40
  protected final String TEXT_21 = ".INSTANCE;" + NL + "\t\t\t}";
40
  protected final String TEXT_21 = " move, ";
41
  protected final String TEXT_22 = NL + "\t\tinstallEditPolicy(";
41
  protected final String TEXT_22 = " 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(";
42
  protected final String TEXT_23 = ".LAYOUT_ROLE, new ";
42
  protected final String TEXT_23 = ".getEditingDomain(node.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 ";
43
  protected final String TEXT_24 = "() {" + NL + "\t\t\tprotected Object getConstraintFor(";
43
  protected final String TEXT_24 = ".INSTANCE;" + NL + "\t\t\t}";
44
  protected final String TEXT_25 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
44
  protected final String TEXT_25 = NL + "\t\tinstallEditPolicy(";
45
  protected final String TEXT_26 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\treturn ";
45
  protected final String TEXT_26 = ".LAYOUT_ROLE, new ";
46
  protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t}";
46
  protected final String TEXT_27 = "() {" + NL + "\t\t\tprotected Object getConstraintFor(";
47
  protected final String TEXT_28 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {";
47
  protected final String TEXT_28 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor(";
48
  protected final String TEXT_29 = NL + "\t\t\t\tif (request instanceof ";
48
  protected final String TEXT_29 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\treturn ";
49
  protected final String TEXT_30 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
49
  protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t}";
50
  protected final String TEXT_31 = ".CreateRequestEx requestEx = (";
50
  protected final String TEXT_31 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {";
51
  protected final String TEXT_32 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\tCompoundCommand result = new CompoundCommand();" + 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) {";
51
  protected final String TEXT_32 = NL + "\t\t\t\tif (request instanceof ";
52
  protected final String TEXT_33 = NL + "\t\t\t\t\t\tcase ";
52
  protected final String TEXT_33 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
53
  protected final String TEXT_34 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create";
53
  protected final String TEXT_34 = ".CreateRequestEx requestEx = (";
54
  protected final String TEXT_35 = "Command((View) getModel(), requestEx";
54
  protected final String TEXT_35 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
55
  protected final String TEXT_36 = ", " + NL + "\t\t\t\t\t\t\t\t(";
55
  protected final String TEXT_36 = " result = new ";
56
  protected final String TEXT_37 = ")getConstraintFor(request)";
56
  protected final String TEXT_37 = "();" + 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) {";
57
  protected final String TEXT_38 = "));" + NL + "\t\t\t\t\t\t\tbreak;";
57
  protected final String TEXT_38 = NL + "\t\t\t\t\t\tcase ";
58
  protected final String TEXT_39 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn result.unwrap();" + NL + "\t\t\t\t}";
58
  protected final String TEXT_39 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
59
  protected final String TEXT_40 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \"";
59
  protected final String TEXT_40 = "Command((View) getModel(), requestEx";
60
  protected final String TEXT_41 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
60
  protected final String TEXT_41 = ", " + NL + "\t\t\t\t\t\t\t\t(";
61
  protected final String TEXT_42 = " createFigure() {" + NL + "\t\t";
61
  protected final String TEXT_42 = ")getConstraintFor(request)";
62
  protected final String TEXT_43 = " result = new ";
62
  protected final String TEXT_43 = "));" + NL + "\t\t\t\t\t\t\tbreak;";
63
  protected final String TEXT_44 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new ";
63
  protected final String TEXT_44 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand(";
64
  protected final String TEXT_45 = "());" + NL + "\t\t";
64
  protected final String TEXT_45 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
65
  protected final String TEXT_46 = " scrollPane = new ";
65
  protected final String TEXT_46 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \"";
66
  protected final String TEXT_47 = "();" + NL + "\t\tresult.add(scrollPane);";
66
  protected final String TEXT_47 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
67
  protected final String TEXT_48 = NL + "\t\t";
67
  protected final String TEXT_48 = " createFigure() {" + NL + "\t\t";
68
  protected final String TEXT_49 = " viewport = new ";
68
  protected final String TEXT_49 = " result = new ";
69
  protected final String TEXT_50 = "();" + NL + "\t\tcontentPane = new ";
69
  protected final String TEXT_50 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new ";
70
  protected final String TEXT_51 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
70
  protected final String TEXT_51 = "());" + NL + "\t\t";
71
  protected final String TEXT_52 = "());";
71
  protected final String TEXT_52 = " scrollPane = new ";
72
  protected final String TEXT_53 = NL + "\t\t";
72
  protected final String TEXT_53 = "();" + NL + "\t\tresult.add(scrollPane);";
73
  protected final String TEXT_54 = " viewport = new ";
73
  protected final String TEXT_54 = NL + "\t\t";
74
  protected final String TEXT_55 = "();" + NL + "\t\tcontentPane = new ";
74
  protected final String TEXT_55 = " viewport = new ";
75
  protected final String TEXT_56 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
75
  protected final String TEXT_56 = "();" + NL + "\t\tcontentPane = new ";
76
  protected final String TEXT_57 = "());";
76
  protected final String TEXT_57 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
77
  protected final String TEXT_58 = 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 ";
77
  protected final String TEXT_58 = "());";
78
  protected final String TEXT_59 = " 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 (";
78
  protected final String TEXT_59 = NL + "\t\t";
79
  protected final String TEXT_60 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL;
79
  protected final String TEXT_60 = " viewport = new ";
80
  protected final String TEXT_61 = NL;
80
  protected final String TEXT_61 = "();" + NL + "\t\tcontentPane = new ";
81
  protected final String TEXT_62 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
81
  protected final String TEXT_62 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
82
  protected final String TEXT_63 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
82
  protected final String TEXT_63 = "());";
83
  protected final String TEXT_64 = " feature, ";
83
  protected final String TEXT_64 = 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 ";
84
  protected final String TEXT_65 = " 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();";
84
  protected final String TEXT_65 = " 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 (";
85
  protected final String TEXT_66 = NL;
85
  protected final String TEXT_66 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL;
86
  protected final String TEXT_67 = "\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(";
86
  protected final String TEXT_67 = NL;
87
  protected final String TEXT_68 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
87
  protected final String TEXT_68 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
88
  protected final String TEXT_69 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
88
  protected final String TEXT_69 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
89
  protected final String TEXT_70 = NL;
89
  protected final String TEXT_70 = " feature, ";
90
  protected final String TEXT_71 = "\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(";
90
  protected final String TEXT_71 = " 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();";
91
  protected final String TEXT_72 = ".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;
91
  protected final String TEXT_72 = NL;
92
  protected final String TEXT_73 = NL;
92
  protected final String TEXT_73 = "\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(";
93
  protected final String TEXT_74 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
93
  protected final String TEXT_74 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
94
  protected final String TEXT_75 = "static ";
94
  protected final String TEXT_75 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
95
  protected final String TEXT_76 = "class Create";
95
  protected final String TEXT_76 = NL;
96
  protected final String TEXT_77 = "Command extends ";
96
  protected final String TEXT_77 = "\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(";
97
  protected final String TEXT_78 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
97
  protected final String TEXT_78 = ".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;
98
  protected final String TEXT_79 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
98
  protected final String TEXT_79 = NL;
99
  protected final String TEXT_80 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
99
  protected final String TEXT_80 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
100
  protected final String TEXT_81 = "Command(";
100
  protected final String TEXT_81 = "static ";
101
  protected final String TEXT_82 = " parent, ";
101
  protected final String TEXT_82 = "class Create";
102
  protected final String TEXT_83 = ".CreateRequestEx request";
102
  protected final String TEXT_83 = "Command extends ";
103
  protected final String TEXT_84 = ", ";
103
  protected final String TEXT_84 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
104
  protected final String TEXT_85 = " constraint";
104
  protected final String TEXT_85 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
105
  protected final String TEXT_86 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = ";
105
  protected final String TEXT_86 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
106
  protected final String TEXT_87 = ".eINSTANCE.createNode();";
106
  protected final String TEXT_87 = "Command(";
107
  protected final String TEXT_88 = NL + "\t\t\t";
107
  protected final String TEXT_88 = " parent, ";
108
  protected final String TEXT_89 = " createdDomainElement = ";
108
  protected final String TEXT_89 = ".CreateRequestEx request";
109
  protected final String TEXT_90 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
109
  protected final String TEXT_90 = ", ";
110
  protected final String TEXT_91 = ".eINSTANCE.get";
110
  protected final String TEXT_91 = " constraint";
111
  protected final String TEXT_92 = "());";
111
  protected final String TEXT_92 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = ";
112
  protected final String TEXT_93 = NL + "\t\t\t";
112
  protected final String TEXT_93 = ".eINSTANCE.createNode();";
113
  protected final String TEXT_94 = " createdDomainElement = ";
113
  protected final String TEXT_94 = NL + "\t\t\t";
114
  protected final String TEXT_95 = ".eINSTANCE.create";
114
  protected final String TEXT_95 = " createdDomainElement = ";
115
  protected final String TEXT_96 = "();";
115
  protected final String TEXT_96 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
116
  protected final String TEXT_97 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t";
116
  protected final String TEXT_97 = ".eINSTANCE.get";
117
  protected final String TEXT_98 = NL + "\t\t\t";
117
  protected final String TEXT_98 = "());";
118
  protected final String TEXT_99 = ".";
118
  protected final String TEXT_99 = NL + "\t\t\t";
119
  protected final String TEXT_100 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t";
119
  protected final String TEXT_100 = " createdDomainElement = ";
120
  protected final String TEXT_101 = ".decorateView(createdNode);";
120
  protected final String TEXT_101 = ".eINSTANCE.create";
121
  protected final String TEXT_102 = NL + "\t\t\t";
121
  protected final String TEXT_102 = "();";
122
  protected final String TEXT_103 = " bounds = ";
122
  protected final String TEXT_103 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t";
123
  protected final String TEXT_104 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
123
  protected final String TEXT_104 = NL + "\t\t\t";
124
  protected final String TEXT_105 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
124
  protected final String TEXT_105 = ".";
125
  protected final String TEXT_106 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
125
  protected final String TEXT_106 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t";
126
  protected final String TEXT_107 = "));";
126
  protected final String TEXT_107 = ".decorateView(createdNode);";
127
  protected final String TEXT_108 = NL + "\t\t\t";
127
  protected final String TEXT_108 = NL + "\t\t\t";
128
  protected final String TEXT_109 = " domainModelEditDomain = ";
128
  protected final String TEXT_109 = " bounds = ";
129
  protected final String TEXT_110 = ".getEditingDomainFor(parent.getDiagram().getElement());";
129
  protected final String TEXT_110 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
130
  protected final String TEXT_111 = NL + "\t\t\t";
130
  protected final String TEXT_111 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
131
  protected final String TEXT_112 = " compoundCommand = new ";
131
  protected final String TEXT_112 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
132
  protected final String TEXT_113 = "();" + NL + "\t\t\tcompoundCommand.append(";
132
  protected final String TEXT_113 = "));";
133
  protected final String TEXT_114 = ".create(domainModelEditDomain, ";
133
  protected final String TEXT_114 = NL + "\t\t\t";
134
  protected final String TEXT_115 = ", " + NL + "\t\t\t\t";
134
  protected final String TEXT_115 = " domainModelEditDomain = ";
135
  protected final String TEXT_116 = ".eINSTANCE.get";
135
  protected final String TEXT_116 = ".getEditingDomain(parent.getDiagram().getElement());";
136
  protected final String TEXT_117 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append(";
136
  protected final String TEXT_117 = NL + "\t\t\t";
137
  protected final String TEXT_118 = ".create(domainModelEditDomain, ";
137
  protected final String TEXT_118 = " compoundCommand = new ";
138
  protected final String TEXT_119 = ", " + NL + "\t\t\t\t";
138
  protected final String TEXT_119 = "();" + NL + "\t\t\tcompoundCommand.append(";
139
  protected final String TEXT_120 = ".eINSTANCE.get";
139
  protected final String TEXT_120 = ".create(domainModelEditDomain, ";
140
  protected final String TEXT_121 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
140
  protected final String TEXT_121 = ", " + NL + "\t\t\t\t";
141
  protected final String TEXT_122 = NL + "\t\t\tthis.domainModelAddCommand = ";
141
  protected final String TEXT_122 = ".eINSTANCE.get";
142
  protected final String TEXT_123 = ".create(domainModelEditDomain, ";
142
  protected final String TEXT_123 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append(";
143
  protected final String TEXT_124 = ", " + NL + "\t\t\t\t";
143
  protected final String TEXT_124 = ".create(domainModelEditDomain, ";
144
  protected final String TEXT_125 = ".eINSTANCE.get";
144
  protected final String TEXT_125 = ", " + NL + "\t\t\t\t";
145
  protected final String TEXT_126 = "(), createdNode.getElement());";
145
  protected final String TEXT_126 = ".eINSTANCE.get";
146
  protected final String TEXT_127 = NL + "\t\t\trequest.setCreatedObject(createdNode);" + 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 && domainModelAddCommand.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 && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tparent.insertChild(createdNode);" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tparent.getPersistedChildren().remove(createdNode);" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t}";
146
  protected final String TEXT_127 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
147
  protected final String TEXT_128 = NL + "}" + NL;
147
  protected final String TEXT_128 = NL + "\t\t\tthis.domainModelAddCommand = ";
148
  protected final String TEXT_129 = NL;
148
  protected final String TEXT_129 = ".create(domainModelEditDomain, ";
149
  protected final String TEXT_130 = ", " + NL + "\t\t\t\t";
150
  protected final String TEXT_131 = ".eINSTANCE.get";
151
  protected final String TEXT_132 = "(), createdNode.getElement());";
152
  protected final String TEXT_133 = NL + "\t\t\trequest.setCreatedObject(createdNode);" + 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 && domainModelAddCommand.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 && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tparent.insertChild(createdNode);" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tparent.getPersistedChildren().remove(createdNode);" + 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}";
153
  protected final String TEXT_134 = NL + "}" + NL;
154
  protected final String TEXT_135 = NL;
149
155
150
  public String generate(Object argument)
156
  public String generate(Object argument)
151
  {
157
  {
Lines 199-317 Link Here
199
    stringBuffer.append(TEXT_15);
205
    stringBuffer.append(TEXT_15);
200
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest"));
206
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest"));
201
    stringBuffer.append(TEXT_16);
207
    stringBuffer.append(TEXT_16);
202
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
208
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
203
    stringBuffer.append(TEXT_17);
209
    stringBuffer.append(TEXT_17);
204
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
210
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
205
    stringBuffer.append(TEXT_18);
211
    stringBuffer.append(TEXT_18);
206
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
212
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
207
    stringBuffer.append(TEXT_19);
213
    stringBuffer.append(TEXT_19);
208
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
214
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
209
    stringBuffer.append(TEXT_20);
215
    stringBuffer.append(TEXT_20);
210
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
216
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
211
    stringBuffer.append(TEXT_21);
217
    stringBuffer.append(TEXT_21);
212
    } else {
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
213
    stringBuffer.append(TEXT_22);
219
    stringBuffer.append(TEXT_22);
214
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
220
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
215
    stringBuffer.append(TEXT_23);
221
    stringBuffer.append(TEXT_23);
216
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
222
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
217
    stringBuffer.append(TEXT_24);
223
    stringBuffer.append(TEXT_24);
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
224
    } else {
219
    stringBuffer.append(TEXT_25);
225
    stringBuffer.append(TEXT_25);
220
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
226
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
221
    stringBuffer.append(TEXT_26);
227
    stringBuffer.append(TEXT_26);
222
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
228
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy"));
223
    stringBuffer.append(TEXT_27);
229
    stringBuffer.append(TEXT_27);
224
    }
230
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
225
    stringBuffer.append(TEXT_28);
231
    stringBuffer.append(TEXT_28);
232
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
233
    stringBuffer.append(TEXT_29);
234
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
235
    stringBuffer.append(TEXT_30);
236
    }
237
    stringBuffer.append(TEXT_31);
226
    if (null != genDiagram.getPalette()) {
238
    if (null != genDiagram.getPalette()) {
227
final Palette palette = genDiagram.getPalette();
239
final Palette palette = genDiagram.getPalette();
228
    stringBuffer.append(TEXT_29);
240
    stringBuffer.append(TEXT_32);
229
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
241
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
230
    stringBuffer.append(TEXT_30);
242
    stringBuffer.append(TEXT_33);
231
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
243
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
232
    stringBuffer.append(TEXT_31);
244
    stringBuffer.append(TEXT_34);
233
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
245
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
234
    stringBuffer.append(TEXT_32);
246
    stringBuffer.append(TEXT_35);
247
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
248
    stringBuffer.append(TEXT_36);
249
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
250
    stringBuffer.append(TEXT_37);
235
    
251
    
236
for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) {
252
for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) {
237
	GenChildNode next = (GenChildNode)it.next();
253
	GenChildNode next = (GenChildNode)it.next();
238
254
239
    stringBuffer.append(TEXT_33);
255
    stringBuffer.append(TEXT_38);
240
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
256
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
241
    stringBuffer.append(TEXT_34);
257
    stringBuffer.append(TEXT_39);
242
    stringBuffer.append(next.getDomainMetaClass().getName());
258
    stringBuffer.append(next.getDomainMetaClass().getName());
243
    stringBuffer.append(next.getVisualID());
259
    stringBuffer.append(next.getVisualID());
244
    stringBuffer.append(TEXT_35);
260
    stringBuffer.append(TEXT_40);
245
    if (!genCompartment.isListLayout()) {
261
    if (!genCompartment.isListLayout()) {
246
    stringBuffer.append(TEXT_36);
262
    stringBuffer.append(TEXT_41);
247
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
263
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
248
    stringBuffer.append(TEXT_37);
264
    stringBuffer.append(TEXT_42);
249
    }
265
    }
250
    stringBuffer.append(TEXT_38);
266
    stringBuffer.append(TEXT_43);
251
    
267
    
252
}
268
}
253
269
254
    stringBuffer.append(TEXT_39);
255
    }/*when there's palette*/
256
    stringBuffer.append(TEXT_40);
257
    stringBuffer.append(genCompartment.getTitle());
258
    stringBuffer.append(TEXT_41);
259
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
260
    stringBuffer.append(TEXT_42);
261
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer"));
262
    stringBuffer.append(TEXT_43);
263
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer"));
264
    stringBuffer.append(TEXT_44);
270
    stringBuffer.append(TEXT_44);
265
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
271
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
266
    stringBuffer.append(TEXT_45);
272
    stringBuffer.append(TEXT_45);
267
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
273
    }/*when there's palette*/
268
    stringBuffer.append(TEXT_46);
274
    stringBuffer.append(TEXT_46);
269
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
275
    stringBuffer.append(genCompartment.getTitle());
270
    stringBuffer.append(TEXT_47);
276
    stringBuffer.append(TEXT_47);
271
    if (genCompartment.isListLayout()) {
277
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
272
    stringBuffer.append(TEXT_48);
278
    stringBuffer.append(TEXT_48);
273
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
279
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer"));
274
    stringBuffer.append(TEXT_49);
280
    stringBuffer.append(TEXT_49);
275
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
281
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer"));
276
    stringBuffer.append(TEXT_50);
282
    stringBuffer.append(TEXT_50);
277
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
278
    stringBuffer.append(TEXT_51);
284
    stringBuffer.append(TEXT_51);
279
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"));
285
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
280
    stringBuffer.append(TEXT_52);
286
    stringBuffer.append(TEXT_52);
281
    } else {
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
282
    stringBuffer.append(TEXT_53);
288
    stringBuffer.append(TEXT_53);
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
289
    if (genCompartment.isListLayout()) {
284
    stringBuffer.append(TEXT_54);
290
    stringBuffer.append(TEXT_54);
285
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport"));
291
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
286
    stringBuffer.append(TEXT_55);
292
    stringBuffer.append(TEXT_55);
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
293
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
288
    stringBuffer.append(TEXT_56);
294
    stringBuffer.append(TEXT_56);
289
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
295
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
290
    stringBuffer.append(TEXT_57);
296
    stringBuffer.append(TEXT_57);
291
    }
297
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"));
292
    stringBuffer.append(TEXT_58);
298
    stringBuffer.append(TEXT_58);
293
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
299
    } else {
294
    stringBuffer.append(TEXT_59);
300
    stringBuffer.append(TEXT_59);
295
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
301
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
296
    stringBuffer.append(TEXT_60);
302
    stringBuffer.append(TEXT_60);
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport"));
297
    stringBuffer.append(TEXT_61);
304
    stringBuffer.append(TEXT_61);
305
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
298
    stringBuffer.append(TEXT_62);
306
    stringBuffer.append(TEXT_62);
299
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
307
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
300
    stringBuffer.append(TEXT_63);
308
    stringBuffer.append(TEXT_63);
301
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
309
    }
302
    stringBuffer.append(TEXT_64);
310
    stringBuffer.append(TEXT_64);
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
311
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
304
    stringBuffer.append(TEXT_65);
312
    stringBuffer.append(TEXT_65);
313
    stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
305
    stringBuffer.append(TEXT_66);
314
    stringBuffer.append(TEXT_66);
306
    stringBuffer.append(TEXT_67);
315
    stringBuffer.append(TEXT_67);
307
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
308
    stringBuffer.append(TEXT_68);
316
    stringBuffer.append(TEXT_68);
309
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
317
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
310
    stringBuffer.append(TEXT_69);
318
    stringBuffer.append(TEXT_69);
319
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
311
    stringBuffer.append(TEXT_70);
320
    stringBuffer.append(TEXT_70);
321
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
312
    stringBuffer.append(TEXT_71);
322
    stringBuffer.append(TEXT_71);
313
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
314
    stringBuffer.append(TEXT_72);
323
    stringBuffer.append(TEXT_72);
324
    stringBuffer.append(TEXT_73);
325
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
326
    stringBuffer.append(TEXT_74);
327
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
328
    stringBuffer.append(TEXT_75);
329
    stringBuffer.append(TEXT_76);
330
    stringBuffer.append(TEXT_77);
331
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
332
    stringBuffer.append(TEXT_78);
315
    
333
    
316
for(Iterator it = genCompartment.getChildNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) {
334
for(Iterator it = genCompartment.getChildNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) {
317
	GenChildNode next = (GenChildNode)it.next();
335
	GenChildNode next = (GenChildNode)it.next();
Lines 319-397 Link Here
319
	boolean isListLayout = genCompartment.isListLayout();
337
	boolean isListLayout = genCompartment.isListLayout();
320
	String resolvedSemanticElement = "resolveSemanticElement()";
338
	String resolvedSemanticElement = "resolveSemanticElement()";
321
339
322
    stringBuffer.append(TEXT_73);
340
    stringBuffer.append(TEXT_79);
323
    stringBuffer.append(TEXT_74);
341
    stringBuffer.append(TEXT_80);
324
    if (isStatic) {
342
    if (isStatic) {
325
    stringBuffer.append(TEXT_75);
343
    stringBuffer.append(TEXT_81);
326
    }
344
    }
327
    stringBuffer.append(TEXT_76);
345
    stringBuffer.append(TEXT_82);
328
    stringBuffer.append(next.getDomainMetaClass().getName());
346
    stringBuffer.append(next.getDomainMetaClass().getName());
329
    stringBuffer.append(next.getVisualID());
347
    stringBuffer.append(next.getVisualID());
330
    stringBuffer.append(TEXT_77);
348
    stringBuffer.append(TEXT_83);
331
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
332
    stringBuffer.append(TEXT_78);
350
    stringBuffer.append(TEXT_84);
333
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
334
    stringBuffer.append(TEXT_79);
352
    stringBuffer.append(TEXT_85);
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
353
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
336
    stringBuffer.append(TEXT_80);
354
    stringBuffer.append(TEXT_86);
337
    stringBuffer.append(next.getDomainMetaClass().getName());
355
    stringBuffer.append(next.getDomainMetaClass().getName());
338
    stringBuffer.append(next.getVisualID());
356
    stringBuffer.append(next.getVisualID());
339
    stringBuffer.append(TEXT_81);
357
    stringBuffer.append(TEXT_87);
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
358
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
341
    stringBuffer.append(TEXT_82);
359
    stringBuffer.append(TEXT_88);
342
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
360
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
343
    stringBuffer.append(TEXT_83);
361
    stringBuffer.append(TEXT_89);
344
    if (!isListLayout) {
362
    if (!isListLayout) {
345
    stringBuffer.append(TEXT_84);
363
    stringBuffer.append(TEXT_90);
346
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
347
    stringBuffer.append(TEXT_85);
365
    stringBuffer.append(TEXT_91);
348
    }
366
    }
349
    stringBuffer.append(TEXT_86);
367
    stringBuffer.append(TEXT_92);
350
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
351
    stringBuffer.append(TEXT_87);
369
    stringBuffer.append(TEXT_93);
352
    
370
    
353
if (next.getDomainMetaClass().isMapEntry()) {
371
if (next.getDomainMetaClass().isMapEntry()) {
354
/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
372
/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
355
373
356
    stringBuffer.append(TEXT_88);
374
    stringBuffer.append(TEXT_94);
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
358
    stringBuffer.append(TEXT_89);
376
    stringBuffer.append(TEXT_95);
359
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
377
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
360
    stringBuffer.append(TEXT_90);
378
    stringBuffer.append(TEXT_96);
361
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
379
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
362
    stringBuffer.append(TEXT_91);
380
    stringBuffer.append(TEXT_97);
363
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
381
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
364
    stringBuffer.append(TEXT_92);
382
    stringBuffer.append(TEXT_98);
365
    
383
    
366
} else {
384
} else {
367
385
368
    stringBuffer.append(TEXT_93);
386
    stringBuffer.append(TEXT_99);
369
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
387
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
370
    stringBuffer.append(TEXT_94);
388
    stringBuffer.append(TEXT_100);
371
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
389
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
372
    stringBuffer.append(TEXT_95);
390
    stringBuffer.append(TEXT_101);
373
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
391
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
374
    stringBuffer.append(TEXT_96);
392
    stringBuffer.append(TEXT_102);
375
    
393
    
376
}
394
}
377
395
378
    stringBuffer.append(TEXT_97);
396
    stringBuffer.append(TEXT_103);
379
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
397
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
380
    stringBuffer.append(TEXT_98);
398
    stringBuffer.append(TEXT_104);
381
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
399
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
382
    stringBuffer.append(TEXT_99);
400
    stringBuffer.append(TEXT_105);
383
    stringBuffer.append(next.getUniqueIdentifier());
401
    stringBuffer.append(next.getUniqueIdentifier());
384
    stringBuffer.append(TEXT_100);
402
    stringBuffer.append(TEXT_106);
385
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
403
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
386
    stringBuffer.append(TEXT_101);
404
    stringBuffer.append(TEXT_107);
387
    
405
    
388
	if (!isListLayout) {
406
	if (!isListLayout) {
389
407
390
    stringBuffer.append(TEXT_102);
408
    stringBuffer.append(TEXT_108);
391
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
392
    stringBuffer.append(TEXT_103);
410
    stringBuffer.append(TEXT_109);
393
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
394
    stringBuffer.append(TEXT_104);
412
    stringBuffer.append(TEXT_110);
395
    
413
    
396
		int defaultWidth = 40;
414
		int defaultWidth = 40;
397
		int defaultHeight = 40;
415
		int defaultHeight = 40;
Lines 401-468 Link Here
401
			defaultHeight = defSizeAttrs.getHeight();
419
			defaultHeight = defSizeAttrs.getHeight();
402
		}
420
		}
403
421
404
    stringBuffer.append(TEXT_105);
422
    stringBuffer.append(TEXT_111);
405
    stringBuffer.append(defaultWidth);
423
    stringBuffer.append(defaultWidth);
406
    stringBuffer.append(TEXT_106);
424
    stringBuffer.append(TEXT_112);
407
    stringBuffer.append(defaultHeight);
425
    stringBuffer.append(defaultHeight);
408
    stringBuffer.append(TEXT_107);
426
    stringBuffer.append(TEXT_113);
409
    
427
    
410
	}
428
	}
411
429
412
    stringBuffer.append(TEXT_108);
430
    stringBuffer.append(TEXT_114);
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
414
    stringBuffer.append(TEXT_109);
432
    stringBuffer.append(TEXT_115);
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
416
    stringBuffer.append(TEXT_110);
434
    stringBuffer.append(TEXT_116);
417
    
435
    
418
	TypeModelFacet facet = next.getModelFacet();
436
	TypeModelFacet facet = next.getModelFacet();
419
	GenFeature childFeature = facet.getChildMetaFeature();
437
	GenFeature childFeature = facet.getChildMetaFeature();
420
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
438
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
421
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
439
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
422
440
423
    stringBuffer.append(TEXT_111);
441
    stringBuffer.append(TEXT_117);
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
442
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
425
    stringBuffer.append(TEXT_112);
443
    stringBuffer.append(TEXT_118);
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
444
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
427
    stringBuffer.append(TEXT_113);
445
    stringBuffer.append(TEXT_119);
428
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
446
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
429
    stringBuffer.append(TEXT_114);
447
    stringBuffer.append(TEXT_120);
430
    stringBuffer.append(resolvedSemanticElement);
448
    stringBuffer.append(resolvedSemanticElement);
431
    stringBuffer.append(TEXT_115);
449
    stringBuffer.append(TEXT_121);
432
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
450
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
433
    stringBuffer.append(TEXT_116);
451
    stringBuffer.append(TEXT_122);
434
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
452
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
435
    stringBuffer.append(TEXT_117);
453
    stringBuffer.append(TEXT_123);
436
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
454
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
437
    stringBuffer.append(TEXT_118);
455
    stringBuffer.append(TEXT_124);
438
    stringBuffer.append(resolvedSemanticElement);
456
    stringBuffer.append(resolvedSemanticElement);
439
    stringBuffer.append(TEXT_119);
457
    stringBuffer.append(TEXT_125);
440
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
458
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
441
    stringBuffer.append(TEXT_120);
459
    stringBuffer.append(TEXT_126);
442
    stringBuffer.append(childFeature.getFeatureAccessorName());
460
    stringBuffer.append(childFeature.getFeatureAccessorName());
443
    stringBuffer.append(TEXT_121);
461
    stringBuffer.append(TEXT_127);
444
    
462
    
445
	} else {
463
	} else {
446
464
447
    stringBuffer.append(TEXT_122);
465
    stringBuffer.append(TEXT_128);
448
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
466
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
449
    stringBuffer.append(TEXT_123);
467
    stringBuffer.append(TEXT_129);
450
    stringBuffer.append(resolvedSemanticElement);
468
    stringBuffer.append(resolvedSemanticElement);
451
    stringBuffer.append(TEXT_124);
469
    stringBuffer.append(TEXT_130);
452
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
470
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
453
    stringBuffer.append(TEXT_125);
471
    stringBuffer.append(TEXT_131);
454
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
472
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
455
    stringBuffer.append(TEXT_126);
473
    stringBuffer.append(TEXT_132);
456
    
474
    
457
	}
475
	}
458
476
459
    stringBuffer.append(TEXT_127);
477
    stringBuffer.append(TEXT_133);
460
    
478
    
461
}
479
}
462
480
463
    stringBuffer.append(TEXT_128);
481
    stringBuffer.append(TEXT_134);
464
    importManager.emitSortedImports();
482
    importManager.emitSortedImports();
465
    stringBuffer.append(TEXT_129);
483
    stringBuffer.append(TEXT_135);
466
    return stringBuffer.toString();
484
    return stringBuffer.toString();
467
  }
485
  }
468
}
486
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java (-186 / +204 lines)
Lines 32-131 Link Here
32
  protected final String TEXT_13 = NL + "\t\t\t\tif (request instanceof ";
32
  protected final String TEXT_13 = NL + "\t\t\t\tif (request instanceof ";
33
  protected final String TEXT_14 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
33
  protected final String TEXT_14 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t";
34
  protected final String TEXT_15 = ".CreateRequestEx requestEx = (";
34
  protected final String TEXT_15 = ".CreateRequestEx requestEx = (";
35
  protected final String TEXT_16 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\tCompoundCommand result = new CompoundCommand();" + 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) {";
35
  protected final String TEXT_16 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t";
36
  protected final String TEXT_17 = NL + "\t\t\t\t\t\tcase ";
36
  protected final String TEXT_17 = " result = new ";
37
  protected final String TEXT_18 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create";
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) {";
38
  protected final String TEXT_19 = "Command(getDiagram(), requestEx, (";
38
  protected final String TEXT_19 = NL + "\t\t\t\t\t\tcase ";
39
  protected final String TEXT_20 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;";
39
  protected final String TEXT_20 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create";
40
  protected final String TEXT_21 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn result.unwrap();" + NL + "\t\t\t\t}";
40
  protected final String TEXT_21 = "Command(getDiagram(), requestEx, (";
41
  protected final String TEXT_22 = 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\treturn new Command(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate Dimension resizeDelta = request.getSizeDelta();" + 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\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn node.getLayoutConstraint() instanceof Bounds;" + 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\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}" + 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}" + 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 (";
41
  protected final String TEXT_22 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;";
42
  protected final String TEXT_23 = ".class == key) {" + NL + "\t\t\treturn new ";
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(";
43
  protected final String TEXT_24 = "(this);" + NL + "\t\t}";
43
  protected final String TEXT_24 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}";
44
  protected final String TEXT_25 = 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;
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";
45
  protected final String TEXT_26 = NL;
45
  protected final String TEXT_26 = " emfCommand = new ";
46
  protected final String TEXT_27 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
46
  protected final String TEXT_27 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate Dimension resizeDelta = request.getSizeDelta();" + 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\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn node.getLayoutConstraint() instanceof Bounds;" + 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(";
47
  protected final String TEXT_28 = "static ";
47
  protected final String TEXT_28 = ".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}" + 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 (";
48
  protected final String TEXT_29 = "class Create";
48
  protected final String TEXT_29 = ".class == key) {" + NL + "\t\t\treturn new ";
49
  protected final String TEXT_30 = "Command extends ";
49
  protected final String TEXT_30 = "(this);" + NL + "\t\t}";
50
  protected final String TEXT_31 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
50
  protected final String TEXT_31 = 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;
51
  protected final String TEXT_32 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
51
  protected final String TEXT_32 = NL;
52
  protected final String TEXT_33 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
52
  protected final String TEXT_33 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
53
  protected final String TEXT_34 = "Command(";
53
  protected final String TEXT_34 = "static ";
54
  protected final String TEXT_35 = " parent, ";
54
  protected final String TEXT_35 = "class Create";
55
  protected final String TEXT_36 = ".CreateRequestEx request";
55
  protected final String TEXT_36 = "Command extends ";
56
  protected final String TEXT_37 = ", ";
56
  protected final String TEXT_37 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final ";
57
  protected final String TEXT_38 = " constraint";
57
  protected final String TEXT_38 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
58
  protected final String TEXT_39 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = ";
58
  protected final String TEXT_39 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create";
59
  protected final String TEXT_40 = ".eINSTANCE.createNode();";
59
  protected final String TEXT_40 = "Command(";
60
  protected final String TEXT_41 = NL + "\t\t\t";
60
  protected final String TEXT_41 = " parent, ";
61
  protected final String TEXT_42 = " createdDomainElement = ";
61
  protected final String TEXT_42 = ".CreateRequestEx request";
62
  protected final String TEXT_43 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
62
  protected final String TEXT_43 = ", ";
63
  protected final String TEXT_44 = ".eINSTANCE.get";
63
  protected final String TEXT_44 = " constraint";
64
  protected final String TEXT_45 = "());";
64
  protected final String TEXT_45 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = ";
65
  protected final String TEXT_46 = NL + "\t\t\t";
65
  protected final String TEXT_46 = ".eINSTANCE.createNode();";
66
  protected final String TEXT_47 = " createdDomainElement = ";
66
  protected final String TEXT_47 = NL + "\t\t\t";
67
  protected final String TEXT_48 = ".eINSTANCE.create";
67
  protected final String TEXT_48 = " createdDomainElement = ";
68
  protected final String TEXT_49 = "();";
68
  protected final String TEXT_49 = ".eINSTANCE.create(" + NL + "\t\t\t\t";
69
  protected final String TEXT_50 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t";
69
  protected final String TEXT_50 = ".eINSTANCE.get";
70
  protected final String TEXT_51 = NL + "\t\t\t";
70
  protected final String TEXT_51 = "());";
71
  protected final String TEXT_52 = ".";
71
  protected final String TEXT_52 = NL + "\t\t\t";
72
  protected final String TEXT_53 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t";
72
  protected final String TEXT_53 = " createdDomainElement = ";
73
  protected final String TEXT_54 = ".decorateView(createdNode);";
73
  protected final String TEXT_54 = ".eINSTANCE.create";
74
  protected final String TEXT_55 = NL + "\t\t\t";
74
  protected final String TEXT_55 = "();";
75
  protected final String TEXT_56 = " bounds = ";
75
  protected final String TEXT_56 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t";
76
  protected final String TEXT_57 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
76
  protected final String TEXT_57 = NL + "\t\t\t";
77
  protected final String TEXT_58 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
77
  protected final String TEXT_58 = ".";
78
  protected final String TEXT_59 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
78
  protected final String TEXT_59 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t";
79
  protected final String TEXT_60 = "));";
79
  protected final String TEXT_60 = ".decorateView(createdNode);";
80
  protected final String TEXT_61 = NL + "\t\t\t";
80
  protected final String TEXT_61 = NL + "\t\t\t";
81
  protected final String TEXT_62 = " domainModelEditDomain = ";
81
  protected final String TEXT_62 = " bounds = ";
82
  protected final String TEXT_63 = ".getEditingDomainFor(parent.getDiagram().getElement());";
82
  protected final String TEXT_63 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);";
83
  protected final String TEXT_64 = NL + "\t\t\t";
83
  protected final String TEXT_64 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, ";
84
  protected final String TEXT_65 = " compoundCommand = new ";
84
  protected final String TEXT_65 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, ";
85
  protected final String TEXT_66 = "();" + NL + "\t\t\tcompoundCommand.append(";
85
  protected final String TEXT_66 = "));";
86
  protected final String TEXT_67 = ".create(domainModelEditDomain, ";
86
  protected final String TEXT_67 = NL + "\t\t\t";
87
  protected final String TEXT_68 = ", " + NL + "\t\t\t\t";
87
  protected final String TEXT_68 = " domainModelEditDomain = ";
88
  protected final String TEXT_69 = ".eINSTANCE.get";
88
  protected final String TEXT_69 = ".getEditingDomain(parent.getDiagram().getElement());";
89
  protected final String TEXT_70 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append(";
89
  protected final String TEXT_70 = NL + "\t\t\t";
90
  protected final String TEXT_71 = ".create(domainModelEditDomain, ";
90
  protected final String TEXT_71 = " compoundCommand = new ";
91
  protected final String TEXT_72 = ", " + NL + "\t\t\t\t";
91
  protected final String TEXT_72 = "();" + NL + "\t\t\tcompoundCommand.append(";
92
  protected final String TEXT_73 = ".eINSTANCE.get";
92
  protected final String TEXT_73 = ".create(domainModelEditDomain, ";
93
  protected final String TEXT_74 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
93
  protected final String TEXT_74 = ", " + NL + "\t\t\t\t";
94
  protected final String TEXT_75 = NL + "\t\t\tthis.domainModelAddCommand = ";
94
  protected final String TEXT_75 = ".eINSTANCE.get";
95
  protected final String TEXT_76 = ".create(domainModelEditDomain, ";
95
  protected final String TEXT_76 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append(";
96
  protected final String TEXT_77 = ", " + NL + "\t\t\t\t";
96
  protected final String TEXT_77 = ".create(domainModelEditDomain, ";
97
  protected final String TEXT_78 = ".eINSTANCE.get";
97
  protected final String TEXT_78 = ", " + NL + "\t\t\t\t";
98
  protected final String TEXT_79 = "(), createdNode.getElement());";
98
  protected final String TEXT_79 = ".eINSTANCE.get";
99
  protected final String TEXT_80 = NL + "\t\t\trequest.setCreatedObject(createdNode);" + 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 && domainModelAddCommand.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 && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tparent.insertChild(createdNode);" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tparent.getPersistedChildren().remove(createdNode);" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t}";
99
  protected final String TEXT_80 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;";
100
  protected final String TEXT_81 = NL;
100
  protected final String TEXT_81 = NL + "\t\t\tthis.domainModelAddCommand = ";
101
  protected final String TEXT_82 = NL;
101
  protected final String TEXT_82 = ".create(domainModelEditDomain, ";
102
  protected final String TEXT_83 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
102
  protected final String TEXT_83 = ", " + NL + "\t\t\t\t";
103
  protected final String TEXT_84 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
103
  protected final String TEXT_84 = ".eINSTANCE.get";
104
  protected final String TEXT_85 = " feature, ";
104
  protected final String TEXT_85 = "(), createdNode.getElement());";
105
  protected final String TEXT_86 = " 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();";
105
  protected final String TEXT_86 = NL + "\t\t\trequest.setCreatedObject(createdNode);" + 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 && domainModelAddCommand.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 && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tparent.insertChild(createdNode);" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tparent.getPersistedChildren().remove(createdNode);" + 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}";
106
  protected final String TEXT_87 = NL;
106
  protected final String TEXT_87 = NL;
107
  protected final String TEXT_88 = "\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(";
107
  protected final String TEXT_88 = NL;
108
  protected final String TEXT_89 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
108
  protected final String TEXT_89 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
109
  protected final String TEXT_90 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends ";
109
  protected final String TEXT_90 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
110
  protected final String TEXT_91 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
110
  protected final String TEXT_91 = " feature, ";
111
  protected final String TEXT_92 = " 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";
111
  protected final String TEXT_92 = " 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();";
112
  protected final String TEXT_93 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor(";
112
  protected final String TEXT_93 = NL;
113
  protected final String TEXT_94 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher((";
113
  protected final String TEXT_94 = "\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(";
114
  protected final String TEXT_95 = ")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 ";
114
  protected final String TEXT_95 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
115
  protected final String TEXT_96 = "/*<IUpdatableEditPart>*/ findAffectedParts(";
115
  protected final String TEXT_96 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends ";
116
  protected final String TEXT_97 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof ";
116
  protected final String TEXT_97 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
117
  protected final String TEXT_98 = ") {" + NL + "\t\t\t\t";
117
  protected final String TEXT_98 = " 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";
118
  protected final String TEXT_99 = " 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 ";
118
  protected final String TEXT_99 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor(";
119
  protected final String TEXT_100 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn ";
119
  protected final String TEXT_100 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher((";
120
  protected final String TEXT_101 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
120
  protected final String TEXT_101 = ")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 ";
121
  protected final String TEXT_102 = " 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 (";
121
  protected final String TEXT_102 = "/*<IUpdatableEditPart>*/ findAffectedParts(";
122
  protected final String TEXT_103 = ") 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}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
122
  protected final String TEXT_103 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof ";
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 DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends ";
124
  protected final String TEXT_105 = " 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 ";
125
  protected final String TEXT_106 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
125
  protected final String TEXT_106 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn ";
126
  protected final String TEXT_107 = " 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((";
126
  protected final String TEXT_107 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
127
  protected final String TEXT_108 = ") 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 + "}";
127
  protected final String TEXT_108 = " 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 (";
128
  protected final String TEXT_109 = NL;
128
  protected final String TEXT_109 = ") 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}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
129
  protected final String TEXT_110 = NL;
130
  protected final String TEXT_111 = "\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 ";
131
  protected final String TEXT_112 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
132
  protected final String TEXT_113 = " 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((";
133
  protected final String TEXT_114 = ") 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 + "}";
134
  protected final String TEXT_115 = NL;
129
135
130
  public String generate(Object argument)
136
  public String generate(Object argument)
131
  {
137
  {
Lines 195-224 Link Here
195
    stringBuffer.append(TEXT_15);
201
    stringBuffer.append(TEXT_15);
196
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
202
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
197
    stringBuffer.append(TEXT_16);
203
    stringBuffer.append(TEXT_16);
204
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
205
    stringBuffer.append(TEXT_17);
206
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
207
    stringBuffer.append(TEXT_18);
198
    
208
    
199
for(Iterator it = genDiagram.getTopLevelNodes().iterator(); it.hasNext(); ) {
209
for(Iterator it = genDiagram.getTopLevelNodes().iterator(); it.hasNext(); ) {
200
	GenTopLevelNode next = (GenTopLevelNode)it.next();
210
	GenTopLevelNode next = (GenTopLevelNode)it.next();
201
211
202
    stringBuffer.append(TEXT_17);
212
    stringBuffer.append(TEXT_19);
203
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
213
    stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
204
    stringBuffer.append(TEXT_18);
214
    stringBuffer.append(TEXT_20);
205
    stringBuffer.append(next.getDomainMetaClass().getName());
215
    stringBuffer.append(next.getDomainMetaClass().getName());
206
    stringBuffer.append(next.getVisualID());
216
    stringBuffer.append(next.getVisualID());
207
    stringBuffer.append(TEXT_19);
217
    stringBuffer.append(TEXT_21);
208
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
209
    stringBuffer.append(TEXT_20);
219
    stringBuffer.append(TEXT_22);
210
    
220
    
211
}
221
}
212
222
213
    stringBuffer.append(TEXT_21);
223
    stringBuffer.append(TEXT_23);
224
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
225
    stringBuffer.append(TEXT_24);
214
    }/*when there's palette*/
226
    }/*when there's palette*/
215
    stringBuffer.append(TEXT_22);
227
    stringBuffer.append(TEXT_25);
228
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
229
    stringBuffer.append(TEXT_26);
230
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
231
    stringBuffer.append(TEXT_27);
232
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
233
    stringBuffer.append(TEXT_28);
216
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
234
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
217
    stringBuffer.append(TEXT_23);
235
    stringBuffer.append(TEXT_29);
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
236
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
219
    stringBuffer.append(TEXT_24);
237
    stringBuffer.append(TEXT_30);
220
    /*@ include file="adapters/propertySource.javajetinc"*/
238
    /*@ include file="adapters/propertySource.javajetinc"*/
221
    stringBuffer.append(TEXT_25);
239
    stringBuffer.append(TEXT_31);
222
    
240
    
223
for(Iterator it = genDiagram.getTopLevelNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) {
241
for(Iterator it = genDiagram.getTopLevelNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) {
224
	GenTopLevelNode next = (GenTopLevelNode)it.next();
242
	GenTopLevelNode next = (GenTopLevelNode)it.next();
Lines 226-304 Link Here
226
	boolean isListLayout = false;
244
	boolean isListLayout = false;
227
	String resolvedSemanticElement = "parent.getElement()";
245
	String resolvedSemanticElement = "parent.getElement()";
228
246
229
    stringBuffer.append(TEXT_26);
247
    stringBuffer.append(TEXT_32);
230
    stringBuffer.append(TEXT_27);
248
    stringBuffer.append(TEXT_33);
231
    if (isStatic) {
249
    if (isStatic) {
232
    stringBuffer.append(TEXT_28);
250
    stringBuffer.append(TEXT_34);
233
    }
251
    }
234
    stringBuffer.append(TEXT_29);
252
    stringBuffer.append(TEXT_35);
235
    stringBuffer.append(next.getDomainMetaClass().getName());
253
    stringBuffer.append(next.getDomainMetaClass().getName());
236
    stringBuffer.append(next.getVisualID());
254
    stringBuffer.append(next.getVisualID());
237
    stringBuffer.append(TEXT_30);
255
    stringBuffer.append(TEXT_36);
238
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
256
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
239
    stringBuffer.append(TEXT_31);
257
    stringBuffer.append(TEXT_37);
240
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
258
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
241
    stringBuffer.append(TEXT_32);
259
    stringBuffer.append(TEXT_38);
242
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
260
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
243
    stringBuffer.append(TEXT_33);
261
    stringBuffer.append(TEXT_39);
244
    stringBuffer.append(next.getDomainMetaClass().getName());
262
    stringBuffer.append(next.getDomainMetaClass().getName());
245
    stringBuffer.append(next.getVisualID());
263
    stringBuffer.append(next.getVisualID());
246
    stringBuffer.append(TEXT_34);
264
    stringBuffer.append(TEXT_40);
247
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
265
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
248
    stringBuffer.append(TEXT_35);
266
    stringBuffer.append(TEXT_41);
249
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
267
    stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName()));
250
    stringBuffer.append(TEXT_36);
268
    stringBuffer.append(TEXT_42);
251
    if (!isListLayout) {
269
    if (!isListLayout) {
252
    stringBuffer.append(TEXT_37);
270
    stringBuffer.append(TEXT_43);
253
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
271
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
254
    stringBuffer.append(TEXT_38);
272
    stringBuffer.append(TEXT_44);
255
    }
273
    }
256
    stringBuffer.append(TEXT_39);
274
    stringBuffer.append(TEXT_45);
257
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
275
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
258
    stringBuffer.append(TEXT_40);
276
    stringBuffer.append(TEXT_46);
259
    
277
    
260
if (next.getDomainMetaClass().isMapEntry()) {
278
if (next.getDomainMetaClass().isMapEntry()) {
261
/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
279
/*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/
262
280
263
    stringBuffer.append(TEXT_41);
281
    stringBuffer.append(TEXT_47);
264
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
282
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
265
    stringBuffer.append(TEXT_42);
283
    stringBuffer.append(TEXT_48);
266
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
284
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
267
    stringBuffer.append(TEXT_43);
285
    stringBuffer.append(TEXT_49);
268
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
286
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName()));
269
    stringBuffer.append(TEXT_44);
287
    stringBuffer.append(TEXT_50);
270
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
288
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
271
    stringBuffer.append(TEXT_45);
289
    stringBuffer.append(TEXT_51);
272
    
290
    
273
} else {
291
} else {
274
292
275
    stringBuffer.append(TEXT_46);
293
    stringBuffer.append(TEXT_52);
276
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
294
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName()));
277
    stringBuffer.append(TEXT_47);
295
    stringBuffer.append(TEXT_53);
278
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
296
    stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName()));
279
    stringBuffer.append(TEXT_48);
297
    stringBuffer.append(TEXT_54);
280
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
298
    stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName());
281
    stringBuffer.append(TEXT_49);
299
    stringBuffer.append(TEXT_55);
282
    
300
    
283
}
301
}
284
302
285
    stringBuffer.append(TEXT_50);
303
    stringBuffer.append(TEXT_56);
286
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
304
    /*XXX: Class name DomainElementInitializer should be user-customizable*/
287
    stringBuffer.append(TEXT_51);
305
    stringBuffer.append(TEXT_57);
288
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
306
    stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer"));
289
    stringBuffer.append(TEXT_52);
307
    stringBuffer.append(TEXT_58);
290
    stringBuffer.append(next.getUniqueIdentifier());
308
    stringBuffer.append(next.getUniqueIdentifier());
291
    stringBuffer.append(TEXT_53);
309
    stringBuffer.append(TEXT_59);
292
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
310
    stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName()));
293
    stringBuffer.append(TEXT_54);
311
    stringBuffer.append(TEXT_60);
294
    
312
    
295
	if (!isListLayout) {
313
	if (!isListLayout) {
296
314
297
    stringBuffer.append(TEXT_55);
315
    stringBuffer.append(TEXT_61);
298
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
316
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
299
    stringBuffer.append(TEXT_56);
317
    stringBuffer.append(TEXT_62);
300
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
318
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
301
    stringBuffer.append(TEXT_57);
319
    stringBuffer.append(TEXT_63);
302
    
320
    
303
		int defaultWidth = 40;
321
		int defaultWidth = 40;
304
		int defaultHeight = 40;
322
		int defaultHeight = 40;
Lines 308-423 Link Here
308
			defaultHeight = defSizeAttrs.getHeight();
326
			defaultHeight = defSizeAttrs.getHeight();
309
		}
327
		}
310
328
311
    stringBuffer.append(TEXT_58);
329
    stringBuffer.append(TEXT_64);
312
    stringBuffer.append(defaultWidth);
330
    stringBuffer.append(defaultWidth);
313
    stringBuffer.append(TEXT_59);
331
    stringBuffer.append(TEXT_65);
314
    stringBuffer.append(defaultHeight);
332
    stringBuffer.append(defaultHeight);
315
    stringBuffer.append(TEXT_60);
333
    stringBuffer.append(TEXT_66);
316
    
334
    
317
	}
335
	}
318
336
319
    stringBuffer.append(TEXT_61);
337
    stringBuffer.append(TEXT_67);
320
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
321
    stringBuffer.append(TEXT_62);
339
    stringBuffer.append(TEXT_68);
322
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
323
    stringBuffer.append(TEXT_63);
341
    stringBuffer.append(TEXT_69);
324
    
342
    
325
	TypeModelFacet facet = next.getModelFacet();
343
	TypeModelFacet facet = next.getModelFacet();
326
	GenFeature childFeature = facet.getChildMetaFeature();
344
	GenFeature childFeature = facet.getChildMetaFeature();
327
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
345
	GenFeature containmentFeature = facet.getContainmentMetaFeature();
328
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
346
	if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
329
347
330
    stringBuffer.append(TEXT_64);
348
    stringBuffer.append(TEXT_70);
331
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
332
    stringBuffer.append(TEXT_65);
350
    stringBuffer.append(TEXT_71);
333
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
334
    stringBuffer.append(TEXT_66);
352
    stringBuffer.append(TEXT_72);
335
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
353
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
336
    stringBuffer.append(TEXT_67);
354
    stringBuffer.append(TEXT_73);
337
    stringBuffer.append(resolvedSemanticElement);
355
    stringBuffer.append(resolvedSemanticElement);
338
    stringBuffer.append(TEXT_68);
356
    stringBuffer.append(TEXT_74);
339
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
357
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
340
    stringBuffer.append(TEXT_69);
358
    stringBuffer.append(TEXT_75);
341
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
359
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
342
    stringBuffer.append(TEXT_70);
360
    stringBuffer.append(TEXT_76);
343
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
361
    stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
344
    stringBuffer.append(TEXT_71);
362
    stringBuffer.append(TEXT_77);
345
    stringBuffer.append(resolvedSemanticElement);
363
    stringBuffer.append(resolvedSemanticElement);
346
    stringBuffer.append(TEXT_72);
364
    stringBuffer.append(TEXT_78);
347
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
365
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
348
    stringBuffer.append(TEXT_73);
366
    stringBuffer.append(TEXT_79);
349
    stringBuffer.append(childFeature.getFeatureAccessorName());
367
    stringBuffer.append(childFeature.getFeatureAccessorName());
350
    stringBuffer.append(TEXT_74);
368
    stringBuffer.append(TEXT_80);
351
    
369
    
352
	} else {
370
	} else {
353
371
354
    stringBuffer.append(TEXT_75);
372
    stringBuffer.append(TEXT_81);
355
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
373
    stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand"));
356
    stringBuffer.append(TEXT_76);
374
    stringBuffer.append(TEXT_82);
357
    stringBuffer.append(resolvedSemanticElement);
375
    stringBuffer.append(resolvedSemanticElement);
358
    stringBuffer.append(TEXT_77);
376
    stringBuffer.append(TEXT_83);
359
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
377
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
360
    stringBuffer.append(TEXT_78);
378
    stringBuffer.append(TEXT_84);
361
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
379
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
362
    stringBuffer.append(TEXT_79);
380
    stringBuffer.append(TEXT_85);
363
    
381
    
364
	}
382
	}
365
383
366
    stringBuffer.append(TEXT_80);
384
    stringBuffer.append(TEXT_86);
367
    
385
    
368
}
386
}
369
387
370
    stringBuffer.append(TEXT_81);
371
    stringBuffer.append(TEXT_82);
372
    stringBuffer.append(TEXT_83);
373
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
374
    stringBuffer.append(TEXT_84);
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
376
    stringBuffer.append(TEXT_85);
377
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
378
    stringBuffer.append(TEXT_86);
379
    stringBuffer.append(TEXT_87);
388
    stringBuffer.append(TEXT_87);
380
    stringBuffer.append(TEXT_88);
389
    stringBuffer.append(TEXT_88);
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
382
    stringBuffer.append(TEXT_89);
390
    stringBuffer.append(TEXT_89);
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
391
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
384
    stringBuffer.append(TEXT_90);
392
    stringBuffer.append(TEXT_90);
385
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter"));
393
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
386
    stringBuffer.append(TEXT_91);
394
    stringBuffer.append(TEXT_91);
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
395
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
388
    stringBuffer.append(TEXT_92);
396
    stringBuffer.append(TEXT_92);
389
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
390
    stringBuffer.append(TEXT_93);
397
    stringBuffer.append(TEXT_93);
391
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
392
    stringBuffer.append(TEXT_94);
398
    stringBuffer.append(TEXT_94);
393
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
394
    stringBuffer.append(TEXT_95);
400
    stringBuffer.append(TEXT_95);
395
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
396
    stringBuffer.append(TEXT_96);
402
    stringBuffer.append(TEXT_96);
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
403
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter"));
398
    stringBuffer.append(TEXT_97);
404
    stringBuffer.append(TEXT_97);
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
405
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
400
    stringBuffer.append(TEXT_98);
406
    stringBuffer.append(TEXT_98);
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
407
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
402
    stringBuffer.append(TEXT_99);
408
    stringBuffer.append(TEXT_99);
403
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
409
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
404
    stringBuffer.append(TEXT_100);
410
    stringBuffer.append(TEXT_100);
405
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
406
    stringBuffer.append(TEXT_101);
412
    stringBuffer.append(TEXT_101);
407
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
413
    stringBuffer.append(importManager.getImportedName("java.util.Collection"));
408
    stringBuffer.append(TEXT_102);
414
    stringBuffer.append(TEXT_102);
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
410
    stringBuffer.append(TEXT_103);
416
    stringBuffer.append(TEXT_103);
417
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
411
    stringBuffer.append(TEXT_104);
418
    stringBuffer.append(TEXT_104);
419
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
412
    stringBuffer.append(TEXT_105);
420
    stringBuffer.append(TEXT_105);
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
421
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
414
    stringBuffer.append(TEXT_106);
422
    stringBuffer.append(TEXT_106);
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
423
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
416
    stringBuffer.append(TEXT_107);
424
    stringBuffer.append(TEXT_107);
417
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
425
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
418
    stringBuffer.append(TEXT_108);
426
    stringBuffer.append(TEXT_108);
419
    importManager.emitSortedImports();
427
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
420
    stringBuffer.append(TEXT_109);
428
    stringBuffer.append(TEXT_109);
429
    stringBuffer.append(TEXT_110);
430
    stringBuffer.append(TEXT_111);
431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
432
    stringBuffer.append(TEXT_112);
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
434
    stringBuffer.append(TEXT_113);
435
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
436
    stringBuffer.append(TEXT_114);
437
    importManager.emitSortedImports();
438
    stringBuffer.append(TEXT_115);
421
    return stringBuffer.toString();
439
    return stringBuffer.toString();
422
  }
440
  }
423
}
441
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java (-451 / +449 lines)
Lines 31-270 Link Here
31
  protected final String TEXT_11 = NL;
31
  protected final String TEXT_11 = NL;
32
  protected final String TEXT_12 = NL;
32
  protected final String TEXT_12 = NL;
33
  protected final String TEXT_13 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
33
  protected final String TEXT_13 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
34
  protected final String TEXT_14 = " manager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
34
  protected final String TEXT_14 = " manager;" + NL;
35
  protected final String TEXT_15 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + 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 = " getDiagramNode() {" + NL + "\t\treturn (";
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 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!";
37
  protected final String TEXT_17 = " getDiagramNode() {" + NL + "\t\treturn (";
38
  protected final String TEXT_18 = NL;
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!";
39
  protected final String TEXT_19 = "\t\tinstallEditPolicy(";
39
  protected final String TEXT_19 = NL;
40
  protected final String TEXT_20 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
40
  protected final String TEXT_20 = "\t\tinstallEditPolicy(";
41
  protected final String TEXT_21 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
41
  protected final String TEXT_21 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
42
  protected final String TEXT_22 = " 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 ";
42
  protected final String TEXT_22 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue(";
43
  protected final String TEXT_23 = " getDirectEditCommand(";
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 ";
44
  protected final String TEXT_24 = " 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 ";
44
  protected final String TEXT_24 = " getDirectEditCommand(";
45
  protected final String TEXT_25 = ".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 ";
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 ";
46
  protected final String TEXT_26 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
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 ";
47
  protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
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 ";
48
  protected final String TEXT_28 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
48
  protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch (";
49
  protected final String TEXT_29 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
49
  protected final String TEXT_29 = " e) {" + NL + "\t\t\t\t\t\t\treturn ";
50
  protected final String TEXT_30 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
50
  protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
51
  protected final String TEXT_31 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
51
  protected final String TEXT_31 = " editingDomain = ";
52
  protected final String TEXT_32 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
52
  protected final String TEXT_32 = ".getEditingDomain(";
53
  protected final String TEXT_33 = " element = ";
53
  protected final String TEXT_33 = ".getDiagram().getElement());";
54
  protected final String TEXT_34 = ";" + NL + "\t\t\t\t\t\t\tprivate ";
54
  protected final String TEXT_34 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn ";
55
  protected final String TEXT_35 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
55
  protected final String TEXT_35 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
56
  protected final String TEXT_36 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
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";
57
  protected final String TEXT_37 = " domainModelEditDomain = ";
57
  protected final String TEXT_37 = " createDomainModelCommand(";
58
  protected final String TEXT_38 = ".getEditingDomainFor(";
58
  protected final String TEXT_38 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t";
59
  protected final String TEXT_39 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
59
  protected final String TEXT_39 = " element = ";
60
  protected final String TEXT_40 = " feature = (";
60
  protected final String TEXT_40 = ";" + NL + "\t\t\t\t\t\t";
61
  protected final String TEXT_41 = ") ";
61
  protected final String TEXT_41 = " feature = (";
62
  protected final String TEXT_42 = ".eINSTANCE.get";
62
  protected final String TEXT_42 = ") ";
63
  protected final String TEXT_43 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
63
  protected final String TEXT_43 = ".eINSTANCE.get";
64
  protected final String TEXT_44 = ".parseValue(feature, parseResult[0]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
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 = ";
65
  protected final String TEXT_45 = ".INSTANCE;" + NL + "\t\t\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 ";
66
  protected final String TEXT_46 = NL + "\t\t\t\t\t\t\t\t";
66
  protected final String TEXT_46 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
67
  protected final String TEXT_47 = " result = new ";
67
  protected final String TEXT_47 = NL + "\t\t\t\t\t\t";
68
  protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\t\t\t";
68
  protected final String TEXT_48 = " result = new ";
69
  protected final String TEXT_49 = " values = new ";
69
  protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t";
70
  protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get";
70
  protected final String TEXT_50 = " values = new ";
71
  protected final String TEXT_51 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
71
  protected final String TEXT_51 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
72
  protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
72
  protected final String TEXT_52 = "());" + NL + "\t\t\t\t\t\tresult.append(";
73
  protected final String TEXT_53 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;";
73
  protected final String TEXT_53 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
74
  protected final String TEXT_54 = NL + "\t\t\t\t\t\t\t\treturn ";
74
  protected final String TEXT_54 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;";
75
  protected final String TEXT_55 = ".create(domainModelEditDomain, element, feature, valueToSet);";
75
  protected final String TEXT_55 = NL + "\t\t\t\t\t\treturn ";
76
  protected final String TEXT_56 = NL + "\t\t\t\t\t\t\t}";
76
  protected final String TEXT_56 = ".create(editingDomain, element, feature, valueToSet);";
77
  protected final String TEXT_57 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
77
  protected final String TEXT_57 = NL + "\t\t\t\t\t}";
78
  protected final String TEXT_58 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
78
  protected final String TEXT_58 = NL + "\t\t\t\t\t\tif (parseResult.length != ";
79
  protected final String TEXT_59 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new ";
79
  protected final String TEXT_59 = ") {" + NL + "\t\t\t\t\t\t\treturn ";
80
  protected final String TEXT_60 = "() {" + NL + "\t\t\t\t\t\t\tprivate ";
80
  protected final String TEXT_60 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t";
81
  protected final String TEXT_61 = " element = ";
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";
82
  protected final String TEXT_62 = ";" + NL + "\t\t\t\t\t\t\tprivate ";
82
  protected final String TEXT_62 = " createDomainModelCommand(";
83
  protected final String TEXT_63 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate ";
83
  protected final String TEXT_63 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t";
84
  protected final String TEXT_64 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t";
84
  protected final String TEXT_64 = " element = ";
85
  protected final String TEXT_65 = " domainModelEditDomain = ";
85
  protected final String TEXT_65 = ";" + NL + "\t\t\t\t\t\t";
86
  protected final String TEXT_66 = ".getEditingDomainFor(";
86
  protected final String TEXT_66 = " result = new ";
87
  protected final String TEXT_67 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t";
87
  protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;";
88
  protected final String TEXT_68 = " result = new ";
88
  protected final String TEXT_68 = NL + "\t\t\t\t\t\t";
89
  protected final String TEXT_69 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;";
89
  protected final String TEXT_69 = " ";
90
  protected final String TEXT_70 = NL + "\t\t\t\t\t\t\t\t";
90
  protected final String TEXT_70 = "feature = (";
91
  protected final String TEXT_71 = " ";
91
  protected final String TEXT_71 = ") ";
92
  protected final String TEXT_72 = "feature = (";
92
  protected final String TEXT_72 = ".eINSTANCE.get";
93
  protected final String TEXT_73 = ") ";
93
  protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = ";
94
  protected final String TEXT_74 = ".eINSTANCE.get";
94
  protected final String TEXT_74 = ".parseValue(feature, values[";
95
  protected final String TEXT_75 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = ";
95
  protected final String TEXT_75 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn ";
96
  protected final String TEXT_76 = ".parseValue(feature, parseResult[";
96
  protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}";
97
  protected final String TEXT_77 = "]);" + NL + "\t\t\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\t\t\treturn ";
97
  protected final String TEXT_77 = NL + "\t\t\t\t\t\t";
98
  protected final String TEXT_78 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}";
98
  protected final String TEXT_78 = " ";
99
  protected final String TEXT_79 = NL + "\t\t\t\t\t\t\t\t";
99
  protected final String TEXT_79 = "values = new ";
100
  protected final String TEXT_80 = " ";
100
  protected final String TEXT_80 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get";
101
  protected final String TEXT_81 = "values = new ";
101
  protected final String TEXT_81 = "());" + NL + "\t\t\t\t\t\tresult.append(";
102
  protected final String TEXT_82 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get";
102
  protected final String TEXT_82 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append(";
103
  protected final String TEXT_83 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append(";
103
  protected final String TEXT_83 = ".create(editingDomain, element, feature, valueToSet));";
104
  protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append(";
104
  protected final String TEXT_84 = NL + "\t\t\t\t\t\tresult.append(";
105
  protected final String TEXT_85 = ".create(domainModelEditDomain, element, feature, valueToSet));";
105
  protected final String TEXT_85 = ".create(editingDomain, element, feature, valueToSet));";
106
  protected final String TEXT_86 = NL + "\t\t\t\t\t\t\t\tresult.append(";
106
  protected final String TEXT_86 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
107
  protected final String TEXT_87 = ".create(domainModelEditDomain, element, feature, valueToSet));";
107
  protected final String TEXT_87 = NL + "\t\t\t\t});";
108
  protected final String TEXT_88 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}";
108
  protected final String TEXT_88 = NL;
109
  protected final String TEXT_89 = NL + "\t\t\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.undo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\t\t\tdomainModelCommand.execute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canUndo();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\t\t\treturn element != null && domainModelCommand != null && domainModelCommand.canExecute();" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t};" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});";
109
  protected final String TEXT_89 = "\t\tinstallEditPolicy(";
110
  protected final String TEXT_90 = NL;
110
  protected final String TEXT_90 = ".COMPONENT_ROLE, new ";
111
  protected final String TEXT_91 = "\t\tinstallEditPolicy(";
111
  protected final String TEXT_91 = "() {" + NL + "\t\t\tprotected ";
112
  protected final String TEXT_92 = ".COMPONENT_ROLE, new ";
112
  protected final String TEXT_92 = " createDeleteCommand(";
113
  protected final String TEXT_93 = "() {" + NL + "\t\t\tprotected ";
113
  protected final String TEXT_93 = " deleteRequest) {" + NL + "\t\t\t\t";
114
  protected final String TEXT_94 = " createDeleteCommand(";
114
  protected final String TEXT_94 = " editingDomain = ";
115
  protected final String TEXT_95 = " deleteRequest) {" + NL + "\t\t\t\treturn new ";
115
  protected final String TEXT_95 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t";
116
  protected final String TEXT_96 = "() {";
116
  protected final String TEXT_96 = " cc = new ";
117
  protected final String TEXT_97 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = getDomainModelRemoveCommand();" + NL + "\t\t\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand() {" + NL + "\t\t\t\t\t\t";
117
  protected final String TEXT_97 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(";
118
  protected final String TEXT_98 = " result = new ";
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(";
119
  protected final String TEXT_99 = "();";
119
  protected final String TEXT_99 = " editingDomain) {";
120
  protected final String TEXT_100 = NL + "\t\t\t\t\t\tresult.append(";
120
  protected final String TEXT_100 = NL + "\t\t\t\t";
121
  protected final String TEXT_101 = ".create(" + NL + "\t\t\t\t\t\t\t";
121
  protected final String TEXT_101 = " result = new ";
122
  protected final String TEXT_102 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
122
  protected final String TEXT_102 = "();";
123
  protected final String TEXT_103 = ".eINSTANCE.get";
123
  protected final String TEXT_103 = NL + "\t\t\t\tresult.append(";
124
  protected final String TEXT_104 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));";
124
  protected final String TEXT_104 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
125
  protected final String TEXT_105 = NL + "\t\t\t\t\t\tresult.append(";
125
  protected final String TEXT_105 = ".eINSTANCE.get";
126
  protected final String TEXT_106 = ".create(" + NL + "\t\t\t\t\t\t\t";
126
  protected final String TEXT_106 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
127
  protected final String TEXT_107 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
127
  protected final String TEXT_107 = NL + "\t\t\t\tresult.append(";
128
  protected final String TEXT_108 = ".eINSTANCE.get";
128
  protected final String TEXT_108 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
129
  protected final String TEXT_109 = "()," + NL + "\t\t\t\t\t\t\t";
129
  protected final String TEXT_109 = ".eINSTANCE.get";
130
  protected final String TEXT_110 = ".UNSET_VALUE));";
130
  protected final String TEXT_110 = "()," + NL + "\t\t\t\t\t";
131
  protected final String TEXT_111 = NL + "\t\t\t\t\t\tresult.append(";
131
  protected final String TEXT_111 = ".UNSET_VALUE));";
132
  protected final String TEXT_112 = ".create(" + NL + "\t\t\t\t\t\t\t";
132
  protected final String TEXT_112 = NL + "\t\t\t\tresult.append(";
133
  protected final String TEXT_113 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
133
  protected final String TEXT_113 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
134
  protected final String TEXT_114 = ".eINSTANCE.get";
134
  protected final String TEXT_114 = ".eINSTANCE.get";
135
  protected final String TEXT_115 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));";
135
  protected final String TEXT_115 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));";
136
  protected final String TEXT_116 = NL + "\t\t\t\t\t\tresult.append(";
136
  protected final String TEXT_116 = NL + "\t\t\t\tresult.append(";
137
  protected final String TEXT_117 = ".create(" + NL + "\t\t\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(), ";
138
  protected final String TEXT_118 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
138
  protected final String TEXT_118 = ".eINSTANCE.get";
139
  protected final String TEXT_119 = ".eINSTANCE.get";
139
  protected final String TEXT_119 = "()," + NL + "\t\t\t\t\t";
140
  protected final String TEXT_120 = "()," + NL + "\t\t\t\t\t\t\t";
140
  protected final String TEXT_120 = ".UNSET_VALUE));";
141
  protected final String TEXT_121 = ".UNSET_VALUE));";
141
  protected final String TEXT_121 = NL + "\t\t\t\treturn result;";
142
  protected final String TEXT_122 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}";
142
  protected final String TEXT_122 = NL + "\t\t\t\treturn ";
143
  protected final String TEXT_123 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = ";
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 = ".create(" + NL + "\t\t\t\t\t\t\t";
144
  protected final String TEXT_124 = ".eINSTANCE.get";
145
  protected final String TEXT_125 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
145
  protected final String TEXT_125 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());";
146
  protected final String TEXT_126 = ".eINSTANCE.get";
146
  protected final String TEXT_126 = NL + "\t\t\t\treturn ";
147
  protected final String TEXT_127 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement());";
147
  protected final String TEXT_127 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
148
  protected final String TEXT_128 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = ";
148
  protected final String TEXT_128 = ".eINSTANCE.get";
149
  protected final String TEXT_129 = ".create(" + NL + "\t\t\t\t\t\t\t";
149
  protected final String TEXT_129 = "()," + NL + "\t\t\t\t\t";
150
  protected final String TEXT_130 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), ";
150
  protected final String TEXT_130 = ".UNSET_VALUE);";
151
  protected final String TEXT_131 = ".eINSTANCE.get";
151
  protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t});";
152
  protected final String TEXT_132 = "()," + NL + "\t\t\t\t\t\t\t";
152
  protected final String TEXT_132 = NL + "\t}" + NL;
153
  protected final String TEXT_133 = ".UNSET_VALUE);";
153
  protected final String TEXT_133 = NL;
154
  protected final String TEXT_134 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command viewRemoveCommand = ";
154
  protected final String TEXT_134 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
155
  protected final String TEXT_135 = ".create(" + NL + "\t\t\t\t\t\t";
155
  protected final String TEXT_135 = " req) {" + NL + "\t\tif (";
156
  protected final String TEXT_136 = ".getEditingDomainFor(getDiagramNode().getDiagram()), " + NL + "\t\t\t\t\t\tgetDiagramNode());" + NL + "\t\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute() && viewRemoveCommand != null && viewRemoveCommand.canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.execute();" + NL + "\t\t\t\t\t\tviewRemoveCommand.execute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo() && viewRemoveCommand != null && viewRemoveCommand.canUndo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\tdomainModelRemoveCommand.undo();" + NL + "\t\t\t\t\t\tviewRemoveCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\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 ";
157
  protected final String TEXT_137 = NL + "\t}" + NL;
157
  protected final String TEXT_137 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
158
  protected final String TEXT_138 = NL;
158
  protected final String TEXT_138 = "(this, ";
159
  protected final String TEXT_139 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
159
  protected final String TEXT_139 = ".class, new ";
160
  protected final String TEXT_140 = " req) {" + NL + "\t\tif (";
160
  protected final String TEXT_140 = "() {" + NL + "\t\t\t\tpublic void relocate(";
161
  protected final String TEXT_141 = ".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 ";
161
  protected final String TEXT_141 = " celleditor) {" + NL + "\t\t\t\t\t";
162
  protected final String TEXT_142 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
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;
163
  protected final String TEXT_143 = "(this, ";
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}";
164
  protected final String TEXT_144 = ".class, new ";
164
  protected final String TEXT_144 = NL;
165
  protected final String TEXT_145 = "() {" + NL + "\t\t\t\tpublic void relocate(";
165
  protected final String TEXT_145 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
166
  protected final String TEXT_146 = " celleditor) {" + NL + "\t\t\t\t\t";
166
  protected final String TEXT_146 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
167
  protected final String TEXT_147 = " 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 + "" + NL + "" + 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}";
167
  protected final String TEXT_147 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
168
  protected final String TEXT_148 = NL;
168
  protected final String TEXT_148 = " element = ";
169
  protected final String TEXT_149 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \"";
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";
170
  protected final String TEXT_150 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \"";
170
  protected final String TEXT_150 = " element = ";
171
  protected final String TEXT_151 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
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(";
172
  protected final String TEXT_152 = " element = ";
172
  protected final String TEXT_152 = " element, String pattern) {";
173
  protected final String TEXT_153 = ";" + 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";
173
  protected final String TEXT_153 = NL + "\t\tif (element.get";
174
  protected final String TEXT_154 = " element = ";
174
  protected final String TEXT_154 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
175
  protected final String TEXT_155 = ";" + 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(";
175
  protected final String TEXT_155 = NL + "\t\treturn ";
176
  protected final String TEXT_156 = " element, String pattern) {";
176
  protected final String TEXT_156 = ".format(pattern, new Object[] {";
177
  protected final String TEXT_157 = NL + "\t\tif (element.get";
177
  protected final String TEXT_157 = NL + "\t\t\t";
178
  protected final String TEXT_158 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}";
178
  protected final String TEXT_158 = NL + "\t\t});";
179
  protected final String TEXT_159 = NL + "\t\treturn ";
179
  protected final String TEXT_159 = NL + "\t\treturn ";
180
  protected final String TEXT_160 = ".format(pattern, new Object[] {";
180
  protected final String TEXT_160 = ".format(pattern, new Object[] {";
181
  protected final String TEXT_161 = NL + "\t\t\t";
181
  protected final String TEXT_161 = NL + "\t\t";
182
  protected final String TEXT_162 = NL + "\t\t});";
182
  protected final String TEXT_162 = ",";
183
  protected final String TEXT_163 = NL + "\t\treturn ";
183
  protected final String TEXT_163 = NL + "\t\t});";
184
  protected final String TEXT_164 = ".format(pattern, new Object[] {";
184
  protected final String TEXT_164 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
185
  protected final String TEXT_165 = NL + "\t\t";
185
  protected final String TEXT_165 = NL + "\t}";
186
  protected final String TEXT_166 = ",";
186
  protected final String TEXT_166 = NL;
187
  protected final String TEXT_167 = NL + "\t\t});";
187
  protected final String TEXT_167 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
188
  protected final String TEXT_168 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;";
188
  protected final String TEXT_168 = " style =" + NL + "\t\t\t(";
189
  protected final String TEXT_169 = NL + "\t}";
189
  protected final String TEXT_169 = ") ";
190
  protected final String TEXT_170 = NL;
190
  protected final String TEXT_170 = ".getStyle(" + NL + "\t\t\t\t";
191
  protected final String TEXT_171 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t";
191
  protected final String TEXT_171 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
192
  protected final String TEXT_172 = " style =" + NL + "\t\t\t(";
192
  protected final String TEXT_172 = " 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 = ") ";
193
  protected final String TEXT_173 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
194
  protected final String TEXT_174 = ".getStyle(" + NL + "\t\t\t\t";
194
  protected final String TEXT_174 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
195
  protected final String TEXT_175 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
195
  protected final String TEXT_175 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
196
  protected final String TEXT_176 = " 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 = ";
196
  protected final String TEXT_176 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
197
  protected final String TEXT_177 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
197
  protected final String TEXT_177 = " 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 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
198
  protected final String TEXT_178 = "(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}" + NL + "\t}" + 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 ";
199
  protected final String TEXT_179 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
199
  protected final String TEXT_179 = " createdFont;";
200
  protected final String TEXT_180 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
200
  protected final String TEXT_180 = NL;
201
  protected final String TEXT_181 = " 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 ";
201
  protected final String TEXT_181 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
202
  protected final String TEXT_182 = "(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}" + NL + "\t}" + 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 ";
202
  protected final String TEXT_182 = " style = (";
203
  protected final String TEXT_183 = " createdFont;";
203
  protected final String TEXT_183 = ")  ";
204
  protected final String TEXT_184 = NL;
204
  protected final String TEXT_184 = ".getStyle(";
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 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
206
  protected final String TEXT_186 = " style = (";
206
  protected final String TEXT_186 = " 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";
207
  protected final String TEXT_187 = ")  ";
207
  protected final String TEXT_187 = " 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 ";
208
  protected final String TEXT_188 = ".getStyle(";
208
  protected final String TEXT_188 = "(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 ";
209
  protected final String TEXT_189 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
209
  protected final String TEXT_189 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
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 = " getLabelIcon() {" + 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) {";
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 = 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;
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 = NL;
213
  protected final String TEXT_193 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
213
  protected final String TEXT_193 = "\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 ";
214
  protected final String TEXT_194 = " getLabelIcon() {" + 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) {";
214
  protected final String TEXT_194 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
215
  protected final String TEXT_195 = 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;
215
  protected final String TEXT_195 = " 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((";
216
  protected final String TEXT_196 = NL;
216
  protected final String TEXT_196 = ") 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;
217
  protected final String TEXT_197 = "\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 ";
217
  protected final String TEXT_197 = NL;
218
  protected final String TEXT_198 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged(";
218
  protected final String TEXT_198 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
219
  protected final String TEXT_199 = " 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((";
219
  protected final String TEXT_199 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
220
  protected final String TEXT_200 = ") 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;
220
  protected final String TEXT_200 = " feature, ";
221
  protected final String TEXT_201 = NL;
221
  protected final String TEXT_201 = " 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();";
222
  protected final String TEXT_202 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
222
  protected final String TEXT_202 = NL;
223
  protected final String TEXT_203 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
223
  protected final String TEXT_203 = "\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(";
224
  protected final String TEXT_204 = " feature, ";
224
  protected final String TEXT_204 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
225
  protected final String TEXT_205 = " 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();";
225
  protected final String TEXT_205 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
226
  protected final String TEXT_206 = NL;
226
  protected final String TEXT_206 = NL;
227
  protected final String TEXT_207 = "\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(";
227
  protected final String TEXT_207 = "\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(";
228
  protected final String TEXT_208 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
228
  protected final String TEXT_208 = ".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};";
229
  protected final String TEXT_209 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);";
229
  protected final String TEXT_209 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
230
  protected final String TEXT_210 = NL;
230
  protected final String TEXT_210 = ".eINSTANCE.get";
231
  protected final String TEXT_211 = "\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(";
231
  protected final String TEXT_211 = "(), labelRefresher);";
232
  protected final String TEXT_212 = ".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};";
232
  protected final String TEXT_212 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
233
  protected final String TEXT_213 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
233
  protected final String TEXT_213 = ".eINSTANCE.get";
234
  protected final String TEXT_214 = ".eINSTANCE.get";
234
  protected final String TEXT_214 = "(), labelRefresher);";
235
  protected final String TEXT_215 = "(), labelRefresher);";
235
  protected final String TEXT_215 = NL;
236
  protected final String TEXT_216 = NL + "\t\t\tstructuralFeatures2Refresher.put(";
236
  protected final String TEXT_216 = "\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(";
237
  protected final String TEXT_217 = ".eINSTANCE.get";
237
  protected final String TEXT_217 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
238
  protected final String TEXT_218 = "(), labelRefresher);";
238
  protected final String TEXT_218 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
239
  protected final String TEXT_219 = NL;
239
  protected final String TEXT_219 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
240
  protected final String TEXT_220 = "\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(";
240
  protected final String TEXT_220 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
241
  protected final String TEXT_221 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
241
  protected final String TEXT_221 = NL;
242
  protected final String TEXT_222 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
242
  protected final String TEXT_222 = "\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(";
243
  protected final String TEXT_223 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
243
  protected final String TEXT_223 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL;
244
  protected final String TEXT_224 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
244
  protected final String TEXT_224 = NL;
245
  protected final String TEXT_225 = NL;
245
  protected final String TEXT_225 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
246
  protected final String TEXT_226 = "\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(";
246
  protected final String TEXT_226 = " createFigure() {" + NL + "\t\t";
247
  protected final String TEXT_227 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL;
247
  protected final String TEXT_227 = " label = createLabel();" + NL + "\t\tdefaultText = label.getText();" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
248
  protected final String TEXT_228 = NL;
248
  protected final String TEXT_228 = " createLabel() {";
249
  protected final String TEXT_229 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
249
  protected final String TEXT_229 = NL + "\t\treturn new ";
250
  protected final String TEXT_230 = " createFigure() {" + NL + "\t\t";
250
  protected final String TEXT_230 = "();";
251
  protected final String TEXT_231 = " label = createLabel();" + NL + "\t\tdefaultText = label.getText();" + NL + "\t\treturn label;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
251
  protected final String TEXT_231 = NL + "\t\treturn ";
252
  protected final String TEXT_232 = " createLabel() {";
252
  protected final String TEXT_232 = ";";
253
  protected final String TEXT_233 = NL + "\t\treturn new ";
253
  protected final String TEXT_233 = NL + "\t\treturn new ";
254
  protected final String TEXT_234 = "();";
254
  protected final String TEXT_234 = "();";
255
  protected final String TEXT_235 = NL + "\t\treturn ";
255
  protected final String TEXT_235 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
256
  protected final String TEXT_236 = ";";
256
  protected final String TEXT_236 = " getLabel() {" + NL + "\t\treturn (";
257
  protected final String TEXT_237 = NL + "\t\treturn new ";
257
  protected final String TEXT_237 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel(";
258
  protected final String TEXT_238 = "();";
258
  protected final String TEXT_238 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);" + NL + "\t\tdefaultText = figure.getText();" + NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
259
  protected final String TEXT_239 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
259
  protected final String TEXT_239 = NL;
260
  protected final String TEXT_240 = " getLabel() {" + NL + "\t\treturn (";
260
  protected final String TEXT_240 = NL;
261
  protected final String TEXT_241 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel(";
261
  protected final String TEXT_241 = 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}";
262
  protected final String TEXT_242 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);" + NL + "\t\tdefaultText = figure.getText();" + NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
262
  protected final String TEXT_242 = NL + "}";
263
  protected final String TEXT_243 = NL;
263
  protected final String TEXT_243 = NL;
264
  protected final String TEXT_244 = NL;
265
  protected final String TEXT_245 = 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}";
266
  protected final String TEXT_246 = NL + "}";
267
  protected final String TEXT_247 = NL;
268
264
269
  public String generate(Object argument)
265
  public String generate(Object argument)
270
  {
266
  {
Lines 277-282 Link Here
277
GenDiagram genDiagram = genChildNode.getDiagram();
273
GenDiagram genDiagram = genChildNode.getDiagram();
278
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
274
final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
279
LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
275
LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
276
final boolean isReadOnly = genChildNode.isLabelReadOnly();
280
277
281
    stringBuffer.append(TEXT_1);
278
    stringBuffer.append(TEXT_1);
282
    
279
    
Lines 312-523 Link Here
312
    }
309
    }
313
    stringBuffer.append(TEXT_11);
310
    stringBuffer.append(TEXT_11);
314
    stringBuffer.append(TEXT_12);
311
    stringBuffer.append(TEXT_12);
312
    
313
if (!isReadOnly) {
314
315
    stringBuffer.append(TEXT_13);
315
    stringBuffer.append(TEXT_13);
316
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
316
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
317
    stringBuffer.append(TEXT_14);
317
    stringBuffer.append(TEXT_14);
318
    stringBuffer.append(genChildNode.getEditPartClassName());
318
    
319
}
320
319
    stringBuffer.append(TEXT_15);
321
    stringBuffer.append(TEXT_15);
320
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
322
    stringBuffer.append(genChildNode.getEditPartClassName());
321
    stringBuffer.append(TEXT_16);
323
    stringBuffer.append(TEXT_16);
322
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
324
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
323
    stringBuffer.append(TEXT_17);
325
    stringBuffer.append(TEXT_17);
326
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
327
    stringBuffer.append(TEXT_18);
324
    
328
    
325
	String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
329
	String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
326
	final String primaryView = "getDiagramNode()";
330
	final String primaryView = "getDiagramNode()";
327
331
328
    
332
    
329
{
333
if (!isReadOnly) {
330
boolean isReadOnly = genChildNode.isLabelReadOnly();
331
334
332
    stringBuffer.append(TEXT_18);
333
    stringBuffer.append(TEXT_19);
335
    stringBuffer.append(TEXT_19);
334
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
335
    stringBuffer.append(TEXT_20);
336
    stringBuffer.append(TEXT_20);
336
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
337
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
337
    stringBuffer.append(TEXT_21);
338
    stringBuffer.append(TEXT_21);
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
339
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy"));
339
    stringBuffer.append(TEXT_22);
340
    stringBuffer.append(TEXT_22);
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
341
    stringBuffer.append(TEXT_23);
342
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
341
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
342
    stringBuffer.append(TEXT_23);
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
343
    stringBuffer.append(TEXT_24);
344
    stringBuffer.append(TEXT_24);
344
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
345
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
345
    stringBuffer.append(TEXT_25);
346
    stringBuffer.append(TEXT_25);
346
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
347
    stringBuffer.append(TEXT_26);
348
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
348
    stringBuffer.append(TEXT_26);
349
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
349
    stringBuffer.append(TEXT_27);
350
    stringBuffer.append(TEXT_27);
350
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
351
    stringBuffer.append(TEXT_28);
352
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
352
    stringBuffer.append(TEXT_28);
353
    stringBuffer.append(importManager.getImportedName("java.text.ParseException"));
353
    stringBuffer.append(TEXT_29);
354
    stringBuffer.append(TEXT_29);
354
    
355
if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) {
356
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
357
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
358
359
    stringBuffer.append(TEXT_30);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
355
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
356
    stringBuffer.append(TEXT_30);
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
361
    stringBuffer.append(TEXT_31);
358
    stringBuffer.append(TEXT_31);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
363
    stringBuffer.append(TEXT_32);
360
    stringBuffer.append(TEXT_32);
364
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
361
    stringBuffer.append(primaryView);
365
    stringBuffer.append(TEXT_33);
362
    stringBuffer.append(TEXT_33);
366
    stringBuffer.append(resolvedSemanticElement);
363
    
364
if (labelModelFacet instanceof FeatureLabelModelFacet) {
365
	GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
366
	EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature();
367
367
    stringBuffer.append(TEXT_34);
368
    stringBuffer.append(TEXT_34);
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
369
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
369
    stringBuffer.append(TEXT_35);
370
    stringBuffer.append(TEXT_35);
370
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
371
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
371
    stringBuffer.append(TEXT_36);
372
    stringBuffer.append(TEXT_36);
372
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
373
    stringBuffer.append(TEXT_37);
374
    stringBuffer.append(TEXT_37);
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
375
    stringBuffer.append(TEXT_38);
376
    stringBuffer.append(TEXT_38);
376
    stringBuffer.append(primaryView);
377
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
377
    stringBuffer.append(TEXT_39);
378
    stringBuffer.append(TEXT_39);
378
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
379
    stringBuffer.append(resolvedSemanticElement);
379
    stringBuffer.append(TEXT_40);
380
    stringBuffer.append(TEXT_40);
380
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
381
    stringBuffer.append(TEXT_41);
382
    stringBuffer.append(TEXT_41);
382
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
383
    stringBuffer.append(TEXT_42);
384
    stringBuffer.append(TEXT_42);
384
    stringBuffer.append(featureToSet.getFeatureAccessorName());
385
    stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
385
    stringBuffer.append(TEXT_43);
386
    stringBuffer.append(TEXT_43);
386
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
387
    stringBuffer.append(featureToSet.getFeatureAccessorName());
387
    stringBuffer.append(TEXT_44);
388
    stringBuffer.append(TEXT_44);
388
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
389
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
389
    stringBuffer.append(TEXT_45);
390
    stringBuffer.append(TEXT_45);
391
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
392
    stringBuffer.append(TEXT_46);
390
    
393
    
391
	if (ecoreFeature.isMany()) {
394
	if (ecoreFeature.isMany()) {
392
395
393
    stringBuffer.append(TEXT_46);
394
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
395
    stringBuffer.append(TEXT_47);
396
    stringBuffer.append(TEXT_47);
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
397
    stringBuffer.append(TEXT_48);
398
    stringBuffer.append(TEXT_48);
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
399
    stringBuffer.append(TEXT_49);
400
    stringBuffer.append(TEXT_49);
400
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
401
    stringBuffer.append(TEXT_50);
402
    stringBuffer.append(TEXT_50);
402
    stringBuffer.append(featureToSet.getAccessorName());
403
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
403
    stringBuffer.append(TEXT_51);
404
    stringBuffer.append(TEXT_51);
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
405
    stringBuffer.append(featureToSet.getAccessorName());
405
    stringBuffer.append(TEXT_52);
406
    stringBuffer.append(TEXT_52);
406
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
407
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
407
    stringBuffer.append(TEXT_53);
408
    stringBuffer.append(TEXT_53);
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
410
    stringBuffer.append(TEXT_54);
408
    
411
    
409
	} else {
412
	} else {
410
413
411
    stringBuffer.append(TEXT_54);
412
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
413
    stringBuffer.append(TEXT_55);
414
    stringBuffer.append(TEXT_55);
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
416
    stringBuffer.append(TEXT_56);
414
    
417
    
415
	}
418
	}
416
419
417
    stringBuffer.append(TEXT_56);
420
    stringBuffer.append(TEXT_57);
418
    
421
    
419
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
422
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
420
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
423
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
421
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
424
	List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures();
422
425
423
    stringBuffer.append(TEXT_57);
424
    stringBuffer.append(metaFeatures.size());
425
    stringBuffer.append(TEXT_58);
426
    stringBuffer.append(TEXT_58);
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
427
    stringBuffer.append(metaFeatures.size());
427
    stringBuffer.append(TEXT_59);
428
    stringBuffer.append(TEXT_59);
428
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
429
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand"));
429
    stringBuffer.append(TEXT_60);
430
    stringBuffer.append(TEXT_60);
430
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
431
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
431
    stringBuffer.append(TEXT_61);
432
    stringBuffer.append(TEXT_61);
432
    stringBuffer.append(resolvedSemanticElement);
433
    stringBuffer.append(TEXT_62);
434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
434
    stringBuffer.append(TEXT_62);
435
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
435
    stringBuffer.append(TEXT_63);
436
    stringBuffer.append(TEXT_63);
436
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
437
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
437
    stringBuffer.append(TEXT_64);
438
    stringBuffer.append(TEXT_64);
438
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain"));
439
    stringBuffer.append(resolvedSemanticElement);
439
    stringBuffer.append(TEXT_65);
440
    stringBuffer.append(TEXT_65);
440
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
441
    stringBuffer.append(TEXT_66);
442
    stringBuffer.append(primaryView);
443
    stringBuffer.append(TEXT_67);
444
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
441
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
445
    stringBuffer.append(TEXT_68);
442
    stringBuffer.append(TEXT_66);
446
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
443
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
447
    stringBuffer.append(TEXT_69);
444
    stringBuffer.append(TEXT_67);
448
    
445
    
449
	boolean haveDeclaredValues = false;
446
	boolean haveDeclaredValues = false;
450
	for(int i = 0; i < metaFeatures.size(); i++) {
447
	for(int i = 0; i < metaFeatures.size(); i++) {
451
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
448
		GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i);
452
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
449
		EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature();
453
450
454
    stringBuffer.append(TEXT_70);
451
    stringBuffer.append(TEXT_68);
455
    if (i == 0) {
452
    if (i == 0) {
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
457
    stringBuffer.append(TEXT_71);
454
    stringBuffer.append(TEXT_69);
458
    }
455
    }
459
    stringBuffer.append(TEXT_72);
456
    stringBuffer.append(TEXT_70);
460
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute"));
461
    stringBuffer.append(TEXT_73);
458
    stringBuffer.append(TEXT_71);
462
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
459
    stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName()));
463
    stringBuffer.append(TEXT_74);
460
    stringBuffer.append(TEXT_72);
464
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
461
    stringBuffer.append(nextFeatureToSet.getFeatureAccessorName());
465
    stringBuffer.append(TEXT_75);
462
    stringBuffer.append(TEXT_73);
466
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
463
    stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName()));
467
    stringBuffer.append(TEXT_76);
464
    stringBuffer.append(TEXT_74);
468
    stringBuffer.append(i);
465
    stringBuffer.append(i);
469
    stringBuffer.append(TEXT_77);
466
    stringBuffer.append(TEXT_75);
470
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
467
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand"));
471
    stringBuffer.append(TEXT_78);
468
    stringBuffer.append(TEXT_76);
472
    
469
    
473
		if (nextEcoreFeature.isMany()) {
470
		if (nextEcoreFeature.isMany()) {
474
471
475
    stringBuffer.append(TEXT_79);
472
    stringBuffer.append(TEXT_77);
476
    if (!haveDeclaredValues) { haveDeclaredValues = true;
473
    if (!haveDeclaredValues) { haveDeclaredValues = true;
477
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
474
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList"));
478
    stringBuffer.append(TEXT_80);
475
    stringBuffer.append(TEXT_78);
479
    }
476
    }
480
    stringBuffer.append(TEXT_81);
477
    stringBuffer.append(TEXT_79);
481
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
478
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList"));
482
    stringBuffer.append(TEXT_82);
479
    stringBuffer.append(TEXT_80);
483
    stringBuffer.append(nextFeatureToSet.getAccessorName());
480
    stringBuffer.append(nextFeatureToSet.getAccessorName());
484
    stringBuffer.append(TEXT_83);
481
    stringBuffer.append(TEXT_81);
485
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
482
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
486
    stringBuffer.append(TEXT_84);
483
    stringBuffer.append(TEXT_82);
487
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
484
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand"));
488
    stringBuffer.append(TEXT_85);
485
    stringBuffer.append(TEXT_83);
489
    
486
    
490
		} else {
487
		} else {
491
488
492
    stringBuffer.append(TEXT_86);
489
    stringBuffer.append(TEXT_84);
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
494
    stringBuffer.append(TEXT_87);
491
    stringBuffer.append(TEXT_85);
495
    
492
    
496
		}
493
		}
497
494
498
    
495
    
499
	}
496
	}
500
497
501
    stringBuffer.append(TEXT_88);
498
    stringBuffer.append(TEXT_86);
502
    
499
    
503
}
500
}
504
501
505
    stringBuffer.append(TEXT_89);
502
    stringBuffer.append(TEXT_87);
506
    
503
    
507
}
504
}
508
505
506
    stringBuffer.append(TEXT_88);
507
    stringBuffer.append(TEXT_89);
508
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
509
    stringBuffer.append(TEXT_90);
509
    stringBuffer.append(TEXT_90);
510
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
510
    stringBuffer.append(TEXT_91);
511
    stringBuffer.append(TEXT_91);
511
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
512
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
512
    stringBuffer.append(TEXT_92);
513
    stringBuffer.append(TEXT_92);
513
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy"));
514
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
514
    stringBuffer.append(TEXT_93);
515
    stringBuffer.append(TEXT_93);
515
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
516
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
516
    stringBuffer.append(TEXT_94);
517
    stringBuffer.append(TEXT_94);
517
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest"));
518
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
518
    stringBuffer.append(TEXT_95);
519
    stringBuffer.append(TEXT_95);
519
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
520
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
520
    stringBuffer.append(TEXT_96);
521
    stringBuffer.append(TEXT_96);
522
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
523
    stringBuffer.append(TEXT_97);
524
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
525
    stringBuffer.append(TEXT_98);
526
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
527
    stringBuffer.append(TEXT_99);
521
    
528
    
522
{
529
{
523
TypeModelFacet facet = genNode.getModelFacet();
530
TypeModelFacet facet = genNode.getModelFacet();
Lines 525-571 Link Here
525
GenFeature containmentFeature = facet.getContainmentMetaFeature();
532
GenFeature containmentFeature = facet.getContainmentMetaFeature();
526
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
533
if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) {
527
534
528
    stringBuffer.append(TEXT_97);
535
    stringBuffer.append(TEXT_100);
529
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
536
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
530
    stringBuffer.append(TEXT_98);
537
    stringBuffer.append(TEXT_101);
531
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
538
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand"));
532
    stringBuffer.append(TEXT_99);
539
    stringBuffer.append(TEXT_102);
533
    
540
    
534
	if (containmentFeature.getEcoreFeature().isMany()) {
541
	if (containmentFeature.getEcoreFeature().isMany()) {
535
542
536
    stringBuffer.append(TEXT_100);
543
    stringBuffer.append(TEXT_103);
537
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
544
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
538
    stringBuffer.append(TEXT_101);
545
    stringBuffer.append(TEXT_104);
539
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
540
    stringBuffer.append(TEXT_102);
541
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
546
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
542
    stringBuffer.append(TEXT_103);
547
    stringBuffer.append(TEXT_105);
543
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
548
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
544
    stringBuffer.append(TEXT_104);
549
    stringBuffer.append(TEXT_106);
545
    
550
    
546
	} else {
551
	} else {
547
552
548
    stringBuffer.append(TEXT_105);
549
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
550
    stringBuffer.append(TEXT_106);
551
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
552
    stringBuffer.append(TEXT_107);
553
    stringBuffer.append(TEXT_107);
553
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
554
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
554
    stringBuffer.append(TEXT_108);
555
    stringBuffer.append(TEXT_108);
555
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
556
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
556
    stringBuffer.append(TEXT_109);
557
    stringBuffer.append(TEXT_109);
557
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
558
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
558
    stringBuffer.append(TEXT_110);
559
    stringBuffer.append(TEXT_110);
560
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
561
    stringBuffer.append(TEXT_111);
559
    
562
    
560
	}
563
	}
561
564
562
    
565
    
563
	if (childFeature.getEcoreFeature().isMany()) {
566
	if (childFeature.getEcoreFeature().isMany()) {
564
567
565
    stringBuffer.append(TEXT_111);
566
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
567
    stringBuffer.append(TEXT_112);
568
    stringBuffer.append(TEXT_112);
568
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
569
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
569
    stringBuffer.append(TEXT_113);
570
    stringBuffer.append(TEXT_113);
570
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
571
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
571
    stringBuffer.append(TEXT_114);
572
    stringBuffer.append(TEXT_114);
Lines 577-653 Link Here
577
    stringBuffer.append(TEXT_116);
578
    stringBuffer.append(TEXT_116);
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
579
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
579
    stringBuffer.append(TEXT_117);
580
    stringBuffer.append(TEXT_117);
580
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
581
    stringBuffer.append(TEXT_118);
582
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
581
    stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName()));
583
    stringBuffer.append(TEXT_119);
582
    stringBuffer.append(TEXT_118);
584
    stringBuffer.append(childFeature.getFeatureAccessorName());
583
    stringBuffer.append(childFeature.getFeatureAccessorName());
585
    stringBuffer.append(TEXT_120);
584
    stringBuffer.append(TEXT_119);
586
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
585
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
587
    stringBuffer.append(TEXT_121);
586
    stringBuffer.append(TEXT_120);
588
    
587
    
589
	}
588
	}
590
589
591
    stringBuffer.append(TEXT_122);
590
    stringBuffer.append(TEXT_121);
592
    
591
    
593
} else {
592
} else {
594
	if (containmentFeature.getEcoreFeature().isMany()) {
593
	if (containmentFeature.getEcoreFeature().isMany()) {
595
594
596
    stringBuffer.append(TEXT_123);
595
    stringBuffer.append(TEXT_122);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
596
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
598
    stringBuffer.append(TEXT_124);
597
    stringBuffer.append(TEXT_123);
599
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
600
    stringBuffer.append(TEXT_125);
601
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
598
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
602
    stringBuffer.append(TEXT_126);
599
    stringBuffer.append(TEXT_124);
603
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
600
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
604
    stringBuffer.append(TEXT_127);
601
    stringBuffer.append(TEXT_125);
605
    
602
    
606
	} else {
603
	} else {
607
604
608
    stringBuffer.append(TEXT_128);
605
    stringBuffer.append(TEXT_126);
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
606
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
610
    stringBuffer.append(TEXT_129);
607
    stringBuffer.append(TEXT_127);
611
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
612
    stringBuffer.append(TEXT_130);
613
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
608
    stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName()));
614
    stringBuffer.append(TEXT_131);
609
    stringBuffer.append(TEXT_128);
615
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
610
    stringBuffer.append(containmentFeature.getFeatureAccessorName());
616
    stringBuffer.append(TEXT_132);
611
    stringBuffer.append(TEXT_129);
617
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
612
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand"));
618
    stringBuffer.append(TEXT_133);
613
    stringBuffer.append(TEXT_130);
619
    
614
    
620
	}
615
	}
621
}
616
}
622
617
623
    stringBuffer.append(TEXT_134);
618
    stringBuffer.append(TEXT_131);
624
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand"));
625
    stringBuffer.append(TEXT_135);
626
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"));
627
    stringBuffer.append(TEXT_136);
628
    
619
    
629
}	/*restrict local vars used in component edit policy*/
620
}	/*restrict local vars used in component edit policy*/
630
621
631
    stringBuffer.append(TEXT_137);
622
    stringBuffer.append(TEXT_132);
632
    stringBuffer.append(TEXT_138);
623
    
633
    stringBuffer.append(TEXT_139);
624
if (!isReadOnly) {
625
626
    stringBuffer.append(TEXT_133);
627
    stringBuffer.append(TEXT_134);
634
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
628
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
635
    stringBuffer.append(TEXT_140);
629
    stringBuffer.append(TEXT_135);
636
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
630
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
637
    stringBuffer.append(TEXT_141);
631
    stringBuffer.append(TEXT_136);
638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
632
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
639
    stringBuffer.append(TEXT_142);
633
    stringBuffer.append(TEXT_137);
640
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
634
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
641
    stringBuffer.append(TEXT_143);
635
    stringBuffer.append(TEXT_138);
642
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
636
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
643
    stringBuffer.append(TEXT_144);
637
    stringBuffer.append(TEXT_139);
644
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator"));
645
    stringBuffer.append(TEXT_145);
639
    stringBuffer.append(TEXT_140);
646
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
640
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor"));
647
    stringBuffer.append(TEXT_146);
641
    stringBuffer.append(TEXT_141);
648
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
642
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
649
    stringBuffer.append(TEXT_147);
643
    stringBuffer.append(TEXT_142);
650
    stringBuffer.append(TEXT_148);
644
    
645
}
646
647
    stringBuffer.append(TEXT_143);
648
    stringBuffer.append(TEXT_144);
651
    
649
    
652
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
650
/*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */
653
HashMap primitiveTypeToWrapperClassName = new HashMap();
651
HashMap primitiveTypeToWrapperClassName = new HashMap();
Lines 691-742 Link Here
691
	}
689
	}
692
}
690
}
693
691
694
    stringBuffer.append(TEXT_149);
692
    stringBuffer.append(TEXT_145);
695
    stringBuffer.append(viewPattern);
693
    stringBuffer.append(viewPattern);
696
    stringBuffer.append(TEXT_150);
694
    stringBuffer.append(TEXT_146);
697
    stringBuffer.append(editPattern);
695
    stringBuffer.append(editPattern);
698
    stringBuffer.append(TEXT_151);
696
    stringBuffer.append(TEXT_147);
699
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
697
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
700
    stringBuffer.append(TEXT_152);
698
    stringBuffer.append(TEXT_148);
701
    stringBuffer.append(resolvedSemanticElement);
699
    stringBuffer.append(resolvedSemanticElement);
702
    stringBuffer.append(TEXT_153);
700
    stringBuffer.append(TEXT_149);
703
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
701
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
704
    stringBuffer.append(TEXT_154);
702
    stringBuffer.append(TEXT_150);
705
    stringBuffer.append(resolvedSemanticElement);
703
    stringBuffer.append(resolvedSemanticElement);
706
    stringBuffer.append(TEXT_155);
704
    stringBuffer.append(TEXT_151);
707
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
705
    stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
708
    stringBuffer.append(TEXT_156);
706
    stringBuffer.append(TEXT_152);
709
    
707
    
710
if (labelModelFacet instanceof FeatureLabelModelFacet) {
708
if (labelModelFacet instanceof FeatureLabelModelFacet) {
711
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
709
	FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
712
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
710
	GenFeature feature = featureLabelModelFacet.getMetaFeature();
713
	if (!feature.isPrimitiveType()) {
711
	if (!feature.isPrimitiveType()) {
714
712
715
    stringBuffer.append(TEXT_157);
713
    stringBuffer.append(TEXT_153);
716
    stringBuffer.append(feature.getCapName());
714
    stringBuffer.append(feature.getCapName());
717
    stringBuffer.append(TEXT_158);
715
    stringBuffer.append(TEXT_154);
718
    
716
    
719
	}
717
	}
720
718
721
    stringBuffer.append(TEXT_159);
719
    stringBuffer.append(TEXT_155);
722
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
720
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
723
    stringBuffer.append(TEXT_160);
721
    stringBuffer.append(TEXT_156);
724
    
722
    
725
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
723
		String value = "element.get" + feature.getCapName() + "()";	/*XXX: getTypedKey is not a part of public API!*/
726
		if (feature.isPrimitiveType()) {
724
		if (feature.isPrimitiveType()) {
727
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
725
			value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
728
		}
726
		}
729
727
730
    stringBuffer.append(TEXT_161);
728
    stringBuffer.append(TEXT_157);
731
    stringBuffer.append(value);
729
    stringBuffer.append(value);
732
    stringBuffer.append(TEXT_162);
730
    stringBuffer.append(TEXT_158);
733
    
731
    
734
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
732
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
735
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
733
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
736
734
737
    stringBuffer.append(TEXT_163);
735
    stringBuffer.append(TEXT_159);
738
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
736
    stringBuffer.append(importManager.getImportedName("java.text.MessageFormat"));
739
    stringBuffer.append(TEXT_164);
737
    stringBuffer.append(TEXT_160);
740
    
738
    
741
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
739
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
742
		GenFeature next = (GenFeature) it.next();
740
		GenFeature next = (GenFeature) it.next();
Lines 745-890 Link Here
745
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
743
			value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")";
746
		}
744
		}
747
745
748
    stringBuffer.append(TEXT_165);
746
    stringBuffer.append(TEXT_161);
749
    stringBuffer.append(value);
747
    stringBuffer.append(value);
750
    if (it.hasNext()) {
748
    if (it.hasNext()) {
751
    stringBuffer.append(TEXT_166);
749
    stringBuffer.append(TEXT_162);
752
    }
750
    }
753
    
751
    
754
	}
752
	}
755
753
756
    stringBuffer.append(TEXT_167);
754
    stringBuffer.append(TEXT_163);
757
    
755
    
758
} else {
756
} else {
759
757
760
    stringBuffer.append(TEXT_168);
758
    stringBuffer.append(TEXT_164);
761
    
759
    
762
}
760
}
763
761
762
    stringBuffer.append(TEXT_165);
763
    stringBuffer.append(TEXT_166);
764
    stringBuffer.append(TEXT_167);
765
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
766
    stringBuffer.append(TEXT_168);
767
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
764
    stringBuffer.append(TEXT_169);
768
    stringBuffer.append(TEXT_169);
769
    stringBuffer.append(primaryView);
765
    stringBuffer.append(TEXT_170);
770
    stringBuffer.append(TEXT_170);
771
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
766
    stringBuffer.append(TEXT_171);
772
    stringBuffer.append(TEXT_171);
767
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
773
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
768
    stringBuffer.append(TEXT_172);
774
    stringBuffer.append(TEXT_172);
769
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
775
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
770
    stringBuffer.append(TEXT_173);
776
    stringBuffer.append(TEXT_173);
771
    stringBuffer.append(primaryView);
777
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
772
    stringBuffer.append(TEXT_174);
778
    stringBuffer.append(TEXT_174);
773
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
779
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
774
    stringBuffer.append(TEXT_175);
780
    stringBuffer.append(TEXT_175);
775
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
781
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
776
    stringBuffer.append(TEXT_176);
782
    stringBuffer.append(TEXT_176);
777
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
783
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
778
    stringBuffer.append(TEXT_177);
784
    stringBuffer.append(TEXT_177);
779
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
785
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
780
    stringBuffer.append(TEXT_178);
786
    stringBuffer.append(TEXT_178);
781
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
782
    stringBuffer.append(TEXT_179);
783
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
787
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
788
    stringBuffer.append(TEXT_179);
784
    stringBuffer.append(TEXT_180);
789
    stringBuffer.append(TEXT_180);
785
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
786
    stringBuffer.append(TEXT_181);
790
    stringBuffer.append(TEXT_181);
787
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
791
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
788
    stringBuffer.append(TEXT_182);
792
    stringBuffer.append(TEXT_182);
789
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
790
    stringBuffer.append(TEXT_183);
794
    stringBuffer.append(TEXT_183);
795
    stringBuffer.append(primaryView);
791
    stringBuffer.append(TEXT_184);
796
    stringBuffer.append(TEXT_184);
797
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
792
    stringBuffer.append(TEXT_185);
798
    stringBuffer.append(TEXT_185);
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
799
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
794
    stringBuffer.append(TEXT_186);
800
    stringBuffer.append(TEXT_186);
795
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
801
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
796
    stringBuffer.append(TEXT_187);
802
    stringBuffer.append(TEXT_187);
797
    stringBuffer.append(primaryView);
803
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
798
    stringBuffer.append(TEXT_188);
804
    stringBuffer.append(TEXT_188);
799
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
800
    stringBuffer.append(TEXT_189);
801
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
805
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
806
    stringBuffer.append(TEXT_189);
807
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
802
    stringBuffer.append(TEXT_190);
808
    stringBuffer.append(TEXT_190);
803
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
809
    /*@ include file="adapters/propertySource.javajetinc"*/
804
    stringBuffer.append(TEXT_191);
810
    stringBuffer.append(TEXT_191);
805
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
806
    stringBuffer.append(TEXT_192);
811
    stringBuffer.append(TEXT_192);
807
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
808
    stringBuffer.append(TEXT_193);
812
    stringBuffer.append(TEXT_193);
809
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
813
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
810
    stringBuffer.append(TEXT_194);
814
    stringBuffer.append(TEXT_194);
811
    /*@ include file="adapters/propertySource.javajetinc"*/
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
812
    stringBuffer.append(TEXT_195);
816
    stringBuffer.append(TEXT_195);
817
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
813
    stringBuffer.append(TEXT_196);
818
    stringBuffer.append(TEXT_196);
814
    stringBuffer.append(TEXT_197);
819
    stringBuffer.append(TEXT_197);
815
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl"));
816
    stringBuffer.append(TEXT_198);
820
    stringBuffer.append(TEXT_198);
817
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
821
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
818
    stringBuffer.append(TEXT_199);
822
    stringBuffer.append(TEXT_199);
819
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
823
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
820
    stringBuffer.append(TEXT_200);
824
    stringBuffer.append(TEXT_200);
825
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
821
    stringBuffer.append(TEXT_201);
826
    stringBuffer.append(TEXT_201);
822
    stringBuffer.append(TEXT_202);
827
    stringBuffer.append(TEXT_202);
823
    stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
824
    stringBuffer.append(TEXT_203);
828
    stringBuffer.append(TEXT_203);
825
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
829
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
826
    stringBuffer.append(TEXT_204);
830
    stringBuffer.append(TEXT_204);
827
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
831
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
828
    stringBuffer.append(TEXT_205);
832
    stringBuffer.append(TEXT_205);
829
    stringBuffer.append(TEXT_206);
833
    stringBuffer.append(TEXT_206);
830
    stringBuffer.append(TEXT_207);
834
    stringBuffer.append(TEXT_207);
831
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
835
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
832
    stringBuffer.append(TEXT_208);
836
    stringBuffer.append(TEXT_208);
833
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
834
    stringBuffer.append(TEXT_209);
835
    stringBuffer.append(TEXT_210);
836
    stringBuffer.append(TEXT_211);
837
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
838
    stringBuffer.append(TEXT_212);
839
    
837
    
840
if (labelModelFacet instanceof FeatureLabelModelFacet) {
838
if (labelModelFacet instanceof FeatureLabelModelFacet) {
841
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
839
	GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature();
842
840
843
    stringBuffer.append(TEXT_213);
841
    stringBuffer.append(TEXT_209);
844
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
842
    stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
845
    stringBuffer.append(TEXT_214);
843
    stringBuffer.append(TEXT_210);
846
    stringBuffer.append(feature.getFeatureAccessorName());
844
    stringBuffer.append(feature.getFeatureAccessorName());
847
    stringBuffer.append(TEXT_215);
845
    stringBuffer.append(TEXT_211);
848
    
846
    
849
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
847
} else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) {
850
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
848
	CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet;
851
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
849
	for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
852
		GenFeature next = (GenFeature) it.next();
850
		GenFeature next = (GenFeature) it.next();
853
851
854
    stringBuffer.append(TEXT_216);
852
    stringBuffer.append(TEXT_212);
855
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
853
    stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
856
    stringBuffer.append(TEXT_217);
854
    stringBuffer.append(TEXT_213);
857
    stringBuffer.append(next.getFeatureAccessorName());
855
    stringBuffer.append(next.getFeatureAccessorName());
858
    stringBuffer.append(TEXT_218);
856
    stringBuffer.append(TEXT_214);
859
    
857
    
860
	}
858
	}
861
}
859
}
862
860
861
    stringBuffer.append(TEXT_215);
862
    stringBuffer.append(TEXT_216);
863
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
864
    stringBuffer.append(TEXT_217);
865
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
866
    stringBuffer.append(TEXT_218);
867
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
863
    stringBuffer.append(TEXT_219);
868
    stringBuffer.append(TEXT_219);
864
    stringBuffer.append(TEXT_220);
865
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
869
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
870
    stringBuffer.append(TEXT_220);
866
    stringBuffer.append(TEXT_221);
871
    stringBuffer.append(TEXT_221);
867
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
868
    stringBuffer.append(TEXT_222);
872
    stringBuffer.append(TEXT_222);
869
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
873
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
870
    stringBuffer.append(TEXT_223);
874
    stringBuffer.append(TEXT_223);
871
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
872
    stringBuffer.append(TEXT_224);
873
    stringBuffer.append(TEXT_225);
874
    stringBuffer.append(TEXT_226);
875
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
876
    stringBuffer.append(TEXT_227);
877
    
875
    
878
final Viewmap viewmap = genChildNode.getViewmap();
876
final Viewmap viewmap = genChildNode.getViewmap();
879
877
880
    stringBuffer.append(TEXT_228);
878
    stringBuffer.append(TEXT_224);
881
    stringBuffer.append(TEXT_229);
879
    stringBuffer.append(TEXT_225);
882
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
880
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
883
    stringBuffer.append(TEXT_230);
881
    stringBuffer.append(TEXT_226);
884
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
882
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
885
    stringBuffer.append(TEXT_231);
883
    stringBuffer.append(TEXT_227);
886
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
884
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
887
    stringBuffer.append(TEXT_232);
885
    stringBuffer.append(TEXT_228);
888
    
886
    
889
String figureQualifiedClassName = null;
887
String figureQualifiedClassName = null;
890
if (viewmap instanceof FigureViewmap) {
888
if (viewmap instanceof FigureViewmap) {
Lines 893-941 Link Here
893
		figureQualifiedClassName = "org.eclipse.draw2d.Label";
891
		figureQualifiedClassName = "org.eclipse.draw2d.Label";
894
	}
892
	}
895
893
896
    stringBuffer.append(TEXT_233);
894
    stringBuffer.append(TEXT_229);
897
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
895
    stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
898
    stringBuffer.append(TEXT_234);
896
    stringBuffer.append(TEXT_230);
899
    } // instanceof FigureViewmap
897
    } // instanceof FigureViewmap
900
 else if (viewmap instanceof SnippetViewmap) {
898
 else if (viewmap instanceof SnippetViewmap) {
901
    stringBuffer.append(TEXT_235);
899
    stringBuffer.append(TEXT_231);
902
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
900
    stringBuffer.append(((SnippetViewmap) viewmap).getBody());
903
    stringBuffer.append(TEXT_236);
901
    stringBuffer.append(TEXT_232);
904
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
902
    } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
905
 else if (viewmap instanceof InnerClassViewmap) {
903
 else if (viewmap instanceof InnerClassViewmap) {
906
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
904
 	figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
907
905
908
    stringBuffer.append(TEXT_237);
906
    stringBuffer.append(TEXT_233);
909
    stringBuffer.append(figureQualifiedClassName);
907
    stringBuffer.append(figureQualifiedClassName);
910
    stringBuffer.append(TEXT_238);
908
    stringBuffer.append(TEXT_234);
911
    }
909
    }
912
    stringBuffer.append(TEXT_239);
910
    stringBuffer.append(TEXT_235);
913
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
911
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
914
    stringBuffer.append(TEXT_240);
912
    stringBuffer.append(TEXT_236);
915
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
913
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
916
    stringBuffer.append(TEXT_241);
914
    stringBuffer.append(TEXT_237);
917
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
915
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
918
    stringBuffer.append(TEXT_242);
916
    stringBuffer.append(TEXT_238);
919
    
917
    
920
if (viewmap instanceof InnerClassViewmap) {
918
if (viewmap instanceof InnerClassViewmap) {
921
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
919
	String classBody = ((InnerClassViewmap) viewmap).getClassBody();
922
920
923
    stringBuffer.append(TEXT_243);
921
    stringBuffer.append(TEXT_239);
924
    stringBuffer.append(classBody);
922
    stringBuffer.append(classBody);
925
    stringBuffer.append(TEXT_244);
923
    stringBuffer.append(TEXT_240);
926
    
924
    
927
if (classBody.indexOf("DPtoLP") != -1) {
925
if (classBody.indexOf("DPtoLP") != -1) {
928
926
929
    stringBuffer.append(TEXT_245);
927
    stringBuffer.append(TEXT_241);
930
    
928
    
931
}
929
}
932
930
933
    
931
    
934
}
932
}
935
933
936
    stringBuffer.append(TEXT_246);
934
    stringBuffer.append(TEXT_242);
937
    importManager.emitSortedImports();
935
    importManager.emitSortedImports();
938
    stringBuffer.append(TEXT_247);
936
    stringBuffer.append(TEXT_243);
939
    return stringBuffer.toString();
937
    return stringBuffer.toString();
940
  }
938
  }
941
}
939
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java (-9 / +12 lines)
Lines 22-33 Link Here
22
  protected final String TEXT_4 = NL + "Bundle-Vendor: %providerName" + NL + "Bundle-Localization: plugin" + NL + "Export-Package: ";
22
  protected final String TEXT_4 = NL + "Bundle-Vendor: %providerName" + NL + "Bundle-Localization: plugin" + NL + "Export-Package: ";
23
  protected final String TEXT_5 = NL + "Require-Bundle: org.eclipse.core.runtime,";
23
  protected final String TEXT_5 = NL + "Require-Bundle: org.eclipse.core.runtime,";
24
  protected final String TEXT_6 = "org.eclipse.core.resources," + NL + " org.eclipse.ui.ide,";
24
  protected final String TEXT_6 = "org.eclipse.core.resources," + NL + " org.eclipse.ui.ide,";
25
  protected final String TEXT_7 = NL + " org.eclipse.jface," + NL + " org.eclipse.ui.views," + NL + " org.eclipse.ui.workbench," + NL + " org.eclipse.emf.ecore," + NL + " org.eclipse.emf.edit.ui," + NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit";
25
  protected final String TEXT_7 = NL + " org.eclipse.jface," + NL + " org.eclipse.ui.views," + NL + " org.eclipse.ui.workbench," + NL + " org.eclipse.emf.ecore," + NL + " org.eclipse.emf.edit.ui," + NL + " org.eclipse.emf.workspace,";
26
  protected final String TEXT_8 = ",";
26
  protected final String TEXT_8 = NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit";
27
  protected final String TEXT_9 = NL + " ";
27
  protected final String TEXT_9 = ",";
28
  protected final String TEXT_10 = ";visibility:=reexport";
28
  protected final String TEXT_10 = NL + " ";
29
  protected final String TEXT_11 = NL + "Eclipse-LazyStart: true";
29
  protected final String TEXT_11 = ";visibility:=reexport";
30
  protected final String TEXT_12 = NL;
30
  protected final String TEXT_12 = NL + "Eclipse-LazyStart: true";
31
  protected final String TEXT_13 = NL;
31
32
32
  public String generate(Object argument)
33
  public String generate(Object argument)
33
  {
34
  {
Lines 63-76 Link Here
63
    stringBuffer.append(TEXT_6);
64
    stringBuffer.append(TEXT_6);
64
    }
65
    }
65
    stringBuffer.append(TEXT_7);
66
    stringBuffer.append(TEXT_7);
66
    while(requiredBundleIterator.hasNext()) {
67
    /*XXX: introduces dependency on org.eclipse.core.resources which may be problematic for RCP*/
67
    stringBuffer.append(TEXT_8);
68
    stringBuffer.append(TEXT_8);
69
    while(requiredBundleIterator.hasNext()) {
68
    stringBuffer.append(TEXT_9);
70
    stringBuffer.append(TEXT_9);
69
    stringBuffer.append(requiredBundleIterator.next());
70
    stringBuffer.append(TEXT_10);
71
    stringBuffer.append(TEXT_10);
71
    }
72
    stringBuffer.append(requiredBundleIterator.next());
72
    stringBuffer.append(TEXT_11);
73
    stringBuffer.append(TEXT_11);
74
    }
73
    stringBuffer.append(TEXT_12);
75
    stringBuffer.append(TEXT_12);
76
    stringBuffer.append(TEXT_13);
74
    return stringBuffer.toString();
77
    return stringBuffer.toString();
75
  }
78
  }
76
}
79
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java (-75 / +77 lines)
Lines 74-80 Link Here
74
  protected final String TEXT_55 = "());" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tvoid valueChanged(UndoablePropertySheetEntry child, ";
74
  protected final String TEXT_55 = "());" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tvoid valueChanged(UndoablePropertySheetEntry child, ";
75
  protected final String TEXT_56 = " command) {" + NL + "\t\t\t";
75
  protected final String TEXT_56 = " command) {" + NL + "\t\t\t";
76
  protected final String TEXT_57 = " cc = new ";
76
  protected final String TEXT_57 = " cc = new ";
77
  protected final String TEXT_58 = "();" + NL + "\t\t\tcommand.add(cc);" + NL + "\t" + NL + "\t\t\tSetValueCommand setCommand;" + NL + "\t\t\tfor (int i = 0; i < getValues().length; i++) {" + NL + "\t\t\t\tsetCommand = new SetValueCommand(child.getDisplayName());" + NL + "\t\t\t\tsetCommand.setTarget(getPropertySource(getValues()[i]));" + NL + "\t\t\t\tsetCommand.setPropertyId(child.getDescriptor().getId());" + NL + "\t\t\t\tsetCommand.setPropertyValue(child.getValues()[i]);" + NL + "\t\t\t\tcc.add(setCommand);" + NL + "\t\t\t}" + NL + "\t" + NL + "\t\t\t// inform our parent" + NL + "\t\t\tif (getParent() != null)" + NL + "\t\t\t\t((UndoablePropertySheetEntry)getParent()).valueChanged(this, command);" + NL + "\t\t\telse {" + NL + "\t\t\t\t//I am the root entry" + NL + "\t\t\t\tstack.execute(command);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate EditingDomain editingDomain;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
77
  protected final String TEXT_58 = "();" + NL + "\t\t\tcommand.add(cc);" + NL + "\t" + NL + "\t\t\tSetValueCommand setCommand;" + NL + "\t\t\tfor (int i = 0; i < getValues().length; i++) {" + NL + "\t\t\t\tsetCommand = new SetValueCommand(child.getDisplayName());" + NL + "\t\t\t\tsetCommand.setTarget(getPropertySource(getValues()[i]));" + NL + "\t\t\t\tsetCommand.setPropertyId(child.getDescriptor().getId());" + NL + "\t\t\t\tsetCommand.setPropertyValue(child.getValues()[i]);" + NL + "\t\t\t\tcc.add(setCommand);" + NL + "\t\t\t}" + NL + "\t" + NL + "\t\t\t// inform our parent" + NL + "\t\t\tif (getParent() != null)" + NL + "\t\t\t\t((UndoablePropertySheetEntry)getParent()).valueChanged(this, command);" + NL + "\t\t\telse {" + NL + "\t\t\t\t//I am the root entry" + NL + "\t\t\t\tstack.execute(command);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TransactionalEditingDomain editingDomain;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
78
  protected final String TEXT_59 = " ";
78
  protected final String TEXT_59 = " ";
79
  protected final String TEXT_60 = ";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
79
  protected final String TEXT_60 = ";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
80
  protected final String TEXT_61 = " diagram;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean isDirty = false;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteRoot paletteRoot;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PropertySheetPage undoablePropertySheetPage;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup stackActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CommandStackListener commandStackListener = new CommandStackListener() {" + NL + "" + NL + "\t\tpublic void commandStackChanged(EventObject event) {" + NL + "\t\t\tstackActions.update();" + NL + "\t\t\tsetDirty(((CommandStack) event.getSource()).isDirty());" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editPartActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ISelectionListener selectionListener = new ISelectionListener() {" + NL + "" + NL + "\t\tpublic void selectionChanged(IWorkbenchPart part, ISelection selection) {" + NL + "\t\t\teditPartActions.update();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editorActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ComposedAdapterFactory domainAdapterFactory;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void firePropertyChange(int propertyId) {" + NL + "\t\tsuper.firePropertyChange(propertyId);" + NL + "\t\teditorActions.update();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an action to this editor's <code>ActionRegistry</code>. (This is" + NL + "\t * a helper method.)" + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the action to add." + NL + "\t */" + NL + "\tprotected void addAction(IAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an editor action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * Editor actions are actions that depend and work on the editor." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the editor action" + NL + "\t */" + NL + "\tprotected void addEditorAction(WorkbenchPartAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditorActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>EditPart</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>EditPart</code> actions are actions that depend and work on the" + NL + "\t * selected <code>EditPart</code>s." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the <code>EditPart</code> action" + NL + "\t */" + NL + "\tprotected void addEditPartAction(SelectionAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditPartActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>CommandStack</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>CommandStack</code> actions are actions that depend and work on" + NL + "\t * the <code>CommandStack</code>." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the <code>CommandStack</code> action" + NL + "\t */" + NL + "\tprotected void addStackAction(StackAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\tstackActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createActions() {" + NL + "\t\taddStackAction(new UndoAction(this));" + NL + "\t\taddStackAction(new RedoAction(this));" + NL + "" + NL + "\t\taddEditPartAction(new DeleteAction((IWorkbenchPart) this));" + NL + "\t\taddEditPartAction(new DirectEditAction((IWorkbenchPart) this));" + NL + "" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.LEFT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.TOP));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.BOTTOM));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.CENTER));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new SaveAction(this));" + NL + "\t\taddEditorAction(new PrintAction(this));" + NL + "" + NL + "\t\tIAction zoomIn = new ZoomInAction(getZoomManager());" + NL + "\t\tIAction zoomOut = new ZoomOutAction(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t}" + NL;
80
  protected final String TEXT_61 = " diagram;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean isDirty = false;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PaletteRoot paletteRoot;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate PropertySheetPage undoablePropertySheetPage;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup stackActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CommandStackListener commandStackListener = new CommandStackListener() {" + NL + "" + NL + "\t\tpublic void commandStackChanged(EventObject event) {" + NL + "\t\t\tstackActions.update();" + NL + "\t\t\tsetDirty(((CommandStack) event.getSource()).isDirty());" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editPartActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ISelectionListener selectionListener = new ISelectionListener() {" + NL + "" + NL + "\t\tpublic void selectionChanged(IWorkbenchPart part, ISelection selection) {" + NL + "\t\t\teditPartActions.update();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdatableActionGroup editorActions = new UpdatableActionGroup();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ComposedAdapterFactory domainAdapterFactory;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void firePropertyChange(int propertyId) {" + NL + "\t\tsuper.firePropertyChange(propertyId);" + NL + "\t\teditorActions.update();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an action to this editor's <code>ActionRegistry</code>. (This is" + NL + "\t * a helper method.)" + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the action to add." + NL + "\t */" + NL + "\tprotected void addAction(IAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an editor action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * Editor actions are actions that depend and work on the editor." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the editor action" + NL + "\t */" + NL + "\tprotected void addEditorAction(WorkbenchPartAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditorActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>EditPart</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>EditPart</code> actions are actions that depend and work on the" + NL + "\t * selected <code>EditPart</code>s." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the <code>EditPart</code> action" + NL + "\t */" + NL + "\tprotected void addEditPartAction(SelectionAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\teditPartActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Adds an <code>CommandStack</code> action to this editor." + NL + "\t * " + NL + "\t * <p>" + NL + "\t * <code>CommandStack</code> actions are actions that depend and work on" + NL + "\t * the <code>CommandStack</code>." + NL + "\t * " + NL + "\t * @generated" + NL + "\t * @param action" + NL + "\t *            the <code>CommandStack</code> action" + NL + "\t */" + NL + "\tprotected void addStackAction(StackAction action) {" + NL + "\t\tgetActionRegistry().registerAction(action);" + NL + "\t\tstackActions.addAction(action);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createActions() {" + NL + "\t\taddStackAction(new UndoAction(this));" + NL + "\t\taddStackAction(new RedoAction(this));" + NL + "" + NL + "\t\taddEditPartAction(new DeleteAction((IWorkbenchPart) this));" + NL + "\t\taddEditPartAction(new DirectEditAction((IWorkbenchPart) this));" + NL + "" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.LEFT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.RIGHT));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.TOP));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.BOTTOM));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.CENTER));" + NL + "\t\taddEditPartAction(new AlignmentAction((IWorkbenchPart) this, PositionConstants.MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new SaveAction(this));" + NL + "\t\taddEditorAction(new PrintAction(this));" + NL + "" + NL + "\t\tIAction zoomIn = new ZoomInAction(getZoomManager());" + NL + "\t\tIAction zoomOut = new ZoomOutAction(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t}" + NL;
Lines 107-152 Link Here
107
  protected final String TEXT_88 = ") {" + NL + "\t\t\treturn URI.createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}";
107
  protected final String TEXT_88 = ") {" + NL + "\t\t\treturn URI.createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}";
108
  protected final String TEXT_89 = NL + "\t\tif (input instanceof ";
108
  protected final String TEXT_89 = NL + "\t\tif (input instanceof ";
109
  protected final String TEXT_90 = ") {" + NL + "\t\t\treturn URI.createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}";
109
  protected final String TEXT_90 = ") {" + NL + "\t\t\treturn URI.createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}";
110
  protected final String TEXT_91 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isDirty() {" + NL + "\t\treturn isDirty;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void setDirty(boolean dirty) {" + NL + "\t\tif (isDirty != dirty) {" + NL + "\t\t\tisDirty = dirty;" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected EditingDomain getEditingDomain() {" + NL + "\t\tif (editingDomain == null) {" + NL + "\t\t\tBasicCommandStack commandStack = new BasicCommandStack();" + NL + "\t\t\teditingDomain = new AdapterFactoryEditingDomain(getDomainAdapterFactory(), commandStack, new HashMap());" + NL + "\t\t\teditingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain));" + NL + "\t\t}" + NL + "\t\treturn editingDomain;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate AdapterFactory getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\tList factories = new ArrayList();" + NL + "\t\t\tfactories.add(new ResourceItemProviderAdapterFactory());";
110
  protected final String TEXT_91 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isDirty() {" + NL + "\t\treturn isDirty;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void setDirty(boolean dirty) {" + NL + "\t\tif (isDirty != dirty) {" + NL + "\t\t\tisDirty = dirty;" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected TransactionalEditingDomain getEditingDomain() {" + NL + "\t\tif (editingDomain == null) {" + NL + "\t\t\teditingDomain = ";
111
  protected final String TEXT_92 = NL + "\t\t\tfactories.add(new ";
111
  protected final String TEXT_92 = ".INSTANCE.createEditingDomain();" + NL + "\t\t\t//editingDomain.setAdapterFactory(getDomainAdapterFactory());" + NL + "\t\t\teditingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain));" + NL + "\t\t}" + NL + "\t\treturn editingDomain;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate AdapterFactory getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\tList factories = new ArrayList();" + NL + "\t\t\tfactories.add(new ResourceItemProviderAdapterFactory());";
112
  protected final String TEXT_93 = "());";
112
  protected final String TEXT_93 = NL + "\t\t\tfactories.add(new ";
113
  protected final String TEXT_94 = NL + "\t\t\tfactories.add(new ReflectiveItemProviderAdapterFactory());" + NL + "\t\t\tfactories.add(new NotationItemProviderAdapterFactory());" + NL + "\t\t\tdomainAdapterFactory = new ComposedAdapterFactory(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load(URI diagramFile) {" + NL + "\t\t";
113
  protected final String TEXT_94 = "());";
114
  protected final String TEXT_95 = " = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tEditingDomain editingDomain = getEditingDomain();" + NL + "\t\tResourceSet resourceSet = editingDomain.getResourceSet();" + NL + "\t\tResource diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = (Diagram) findInResource(diagramResource, Diagram.class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = NotationFactory.eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(Collections.EMPTY_MAP);" + NL + "\t\t\t} catch (IOException e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\t";
114
  protected final String TEXT_95 = NL + "\t\t\tfactories.add(new ReflectiveItemProviderAdapterFactory());" + NL + "\t\t\tfactories.add(new NotationItemProviderAdapterFactory());" + NL + "\t\t\tdomainAdapterFactory = new ComposedAdapterFactory(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load(URI diagramFile) {" + NL + "\t\t";
115
  protected final String TEXT_96 = " = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
115
  protected final String TEXT_96 = " = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tTransactionalEditingDomain editingDomain = getEditingDomain();" + NL + "\t\tResourceSet resourceSet = editingDomain.getResourceSet();" + NL + "\t\tResource diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = (Diagram) findInResource(diagramResource, Diagram.class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = NotationFactory.eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(Collections.EMPTY_MAP);" + NL + "\t\t\t} catch (IOException e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\t";
116
  protected final String TEXT_97 = " = (";
116
  protected final String TEXT_97 = " = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t";
117
  protected final String TEXT_98 = ") diagram.getElement();" + NL + "\t\tif (";
117
  protected final String TEXT_98 = " = (";
118
  protected final String TEXT_99 = " == null) {";
118
  protected final String TEXT_99 = ") diagram.getElement();" + NL + "\t\tif (";
119
  protected final String TEXT_100 = NL + "\t\t\tURI modelFile = ";
119
  protected final String TEXT_100 = " == null) {";
120
  protected final String TEXT_101 = ".getModelFileURI(diagramFile);" + NL + "\t\t\tResource modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}";
120
  protected final String TEXT_101 = NL + "\t\t\tURI modelFile = ";
121
  protected final String TEXT_102 = NL + "\t\t\t";
121
  protected final String TEXT_102 = ".getModelFileURI(diagramFile);" + NL + "\t\t\tResource modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}";
122
  protected final String TEXT_103 = " = (";
122
  protected final String TEXT_103 = NL + "\t\t\t";
123
  protected final String TEXT_104 = ") findInResource(";
123
  protected final String TEXT_104 = " = (";
124
  protected final String TEXT_105 = ", ";
124
  protected final String TEXT_105 = ") findInResource(";
125
  protected final String TEXT_106 = ".class);" + NL + "\t\t\tif (";
125
  protected final String TEXT_106 = ", ";
126
  protected final String TEXT_107 = " == null) {" + NL + "\t\t\t\t";
126
  protected final String TEXT_107 = ".class);" + NL + "\t\t\tif (";
127
  protected final String TEXT_108 = " = ";
127
  protected final String TEXT_108 = " == null) {" + NL + "\t\t\t\t";
128
  protected final String TEXT_109 = ".eINSTANCE.create";
128
  protected final String TEXT_109 = " = ";
129
  protected final String TEXT_110 = "();" + NL + "\t\t\t\t";
129
  protected final String TEXT_110 = ".eINSTANCE.create";
130
  protected final String TEXT_111 = ".getContents().add(0, ";
130
  protected final String TEXT_111 = "();" + NL + "\t\t\t\t";
131
  protected final String TEXT_112 = ");" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t";
131
  protected final String TEXT_112 = ".getContents().add(0, ";
132
  protected final String TEXT_113 = ".save(Collections.EMPTY_MAP);" + NL + "\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\t";
132
  protected final String TEXT_113 = ");" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t";
133
  protected final String TEXT_114 = " = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement(";
133
  protected final String TEXT_114 = ".save(Collections.EMPTY_MAP);" + NL + "\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\t";
134
  protected final String TEXT_115 = ");" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
134
  protected final String TEXT_115 = " = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement(";
135
  protected final String TEXT_116 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource(Resource resource, Class expectedClass) {" + NL + "\t\tfor(Iterator it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + 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 + "\tpublic void setFocus() {" + NL + "\t\tgetGraphicalViewer().getControl().setFocus();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic final void createPartControl(Composite parent) {" + NL + "\t\tsuper.createPartControl(parent);" + NL + "\t\t// initialize actions" + NL + "\t\tcreateActions();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer(Composite parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\tScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new ";
135
  protected final String TEXT_116 = ");" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
136
  protected final String TEXT_117 = "());" + NL + "" + NL + "\t\t";
136
  protected final String TEXT_117 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource(Resource resource, Class expectedClass) {" + NL + "\t\tfor(Iterator it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + 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 + "\tpublic void setFocus() {" + NL + "\t\tgetGraphicalViewer().getControl().setFocus();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic final void createPartControl(Composite parent) {" + NL + "\t\tsuper.createPartControl(parent);" + NL + "\t\t// initialize actions" + NL + "\t\tcreateActions();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer(Composite parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\tScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new ";
137
  protected final String TEXT_118 = " printableLayers = (";
137
  protected final String TEXT_118 = "());" + NL + "" + NL + "\t\t";
138
  protected final String TEXT_119 = ") root.getLayer(";
138
  protected final String TEXT_119 = " printableLayers = (";
139
  protected final String TEXT_120 = ".PRINTABLE_LAYERS);" + NL + "\t\t";
139
  protected final String TEXT_120 = ") root.getLayer(";
140
  protected final String TEXT_121 = " extLabelsLayer = new ";
140
  protected final String TEXT_121 = ".PRINTABLE_LAYERS);" + NL + "\t\t";
141
  protected final String TEXT_122 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new ";
141
  protected final String TEXT_122 = " extLabelsLayer = new ";
142
  protected final String TEXT_123 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, ";
142
  protected final String TEXT_123 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new ";
143
  protected final String TEXT_124 = ".EXTERNAL_NODE_LABELS_LAYER, ";
143
  protected final String TEXT_124 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, ";
144
  protected final String TEXT_125 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\tGraphicalViewer viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\tContextMenuProvider provider = new ";
144
  protected final String TEXT_125 = ".EXTERNAL_NODE_LABELS_LAYER, ";
145
  protected final String TEXT_126 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu(";
145
  protected final String TEXT_126 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\tGraphicalViewer viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\tContextMenuProvider provider = new ";
146
  protected final String TEXT_127 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\tKeyHandler keyHandler = new GraphicalViewerKeyHandler(viewer);" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ";
146
  protected final String TEXT_127 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu(";
147
  protected final String TEXT_128 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
147
  protected final String TEXT_128 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\tKeyHandler keyHandler = new GraphicalViewerKeyHandler(viewer);" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.DEL, 127, 0), getActionRegistry().getAction(ActionFactory.DELETE.getId()));" + NL + "\t\tkeyHandler.put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.CTRL), MouseWheelZoomHandler.SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ";
148
  protected final String TEXT_129 = "ContextMenuProvider(EditPartViewer viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t    public void buildContextMenu(IMenuManager menuManager) {" + NL + "\t        GEFActionConstants.addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.UNDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.REDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.COPY.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.PASTE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.DELETE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, GEFActionConstants.DIRECT_EDIT, GEFActionConstants.GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.SAVE.getId(), GEFActionConstants.GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t    }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu(IMenuManager menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\tMenuManager submenu = new MenuManager(\"Align\");" + NL + "\t\t\tsubmenu.add(new Separator(GEFActionConstants.MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_LEFT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_CENTER, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_RIGHT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_TOP, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_MIDDLE, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_BOTTOM, GEFActionConstants.MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup(GEFActionConstants.GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu(IMenuManager menu, String actionId, String menuGroup) {" + NL + "\t\t\tIAction action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}";
148
  protected final String TEXT_129 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
149
  protected final String TEXT_130 = NL;
149
  protected final String TEXT_130 = "ContextMenuProvider(EditPartViewer viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t    public void buildContextMenu(IMenuManager menuManager) {" + NL + "\t        GEFActionConstants.addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.UNDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.REDO.getId(), GEFActionConstants.GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.COPY.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.PASTE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.DELETE.getId(), GEFActionConstants.GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, GEFActionConstants.DIRECT_EDIT, GEFActionConstants.GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ActionFactory.SAVE.getId(), GEFActionConstants.GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t    }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu(IMenuManager menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\tMenuManager submenu = new MenuManager(\"Align\");" + NL + "\t\t\tsubmenu.add(new Separator(GEFActionConstants.MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_LEFT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_CENTER, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_RIGHT, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_TOP, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_MIDDLE, GEFActionConstants.MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, GEFActionConstants.ALIGN_BOTTOM, GEFActionConstants.MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup(GEFActionConstants.GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu(IMenuManager menu, String actionId, String menuGroup) {" + NL + "\t\t\tIAction action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}";
150
  protected final String TEXT_131 = NL;
150
151
151
  public String generate(Object argument)
152
  public String generate(Object argument)
152
  {
153
  {
Lines 184-195 Link Here
184
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
185
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
185
importManager.addImport("org.eclipse.core.runtime.Status");
186
importManager.addImport("org.eclipse.core.runtime.Status");
186
importManager.addImport("org.eclipse.draw2d.PositionConstants");
187
importManager.addImport("org.eclipse.draw2d.PositionConstants");
187
importManager.addImport("org.eclipse.emf.common.command.BasicCommandStack");
188
importManager.addImport("org.eclipse.emf.common.util.URI");
188
importManager.addImport("org.eclipse.emf.common.util.URI");
189
importManager.addImport("org.eclipse.emf.ecore.resource.Resource");
189
importManager.addImport("org.eclipse.emf.ecore.resource.Resource");
190
importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet");
190
importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet");
191
importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain");
191
importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain");
192
importManager.addImport("org.eclipse.emf.edit.domain.EditingDomain");
192
importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain");
193
importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory");
193
importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory");
194
importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory");
194
importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory");
195
importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory");
195
importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory");
Lines 449-474 Link Here
449
    stringBuffer.append(TEXT_90);
449
    stringBuffer.append(TEXT_90);
450
    }
450
    }
451
    stringBuffer.append(TEXT_91);
451
    stringBuffer.append(TEXT_91);
452
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.workspace.WorkspaceEditingDomainFactory"));
453
    stringBuffer.append(TEXT_92);
452
    
454
    
453
final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true);
455
final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true);
454
for (int i = 0; i < genPackages.size(); i++) {
456
for (int i = 0; i < genPackages.size(); i++) {
455
	GenPackage genPackage = (GenPackage) genPackages.get(i);
457
	GenPackage genPackage = (GenPackage) genPackages.get(i);
456
458
457
    stringBuffer.append(TEXT_92);
458
    stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName()));
459
    stringBuffer.append(TEXT_93);
459
    stringBuffer.append(TEXT_93);
460
    }
460
    stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName()));
461
    stringBuffer.append(TEXT_94);
461
    stringBuffer.append(TEXT_94);
462
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
462
    }
463
    stringBuffer.append(TEXT_95);
463
    stringBuffer.append(TEXT_95);
464
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
464
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
465
    stringBuffer.append(TEXT_96);
465
    stringBuffer.append(TEXT_96);
466
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
466
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
467
    stringBuffer.append(TEXT_97);
467
    stringBuffer.append(TEXT_97);
468
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
469
    stringBuffer.append(TEXT_98);
470
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
468
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
469
    stringBuffer.append(TEXT_98);
470
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
471
    stringBuffer.append(TEXT_99);
471
    stringBuffer.append(TEXT_99);
472
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
473
    stringBuffer.append(TEXT_100);
472
    
474
    
473
{
475
{
474
476
Lines 477-550 Link Here
477
	String resourceToUse;
479
	String resourceToUse;
478
	if (!sameFile) {
480
	if (!sameFile) {
479
481
480
    stringBuffer.append(TEXT_100);
481
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
482
    stringBuffer.append(TEXT_101);
482
    stringBuffer.append(TEXT_101);
483
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
484
    stringBuffer.append(TEXT_102);
483
    
485
    
484
		resourceToUse = "modelResource";
486
		resourceToUse = "modelResource";
485
	} else {
487
	} else {
486
		resourceToUse = "diagramResource";
488
		resourceToUse = "diagramResource";
487
	}
489
	}
488
490
489
    stringBuffer.append(TEXT_102);
490
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
491
    stringBuffer.append(TEXT_103);
491
    stringBuffer.append(TEXT_103);
492
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
492
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
493
    stringBuffer.append(TEXT_104);
493
    stringBuffer.append(TEXT_104);
494
    stringBuffer.append(resourceToUse);
495
    stringBuffer.append(TEXT_105);
496
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
494
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
495
    stringBuffer.append(TEXT_105);
496
    stringBuffer.append(resourceToUse);
497
    stringBuffer.append(TEXT_106);
497
    stringBuffer.append(TEXT_106);
498
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
498
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
499
    stringBuffer.append(TEXT_107);
499
    stringBuffer.append(TEXT_107);
500
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
500
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
501
    stringBuffer.append(TEXT_108);
501
    stringBuffer.append(TEXT_108);
502
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName()));
502
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
503
    stringBuffer.append(TEXT_109);
503
    stringBuffer.append(TEXT_109);
504
    stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName());
504
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName()));
505
    stringBuffer.append(TEXT_110);
505
    stringBuffer.append(TEXT_110);
506
    stringBuffer.append(resourceToUse);
506
    stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName());
507
    stringBuffer.append(TEXT_111);
507
    stringBuffer.append(TEXT_111);
508
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
509
    stringBuffer.append(TEXT_112);
510
    stringBuffer.append(resourceToUse);
508
    stringBuffer.append(resourceToUse);
511
    stringBuffer.append(TEXT_113);
509
    stringBuffer.append(TEXT_112);
512
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
510
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
511
    stringBuffer.append(TEXT_113);
512
    stringBuffer.append(resourceToUse);
513
    stringBuffer.append(TEXT_114);
513
    stringBuffer.append(TEXT_114);
514
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
514
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
515
    stringBuffer.append(TEXT_115);
515
    stringBuffer.append(TEXT_115);
516
    stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName());
517
    stringBuffer.append(TEXT_116);
516
    
518
    
517
}
519
}
518
520
519
    stringBuffer.append(TEXT_116);
520
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
521
    stringBuffer.append(TEXT_117);
521
    stringBuffer.append(TEXT_117);
522
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
522
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
523
    stringBuffer.append(TEXT_118);
523
    stringBuffer.append(TEXT_118);
524
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
524
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
525
    stringBuffer.append(TEXT_119);
525
    stringBuffer.append(TEXT_119);
526
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
526
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
527
    stringBuffer.append(TEXT_120);
527
    stringBuffer.append(TEXT_120);
528
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
528
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
529
    stringBuffer.append(TEXT_121);
529
    stringBuffer.append(TEXT_121);
530
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
530
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
531
    stringBuffer.append(TEXT_122);
531
    stringBuffer.append(TEXT_122);
532
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout"));
532
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
533
    stringBuffer.append(TEXT_123);
533
    stringBuffer.append(TEXT_123);
534
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
534
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout"));
535
    stringBuffer.append(TEXT_124);
535
    stringBuffer.append(TEXT_124);
536
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
536
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
537
    stringBuffer.append(TEXT_125);
537
    stringBuffer.append(TEXT_125);
538
    stringBuffer.append(genEditor.getClassName());
538
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
539
    stringBuffer.append(TEXT_126);
539
    stringBuffer.append(TEXT_126);
540
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
541
    stringBuffer.append(TEXT_127);
542
    stringBuffer.append(genEditor.getClassName());
540
    stringBuffer.append(genEditor.getClassName());
541
    stringBuffer.append(TEXT_127);
542
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
543
    stringBuffer.append(TEXT_128);
543
    stringBuffer.append(TEXT_128);
544
    stringBuffer.append(genEditor.getClassName());
544
    stringBuffer.append(genEditor.getClassName());
545
    stringBuffer.append(TEXT_129);
545
    stringBuffer.append(TEXT_129);
546
    importManager.emitSortedImports();
546
    stringBuffer.append(genEditor.getClassName());
547
    stringBuffer.append(TEXT_130);
547
    stringBuffer.append(TEXT_130);
548
    importManager.emitSortedImports();
549
    stringBuffer.append(TEXT_131);
548
    return stringBuffer.toString();
550
    return stringBuffer.toString();
549
  }
551
  }
550
}
552
}
(-)src/org/eclipse/gmf/internal/codegen/lite/Generator.java (-1 / +2 lines)
Lines 97-102 Link Here
97
			internalGenerateJavaClass(myEmitters.getPaletteFactoryGenerator(), myDiagram.getPalette().getFactoryQualifiedClassName(), myDiagram);
97
			internalGenerateJavaClass(myEmitters.getPaletteFactoryGenerator(), myDiagram.getPalette().getFactoryQualifiedClassName(), myDiagram);
98
		}
98
		}
99
		internalGenerateJavaClass(myEmitters.getUpdatableEditPartGenerator(), myDiagram.getEditPartsPackageName(), "IUpdatableEditPart", myDiagram); // XXX: should be customizable
99
		internalGenerateJavaClass(myEmitters.getUpdatableEditPartGenerator(), myDiagram.getEditPartsPackageName(), "IUpdatableEditPart", myDiagram); // XXX: should be customizable
100
		internalGenerateJavaClass(myEmitters.getWrappingCommandGenerator(), myDiagram.getEditPartsPackageName(), "WrappingCommand", myDiagram); // XXX: should be customizable or moved to a lite-runtime plugin
100
		internalGenerateJavaClass(myEmitters.getEditPartFactoryGenerator(), myDiagram.getEditPartFactoryQualifiedClassName(), myDiagram);
101
		internalGenerateJavaClass(myEmitters.getEditPartFactoryGenerator(), myDiagram.getEditPartFactoryQualifiedClassName(), myDiagram);
101
		internalGenerateJavaClass(myEmitters.getDiagramEditPartGenerator(), myDiagram.getEditPartQualifiedClassName(), myDiagram);
102
		internalGenerateJavaClass(myEmitters.getDiagramEditPartGenerator(), myDiagram.getEditPartQualifiedClassName(), myDiagram);
102
103
Lines 201-204 Link Here
201
			return myHits[index];
202
			return myHits[index];
202
		}
203
		}
203
	}
204
	}
204
}
205
}
(-)src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java (+6 lines)
Lines 45-50 Link Here
45
import org.eclipse.gmf.codegen.templates.lite.parts.NodeEditPartGenerator;
45
import org.eclipse.gmf.codegen.templates.lite.parts.NodeEditPartGenerator;
46
import org.eclipse.gmf.codegen.templates.lite.parts.NodeLabelEditPartGenerator;
46
import org.eclipse.gmf.codegen.templates.lite.parts.NodeLabelEditPartGenerator;
47
import org.eclipse.gmf.codegen.templates.lite.parts.UpdatableEditPartGenerator;
47
import org.eclipse.gmf.codegen.templates.lite.parts.UpdatableEditPartGenerator;
48
import org.eclipse.gmf.codegen.templates.lite.parts.WrappingCommandGenerator;
48
import org.eclipse.gmf.codegen.templates.lite.providers.AbstractParserGenerator;
49
import org.eclipse.gmf.codegen.templates.lite.providers.AbstractParserGenerator;
49
import org.eclipse.gmf.codegen.templates.lite.providers.CompartmentViewFactoryGenerator;
50
import org.eclipse.gmf.codegen.templates.lite.providers.CompartmentViewFactoryGenerator;
50
import org.eclipse.gmf.codegen.templates.lite.providers.DiagramViewFactoryGenerator;
51
import org.eclipse.gmf.codegen.templates.lite.providers.DiagramViewFactoryGenerator;
Lines 97-102 Link Here
97
		put(tr, "/parts/DiagramEditPart.javajet", DiagramEditPartGenerator.class);
98
		put(tr, "/parts/DiagramEditPart.javajet", DiagramEditPartGenerator.class);
98
		put(tr, "/parts/EditPartFactory.javajet", EditPartFactoryGenerator.class);
99
		put(tr, "/parts/EditPartFactory.javajet", EditPartFactoryGenerator.class);
99
		put(tr, "/parts/IUpdatableEditPart.javajet", UpdatableEditPartGenerator.class);
100
		put(tr, "/parts/IUpdatableEditPart.javajet", UpdatableEditPartGenerator.class);
101
		put(tr, "/parts/WrappingCommand.javajet", WrappingCommandGenerator.class);
100
		put(tr, "/providers/AbstractParser.javajet", AbstractParserGenerator.class);
102
		put(tr, "/providers/AbstractParser.javajet", AbstractParserGenerator.class);
101
		put(tr, "/providers/DomainElementInitializer.javajet", DomainElementInitializerGenerator.class);
103
		put(tr, "/providers/DomainElementInitializer.javajet", DomainElementInitializerGenerator.class);
102
		put(tr, "/providers/PropertySourceProvider.javajet", PropertySourceProviderGenerator.class);
104
		put(tr, "/providers/PropertySourceProvider.javajet", PropertySourceProviderGenerator.class);
Lines 164-169 Link Here
164
		return retrieve(UpdatableEditPartGenerator.class);
166
		return retrieve(UpdatableEditPartGenerator.class);
165
	}
167
	}
166
168
169
	public TextEmitter getWrappingCommandGenerator() throws UnexpectedBehaviourException {
170
		return retrieve(WrappingCommandGenerator.class);
171
	}
172
167
	public TextEmitter getLinkEditPartGenerator() throws UnexpectedBehaviourException {
173
	public TextEmitter getLinkEditPartGenerator() throws UnexpectedBehaviourException {
168
		return retrieve(LinkEditPartGenerator.class);
174
		return retrieve(LinkEditPartGenerator.class);
169
	}
175
	}
(-)templates/parts/WrappingCommand.javajet (+90 lines)
Added Link Here
1
<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="WrappingCommandGenerator"
2
	imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.*"%>
3
<%
4
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
5
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
6
final GenPlugin genPlugin = genDiagram.getEditorGen().getPlugin();
7
%>
8
<%
9
importManager.emitPackageStatement(stringBuffer);
10
importManager.addImport("org.eclipse.core.commands.ExecutionException");
11
importManager.addImport("org.eclipse.core.commands.operations.IUndoableOperation");
12
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
13
importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain");
14
importManager.addImport("org.eclipse.emf.workspace.EMFCommandOperation");
15
importManager.addImport("org.eclipse.gef.commands.Command");
16
importManager.markImportLocation(stringBuffer);
17
%>
18
19
/**
20
 * Wraps a EMF command into a GEF command. The undelying EMF command will be executed within a transaction provided by the specified editing domain.
21
 * @generated
22
 */
23
public class WrappingCommand extends Command {
24
	/**
25
	 * @generated
26
	 */
27
	private final IUndoableOperation operation;
28
29
	/**
30
	 * @generated
31
	 */
32
	protected WrappingCommand(IUndoableOperation operation) {
33
		this.operation = operation;
34
	}
35
36
	/**
37
	 * @generated
38
	 */
39
	public WrappingCommand(TransactionalEditingDomain editingDomain, org.eclipse.emf.common.command.Command emfCommand) {
40
		this.operation = new EMFCommandOperation(editingDomain, emfCommand);
41
	}
42
43
	/**
44
	 * @generated
45
	 */
46
	public void execute() {
47
		try {
48
			operation.execute(new NullProgressMonitor(), null);
49
		} catch (ExecutionException e) {
50
			<%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while executing operation", e);
51
		}
52
	}
53
54
	/**
55
	 * @generated
56
	 */
57
	public boolean canExecute() {
58
		return operation.canExecute();
59
	}
60
61
	/**
62
	 * @generated
63
	 */
64
	public void undo() {
65
		try {
66
			operation.undo(new NullProgressMonitor(), null);
67
		} catch (ExecutionException e) {
68
			<%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while undoing operation", e);
69
		}
70
	}
71
72
	/**
73
	 * @generated
74
	 */
75
	public boolean canUndo() {
76
		return operation.canUndo();
77
	}
78
79
	/**
80
	 * @generated
81
	 */
82
	public void redo() {
83
		try {
84
			operation.redo(new NullProgressMonitor(), null);
85
		} catch (ExecutionException e) {
86
			<%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while redoing operation", e);
87
		}
88
	}
89
}
90
<%importManager.emitSortedImports();%>
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/parts/WrappingCommandGenerator.java (+53 lines)
Added Link Here
1
package org.eclipse.gmf.codegen.templates.lite.parts;
2
3
import org.eclipse.gmf.codegen.gmfgen.*;
4
import org.eclipse.gmf.common.codegen.*;
5
import java.util.*;
6
import org.eclipse.emf.codegen.ecore.genmodel.*;
7
8
public class WrappingCommandGenerator
9
{
10
  protected static String nl;
11
  public static synchronized WrappingCommandGenerator create(String lineSeparator)
12
  {
13
    nl = lineSeparator;
14
    WrappingCommandGenerator result = new WrappingCommandGenerator();
15
    nl = null;
16
    return result;
17
  }
18
19
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
20
  protected final String TEXT_1 = NL + "/**" + NL + " * Wraps a EMF command into a GEF command. The undelying EMF command will be executed within a transaction provided by the specified editing domain." + NL + " * @generated" + NL + " */" + NL + "public class WrappingCommand extends Command {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate final IUndoableOperation operation;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected WrappingCommand(IUndoableOperation operation) {" + NL + "\t\tthis.operation = operation;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic WrappingCommand(TransactionalEditingDomain editingDomain, org.eclipse.emf.common.command.Command emfCommand) {" + NL + "\t\tthis.operation = new EMFCommandOperation(editingDomain, emfCommand);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void execute() {" + NL + "\t\ttry {" + NL + "\t\t\toperation.execute(new NullProgressMonitor(), null);" + NL + "\t\t} catch (ExecutionException e) {" + NL + "\t\t\t";
21
  protected final String TEXT_2 = ".getInstance().logError(\"exception occurred while executing operation\", e);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canExecute() {" + NL + "\t\treturn operation.canExecute();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void undo() {" + NL + "\t\ttry {" + NL + "\t\t\toperation.undo(new NullProgressMonitor(), null);" + NL + "\t\t} catch (ExecutionException e) {" + NL + "\t\t\t";
22
  protected final String TEXT_3 = ".getInstance().logError(\"exception occurred while undoing operation\", e);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean canUndo() {" + NL + "\t\treturn operation.canUndo();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void redo() {" + NL + "\t\ttry {" + NL + "\t\t\toperation.redo(new NullProgressMonitor(), null);" + NL + "\t\t} catch (ExecutionException e) {" + NL + "\t\t\t";
23
  protected final String TEXT_4 = ".getInstance().logError(\"exception occurred while redoing operation\", e);" + NL + "\t\t}" + NL + "\t}" + NL + "}";
24
25
  public String generate(Object argument)
26
  {
27
    final StringBuffer stringBuffer = new StringBuffer();
28
    
29
GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
30
ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
31
final GenPlugin genPlugin = genDiagram.getEditorGen().getPlugin();
32
33
    
34
importManager.emitPackageStatement(stringBuffer);
35
importManager.addImport("org.eclipse.core.commands.ExecutionException");
36
importManager.addImport("org.eclipse.core.commands.operations.IUndoableOperation");
37
importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor");
38
importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain");
39
importManager.addImport("org.eclipse.emf.workspace.EMFCommandOperation");
40
importManager.addImport("org.eclipse.gef.commands.Command");
41
importManager.markImportLocation(stringBuffer);
42
43
    stringBuffer.append(TEXT_1);
44
    stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName()));
45
    stringBuffer.append(TEXT_2);
46
    stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName()));
47
    stringBuffer.append(TEXT_3);
48
    stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName()));
49
    stringBuffer.append(TEXT_4);
50
    importManager.emitSortedImports();
51
    return stringBuffer.toString();
52
  }
53
}

Return to bug 138430