Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 42146 Details for
Bug 138430
Lite Generator: Generated code should make use of emf.transaction API
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Fixes the subj
138430.patch (text/plain), 613.20 KB, created by
Boris Blajer
on 2006-05-22 09:58:01 EDT
(
hide
)
Description:
Fixes the subj
Filename:
MIME Type:
Creator:
Boris Blajer
Created:
2006-05-22 09:58:01 EDT
Size:
613.20 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.codegen.lite >Index: templates/editor/Editor.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/Editor.javajet,v >retrieving revision 1.4 >diff -u -r1.4 Editor.javajet >--- templates/editor/Editor.javajet 15 May 2006 15:54:30 -0000 1.4 >+++ templates/editor/Editor.javajet 22 May 2006 13:59:35 -0000 >@@ -33,12 +33,11 @@ > importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor"); > importManager.addImport("org.eclipse.core.runtime.Status"); > importManager.addImport("org.eclipse.draw2d.PositionConstants"); >-importManager.addImport("org.eclipse.emf.common.command.BasicCommandStack"); > importManager.addImport("org.eclipse.emf.common.util.URI"); > importManager.addImport("org.eclipse.emf.ecore.resource.Resource"); > importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet"); > importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"); >-importManager.addImport("org.eclipse.emf.edit.domain.EditingDomain"); >+importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain"); > importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory"); > importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory"); > importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"); >@@ -560,7 +559,7 @@ > /** > * @generated > */ >- private EditingDomain editingDomain; >+ private TransactionalEditingDomain editingDomain; > > /** > * @generated >@@ -1004,10 +1003,10 @@ > /** > * @generated > */ >- protected EditingDomain getEditingDomain() { >+ protected TransactionalEditingDomain getEditingDomain() { > if (editingDomain == null) { >- BasicCommandStack commandStack = new BasicCommandStack(); >- editingDomain = new AdapterFactoryEditingDomain(getDomainAdapterFactory(), commandStack, new HashMap()); >+ editingDomain = <%=importManager.getImportedName("org.eclipse.emf.workspace.WorkspaceEditingDomainFactory")%>.INSTANCE.createEditingDomain(); >+ //editingDomain.setAdapterFactory(getDomainAdapterFactory()); > editingDomain.getResourceSet().eAdapters().add(new AdapterFactoryEditingDomain.EditingDomainProvider(editingDomain)); > } > return editingDomain; >@@ -1043,7 +1042,7 @@ > if (diagramFile == null) { > return; > } >- EditingDomain editingDomain = getEditingDomain(); >+ TransactionalEditingDomain editingDomain = getEditingDomain(); > ResourceSet resourceSet = editingDomain.getResourceSet(); > Resource diagramResource = resourceSet.getResource(diagramFile, true); > if (diagramResource == null) { >Index: templates/editor/manifest.mfjet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet,v >retrieving revision 1.2 >diff -u -r1.2 manifest.mfjet >--- templates/editor/manifest.mfjet 20 Apr 2006 18:27:23 -0000 1.2 >+++ templates/editor/manifest.mfjet 22 May 2006 13:59:35 -0000 >@@ -36,6 +36,7 @@ > org.eclipse.ui.workbench, > org.eclipse.emf.ecore, > org.eclipse.emf.edit.ui, >+ org.eclipse.emf.workspace,<%/*XXX: introduces dependency on org.eclipse.core.resources which may be problematic for RCP*/%> > org.eclipse.gef;visibility:=reexport, > org.eclipse.gmf.runtime.notation, > org.eclipse.gmf.runtime.notation.edit<%while(requiredBundleIterator.hasNext()) {%>, >Index: templates/parts/directEditPolicy.javajetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/directEditPolicy.javajetinc,v >retrieving revision 1.2 >diff -u -r1.2 directEditPolicy.javajetinc >--- templates/parts/directEditPolicy.javajetinc 15 May 2006 11:19:18 -0000 1.2 >+++ templates/parts/directEditPolicy.javajetinc 22 May 2006 13:59:36 -0000 >@@ -19,43 +19,44 @@ > } catch (<%=importManager.getImportedName("java.text.ParseException")%> e) { > return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; > } >+ <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(<%=primaryView%>.getDiagram().getElement()); > <% >-if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) { >+if (labelModelFacet instanceof FeatureLabelModelFacet) { > GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); > EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); > %> > if (parseResult.length != 1) { > return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; > } >- return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() { >- private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>; >- private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(); >- private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand() { >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(<%=primaryView%>.getDiagram().getElement()); >- <%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=featureToSet.getFeatureAccessorName()%>(); >- Object valueToSet; >- try { >- valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, parseResult[0]); >- } catch (IllegalArgumentException e) { >- return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >- } >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]); >+ return new WrappingCommand(editingDomain, domainModelCommand); >+ } >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain, Object value) { >+ <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>; >+ <%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%> feature = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")%>) <%=importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=featureToSet.getFeatureAccessorName()%>(); >+ Object valueToSet; >+ try { >+ valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, value); >+ } catch (IllegalArgumentException e) { >+ return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >+ } > <% > if (ecoreFeature.isMany()) { > %> >- <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >- <%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>(); >- values.addAll(element.get<%=featureToSet.getAccessorName()%>()); >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(domainModelEditDomain, element, feature, values)); >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(domainModelEditDomain, element, feature, valueToSet)); >- return result; >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>(); >+ values.addAll(element.get<%=featureToSet.getAccessorName()%>()); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, element, feature, values)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(editingDomain, element, feature, valueToSet)); >+ return result; > <% > } else { > %> >- return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, element, feature, valueToSet); >+ return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(editingDomain, element, feature, valueToSet); > <% > } > %> >- } >+ } > <% > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; >@@ -64,59 +65,45 @@ > if (parseResult.length != <%=metaFeatures.size()%>) { > return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; > } >- return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() { >- private <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>; >- private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(); >- private <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand() { >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(<%=primaryView%>.getDiagram().getElement()); >- <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >- Object valueToSet; >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> domainModelCommand = createDomainModelCommand(editingDomain, parseResult); >+ return new WrappingCommand(editingDomain, domainModelCommand); >+ } >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> createDomainModelCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain, Object[] values) { >+ <%=importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())%> element = <%=resolvedSemanticElement%>; >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ Object valueToSet; > <% > boolean haveDeclaredValues = false; > for(int i = 0; i < metaFeatures.size(); i++) { > GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); > EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); > %> >- <%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()%>(); >- try { >- valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, parseResult[<%=i%>]); >- } catch (IllegalArgumentException e) { >- return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >- } >+ <%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()%>(); >+ try { >+ valueToSet = <%=importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())%>.parseValue(feature, values[<%=i%>]); >+ } catch (IllegalArgumentException e) { >+ return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >+ } > <% > if (nextEcoreFeature.isMany()) { > %> >- <%if (!haveDeclaredValues) { haveDeclaredValues = true;%><%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> <%}%>values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>(); >- values.addAll(element.get<%=nextFeatureToSet.getAccessorName()%>()); >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(domainModelEditDomain, element, feature, values)); >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(domainModelEditDomain, element, feature, valueToSet)); >+ <%if (!haveDeclaredValues) { haveDeclaredValues = true;%><%=importManager.getImportedName("org.eclipse.emf.common.util.EList")%> <%}%>values = new <%=importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")%>(); >+ values.addAll(element.get<%=nextFeatureToSet.getAccessorName()%>()); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, element, feature, values)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")%>.create(editingDomain, element, feature, valueToSet)); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, element, feature, valueToSet)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create(editingDomain, element, feature, valueToSet)); > <% > } > %> > <% > } > %> >- return result; >- } >+ return result; >+ } > <% > } > %> >- public void undo() { >- domainModelCommand.undo(); >- } >- public void execute() { >- domainModelCommand.execute(); >- } >- public boolean canUndo() { >- return element != null && domainModelCommand != null && domainModelCommand.canUndo(); >- } >- public boolean canExecute() { >- return element != null && domainModelCommand != null && domainModelCommand.canExecute(); >- } >- }; >- } > }); >Index: templates/parts/NodeEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeEditPart.javajet,v >retrieving revision 1.4 >diff -u -r1.4 NodeEditPart.javajet >--- templates/parts/NodeEditPart.javajet 18 May 2006 19:18:26 -0000 1.4 >+++ templates/parts/NodeEditPart.javajet 22 May 2006 13:59:36 -0000 >@@ -140,7 +140,7 @@ > if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) { > <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) request; > int[] visualIds = requestEx.getVisualIds(); >- <%=importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")%>(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); > for (int i = 0; i < visualIds.length; i++) { > int nextVisualId = visualIds[i]; > switch (nextVisualId) { >@@ -168,18 +168,18 @@ > } > %> > case <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID: >- result.add(new Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command(requestEx)); >+ result.append(new Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command(requestEx)); > break; > <% > } > %> > } > } >- if (result.getChildren().length != 1) { >+ if (result.getCommandList().size() != 1) { > //Cannot create several connections at once. > return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; > } >- return result.unwrap(); >+ return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramNode().getDiagram().getElement()), result); > } > <%}/*when there's palette*/%> > return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; >@@ -629,7 +629,7 @@ > /** > * @generated > */ >- private static class Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> { >+ private static class Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%> { > /** > * @generated > */ >@@ -660,6 +660,11 @@ > } else { > target = null; > } >+ if (source == null || target == null) { >+ createdEdge = null; >+ domainModelAddCommand = <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >+ return; >+ } > createdEdge = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createEdge(); > <% > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { >@@ -678,7 +683,7 @@ > } > %> > <%=importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())%>.decorateView(createdEdge); >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(source.getDiagram().getElement()); >+ <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(source.getDiagram().getElement()); > <% > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > %> >@@ -802,6 +807,12 @@ > createdEdge.setSource(null); > createdEdge.setTarget(null); > } >+ /** >+ * @generated >+ */ >+ public void redo() { >+ execute(); >+ } > } > <% > } >Index: templates/parts/ChildNodeEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet,v >retrieving revision 1.3 >diff -u -r1.3 ChildNodeEditPart.javajet >--- templates/parts/ChildNodeEditPart.javajet 15 May 2006 11:19:18 -0000 1.3 >+++ templates/parts/ChildNodeEditPart.javajet 22 May 2006 13:59:35 -0000 >@@ -8,6 +8,7 @@ > GenDiagram genDiagram = genChildNode.getDiagram(); > final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; > LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet(); >+final boolean isReadOnly = genChildNode.isLabelReadOnly(); > %> > <%@ include file="../copyright4java.jetinc"%> > >@@ -57,8 +58,7 @@ > final String primaryView = "getDiagramNode()"; > %> > <% >-{ >-boolean isReadOnly = genChildNode.isLabelReadOnly(); >+if (!isReadOnly) { > %> > <%@ include file="directEditPolicy.javajetinc"%> > <% >@@ -67,8 +67,13 @@ > <%@ include file="componentEditPolicy.javajetinc"%> > } > >+<% >+if (!isReadOnly) { >+%> > <%@ include file="directEdit.javajetinc"%> >- >+<% >+} >+%> > /** > * @generated > */ >Index: templates/parts/textAwareFields.jetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/textAwareFields.jetinc,v >retrieving revision 1.1 >diff -u -r1.1 textAwareFields.jetinc >--- templates/parts/textAwareFields.jetinc 13 Apr 2006 21:20:15 -0000 1.1 >+++ templates/parts/textAwareFields.jetinc 22 May 2006 13:59:36 -0000 >@@ -1,9 +1,15 @@ > >+<% >+if (!isReadOnly) { >+%> > /** > * @generated > */ > private <%=importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")%> manager; > >+<% >+} >+%> > /** > * @generated > */ >Index: templates/parts/NodeLabelEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeLabelEditPart.javajet,v >retrieving revision 1.3 >diff -u -r1.3 NodeLabelEditPart.javajet >--- templates/parts/NodeLabelEditPart.javajet 15 May 2006 11:19:18 -0000 1.3 >+++ templates/parts/NodeLabelEditPart.javajet 22 May 2006 13:59:36 -0000 >@@ -7,6 +7,7 @@ > GenClass underlyingMetaClass = genHost.getDomainMetaClass(); > GenDiagram genDiagram = genLabel.getDiagram(); > LabelModelFacet labelModelFacet = genLabel.getModelFacet(); >+final boolean isReadOnly = genLabel.isReadOnly(); > %> > <%@ include file="../copyright4java.jetinc"%> > <%importManager.emitPackageStatement(stringBuffer);%> >@@ -42,12 +43,21 @@ > <% > final String primaryView = "getUpdatableParent().getDiagramNode()"; > final String resolvedSemanticElement = "resolveSemanticElement()"; >- final boolean isReadOnly = genLabel.isReadOnly(); >+ if (!isReadOnly) { > %> > <%@ include file="directEditPolicy.javajetinc"%> >+<% >+ } >+%> > } > >+<% >+ if (!isReadOnly) { >+%> > <%@ include file="directEdit.javajetinc"%> >+<% >+ } >+%> > > /** > * @generated >Index: templates/parts/LinkLabelEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkLabelEditPart.javajet,v >retrieving revision 1.3 >diff -u -r1.3 LinkLabelEditPart.javajet >--- templates/parts/LinkLabelEditPart.javajet 15 May 2006 11:19:18 -0000 1.3 >+++ templates/parts/LinkLabelEditPart.javajet 22 May 2006 13:59:36 -0000 >@@ -16,6 +16,7 @@ > } else { > underlyingMetaClass = null; > } >+final boolean isReadOnly = genLabel.isReadOnly(); > %> > <%@ include file="../copyright4java.jetinc"%> > <%importManager.emitPackageStatement(stringBuffer); >@@ -69,8 +70,7 @@ > } > }); > <% >-if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) { >- boolean isReadOnly = genLabel.isReadOnly(); >+if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { > %> > <%@ include file="directEditPolicy.javajetinc"%> > <% >@@ -79,7 +79,7 @@ > } > > <% >-if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) { >+if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { > %> > <%@ include file="directEdit.javajetinc"%> > <% >Index: templates/parts/DiagramEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet,v >retrieving revision 1.2 >diff -u -r1.2 DiagramEditPart.javajet >--- templates/parts/DiagramEditPart.javajet 26 Apr 2006 11:58:48 -0000 1.2 >+++ templates/parts/DiagramEditPart.javajet 22 May 2006 13:59:35 -0000 >@@ -76,7 +76,7 @@ > if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) { > <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request; > int[] visualIds = requestEx.getVisualIds(); >- CompoundCommand result = new CompoundCommand(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); > for(int i = 0; i < visualIds.length; i++) { > int nextVisualId = visualIds[i]; > switch (nextVisualId) { >@@ -85,21 +85,21 @@ > GenTopLevelNode next = (GenTopLevelNode)it.next(); > %> > case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID: >- result.add(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command(getDiagram(), requestEx, (<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request))); >+ result.append(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command(getDiagram(), requestEx, (<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request))); > break; > <% > } > %> > } > } >- return result.unwrap(); >+ return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagram().getElement()), result); > } > <%}/*when there's palette*/%> > return null; > } > protected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) { > final Node node = (Node) child.getModel(); >- return new Command("Change node position/size") { >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> emfCommand = new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>("Change node position/size") { > private Point moveDelta = request.getMoveDelta(); > private Dimension resizeDelta = request.getSizeDelta(); > >@@ -115,6 +115,9 @@ > public void execute() { > execute(moveDelta, resizeDelta); > } >+ public void redo() { >+ execute(); >+ } > private void execute(Point move, Dimension resize) { > Bounds bounds = (Bounds) node.getLayoutConstraint(); > bounds.setX(bounds.getX() + move.x); >@@ -123,6 +126,7 @@ > bounds.setHeight(bounds.getHeight() + resize.height); > } > }; >+ return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagram().getElement()), emfCommand); > } > protected Command createChangeConstraintCommand(EditPart child, Object constraint) { > assert false; >Index: templates/parts/CompartmentEditPart.javajet >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet,v >retrieving revision 1.2 >diff -u -r1.2 CompartmentEditPart.javajet >--- templates/parts/CompartmentEditPart.javajet 26 Apr 2006 11:58:48 -0000 1.2 >+++ templates/parts/CompartmentEditPart.javajet 22 May 2006 13:59:35 -0000 >@@ -49,7 +49,7 @@ > installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.LAYOUT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")%>() { > protected Command createChangeConstraintCommand(final <%=importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")%> request, EditPart child, Object constraint) { > final Node node = (Node) child.getModel(); >- return new Command("Change node position/size") { >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> emfCommand = new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>("Change node position/size") { > private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> moveDelta = request.getMoveDelta(); > private <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resizeDelta = request.getSizeDelta(); > >@@ -65,6 +65,9 @@ > public void execute() { > execute(moveDelta, resizeDelta); > } >+ public void redo() { >+ execute(); >+ } > private void execute(<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Point")%> move, <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%> resize) { > Bounds bounds = (Bounds) node.getLayoutConstraint(); > bounds.setX(bounds.getX() + move.x); >@@ -73,6 +76,7 @@ > bounds.setHeight(bounds.getHeight() + resize.height); > } > }; >+ return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(node.getDiagram().getElement()), emfCommand); > } > protected Command createChangeConstraintCommand(EditPart child, Object constraint) { > assert false; >@@ -96,7 +100,7 @@ > if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) { > <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateRequestEx) request; > int[] visualIds = requestEx.getVisualIds(); >- CompoundCommand result = new CompoundCommand(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); > for(int i = 0; i < visualIds.length; i++) { > int nextVisualId = visualIds[i]; > switch (nextVisualId) { >@@ -105,7 +109,7 @@ > GenChildNode next = (GenChildNode)it.next(); > %> > case <%=importManager.getImportedName(next.getEditPartQualifiedClassName())%>.VISUAL_ID: >- result.add(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command((View) getModel(), requestEx<%if (!genCompartment.isListLayout()) {%>, >+ result.append(new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command((View) getModel(), requestEx<%if (!genCompartment.isListLayout()) {%>, > (<%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>)getConstraintFor(request)<%}%>)); > break; > <% >@@ -113,7 +117,7 @@ > %> > } > } >- return result.unwrap(); >+ return new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(((View) getModel()).getDiagram().getElement()), result); > } > <%}/*when there's palette*/%> > return null; >Index: templates/parts/createNodeCommand.javajetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/createNodeCommand.javajetinc,v >retrieving revision 1.1 >diff -u -r1.1 createNodeCommand.javajetinc >--- templates/parts/createNodeCommand.javajetinc 13 Apr 2006 21:20:15 -0000 1.1 >+++ templates/parts/createNodeCommand.javajetinc 22 May 2006 13:59:36 -0000 >@@ -1,7 +1,7 @@ > /** > * @generated > */ >- private <%if (isStatic) {%>static <%}%>class Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> { >+ private <%if (isStatic) {%>static <%}%>class Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>Command extends <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%> { > /** > * @generated > */ >@@ -54,7 +54,7 @@ > <% > } > %> >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(parent.getDiagram().getElement()); >+ <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> domainModelEditDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(parent.getDiagram().getElement()); > <% > TypeModelFacet facet = next.getModelFacet(); > GenFeature childFeature = facet.getChildMetaFeature(); >@@ -112,4 +112,10 @@ > parent.getPersistedChildren().remove(createdNode); > domainModelAddCommand.undo(); > } >+ /** >+ * @generated >+ */ >+ public void redo() { >+ execute(); >+ } > } >Index: templates/parts/componentEditPolicy.javajetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/componentEditPolicy.javajetinc,v >retrieving revision 1.1 >diff -u -r1.1 componentEditPolicy.javajetinc >--- templates/parts/componentEditPolicy.javajetinc 13 Apr 2006 21:20:15 -0000 1.1 >+++ templates/parts/componentEditPolicy.javajetinc 22 May 2006 13:59:36 -0000 >@@ -1,6 +1,13 @@ > installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() { > protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) { >- return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() { >+ <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramNode().getDiagram().getElement()); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ cc.append(getDomainModelRemoveCommand(editingDomain)); >+ cc.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create(editingDomain, getDiagramNode())); >+ return new WrappingCommand(editingDomain, cc); >+ } >+ >+ private org.eclipse.emf.common.command.Command getDomainModelRemoveCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) { > <% > { > TypeModelFacet facet = genNode.getModelFacet(); >@@ -8,82 +15,61 @@ > GenFeature containmentFeature = facet.getContainmentMetaFeature(); > if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { > %> >- private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = getDomainModelRemoveCommand(); >- private org.eclipse.emf.common.command.Command getDomainModelRemoveCommand() { >- <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); > <% > if (containmentFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >- getDiagramNode().getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >+ getDiagramNode().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >- <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >+ <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > %> > <% > if (childFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >- getDiagramNode().getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >+ getDiagramNode().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >- <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >+ <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > %> >- return result; >- } >+ return result; > <% > } else { > if (containmentFeature.getEcoreFeature().isMany()) { > %> >- private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >- getDiagramNode().getElement()); >+ return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >+ getDiagramNode().getElement()); > <% > } else { > %> >- private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram().getElement()), >- getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >- <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE); >+ return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramNode().getElement().eContainer(), <%=importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getFeatureAccessorName()%>(), >+ <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE); > <% > } > } > %> >- private final org.eclipse.emf.common.command.Command viewRemoveCommand = <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(getDiagramNode().getDiagram()), >- getDiagramNode()); >- public boolean canExecute() { >- return domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute() && viewRemoveCommand != null && viewRemoveCommand.canExecute(); >- } >- public void execute() { >- domainModelRemoveCommand.execute(); >- viewRemoveCommand.execute(); >- } >- public boolean canUndo() { >- return domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo() && viewRemoveCommand != null && viewRemoveCommand.canUndo(); >- } >- public void undo() { >- domainModelRemoveCommand.undo(); >- viewRemoveCommand.undo(); >- } >- }; > } > }); > <% >Index: templates/parts/linkComponentEditPolicy.javajetinc >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/linkComponentEditPolicy.javajetinc,v >retrieving revision 1.1 >diff -u -r1.1 linkComponentEditPolicy.javajetinc >--- templates/parts/linkComponentEditPolicy.javajetinc 13 Apr 2006 21:20:15 -0000 1.1 >+++ templates/parts/linkComponentEditPolicy.javajetinc 22 May 2006 13:59:36 -0000 >@@ -1,11 +1,35 @@ > installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.COMPONENT_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")%>() { > protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> createDeleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")%> deleteRequest) { >- return new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() { >- private final Edge edgeToRemove = getDiagramEdge(); >- private final View source = edgeToRemove.getSource(); >- private final View target = edgeToRemove.getTarget(); >- private final org.eclipse.emf.common.command.Command domainModelRemoveCommand = createDomainModelRemoveCommand(); >- private org.eclipse.emf.common.command.Command createDomainModelRemoveCommand() { >+ final Edge edgeToRemove = getDiagramEdge(); >+ final View source = edgeToRemove.getSource(); >+ final View target = edgeToRemove.getTarget(); >+ <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramEdge().getDiagram().getElement()); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> cc = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ cc.append(createDomainModelRemoveCommand(editingDomain)); >+ cc.append(new <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%>() { >+ public boolean canExecute() { >+ return source != null && edgeToRemove != null; >+ } >+ public boolean canUndo() { >+ return source != null && edgeToRemove != null; >+ } >+ public void undo() { >+ source.getDiagram().insertEdge(edgeToRemove); >+ edgeToRemove.setSource(source); >+ edgeToRemove.setTarget(target); >+ } >+ public void redo() { >+ execute(); >+ } >+ public void execute() { >+ source.getDiagram().removeEdge(edgeToRemove); >+ edgeToRemove.setSource(null); >+ edgeToRemove.setTarget(null); >+ } >+ }); >+ return new WrappingCommand(editingDomain, cc); >+ } >+ private org.eclipse.emf.common.command.Command createDomainModelRemoveCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain) { > <% > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); >@@ -32,115 +56,94 @@ > } > } > %> >- <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); >+ <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); > <% > if (containmentFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), edgeToRemove.getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), getDiagramEdge().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > } else { > %> >- return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; >+ return <%=importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")%>.INSTANCE; > <% > } > if (removeChild) { > if (childFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >- edgeToRemove.getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >+ getDiagramEdge().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >- <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement().eContainer(), <%=importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=childFeature.getFeatureAccessorName()%>(), >+ <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > } > if (removeSource) { > if (sourceFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), source.getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), getDiagramEdge().getSource().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement(), <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > } > if (removeTarget) { > if (targetFeature.getEcoreFeature().isMany()) { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), target.getElement())); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), getDiagramEdge().getTarget().getElement())); > <% > } else { > %> >- result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- edgeToRemove.getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); >+ result.append(<%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getElement(), <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE)); > <% > } > } > %> >- return result; >+ return result; > <% > } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { > GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); > if (metaFeature.getEcoreFeature().isMany()) { > %> >- return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- source.getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), target.getElement()); >+ return <%=importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getSource().getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), getDiagramEdge().getTarget().getElement()); > <% > } else { > %> >- return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >- <%=importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")%>.getEditingDomainFor(edgeToRemove.getDiagram().getElement()), >- source.getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE); >+ return <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.create( >+ editingDomain, >+ getDiagramEdge().getSource().getElement(), <%=importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=metaFeature.getFeatureAccessorName()%>(), <%=importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")%>.UNSET_VALUE); > <% > } > %> > <% > } > %> >- } >- >- public boolean canExecute() { >- return domainModelRemoveCommand != null && domainModelRemoveCommand.canExecute(); >- } >- public void execute() { >- domainModelRemoveCommand.execute(); >- source.getDiagram().removeEdge(edgeToRemove); >- edgeToRemove.setSource(null); >- edgeToRemove.setTarget(null); >- } >- public boolean canUndo() { >- return domainModelRemoveCommand != null && domainModelRemoveCommand.canUndo(); >- } >- public void undo() { >- domainModelRemoveCommand.undo(); >- source.getDiagram().insertEdge(edgeToRemove); >- edgeToRemove.setSource(source); >- edgeToRemove.setTarget(target); >- } >- }; > } > }); >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 LinkEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java 26 Apr 2006 11:58:49 -0000 1.2 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java 22 May 2006 13:59:34 -0000 >@@ -37,114 +37,109 @@ > protected final String TEXT_18 = ".COMPONENT_ROLE, new "; > protected final String TEXT_19 = "() {" + NL + "\t\t\tprotected "; > protected final String TEXT_20 = " createDeleteCommand("; >- protected final String TEXT_21 = " deleteRequest) {" + NL + "\t\t\t\treturn new "; >- 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() {"; >- protected final String TEXT_23 = NL + "\t\t\t\t\t\t"; >- protected final String TEXT_24 = " result = new "; >- protected final String TEXT_25 = "();"; >- protected final String TEXT_26 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_27 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_28 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), edgeToRemove.getElement()));"; >- protected final String TEXT_29 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_30 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_31 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), edgeToRemove.getElement().eContainmentFeature(), "; >- protected final String TEXT_32 = ".UNSET_VALUE));"; >- protected final String TEXT_33 = NL + "\t\t\treturn "; >- protected final String TEXT_34 = ".INSTANCE;"; >- protected final String TEXT_35 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_36 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_37 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), "; >- protected final String TEXT_38 = ".eINSTANCE.get"; >- protected final String TEXT_39 = "()," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement()));"; >- protected final String TEXT_40 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_41 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_42 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement().eContainer(), "; >- protected final String TEXT_43 = ".eINSTANCE.get"; >- protected final String TEXT_44 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_45 = ".UNSET_VALUE));"; >- protected final String TEXT_46 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_48 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), "; >+ 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"; >+ protected final String TEXT_22 = " editingDomain = "; >+ protected final String TEXT_23 = ".getEditingDomain(getDiagramEdge().getDiagram().getElement());" + NL + "\t\t\t\t"; >+ protected final String TEXT_24 = " cc = new "; >+ protected final String TEXT_25 = "();" + NL + "\t\t\t\tcc.append(createDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append(new "; >+ 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("; >+ protected final String TEXT_27 = " editingDomain) {"; >+ protected final String TEXT_28 = NL + "\t\t\t\t"; >+ protected final String TEXT_29 = " result = new "; >+ protected final String TEXT_30 = "();"; >+ protected final String TEXT_31 = NL + "\t\t\t\tresult.append("; >+ 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()));"; >+ protected final String TEXT_33 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), getDiagramEdge().getElement().eContainmentFeature(), "; >+ protected final String TEXT_35 = ".UNSET_VALUE));"; >+ protected final String TEXT_36 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_37 = ".INSTANCE;"; >+ protected final String TEXT_38 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_39 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), "; >+ protected final String TEXT_40 = ".eINSTANCE.get"; >+ protected final String TEXT_41 = "()," + NL + "\t\t\t\t\tgetDiagramEdge().getElement()));"; >+ protected final String TEXT_42 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_43 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement().eContainer(), "; >+ protected final String TEXT_44 = ".eINSTANCE.get"; >+ protected final String TEXT_45 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_46 = ".UNSET_VALUE));"; >+ protected final String TEXT_47 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_48 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), "; > protected final String TEXT_49 = ".eINSTANCE.get"; >- protected final String TEXT_50 = "(), source.getElement()));"; >- protected final String TEXT_51 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_53 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), "; >- protected final String TEXT_54 = ".eINSTANCE.get"; >- protected final String TEXT_55 = "(), "; >- protected final String TEXT_56 = ".UNSET_VALUE));"; >- protected final String TEXT_57 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_58 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_59 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), "; >- protected final String TEXT_60 = ".eINSTANCE.get"; >- protected final String TEXT_61 = "(), target.getElement()));"; >- protected final String TEXT_62 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_64 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tedgeToRemove.getElement(), "; >- protected final String TEXT_65 = ".eINSTANCE.get"; >- protected final String TEXT_66 = "(), "; >- protected final String TEXT_67 = ".UNSET_VALUE));"; >- protected final String TEXT_68 = NL + "\t\t\t\t\t\treturn result;"; >- protected final String TEXT_69 = NL + "\t\t\t\t\t\treturn "; >- protected final String TEXT_70 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_71 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tsource.getElement(), "; >+ protected final String TEXT_50 = "(), getDiagramEdge().getSource().getElement()));"; >+ protected final String TEXT_51 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), "; >+ protected final String TEXT_53 = ".eINSTANCE.get"; >+ protected final String TEXT_54 = "(), "; >+ protected final String TEXT_55 = ".UNSET_VALUE));"; >+ protected final String TEXT_56 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), "; >+ protected final String TEXT_58 = ".eINSTANCE.get"; >+ protected final String TEXT_59 = "(), getDiagramEdge().getTarget().getElement()));"; >+ protected final String TEXT_60 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_61 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getElement(), "; >+ protected final String TEXT_62 = ".eINSTANCE.get"; >+ protected final String TEXT_63 = "(), "; >+ protected final String TEXT_64 = ".UNSET_VALUE));"; >+ protected final String TEXT_65 = NL + "\t\t\t\treturn result;"; >+ protected final String TEXT_66 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_67 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getSource().getElement(), "; >+ protected final String TEXT_68 = ".eINSTANCE.get"; >+ protected final String TEXT_69 = "(), getDiagramEdge().getTarget().getElement());"; >+ protected final String TEXT_70 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_71 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tgetDiagramEdge().getSource().getElement(), "; > protected final String TEXT_72 = ".eINSTANCE.get"; >- protected final String TEXT_73 = "(), target.getElement());"; >- protected final String TEXT_74 = NL + "\t\t\t\t\t\treturn "; >- protected final String TEXT_75 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_76 = ".getEditingDomainFor(edgeToRemove.getDiagram().getElement())," + NL + "\t\t\t\t\t\t\tsource.getElement(), "; >- protected final String TEXT_77 = ".eINSTANCE.get"; >- protected final String TEXT_78 = "(), "; >- protected final String TEXT_79 = ".UNSET_VALUE);"; >- 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("; >- protected final String TEXT_81 = ".CONNECTION_ENDPOINTS_ROLE, new "; >- protected final String TEXT_82 = "());" + NL + "\t}" + NL; >- 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 "; >- protected final String TEXT_84 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; >- protected final String TEXT_85 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; >- protected final String TEXT_86 = " nextChild = ("; >- protected final String TEXT_87 = ")it.next();" + NL + "\t\t\tif ("; >- protected final String TEXT_88 = ".getVisualID(nextChild) == "; >- 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("; >- protected final String TEXT_90 = " req) {" + NL + "\t\tif ("; >- protected final String TEXT_91 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; >- 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}"; >- 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; >+ protected final String TEXT_73 = "(), "; >+ protected final String TEXT_74 = ".UNSET_VALUE);"; >+ protected final String TEXT_75 = NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; >+ protected final String TEXT_76 = ".CONNECTION_ENDPOINTS_ROLE, new "; >+ protected final String TEXT_77 = "());" + NL + "\t}" + NL; >+ 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 "; >+ protected final String TEXT_79 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; >+ protected final String TEXT_80 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; >+ protected final String TEXT_81 = " nextChild = ("; >+ protected final String TEXT_82 = ")it.next();" + NL + "\t\t\tif ("; >+ protected final String TEXT_83 = ".getVisualID(nextChild) == "; >+ 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("; >+ protected final String TEXT_85 = " req) {" + NL + "\t\tif ("; >+ protected final String TEXT_86 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; >+ 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}"; >+ 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; >+ protected final String TEXT_89 = NL; >+ protected final String TEXT_90 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_91 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >+ protected final String TEXT_92 = " feature, "; >+ 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; > protected final String TEXT_94 = NL; >- protected final String TEXT_95 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_96 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >- protected final String TEXT_97 = " feature, "; >- 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; >+ 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 "; >+ protected final String TEXT_96 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >+ 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(("; >+ 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; > protected final String TEXT_99 = NL; >- 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 "; >- protected final String TEXT_101 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >- 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(("; >- 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; >+ protected final String TEXT_100 = "\tpublic void addRefresher("; >+ 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("; >+ 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("; >+ 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();"; > protected final String TEXT_104 = NL; >- protected final String TEXT_105 = "\tpublic void addRefresher("; >- 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("; >- 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("; >- 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();"; >- protected final String TEXT_109 = NL; >- 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("; >- protected final String TEXT_111 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_112 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >- protected final String TEXT_113 = NL; >- 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("; >- 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 "; >- protected final String TEXT_116 = " createFigure() {"; >- protected final String TEXT_117 = NL + "\t\treturn new "; >- protected final String TEXT_118 = "();"; >- protected final String TEXT_119 = NL + "\t\treturn "; >- protected final String TEXT_120 = ";"; >- protected final String TEXT_121 = NL + " \t\treturn new "; >- protected final String TEXT_122 = "();"; >- protected final String TEXT_123 = NL + "\t}" + NL; >- protected final String TEXT_124 = NL; >- protected final String TEXT_125 = NL; >- 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}"; >- protected final String TEXT_127 = NL + "}"; >- protected final String TEXT_128 = NL; >+ 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("; >+ protected final String TEXT_106 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_107 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >+ protected final String TEXT_108 = NL; >+ 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("; >+ 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 "; >+ protected final String TEXT_111 = " createFigure() {"; >+ protected final String TEXT_112 = NL + "\t\treturn new "; >+ protected final String TEXT_113 = "();"; >+ protected final String TEXT_114 = NL + "\t\treturn "; >+ protected final String TEXT_115 = ";"; >+ protected final String TEXT_116 = NL + " \t\treturn new "; >+ protected final String TEXT_117 = "();"; >+ protected final String TEXT_118 = NL + "\t}" + NL; >+ protected final String TEXT_119 = NL; >+ protected final String TEXT_120 = NL; >+ 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}"; >+ protected final String TEXT_122 = NL + "}"; >+ protected final String TEXT_123 = NL; > > public String generate(Object argument) > { >@@ -201,8 +196,18 @@ > stringBuffer.append(TEXT_20); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); > stringBuffer.append(TEXT_21); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_22); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_23); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_24); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_25); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); >+ stringBuffer.append(TEXT_26); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); >+ stringBuffer.append(TEXT_27); > > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); >@@ -229,74 +234,64 @@ > } > } > >- stringBuffer.append(TEXT_23); >+ stringBuffer.append(TEXT_28); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_24); >+ stringBuffer.append(TEXT_29); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_25); >+ stringBuffer.append(TEXT_30); > > if (containmentFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_26); >+ stringBuffer.append(TEXT_31); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_27); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_28); >+ stringBuffer.append(TEXT_32); > > } else { > >- stringBuffer.append(TEXT_29); >+ stringBuffer.append(TEXT_33); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_30); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_31); >+ stringBuffer.append(TEXT_34); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_35); > > } > } else { > >- stringBuffer.append(TEXT_33); >+ stringBuffer.append(TEXT_36); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >- stringBuffer.append(TEXT_34); >+ stringBuffer.append(TEXT_37); > > } > if (removeChild) { > if (childFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_38); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_36); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_37); >+ stringBuffer.append(TEXT_39); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_38); >+ stringBuffer.append(TEXT_40); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_39); >+ stringBuffer.append(TEXT_41); > > } else { > >- stringBuffer.append(TEXT_40); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_41); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); > stringBuffer.append(TEXT_42); >- stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_43); >- stringBuffer.append(childFeature.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_44); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(childFeature.getFeatureAccessorName()); > stringBuffer.append(TEXT_45); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_46); > > } > } > if (removeSource) { > if (sourceFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_47); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_48); > stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_49); >@@ -308,150 +303,140 @@ > stringBuffer.append(TEXT_51); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_52); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_53); > stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_54); >+ stringBuffer.append(TEXT_53); > stringBuffer.append(sourceFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_55); >+ stringBuffer.append(TEXT_54); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_56); >+ stringBuffer.append(TEXT_55); > > } > } > if (removeTarget) { > if (targetFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_57); >+ stringBuffer.append(TEXT_56); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_58); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_59); >+ stringBuffer.append(TEXT_57); > stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_60); >+ stringBuffer.append(TEXT_58); > stringBuffer.append(targetFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_61); >+ stringBuffer.append(TEXT_59); > > } else { > >- stringBuffer.append(TEXT_62); >+ stringBuffer.append(TEXT_60); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_64); >+ stringBuffer.append(TEXT_61); > stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_65); >+ stringBuffer.append(TEXT_62); > stringBuffer.append(targetFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_66); >+ stringBuffer.append(TEXT_63); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_67); >+ stringBuffer.append(TEXT_64); > > } > } > >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_65); > > } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { > GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); > if (metaFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_66); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_70); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_67); > stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_68); > stringBuffer.append(metaFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_73); >+ stringBuffer.append(TEXT_69); > > } else { > >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_70); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_75); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_71); > stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_77); >+ stringBuffer.append(TEXT_72); > stringBuffer.append(metaFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_73); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_74); > > } > > > } > >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_75); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >- stringBuffer.append(TEXT_81); >+ stringBuffer.append(TEXT_76); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); >- stringBuffer.append(TEXT_82); >+ stringBuffer.append(TEXT_77); > > if (genLink.getLabels().size() > 0) { > GenLinkLabel primaryLabel = (GenLinkLabel)genLink.getLabels().get(0); > >- stringBuffer.append(TEXT_83); >+ stringBuffer.append(TEXT_78); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_84); >+ stringBuffer.append(TEXT_79); > stringBuffer.append(importManager.getImportedName("java.util.Iterator")); >- stringBuffer.append(TEXT_85); >+ stringBuffer.append(TEXT_80); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_86); >+ stringBuffer.append(TEXT_81); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_87); >+ stringBuffer.append(TEXT_82); > stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); >- stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_83); > stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_84); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >- stringBuffer.append(TEXT_90); >+ stringBuffer.append(TEXT_85); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >- stringBuffer.append(TEXT_91); >+ stringBuffer.append(TEXT_86); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_92); >+ stringBuffer.append(TEXT_87); > > } //if (genLink.getLabels().size() > 0) > >+ stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_90); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); >+ stringBuffer.append(TEXT_91); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(TEXT_92); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_93); > stringBuffer.append(TEXT_94); > stringBuffer.append(TEXT_95); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); > stringBuffer.append(TEXT_96); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >- stringBuffer.append(TEXT_97); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(TEXT_97); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_98); > stringBuffer.append(TEXT_99); > stringBuffer.append(TEXT_100); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_101); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_102); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_103); > stringBuffer.append(TEXT_104); > stringBuffer.append(TEXT_105); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_106); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_107); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_108); > stringBuffer.append(TEXT_109); >- stringBuffer.append(TEXT_110); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_111); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_112); >- stringBuffer.append(TEXT_113); >- stringBuffer.append(TEXT_114); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_115); >+ stringBuffer.append(TEXT_110); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_116); >+ stringBuffer.append(TEXT_111); > > Viewmap viewmap = genLink.getViewmap(); > if (viewmap instanceof FigureViewmap) { >@@ -461,41 +446,41 @@ > figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection"; > } > >- stringBuffer.append(TEXT_117); >+ stringBuffer.append(TEXT_112); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_118); >+ stringBuffer.append(TEXT_113); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_119); >+ stringBuffer.append(TEXT_114); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_120); >+ stringBuffer.append(TEXT_115); > } // instanceof SnippetViewmap > else if (viewmap instanceof InnerClassViewmap) { >- stringBuffer.append(TEXT_121); >+ stringBuffer.append(TEXT_116); > stringBuffer.append(((InnerClassViewmap) viewmap).getClassName()); >- stringBuffer.append(TEXT_122); >+ stringBuffer.append(TEXT_117); > } >- stringBuffer.append(TEXT_123); >+ stringBuffer.append(TEXT_118); > > if (genLink.getViewmap() instanceof InnerClassViewmap) { > String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody(); > >- stringBuffer.append(TEXT_124); >+ stringBuffer.append(TEXT_119); > stringBuffer.append(classBody); >- stringBuffer.append(TEXT_125); >+ stringBuffer.append(TEXT_120); > > if (classBody.indexOf("DPtoLP") != -1) { > >- stringBuffer.append(TEXT_126); >+ stringBuffer.append(TEXT_121); > > } > > > } > >- stringBuffer.append(TEXT_127); >+ stringBuffer.append(TEXT_122); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_123); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java,v >retrieving revision 1.3 >diff -u -r1.3 LinkLabelEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 15 May 2006 11:19:18 -0000 1.3 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 22 May 2006 13:59:34 -0000 >@@ -30,199 +30,197 @@ > protected final String TEXT_10 = NL; > protected final String TEXT_11 = NL; > protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- 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 "; >- 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() {"; >- protected final String TEXT_15 = NL + "\t\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new "; >- protected final String TEXT_16 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});"; >- protected final String TEXT_17 = NL; >- protected final String TEXT_18 = "\t\tinstallEditPolicy("; >- protected final String TEXT_19 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >- protected final String TEXT_20 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >- 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 "; >- protected final String TEXT_22 = " getDirectEditCommand("; >- 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 "; >- 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 "; >- 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 "; >- protected final String TEXT_26 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >- protected final String TEXT_27 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >- protected final String TEXT_29 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_31 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_32 = " element = "; >- protected final String TEXT_33 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_34 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_35 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_36 = " domainModelEditDomain = "; >- protected final String TEXT_37 = ".getEditingDomainFor("; >- protected final String TEXT_38 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_39 = " feature = ("; >- protected final String TEXT_40 = ") "; >- protected final String TEXT_41 = ".eINSTANCE.get"; >- 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 = "; >- 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 "; >- protected final String TEXT_44 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_45 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_46 = " result = new "; >- protected final String TEXT_47 = "();" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_48 = " values = new "; >- protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_50 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_51 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;"; >- protected final String TEXT_53 = NL + "\t\t\t\t\t\t\t\treturn "; >- protected final String TEXT_54 = ".create(domainModelEditDomain, element, feature, valueToSet);"; >- protected final String TEXT_55 = NL + "\t\t\t\t\t\t\t}"; >- protected final String TEXT_56 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >- protected final String TEXT_57 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_58 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_59 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_60 = " element = "; >- protected final String TEXT_61 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_62 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_63 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_64 = " domainModelEditDomain = "; >- protected final String TEXT_65 = ".getEditingDomainFor("; >- protected final String TEXT_66 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_67 = " result = new "; >- protected final String TEXT_68 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;"; >- protected final String TEXT_69 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_70 = " "; >- protected final String TEXT_71 = "feature = ("; >- protected final String TEXT_72 = ") "; >- protected final String TEXT_73 = ".eINSTANCE.get"; >- protected final String TEXT_74 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = "; >- protected final String TEXT_75 = ".parseValue(feature, parseResult["; >- 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 "; >- protected final String TEXT_77 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_78 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_79 = " "; >- protected final String TEXT_80 = "values = new "; >- protected final String TEXT_81 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_82 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_83 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_85 = NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_86 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_87 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}"; >- 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});"; >- protected final String TEXT_89 = NL + "\t}" + NL; >- protected final String TEXT_90 = NL; >- protected final String TEXT_91 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >- protected final String TEXT_92 = " req) {" + NL + "\t\tif ("; >- 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 "; >- protected final String TEXT_94 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >- protected final String TEXT_95 = "(this, "; >- protected final String TEXT_96 = ".class, new "; >- protected final String TEXT_97 = "() {" + NL + "\t\t\t\tpublic void relocate("; >- protected final String TEXT_98 = " celleditor) {" + NL + "\t\t\t\t\t"; >- 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; >- 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(("; >- protected final String TEXT_101 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; >- protected final String TEXT_102 = "() {" + NL + "\t\t\t\t\tprotected "; >- protected final String TEXT_103 = " getReferencePoint() {" + NL + "\t\t\t\t\t\t"; >- protected final String TEXT_104 = " parent = getUpdatableParent();" + NL + "\t\t\t\t\t\t"; >- protected final String TEXT_105 = " connection = ("; >- protected final String TEXT_106 = ") parent.getFigure();" + NL + "\t\t\t\t\t\t"; >- 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 "; >- 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; >- protected final String TEXT_109 = NL; >- protected final String TEXT_110 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; >- protected final String TEXT_111 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; >- protected final String TEXT_112 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; >+ protected final String TEXT_13 = " manager;" + NL; >+ 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 "; >+ 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() {"; >+ protected final String TEXT_16 = NL + "\t\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new "; >+ protected final String TEXT_17 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});"; >+ protected final String TEXT_18 = NL; >+ protected final String TEXT_19 = "\t\tinstallEditPolicy("; >+ protected final String TEXT_20 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >+ protected final String TEXT_21 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >+ 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 "; >+ protected final String TEXT_23 = " getDirectEditCommand("; >+ 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 "; >+ 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 "; >+ 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 "; >+ protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >+ protected final String TEXT_28 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_29 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_30 = " editingDomain = "; >+ protected final String TEXT_31 = ".getEditingDomain("; >+ protected final String TEXT_32 = ".getDiagram().getElement());"; >+ protected final String TEXT_33 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_34 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_36 = " createDomainModelCommand("; >+ protected final String TEXT_37 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_38 = " element = "; >+ protected final String TEXT_39 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_40 = " feature = ("; >+ protected final String TEXT_41 = ") "; >+ protected final String TEXT_42 = ".eINSTANCE.get"; >+ 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 = "; >+ 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 "; >+ protected final String TEXT_45 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_46 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_47 = " result = new "; >+ protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_49 = " values = new "; >+ protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_51 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_52 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_53 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; >+ protected final String TEXT_54 = NL + "\t\t\t\t\t\treturn "; >+ protected final String TEXT_55 = ".create(editingDomain, element, feature, valueToSet);"; >+ protected final String TEXT_56 = NL + "\t\t\t\t\t}"; >+ protected final String TEXT_57 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >+ protected final String TEXT_58 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_59 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_61 = " createDomainModelCommand("; >+ protected final String TEXT_62 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_63 = " element = "; >+ protected final String TEXT_64 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_65 = " result = new "; >+ protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; >+ protected final String TEXT_67 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_68 = " "; >+ protected final String TEXT_69 = "feature = ("; >+ protected final String TEXT_70 = ") "; >+ protected final String TEXT_71 = ".eINSTANCE.get"; >+ protected final String TEXT_72 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; >+ protected final String TEXT_73 = ".parseValue(feature, values["; >+ protected final String TEXT_74 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_76 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_77 = " "; >+ protected final String TEXT_78 = "values = new "; >+ protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_80 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_81 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_82 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_83 = NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_84 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_85 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; >+ protected final String TEXT_86 = NL + "\t\t\t\t});"; >+ protected final String TEXT_87 = NL + "\t}" + NL; >+ protected final String TEXT_88 = NL; >+ protected final String TEXT_89 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >+ protected final String TEXT_90 = " req) {" + NL + "\t\tif ("; >+ 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 "; >+ protected final String TEXT_92 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >+ protected final String TEXT_93 = "(this, "; >+ protected final String TEXT_94 = ".class, new "; >+ protected final String TEXT_95 = "() {" + NL + "\t\t\t\tpublic void relocate("; >+ protected final String TEXT_96 = " celleditor) {" + NL + "\t\t\t\t\t"; >+ 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; >+ 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(("; >+ protected final String TEXT_99 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; >+ protected final String TEXT_100 = "() {" + NL + "\t\t\t\t\tprotected "; >+ protected final String TEXT_101 = " getReferencePoint() {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_102 = " parent = getUpdatableParent();" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_103 = " connection = ("; >+ protected final String TEXT_104 = ") parent.getFigure();" + NL + "\t\t\t\t\t\t"; >+ 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 "; >+ 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; >+ protected final String TEXT_107 = NL; >+ protected final String TEXT_108 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; >+ protected final String TEXT_109 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; >+ protected final String TEXT_110 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; >+ protected final String TEXT_111 = " element = "; >+ 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"; > protected final String TEXT_113 = " element = "; >- 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"; >- protected final String TEXT_115 = " element = "; >- 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("; >- protected final String TEXT_117 = " element, String pattern) {"; >- protected final String TEXT_118 = NL + "\t\tif (element.get"; >- protected final String TEXT_119 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; >- protected final String TEXT_120 = NL + "\t\treturn "; >- protected final String TEXT_121 = ".format(pattern, new Object[] {"; >- protected final String TEXT_122 = NL + "\t\t\t"; >- protected final String TEXT_123 = NL + "\t\t});"; >- protected final String TEXT_124 = NL + "\t\treturn "; >- protected final String TEXT_125 = ".format(pattern, new Object[] {"; >- protected final String TEXT_126 = NL + "\t\t"; >- protected final String TEXT_127 = ","; >- protected final String TEXT_128 = NL + "\t\t});"; >- protected final String TEXT_129 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; >- protected final String TEXT_130 = NL + "\t}"; >- protected final String TEXT_131 = NL; >- protected final String TEXT_132 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >- protected final String TEXT_133 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_134 = ") "; >- protected final String TEXT_135 = ".getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_136 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- 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 = "; >- protected final String TEXT_138 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_139 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_140 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >- protected final String TEXT_141 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >- 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 "; >- 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 "; >- protected final String TEXT_144 = " createdFont;"; >- protected final String TEXT_145 = NL; >- protected final String TEXT_146 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; >- protected final String TEXT_147 = " style = ("; >- protected final String TEXT_148 = ") "; >- protected final String TEXT_149 = ".getStyle("; >- protected final String TEXT_150 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- 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"; >- 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 "; >- 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 "; >- protected final String TEXT_154 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- 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 ("; >- 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 "; >- protected final String TEXT_157 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; >- protected final String TEXT_158 = ") {" + NL + "\t\t\t\treturn ("; >- 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"; >- protected final String TEXT_160 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_163 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_165 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; >- protected final String TEXT_166 = NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_167 = ".eINSTANCE.get"; >- protected final String TEXT_168 = "(), labelRefresher);"; >- protected final String TEXT_169 = NL + "\t\t\tupdatableParent.addRefresher("; >- protected final String TEXT_170 = ".eINSTANCE.get"; >- protected final String TEXT_171 = "(), labelRefresher);"; >- 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"; >- protected final String TEXT_173 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_176 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_178 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; >- protected final String TEXT_179 = NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_180 = ".eINSTANCE.get"; >- protected final String TEXT_181 = "(), labelRefresher);"; >- protected final String TEXT_182 = NL + "\t\t\tupdatableParent.removeRefresher("; >- protected final String TEXT_183 = ".eINSTANCE.get"; >- protected final String TEXT_184 = "(), labelRefresher);"; >- 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; >- protected final String TEXT_186 = NL; >- protected final String TEXT_187 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_188 = " createFigure() {" + NL + "\t\t"; >- 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 "; >- protected final String TEXT_190 = " createLabel() {"; >- protected final String TEXT_191 = NL + "\t\treturn new "; >- protected final String TEXT_192 = "();"; >- protected final String TEXT_193 = NL + "\t\treturn "; >- protected final String TEXT_194 = ";"; >- protected final String TEXT_195 = NL + "\t\treturn new "; >- protected final String TEXT_196 = "();"; >- protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_198 = " getLabel() {" + NL + "\t\treturn ("; >- protected final String TEXT_199 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel("; >- 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; >- protected final String TEXT_201 = NL; >- protected final String TEXT_202 = NL; >- 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}"; >- protected final String TEXT_204 = NL + "}"; >- protected final String TEXT_205 = NL; >+ 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("; >+ protected final String TEXT_115 = " element, String pattern) {"; >+ protected final String TEXT_116 = NL + "\t\tif (element.get"; >+ protected final String TEXT_117 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; >+ protected final String TEXT_118 = NL + "\t\treturn "; >+ protected final String TEXT_119 = ".format(pattern, new Object[] {"; >+ protected final String TEXT_120 = NL + "\t\t\t"; >+ protected final String TEXT_121 = NL + "\t\t});"; >+ protected final String TEXT_122 = NL + "\t\treturn "; >+ protected final String TEXT_123 = ".format(pattern, new Object[] {"; >+ protected final String TEXT_124 = NL + "\t\t"; >+ protected final String TEXT_125 = ","; >+ protected final String TEXT_126 = NL + "\t\t});"; >+ protected final String TEXT_127 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; >+ protected final String TEXT_128 = NL + "\t}"; >+ protected final String TEXT_129 = NL; >+ protected final String TEXT_130 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >+ protected final String TEXT_131 = " style =" + NL + "\t\t\t("; >+ protected final String TEXT_132 = ") "; >+ protected final String TEXT_133 = ".getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_134 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >+ 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 = "; >+ protected final String TEXT_136 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_137 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_138 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >+ protected final String TEXT_139 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_142 = " createdFont;"; >+ protected final String TEXT_143 = NL; >+ protected final String TEXT_144 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; >+ protected final String TEXT_145 = " style = ("; >+ protected final String TEXT_146 = ") "; >+ protected final String TEXT_147 = ".getStyle("; >+ protected final String TEXT_148 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >+ 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"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_152 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ 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 ("; >+ 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 "; >+ protected final String TEXT_155 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; >+ protected final String TEXT_156 = ") {" + NL + "\t\t\t\treturn ("; >+ 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"; >+ protected final String TEXT_158 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_159 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_162 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; >+ protected final String TEXT_164 = NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_165 = ".eINSTANCE.get"; >+ protected final String TEXT_166 = "(), labelRefresher);"; >+ protected final String TEXT_167 = NL + "\t\t\tupdatableParent.addRefresher("; >+ protected final String TEXT_168 = ".eINSTANCE.get"; >+ protected final String TEXT_169 = "(), labelRefresher);"; >+ 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"; >+ protected final String TEXT_171 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_172 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; >+ protected final String TEXT_177 = NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_178 = ".eINSTANCE.get"; >+ protected final String TEXT_179 = "(), labelRefresher);"; >+ protected final String TEXT_180 = NL + "\t\t\tupdatableParent.removeRefresher("; >+ protected final String TEXT_181 = ".eINSTANCE.get"; >+ protected final String TEXT_182 = "(), labelRefresher);"; >+ 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; >+ protected final String TEXT_184 = NL; >+ protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_186 = " createFigure() {" + NL + "\t\t"; >+ 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 "; >+ protected final String TEXT_188 = " createLabel() {"; >+ protected final String TEXT_189 = NL + "\t\treturn new "; >+ protected final String TEXT_190 = "();"; >+ protected final String TEXT_191 = NL + "\t\treturn "; >+ protected final String TEXT_192 = ";"; >+ protected final String TEXT_193 = NL + "\t\treturn new "; >+ protected final String TEXT_194 = "();"; >+ protected final String TEXT_195 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_196 = " getLabel() {" + NL + "\t\treturn ("; >+ protected final String TEXT_197 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel("; >+ 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; >+ protected final String TEXT_199 = NL; >+ protected final String TEXT_200 = NL; >+ 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}"; >+ protected final String TEXT_202 = NL + "}"; >+ protected final String TEXT_203 = NL; > > public String generate(Object argument) > { >@@ -243,6 +241,7 @@ > } else { > underlyingMetaClass = null; > } >+final boolean isReadOnly = genLabel.isReadOnly(); > > stringBuffer.append(TEXT_1); > >@@ -277,242 +276,242 @@ > } > stringBuffer.append(TEXT_10); > stringBuffer.append(TEXT_11); >+ >+if (!isReadOnly) { >+ > stringBuffer.append(TEXT_12); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); > stringBuffer.append(TEXT_13); >- stringBuffer.append(genLabel.getEditPartClassName()); >+ >+} >+ > stringBuffer.append(TEXT_14); >+ stringBuffer.append(genLabel.getEditPartClassName()); >+ stringBuffer.append(TEXT_15); > > final String primaryView = "getUpdatableParent().getDiagramEdge()"; > final String resolvedSemanticElement = "resolveSemanticElement()"; > >- stringBuffer.append(TEXT_15); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); > stringBuffer.append(TEXT_16); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); >+ stringBuffer.append(TEXT_17); > >-if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) { >- boolean isReadOnly = genLabel.isReadOnly(); >+if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { > >- stringBuffer.append(TEXT_17); > stringBuffer.append(TEXT_18); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_19); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_20); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); > stringBuffer.append(TEXT_21); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_22); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(TEXT_22); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_23); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); > stringBuffer.append(TEXT_24); >- stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_25); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_25); >+ stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); > stringBuffer.append(TEXT_26); >- stringBuffer.append(importManager.getImportedName("java.text.ParseException")); >- stringBuffer.append(TEXT_27); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_27); >+ stringBuffer.append(importManager.getImportedName("java.text.ParseException")); > stringBuffer.append(TEXT_28); >- >-if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) { >- GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >- EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >- >- stringBuffer.append(TEXT_29); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_29); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_30); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_31); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_32); >- stringBuffer.append(resolvedSemanticElement); >+ >+if (labelModelFacet instanceof FeatureLabelModelFacet) { >+ GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >+ EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >+ > stringBuffer.append(TEXT_33); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_34); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_35); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_36); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_37); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_38); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_39); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_40); >- stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_41); >- stringBuffer.append(featureToSet.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_42); >- stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >+ stringBuffer.append(featureToSet.getFeatureAccessorName()); > stringBuffer.append(TEXT_43); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); > stringBuffer.append(TEXT_44); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(TEXT_45); > > if (ecoreFeature.isMany()) { > >- stringBuffer.append(TEXT_45); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_46); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_47); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_48); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); > stringBuffer.append(TEXT_49); >- stringBuffer.append(featureToSet.getAccessorName()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); > stringBuffer.append(TEXT_50); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >+ stringBuffer.append(featureToSet.getAccessorName()); > stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_52); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(TEXT_53); > > } else { > >- stringBuffer.append(TEXT_53); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_54); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_55); > > } > >- stringBuffer.append(TEXT_55); >+ stringBuffer.append(TEXT_56); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); > >- stringBuffer.append(TEXT_56); >- stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_57); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_58); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_59); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_60); >- stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_61); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(TEXT_61); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_64); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_65); >- stringBuffer.append(primaryView); >- stringBuffer.append(TEXT_66); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_67); >+ stringBuffer.append(TEXT_65); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_66); > > boolean haveDeclaredValues = false; > for(int i = 0; i < metaFeatures.size(); i++) { > GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); > EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); > >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_67); > if (i == 0) { > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_70); >+ stringBuffer.append(TEXT_68); > } >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_69); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_70); > stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_73); >+ stringBuffer.append(TEXT_71); > stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_72); > stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >- stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_73); > stringBuffer.append(i); >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_74); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >- stringBuffer.append(TEXT_77); >+ stringBuffer.append(TEXT_75); > > if (nextEcoreFeature.isMany()) { > >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_76); > if (!haveDeclaredValues) { haveDeclaredValues = true; > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_77); > } >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_78); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >- stringBuffer.append(TEXT_81); >+ stringBuffer.append(TEXT_79); > stringBuffer.append(nextFeatureToSet.getAccessorName()); >- stringBuffer.append(TEXT_82); >+ stringBuffer.append(TEXT_80); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_83); >+ stringBuffer.append(TEXT_81); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >- stringBuffer.append(TEXT_84); >+ stringBuffer.append(TEXT_82); > > } else { > >- stringBuffer.append(TEXT_85); >+ stringBuffer.append(TEXT_83); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_86); >+ stringBuffer.append(TEXT_84); > > } > > > } > >- stringBuffer.append(TEXT_87); >+ stringBuffer.append(TEXT_85); > > } > >- stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_86); > > } > >- stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_87); > >-if (labelModelFacet instanceof FeatureLabelModelFacet == true || labelModelFacet instanceof CompositeFeatureLabelModelFacet) { >+if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { > >- stringBuffer.append(TEXT_90); >- stringBuffer.append(TEXT_91); >+ stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_89); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >- stringBuffer.append(TEXT_92); >+ stringBuffer.append(TEXT_90); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >- stringBuffer.append(TEXT_93); >+ stringBuffer.append(TEXT_91); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); >- stringBuffer.append(TEXT_94); >+ stringBuffer.append(TEXT_92); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); >- stringBuffer.append(TEXT_95); >+ stringBuffer.append(TEXT_93); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); >- stringBuffer.append(TEXT_96); >+ stringBuffer.append(TEXT_94); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); >- stringBuffer.append(TEXT_97); >+ stringBuffer.append(TEXT_95); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); >- stringBuffer.append(TEXT_98); >+ stringBuffer.append(TEXT_96); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_99); >+ stringBuffer.append(TEXT_97); > > } > >- stringBuffer.append(TEXT_100); >+ stringBuffer.append(TEXT_98); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); >- stringBuffer.append(TEXT_101); >+ stringBuffer.append(TEXT_99); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.AbstractLocator")); >- stringBuffer.append(TEXT_102); >+ stringBuffer.append(TEXT_100); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >- stringBuffer.append(TEXT_103); >+ stringBuffer.append(TEXT_101); > stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_104); >+ stringBuffer.append(TEXT_102); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); >- stringBuffer.append(TEXT_105); >+ stringBuffer.append(TEXT_103); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); >- stringBuffer.append(TEXT_106); >+ stringBuffer.append(TEXT_104); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >- stringBuffer.append(TEXT_107); >+ stringBuffer.append(TEXT_105); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >- stringBuffer.append(TEXT_108); >- stringBuffer.append(TEXT_109); >+ stringBuffer.append(TEXT_106); >+ stringBuffer.append(TEXT_107); > > /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ > HashMap primitiveTypeToWrapperClassName = new HashMap(); >@@ -556,10 +555,14 @@ > } > } > >- stringBuffer.append(TEXT_110); >+ stringBuffer.append(TEXT_108); > stringBuffer.append(viewPattern); >- stringBuffer.append(TEXT_111); >+ stringBuffer.append(TEXT_109); > stringBuffer.append(editPattern); >+ stringBuffer.append(TEXT_110); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(TEXT_111); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_112); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_113); >@@ -567,41 +570,37 @@ > stringBuffer.append(TEXT_114); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_115); >- stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_116); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_117); > > if (labelModelFacet instanceof FeatureLabelModelFacet) { > FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; > GenFeature feature = featureLabelModelFacet.getMetaFeature(); > if (!feature.isPrimitiveType()) { > >- stringBuffer.append(TEXT_118); >+ stringBuffer.append(TEXT_116); > stringBuffer.append(feature.getCapName()); >- stringBuffer.append(TEXT_119); >+ stringBuffer.append(TEXT_117); > > } > >- stringBuffer.append(TEXT_120); >+ stringBuffer.append(TEXT_118); > stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_121); >+ stringBuffer.append(TEXT_119); > > String value = "element.get" + feature.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ > if (feature.isPrimitiveType()) { > value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; > } > >- stringBuffer.append(TEXT_122); >+ stringBuffer.append(TEXT_120); > stringBuffer.append(value); >- stringBuffer.append(TEXT_123); >+ stringBuffer.append(TEXT_121); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > >- stringBuffer.append(TEXT_124); >+ stringBuffer.append(TEXT_122); > stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_125); >+ stringBuffer.append(TEXT_123); > > for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { > GenFeature next = (GenFeature) it.next(); >@@ -610,78 +609,82 @@ > value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; > } > >- stringBuffer.append(TEXT_126); >+ stringBuffer.append(TEXT_124); > stringBuffer.append(value); > if (it.hasNext()) { >- stringBuffer.append(TEXT_127); >+ stringBuffer.append(TEXT_125); > } > > } > >- stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_126); > > } else { > >- stringBuffer.append(TEXT_129); >+ stringBuffer.append(TEXT_127); > > } > >+ stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_129); > stringBuffer.append(TEXT_130); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_131); >- stringBuffer.append(TEXT_132); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(TEXT_132); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_133); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_134); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_135); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_136); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_137); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_138); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_139); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); > stringBuffer.append(TEXT_140); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_141); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); >- stringBuffer.append(TEXT_142); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(TEXT_142); > stringBuffer.append(TEXT_143); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_144); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_145); >- stringBuffer.append(TEXT_146); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(TEXT_146); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_147); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_148); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_149); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_150); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_151); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_152); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_153); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_154); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(TEXT_154); >+ stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_155); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_156); > stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_157); > stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); > stringBuffer.append(TEXT_158); >- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_159); >- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_160); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_161); >@@ -689,36 +692,36 @@ > stringBuffer.append(TEXT_162); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_163); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_164); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_165); > > if (labelModelFacet instanceof FeatureLabelModelFacet) { > GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); > >- stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_164); > stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_167); >+ stringBuffer.append(TEXT_165); > stringBuffer.append(feature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_168); >+ stringBuffer.append(TEXT_166); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { > GenFeature next = (GenFeature) it.next(); > >- stringBuffer.append(TEXT_169); >+ stringBuffer.append(TEXT_167); > stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_170); >+ stringBuffer.append(TEXT_168); > stringBuffer.append(next.getFeatureAccessorName()); >- stringBuffer.append(TEXT_171); >+ stringBuffer.append(TEXT_169); > > } > } > >- stringBuffer.append(TEXT_172); >+ stringBuffer.append(TEXT_170); > stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); >+ stringBuffer.append(TEXT_171); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_172); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_173); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_174); >@@ -726,46 +729,42 @@ > stringBuffer.append(TEXT_175); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_176); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_177); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_178); > > if (labelModelFacet instanceof FeatureLabelModelFacet) { > GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); > >- stringBuffer.append(TEXT_179); >+ stringBuffer.append(TEXT_177); > stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_180); >+ stringBuffer.append(TEXT_178); > stringBuffer.append(feature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_181); >+ stringBuffer.append(TEXT_179); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { > GenFeature next = (GenFeature) it.next(); > >- stringBuffer.append(TEXT_182); >+ stringBuffer.append(TEXT_180); > stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_183); >+ stringBuffer.append(TEXT_181); > stringBuffer.append(next.getFeatureAccessorName()); >- stringBuffer.append(TEXT_184); >+ stringBuffer.append(TEXT_182); > > } > } > >- stringBuffer.append(TEXT_185); >+ stringBuffer.append(TEXT_183); > > final Viewmap viewmap = genLabel.getViewmap(); > >- stringBuffer.append(TEXT_186); >- stringBuffer.append(TEXT_187); >+ stringBuffer.append(TEXT_184); >+ stringBuffer.append(TEXT_185); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_188); >+ stringBuffer.append(TEXT_186); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_189); >+ stringBuffer.append(TEXT_187); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_190); >+ stringBuffer.append(TEXT_188); > > String figureQualifiedClassName = null; > if (viewmap instanceof FigureViewmap) { >@@ -774,49 +773,49 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_191); >+ stringBuffer.append(TEXT_189); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_192); >+ stringBuffer.append(TEXT_190); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_193); >+ stringBuffer.append(TEXT_191); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_194); >+ stringBuffer.append(TEXT_192); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_195); >+ stringBuffer.append(TEXT_193); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_196); >+ stringBuffer.append(TEXT_194); > } >- stringBuffer.append(TEXT_197); >+ stringBuffer.append(TEXT_195); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_198); >+ stringBuffer.append(TEXT_196); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_199); >+ stringBuffer.append(TEXT_197); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_200); >+ stringBuffer.append(TEXT_198); > > if (viewmap instanceof InnerClassViewmap) { > String classBody = ((InnerClassViewmap) viewmap).getClassBody(); > >- stringBuffer.append(TEXT_201); >+ stringBuffer.append(TEXT_199); > stringBuffer.append(classBody); >- stringBuffer.append(TEXT_202); >+ stringBuffer.append(TEXT_200); > > if (classBody.indexOf("DPtoLP") != -1) { > >- stringBuffer.append(TEXT_203); >+ stringBuffer.append(TEXT_201); > > } > > > } > >- stringBuffer.append(TEXT_204); >+ stringBuffer.append(TEXT_202); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_205); >+ stringBuffer.append(TEXT_203); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java,v >retrieving revision 1.3 >diff -u -r1.3 NodeLabelEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 15 May 2006 11:19:18 -0000 1.3 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 22 May 2006 13:59:35 -0000 >@@ -30,90 +30,90 @@ > protected final String TEXT_10 = ";"; > protected final String TEXT_11 = NL; > protected final String TEXT_12 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- 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 "; >- 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() {"; >- protected final String TEXT_15 = NL; >- protected final String TEXT_16 = "\t\tinstallEditPolicy("; >- protected final String TEXT_17 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >- protected final String TEXT_18 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >- 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 "; >- protected final String TEXT_20 = " getDirectEditCommand("; >- 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 "; >- 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 "; >- 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 "; >- protected final String TEXT_24 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >- protected final String TEXT_25 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_26 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >- protected final String TEXT_27 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_29 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_30 = " element = "; >- protected final String TEXT_31 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_32 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_33 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_34 = " domainModelEditDomain = "; >- protected final String TEXT_35 = ".getEditingDomainFor("; >- protected final String TEXT_36 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_37 = " feature = ("; >- protected final String TEXT_38 = ") "; >- protected final String TEXT_39 = ".eINSTANCE.get"; >- 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 = "; >- 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 "; >- protected final String TEXT_42 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_43 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_44 = " result = new "; >- protected final String TEXT_45 = "();" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_46 = " values = new "; >- protected final String TEXT_47 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_48 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_49 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_50 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;"; >- protected final String TEXT_51 = NL + "\t\t\t\t\t\t\t\treturn "; >- protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, valueToSet);"; >- protected final String TEXT_53 = NL + "\t\t\t\t\t\t\t}"; >- protected final String TEXT_54 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >- protected final String TEXT_55 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_56 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_57 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_58 = " element = "; >- protected final String TEXT_59 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_60 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_61 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_62 = " domainModelEditDomain = "; >- protected final String TEXT_63 = ".getEditingDomainFor("; >- protected final String TEXT_64 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_65 = " result = new "; >- protected final String TEXT_66 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;"; >- protected final String TEXT_67 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_68 = " "; >- protected final String TEXT_69 = "feature = ("; >- protected final String TEXT_70 = ") "; >- protected final String TEXT_71 = ".eINSTANCE.get"; >- protected final String TEXT_72 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = "; >- protected final String TEXT_73 = ".parseValue(feature, parseResult["; >- 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 "; >- protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_76 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_77 = " "; >- protected final String TEXT_78 = "values = new "; >- protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_80 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_81 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_82 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_83 = NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_85 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}"; >- 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; >- protected final String TEXT_87 = NL; >- protected final String TEXT_88 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >- protected final String TEXT_89 = " req) {" + NL + "\t\tif ("; >- 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 "; >- protected final String TEXT_91 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >- protected final String TEXT_92 = "(this, "; >- protected final String TEXT_93 = ".class, new "; >- protected final String TEXT_94 = "() {" + NL + "\t\t\t\tpublic void relocate("; >- protected final String TEXT_95 = " celleditor) {" + NL + "\t\t\t\t\t"; >- 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; >+ protected final String TEXT_13 = " manager;" + NL; >+ 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 "; >+ 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() {"; >+ protected final String TEXT_16 = NL; >+ protected final String TEXT_17 = "\t\tinstallEditPolicy("; >+ protected final String TEXT_18 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >+ protected final String TEXT_19 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >+ 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 "; >+ protected final String TEXT_21 = " getDirectEditCommand("; >+ 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 "; >+ 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 "; >+ 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 "; >+ protected final String TEXT_25 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >+ protected final String TEXT_26 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_28 = " editingDomain = "; >+ protected final String TEXT_29 = ".getEditingDomain("; >+ protected final String TEXT_30 = ".getDiagram().getElement());"; >+ protected final String TEXT_31 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_32 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_34 = " createDomainModelCommand("; >+ protected final String TEXT_35 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_36 = " element = "; >+ protected final String TEXT_37 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_38 = " feature = ("; >+ protected final String TEXT_39 = ") "; >+ protected final String TEXT_40 = ".eINSTANCE.get"; >+ 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 = "; >+ 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 "; >+ protected final String TEXT_43 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_44 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_45 = " result = new "; >+ protected final String TEXT_46 = "();" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_47 = " values = new "; >+ protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_49 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_50 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_51 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; >+ protected final String TEXT_52 = NL + "\t\t\t\t\t\treturn "; >+ protected final String TEXT_53 = ".create(editingDomain, element, feature, valueToSet);"; >+ protected final String TEXT_54 = NL + "\t\t\t\t\t}"; >+ protected final String TEXT_55 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >+ protected final String TEXT_56 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_57 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_59 = " createDomainModelCommand("; >+ protected final String TEXT_60 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_61 = " element = "; >+ protected final String TEXT_62 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_63 = " result = new "; >+ protected final String TEXT_64 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; >+ protected final String TEXT_65 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_66 = " "; >+ protected final String TEXT_67 = "feature = ("; >+ protected final String TEXT_68 = ") "; >+ protected final String TEXT_69 = ".eINSTANCE.get"; >+ protected final String TEXT_70 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; >+ protected final String TEXT_71 = ".parseValue(feature, values["; >+ protected final String TEXT_72 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_73 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_74 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_75 = " "; >+ protected final String TEXT_76 = "values = new "; >+ protected final String TEXT_77 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_78 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_79 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_80 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_81 = NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_82 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_83 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; >+ protected final String TEXT_84 = NL + "\t\t\t\t});"; >+ protected final String TEXT_85 = NL + "\t}" + NL; >+ protected final String TEXT_86 = NL; >+ protected final String TEXT_87 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >+ protected final String TEXT_88 = " req) {" + NL + "\t\tif ("; >+ 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 "; >+ protected final String TEXT_90 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >+ protected final String TEXT_91 = "(this, "; >+ protected final String TEXT_92 = ".class, new "; >+ protected final String TEXT_93 = "() {" + NL + "\t\t\t\tpublic void relocate("; >+ protected final String TEXT_94 = " celleditor) {" + NL + "\t\t\t\t\t"; >+ 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; >+ 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; > protected final String TEXT_97 = NL; > protected final String TEXT_98 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; > protected final String TEXT_99 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; >@@ -227,6 +227,7 @@ > GenClass underlyingMetaClass = genHost.getDomainMetaClass(); > GenDiagram genDiagram = genLabel.getDiagram(); > LabelModelFacet labelModelFacet = genLabel.getModelFacet(); >+final boolean isReadOnly = genLabel.isReadOnly(); > > stringBuffer.append(TEXT_1); > >@@ -258,207 +259,219 @@ > stringBuffer.append(TEXT_10); > } > stringBuffer.append(TEXT_11); >+ >+if (!isReadOnly) { >+ > stringBuffer.append(TEXT_12); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); > stringBuffer.append(TEXT_13); >- stringBuffer.append(genLabel.getEditPartClassName()); >+ >+} >+ > stringBuffer.append(TEXT_14); >+ stringBuffer.append(genLabel.getEditPartClassName()); >+ stringBuffer.append(TEXT_15); > > final String primaryView = "getUpdatableParent().getDiagramNode()"; > final String resolvedSemanticElement = "resolveSemanticElement()"; >- final boolean isReadOnly = genLabel.isReadOnly(); >+ if (!isReadOnly) { > >- stringBuffer.append(TEXT_15); > stringBuffer.append(TEXT_16); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_17); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_18); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); > stringBuffer.append(TEXT_19); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_20); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(TEXT_20); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_21); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); > stringBuffer.append(TEXT_22); >- stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_23); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_23); >+ stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); > stringBuffer.append(TEXT_24); >- stringBuffer.append(importManager.getImportedName("java.text.ParseException")); >- stringBuffer.append(TEXT_25); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_25); >+ stringBuffer.append(importManager.getImportedName("java.text.ParseException")); > stringBuffer.append(TEXT_26); >- >-if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) { >- GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >- EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >- >- stringBuffer.append(TEXT_27); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_27); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_28); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_29); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_30); >- stringBuffer.append(resolvedSemanticElement); >+ >+if (labelModelFacet instanceof FeatureLabelModelFacet) { >+ GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >+ EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >+ > stringBuffer.append(TEXT_31); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_32); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_33); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_34); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_35); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_36); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_37); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_38); >- stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_39); >- stringBuffer.append(featureToSet.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_40); >- stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >+ stringBuffer.append(featureToSet.getFeatureAccessorName()); > stringBuffer.append(TEXT_41); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); > stringBuffer.append(TEXT_42); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(TEXT_43); > > if (ecoreFeature.isMany()) { > >- stringBuffer.append(TEXT_43); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_44); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_45); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); > stringBuffer.append(TEXT_47); >- stringBuffer.append(featureToSet.getAccessorName()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); > stringBuffer.append(TEXT_48); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >+ stringBuffer.append(featureToSet.getAccessorName()); > stringBuffer.append(TEXT_49); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_50); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(TEXT_51); > > } else { > >- stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_52); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_53); > > } > >- stringBuffer.append(TEXT_53); >+ stringBuffer.append(TEXT_54); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); > >- stringBuffer.append(TEXT_54); >- stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_55); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_56); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_57); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_58); >- stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_59); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(TEXT_59); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_60); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_61); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_63); >- stringBuffer.append(primaryView); >- stringBuffer.append(TEXT_64); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_65); >+ stringBuffer.append(TEXT_63); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_66); >+ stringBuffer.append(TEXT_64); > > boolean haveDeclaredValues = false; > for(int i = 0; i < metaFeatures.size(); i++) { > GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); > EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); > >- stringBuffer.append(TEXT_67); >+ stringBuffer.append(TEXT_65); > if (i == 0) { > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_66); > } >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_67); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_70); >+ stringBuffer.append(TEXT_68); > stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_69); > stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_70); > stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >- stringBuffer.append(TEXT_73); >+ stringBuffer.append(TEXT_71); > stringBuffer.append(i); >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_72); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >- stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_73); > > if (nextEcoreFeature.isMany()) { > >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_74); > if (!haveDeclaredValues) { haveDeclaredValues = true; > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >- stringBuffer.append(TEXT_77); >+ stringBuffer.append(TEXT_75); > } >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_76); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_77); > stringBuffer.append(nextFeatureToSet.getAccessorName()); >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_78); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_81); >+ stringBuffer.append(TEXT_79); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >- stringBuffer.append(TEXT_82); >+ stringBuffer.append(TEXT_80); > > } else { > >- stringBuffer.append(TEXT_83); >+ stringBuffer.append(TEXT_81); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_84); >+ stringBuffer.append(TEXT_82); > > } > > > } > >- stringBuffer.append(TEXT_85); >+ stringBuffer.append(TEXT_83); > > } > >+ stringBuffer.append(TEXT_84); >+ >+ } >+ >+ stringBuffer.append(TEXT_85); >+ >+ if (!isReadOnly) { >+ > stringBuffer.append(TEXT_86); > stringBuffer.append(TEXT_87); >- stringBuffer.append(TEXT_88); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >- stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_88); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >+ stringBuffer.append(TEXT_89); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); > stringBuffer.append(TEXT_90); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); > stringBuffer.append(TEXT_91); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); >- stringBuffer.append(TEXT_92); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); >- stringBuffer.append(TEXT_93); >+ stringBuffer.append(TEXT_92); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); >- stringBuffer.append(TEXT_94); >+ stringBuffer.append(TEXT_93); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); >- stringBuffer.append(TEXT_95); >+ stringBuffer.append(TEXT_94); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >+ stringBuffer.append(TEXT_95); >+ >+ } >+ > stringBuffer.append(TEXT_96); > stringBuffer.append(TEXT_97); > >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java,v >retrieving revision 1.4 >diff -u -r1.4 NodeEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 18 May 2006 19:18:26 -0000 1.4 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 22 May 2006 13:59:35 -0000 >@@ -41,352 +41,351 @@ > protected final String TEXT_20 = ".COMPONENT_ROLE, new "; > protected final String TEXT_21 = "() {" + NL + "\t\t\tprotected "; > protected final String TEXT_22 = " createDeleteCommand("; >- protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\treturn new "; >- protected final String TEXT_24 = "() {"; >- 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"; >- protected final String TEXT_26 = " result = new "; >- protected final String TEXT_27 = "();"; >- protected final String TEXT_28 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_29 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_30 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_31 = ".eINSTANCE.get"; >- protected final String TEXT_32 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));"; >- protected final String TEXT_33 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_35 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_36 = ".eINSTANCE.get"; >- protected final String TEXT_37 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_38 = ".UNSET_VALUE));"; >- protected final String TEXT_39 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_41 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_42 = ".eINSTANCE.get"; >- protected final String TEXT_43 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));"; >- protected final String TEXT_44 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_45 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_46 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_47 = ".eINSTANCE.get"; >- protected final String TEXT_48 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_49 = ".UNSET_VALUE));"; >- protected final String TEXT_50 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; >- protected final String TEXT_51 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = "; >- protected final String TEXT_52 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_53 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_23 = " deleteRequest) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_24 = " editingDomain = "; >+ protected final String TEXT_25 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; >+ protected final String TEXT_26 = " cc = new "; >+ protected final String TEXT_27 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; >+ 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("; >+ protected final String TEXT_29 = " editingDomain) {"; >+ protected final String TEXT_30 = NL + "\t\t\t\t"; >+ protected final String TEXT_31 = " result = new "; >+ protected final String TEXT_32 = "();"; >+ protected final String TEXT_33 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_34 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_35 = ".eINSTANCE.get"; >+ protected final String TEXT_36 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; >+ protected final String TEXT_37 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_38 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_39 = ".eINSTANCE.get"; >+ protected final String TEXT_40 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_41 = ".UNSET_VALUE));"; >+ protected final String TEXT_42 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_43 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_44 = ".eINSTANCE.get"; >+ protected final String TEXT_45 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; >+ protected final String TEXT_46 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_47 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_48 = ".eINSTANCE.get"; >+ protected final String TEXT_49 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_50 = ".UNSET_VALUE));"; >+ protected final String TEXT_51 = NL + "\t\t\t\treturn result;"; >+ protected final String TEXT_52 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_53 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; > protected final String TEXT_54 = ".eINSTANCE.get"; >- protected final String TEXT_55 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement());"; >- protected final String TEXT_56 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = "; >- protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_58 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_59 = ".eINSTANCE.get"; >- protected final String TEXT_60 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_61 = ".UNSET_VALUE);"; >- protected final String TEXT_62 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command viewRemoveCommand = "; >- protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\t\t"; >- 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});"; >- protected final String TEXT_65 = NL + "\t\tinstallEditPolicy("; >- protected final String TEXT_66 = ".LAYOUT_ROLE, new "; >- protected final String TEXT_67 = "() {" + NL + "\t\t\tprotected "; >- protected final String TEXT_68 = " getCreateCommand("; >- protected final String TEXT_69 = " request) {" + NL + "\t\t\t\treturn "; >- protected final String TEXT_70 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >- protected final String TEXT_71 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >- protected final String TEXT_72 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >- protected final String TEXT_73 = " createChangeConstraintCommand("; >- protected final String TEXT_74 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; >- protected final String TEXT_75 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >- protected final String TEXT_76 = " createChildEditPolicy("; >- protected final String TEXT_77 = " child) {" + NL + "\t\t\t\treturn new "; >- protected final String TEXT_78 = "() {" + NL + "\t\t\t\t\tpublic "; >- protected final String TEXT_79 = " getTargetEditPart("; >- protected final String TEXT_80 = " request) {" + NL + "\t\t\t\t\t\tif ("; >- protected final String TEXT_81 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; >- 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("; >- protected final String TEXT_83 = ".GRAPHICAL_NODE_ROLE, new "; >- protected final String TEXT_84 = "() {" + NL + "\t\t\tprotected "; >- protected final String TEXT_85 = " getReconnectTargetCommand("; >+ protected final String TEXT_55 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; >+ protected final String TEXT_56 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_57 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_58 = ".eINSTANCE.get"; >+ protected final String TEXT_59 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_60 = ".UNSET_VALUE);"; >+ protected final String TEXT_61 = NL + "\t\t\t}" + NL + "\t\t});"; >+ protected final String TEXT_62 = NL + "\t\tinstallEditPolicy("; >+ protected final String TEXT_63 = ".LAYOUT_ROLE, new "; >+ protected final String TEXT_64 = "() {" + NL + "\t\t\tprotected "; >+ protected final String TEXT_65 = " getCreateCommand("; >+ protected final String TEXT_66 = " request) {" + NL + "\t\t\t\treturn "; >+ protected final String TEXT_67 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >+ protected final String TEXT_68 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >+ protected final String TEXT_69 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >+ protected final String TEXT_70 = " createChangeConstraintCommand("; >+ protected final String TEXT_71 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; >+ protected final String TEXT_72 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >+ protected final String TEXT_73 = " createChildEditPolicy("; >+ protected final String TEXT_74 = " child) {" + NL + "\t\t\t\treturn new "; >+ protected final String TEXT_75 = "() {" + NL + "\t\t\t\t\tpublic "; >+ protected final String TEXT_76 = " getTargetEditPart("; >+ protected final String TEXT_77 = " request) {" + NL + "\t\t\t\t\t\tif ("; >+ protected final String TEXT_78 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; >+ 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("; >+ protected final String TEXT_80 = ".GRAPHICAL_NODE_ROLE, new "; >+ protected final String TEXT_81 = "() {" + NL + "\t\t\tprotected "; >+ protected final String TEXT_82 = " getReconnectTargetCommand("; >+ protected final String TEXT_83 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn "; >+ protected final String TEXT_84 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >+ protected final String TEXT_85 = " getReconnectSourceCommand("; > protected final String TEXT_86 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn "; > protected final String TEXT_87 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >- protected final String TEXT_88 = " getReconnectSourceCommand("; >- protected final String TEXT_89 = " request) {" + NL + "\t\t\t\t//XXX: reconnect command" + NL + "\t\t\t\treturn "; >- protected final String TEXT_90 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >- protected final String TEXT_91 = " getConnectionCreateCommand("; >- protected final String TEXT_92 = " request) {"; >- protected final String TEXT_93 = NL + "\t\t\t\tif (request instanceof "; >- protected final String TEXT_94 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; >- protected final String TEXT_95 = ".CreateConnectionRequestEx requestEx = ("; >- 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) {"; >- protected final String TEXT_97 = NL + "\t\t\t\t\t\tcase "; >- protected final String TEXT_98 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tmatchingVisualIdsCount++;" + NL + "\t\t\t\t\t\t\tbreak;"; >- 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 "; >- protected final String TEXT_100 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; >- protected final String TEXT_101 = " result = new "; >- 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}"; >- protected final String TEXT_103 = NL + "\t\t\t\treturn "; >- protected final String TEXT_104 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >- protected final String TEXT_105 = " getConnectionCompleteCommand("; >- protected final String TEXT_106 = " request) {"; >- protected final String TEXT_107 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; >- protected final String TEXT_108 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; >- protected final String TEXT_109 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; >- protected final String TEXT_110 = ".CreateConnectionRequestEx requestEx = ("; >- protected final String TEXT_111 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; >- protected final String TEXT_112 = " result = new "; >- 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) {"; >- protected final String TEXT_114 = NL + "\t\t\t\t\t\tcase "; >- protected final String TEXT_115 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create"; >- protected final String TEXT_116 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; >- 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 "; >- 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}"; >- protected final String TEXT_119 = NL + "\t\t\t\treturn "; >- 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 "; >- protected final String TEXT_121 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_122 = " invisibleRectangle = new "; >- protected final String TEXT_123 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; >- protected final String TEXT_124 = "());" + NL + "\t\t"; >- protected final String TEXT_125 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; >- 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 "; >- protected final String TEXT_127 = " createNodeShape() {"; >- protected final String TEXT_128 = NL + "\t\tprimaryShape = new "; >- protected final String TEXT_129 = "()"; >- protected final String TEXT_130 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; >+ protected final String TEXT_88 = " getConnectionCreateCommand("; >+ protected final String TEXT_89 = " request) {"; >+ protected final String TEXT_90 = NL + "\t\t\t\tif (request instanceof "; >+ protected final String TEXT_91 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_92 = ".CreateConnectionRequestEx requestEx = ("; >+ 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) {"; >+ protected final String TEXT_94 = NL + "\t\t\t\t\t\tcase "; >+ protected final String TEXT_95 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tmatchingVisualIdsCount++;" + NL + "\t\t\t\t\t\t\tbreak;"; >+ 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 "; >+ protected final String TEXT_97 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_98 = " result = new "; >+ 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}"; >+ protected final String TEXT_100 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; >+ protected final String TEXT_102 = " getConnectionCompleteCommand("; >+ protected final String TEXT_103 = " request) {"; >+ protected final String TEXT_104 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; >+ protected final String TEXT_105 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; >+ protected final String TEXT_106 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_107 = ".CreateConnectionRequestEx requestEx = ("; >+ protected final String TEXT_108 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_109 = " result = new "; >+ 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) {"; >+ protected final String TEXT_111 = NL + "\t\t\t\t\t\tcase "; >+ protected final String TEXT_112 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; >+ protected final String TEXT_113 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; >+ 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 "; >+ protected final String TEXT_115 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; >+ protected final String TEXT_116 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; >+ protected final String TEXT_117 = NL + "\t\t\t\treturn "; >+ 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 "; >+ protected final String TEXT_119 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_120 = " invisibleRectangle = new "; >+ protected final String TEXT_121 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; >+ protected final String TEXT_122 = "());" + NL + "\t\t"; >+ protected final String TEXT_123 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; >+ 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 "; >+ protected final String TEXT_125 = " createNodeShape() {"; >+ protected final String TEXT_126 = NL + "\t\tprimaryShape = new "; >+ protected final String TEXT_127 = "()"; >+ protected final String TEXT_128 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; >+ protected final String TEXT_129 = ";"; >+ protected final String TEXT_130 = NL + "\t\tprimaryShape = "; > protected final String TEXT_131 = ";"; >- protected final String TEXT_132 = NL + "\t\tprimaryShape = "; >- protected final String TEXT_133 = ";"; >- protected final String TEXT_134 = NL + "\t\t"; >- protected final String TEXT_135 = " figure = new "; >- protected final String TEXT_136 = "();" + NL + " \t\tfigure.setUseLocalCoordinates("; >- protected final String TEXT_137 = ");" + NL + " \t\tprimaryShape = figure;"; >- protected final String TEXT_138 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_139 = " createDecorationPane() {" + NL + "\t\t"; >- protected final String TEXT_140 = " view = ("; >- protected final String TEXT_141 = ") getModel();" + NL + "\t\t"; >- 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"; >- protected final String TEXT_143 = " decorationPane = new "; >- protected final String TEXT_144 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; >- protected final String TEXT_145 = "());" + NL + "" + NL + "\t\t"; >- protected final String TEXT_146 = " imageFigure = new "; >- protected final String TEXT_147 = "("; >- protected final String TEXT_148 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; >- protected final String TEXT_149 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; >- 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 "; >- protected final String TEXT_151 = " setupContentPane("; >- protected final String TEXT_152 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; >- protected final String TEXT_153 = NL + "\t\t\t"; >- protected final String TEXT_154 = " layout = new "; >- protected final String TEXT_155 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; >- protected final String TEXT_156 = NL + "\t\tnodeShape.setLayoutManager(new "; >- protected final String TEXT_157 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; >- 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 "; >- 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});"; >- 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 "; >- 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 "; >- protected final String TEXT_162 = " getDiagramNode() {" + NL + "\t\treturn ("; >- protected final String TEXT_163 = ") getModel();" + NL + "\t}" + NL; >- protected final String TEXT_164 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; >- protected final String TEXT_165 = " childEditPart) {"; >- protected final String TEXT_166 = NL + "\t\tif (childEditPart instanceof "; >- protected final String TEXT_167 = ") {"; >- protected final String TEXT_168 = NL + "\t\t\t(("; >- protected final String TEXT_169 = ") childEditPart).setLabel((("; >- protected final String TEXT_170 = ") primaryShape).getFigure"; >- protected final String TEXT_171 = "());"; >- protected final String TEXT_172 = NL + "\t\t\t(("; >- protected final String TEXT_173 = ") childEditPart).setLabel(new "; >- protected final String TEXT_174 = "());"; >- protected final String TEXT_175 = NL + "\t\t\treturn true;" + NL + "\t\t}"; >- 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 "; >- protected final String TEXT_177 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; >- protected final String TEXT_178 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; >- protected final String TEXT_179 = " nextChild = ("; >- protected final String TEXT_180 = ")it.next();" + NL + "\t\t\tif ("; >- protected final String TEXT_181 = ".getVisualID(nextChild) == "; >- protected final String TEXT_182 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; >- 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("; >- protected final String TEXT_184 = " req) {" + NL + "\t\tif ("; >- protected final String TEXT_185 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; >- 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; >- protected final String TEXT_187 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; >- protected final String TEXT_188 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; >- protected final String TEXT_189 = " labelFigure = (("; >- protected final String TEXT_190 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {"; >- protected final String TEXT_191 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}"; >- protected final String TEXT_192 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);"; >- protected final String TEXT_193 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; >- protected final String TEXT_194 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; >- protected final String TEXT_195 = " labelFigure = (("; >- 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("; >- protected final String TEXT_197 = " childEditPart) {"; >- protected final String TEXT_198 = NL + "\t\tif (childEditPart instanceof "; >- protected final String TEXT_199 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; >- protected final String TEXT_200 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_201 = " getExternalLabelsContainer() {" + NL + "\t\t"; >- protected final String TEXT_202 = " root = ("; >- protected final String TEXT_203 = ") getRoot();" + NL + "\t\treturn root.getLayer("; >- protected final String TEXT_204 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; >- protected final String TEXT_205 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; >- 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}"; >- 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"; >- protected final String TEXT_208 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; >- protected final String TEXT_209 = ";" + NL + "\t\t"; >- protected final String TEXT_210 = " bounds = ("; >- protected final String TEXT_211 = ") node.getLayoutConstraint();" + NL + "\t\t(("; >- protected final String TEXT_212 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; >- 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 "; >- protected final String TEXT_214 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_215 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_216 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_217 = " getSourceConnectionAnchor("; >- protected final String TEXT_218 = " connection) {" + NL + "\t\treturn new "; >- protected final String TEXT_219 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_220 = " getSourceConnectionAnchor("; >- protected final String TEXT_221 = " request) {" + NL + "\t\treturn new "; >- protected final String TEXT_222 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_223 = " getTargetConnectionAnchor("; >- protected final String TEXT_224 = " connection) {" + NL + "\t\treturn new "; >- protected final String TEXT_225 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_226 = " getTargetConnectionAnchor("; >- protected final String TEXT_227 = " request) {" + NL + "\t\treturn new "; >- protected final String TEXT_228 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; >- 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; >- protected final String TEXT_230 = NL; >- 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 "; >- protected final String TEXT_232 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >- 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(("; >- 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; >- protected final String TEXT_235 = NL; >- protected final String TEXT_236 = "\tpublic void addRefresher("; >- 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("; >- 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("; >- 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; >- protected final String TEXT_240 = NL; >- protected final String TEXT_241 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >- protected final String TEXT_242 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_243 = ") "; >- protected final String TEXT_244 = ".getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_245 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- 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 = "; >- protected final String TEXT_247 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_248 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_249 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >- protected final String TEXT_250 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >- 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 "; >- 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 "; >- protected final String TEXT_253 = " createdFont;" + NL; >- protected final String TEXT_254 = NL; >- protected final String TEXT_255 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; >- protected final String TEXT_256 = " style = ("; >- protected final String TEXT_257 = ") "; >- protected final String TEXT_258 = ".getStyle("; >- protected final String TEXT_259 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; >- 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"; >- 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 "; >- 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 "; >- protected final String TEXT_263 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; >- protected final String TEXT_264 = " style = ("; >- protected final String TEXT_265 = ") "; >- protected final String TEXT_266 = ".getStyle("; >- protected final String TEXT_267 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; >- 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"; >- 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 "; >- 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 "; >- protected final String TEXT_271 = " createdBackgroundColor;" + NL; >- protected final String TEXT_272 = NL; >- protected final String TEXT_273 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_274 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >- protected final String TEXT_275 = " feature, "; >- 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 "; >- protected final String TEXT_277 = "();"; >- protected final String TEXT_278 = NL; >- 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("; >- protected final String TEXT_280 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_281 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >- protected final String TEXT_282 = NL; >- 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("; >- protected final String TEXT_284 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_285 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_286 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_287 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_288 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; >- protected final String TEXT_289 = NL; >- 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("; >- protected final String TEXT_291 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; >- protected final String TEXT_292 = NL; >- 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("; >- protected final String TEXT_294 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; >- protected final String TEXT_295 = NL; >- 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("; >- protected final String TEXT_297 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; >- protected final String TEXT_298 = NL; >- 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("; >- protected final String TEXT_300 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_301 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_302 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_303 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; >- protected final String TEXT_304 = NL; >- 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("; >- 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("; >- protected final String TEXT_307 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; >- protected final String TEXT_308 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; >- protected final String TEXT_309 = "Command extends "; >- protected final String TEXT_310 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >- protected final String TEXT_311 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >- protected final String TEXT_312 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >- 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"; >- protected final String TEXT_314 = "Command("; >- protected final String TEXT_315 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; >- protected final String TEXT_316 = ") {" + NL + "\t\t\t\tsource = ("; >- 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 "; >- protected final String TEXT_318 = ") {" + NL + "\t\t\t\ttarget = ("; >- 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 = "; >- protected final String TEXT_320 = ".eINSTANCE.createEdge();"; >- protected final String TEXT_321 = NL + "\t\t\t"; >- protected final String TEXT_322 = " createdDomainElement = "; >- protected final String TEXT_323 = ".eINSTANCE.create"; >- protected final String TEXT_324 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; >- protected final String TEXT_325 = NL + "\t\t\t"; >- protected final String TEXT_326 = "."; >- protected final String TEXT_327 = ".initializeElement(createdDomainElement);"; >- protected final String TEXT_328 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?"; >- protected final String TEXT_329 = NL + "\t\t\t"; >- protected final String TEXT_330 = ".decorateView(createdEdge);" + NL + "\t\t\t"; >- protected final String TEXT_331 = " domainModelEditDomain = "; >- protected final String TEXT_332 = ".getEditingDomainFor(source.getDiagram().getElement());"; >- protected final String TEXT_333 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; >- protected final String TEXT_334 = NL + "\t\t\t"; >- protected final String TEXT_335 = " container = getRelationshipContainer(source.getElement(), "; >- protected final String TEXT_336 = ".eINSTANCE.get"; >- 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("; >- protected final String TEXT_338 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; >- protected final String TEXT_339 = ".eINSTANCE.get"; >- protected final String TEXT_340 = "(), createdDomainElement));"; >- protected final String TEXT_341 = NL + "\t\t\taddLinkEndsCommand.append("; >- protected final String TEXT_342 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; >- protected final String TEXT_343 = ".eINSTANCE.get"; >- protected final String TEXT_344 = "(), createdDomainElement));"; >- protected final String TEXT_345 = NL + "\t\t\taddLinkEndsCommand.append("; >- protected final String TEXT_346 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; >- protected final String TEXT_347 = ".eINSTANCE.get"; >- protected final String TEXT_348 = "(), source.getElement()));"; >- protected final String TEXT_349 = NL + "\t\t\taddLinkEndsCommand.append("; >- protected final String TEXT_350 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; >- protected final String TEXT_351 = ".eINSTANCE.get"; >- protected final String TEXT_352 = "(), target.getElement()));"; >- protected final String TEXT_353 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; >- protected final String TEXT_354 = NL + "\t\t\tdomainModelAddCommand = "; >- protected final String TEXT_355 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; >- protected final String TEXT_356 = ".eINSTANCE.get"; >- protected final String TEXT_357 = "(), target.getElement());"; >- protected final String TEXT_358 = NL + "\t\t}" + NL; >- 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 "; >- protected final String TEXT_360 = " getRelationshipContainer("; >- protected final String TEXT_361 = " element, "; >- 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}"; >- 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}"; >+ protected final String TEXT_132 = NL + "\t\t"; >+ protected final String TEXT_133 = " figure = new "; >+ protected final String TEXT_134 = "();" + NL + " \t\tfigure.setUseLocalCoordinates("; >+ protected final String TEXT_135 = ");" + NL + " \t\tprimaryShape = figure;"; >+ protected final String TEXT_136 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_137 = " createDecorationPane() {" + NL + "\t\t"; >+ protected final String TEXT_138 = " view = ("; >+ protected final String TEXT_139 = ") getModel();" + NL + "\t\t"; >+ 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"; >+ protected final String TEXT_141 = " decorationPane = new "; >+ protected final String TEXT_142 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; >+ protected final String TEXT_143 = "());" + NL + "" + NL + "\t\t"; >+ protected final String TEXT_144 = " imageFigure = new "; >+ protected final String TEXT_145 = "("; >+ protected final String TEXT_146 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; >+ protected final String TEXT_147 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; >+ 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 "; >+ protected final String TEXT_149 = " setupContentPane("; >+ protected final String TEXT_150 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; >+ protected final String TEXT_151 = NL + "\t\t\t"; >+ protected final String TEXT_152 = " layout = new "; >+ protected final String TEXT_153 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; >+ protected final String TEXT_154 = NL + "\t\tnodeShape.setLayoutManager(new "; >+ protected final String TEXT_155 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; >+ 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 "; >+ 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});"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_160 = " getDiagramNode() {" + NL + "\t\treturn ("; >+ protected final String TEXT_161 = ") getModel();" + NL + "\t}" + NL; >+ protected final String TEXT_162 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; >+ protected final String TEXT_163 = " childEditPart) {"; >+ protected final String TEXT_164 = NL + "\t\tif (childEditPart instanceof "; >+ protected final String TEXT_165 = ") {"; >+ protected final String TEXT_166 = NL + "\t\t\t(("; >+ protected final String TEXT_167 = ") childEditPart).setLabel((("; >+ protected final String TEXT_168 = ") primaryShape).getFigure"; >+ protected final String TEXT_169 = "());"; >+ protected final String TEXT_170 = NL + "\t\t\t(("; >+ protected final String TEXT_171 = ") childEditPart).setLabel(new "; >+ protected final String TEXT_172 = "());"; >+ protected final String TEXT_173 = NL + "\t\t\treturn true;" + NL + "\t\t}"; >+ 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 "; >+ protected final String TEXT_175 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor("; >+ protected final String TEXT_176 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; >+ protected final String TEXT_177 = " nextChild = ("; >+ protected final String TEXT_178 = ")it.next();" + NL + "\t\t\tif ("; >+ protected final String TEXT_179 = ".getVisualID(nextChild) == "; >+ protected final String TEXT_180 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; >+ 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("; >+ protected final String TEXT_182 = " req) {" + NL + "\t\tif ("; >+ protected final String TEXT_183 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; >+ 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; >+ protected final String TEXT_185 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; >+ protected final String TEXT_186 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; >+ protected final String TEXT_187 = " labelFigure = (("; >+ protected final String TEXT_188 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {"; >+ protected final String TEXT_189 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}"; >+ protected final String TEXT_190 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);"; >+ protected final String TEXT_191 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; >+ protected final String TEXT_192 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; >+ protected final String TEXT_193 = " labelFigure = (("; >+ 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("; >+ protected final String TEXT_195 = " childEditPart) {"; >+ protected final String TEXT_196 = NL + "\t\tif (childEditPart instanceof "; >+ protected final String TEXT_197 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; >+ protected final String TEXT_198 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_199 = " getExternalLabelsContainer() {" + NL + "\t\t"; >+ protected final String TEXT_200 = " root = ("; >+ protected final String TEXT_201 = ") getRoot();" + NL + "\t\treturn root.getLayer("; >+ protected final String TEXT_202 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; >+ protected final String TEXT_203 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; >+ 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}"; >+ 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"; >+ protected final String TEXT_206 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; >+ protected final String TEXT_207 = ";" + NL + "\t\t"; >+ protected final String TEXT_208 = " bounds = ("; >+ protected final String TEXT_209 = ") node.getLayoutConstraint();" + NL + "\t\t(("; >+ protected final String TEXT_210 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; >+ 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 "; >+ protected final String TEXT_212 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_213 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_214 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_215 = " getSourceConnectionAnchor("; >+ protected final String TEXT_216 = " connection) {" + NL + "\t\treturn new "; >+ protected final String TEXT_217 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_218 = " getSourceConnectionAnchor("; >+ protected final String TEXT_219 = " request) {" + NL + "\t\treturn new "; >+ protected final String TEXT_220 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_221 = " getTargetConnectionAnchor("; >+ protected final String TEXT_222 = " connection) {" + NL + "\t\treturn new "; >+ protected final String TEXT_223 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_224 = " getTargetConnectionAnchor("; >+ protected final String TEXT_225 = " request) {" + NL + "\t\treturn new "; >+ protected final String TEXT_226 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; >+ 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; >+ protected final String TEXT_228 = NL; >+ 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 "; >+ protected final String TEXT_230 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >+ 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(("; >+ 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; >+ protected final String TEXT_233 = NL; >+ protected final String TEXT_234 = "\tpublic void addRefresher("; >+ 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("; >+ 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("; >+ 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; >+ protected final String TEXT_238 = NL; >+ protected final String TEXT_239 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >+ protected final String TEXT_240 = " style =" + NL + "\t\t\t("; >+ protected final String TEXT_241 = ") "; >+ protected final String TEXT_242 = ".getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_243 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >+ 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 = "; >+ protected final String TEXT_245 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_246 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_247 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >+ protected final String TEXT_248 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_251 = " createdFont;" + NL; >+ protected final String TEXT_252 = NL; >+ protected final String TEXT_253 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; >+ protected final String TEXT_254 = " style = ("; >+ protected final String TEXT_255 = ") "; >+ protected final String TEXT_256 = ".getStyle("; >+ protected final String TEXT_257 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; >+ 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"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_261 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; >+ protected final String TEXT_262 = " style = ("; >+ protected final String TEXT_263 = ") "; >+ protected final String TEXT_264 = ".getStyle("; >+ protected final String TEXT_265 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; >+ 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"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_269 = " createdBackgroundColor;" + NL; >+ protected final String TEXT_270 = NL; >+ protected final String TEXT_271 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_272 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >+ protected final String TEXT_273 = " feature, "; >+ 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 "; >+ protected final String TEXT_275 = "();"; >+ protected final String TEXT_276 = NL; >+ 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("; >+ protected final String TEXT_278 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_279 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >+ protected final String TEXT_280 = NL; >+ 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("; >+ protected final String TEXT_282 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_283 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_284 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_285 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_286 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; >+ protected final String TEXT_287 = NL; >+ 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("; >+ protected final String TEXT_289 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; >+ protected final String TEXT_290 = NL; >+ 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("; >+ protected final String TEXT_292 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; >+ protected final String TEXT_293 = NL; >+ 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("; >+ protected final String TEXT_295 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; >+ protected final String TEXT_296 = NL; >+ 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("; >+ protected final String TEXT_298 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_299 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_300 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_301 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; >+ protected final String TEXT_302 = NL; >+ 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("; >+ 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("; >+ protected final String TEXT_305 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; >+ protected final String TEXT_306 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; >+ protected final String TEXT_307 = "Command extends "; >+ protected final String TEXT_308 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >+ protected final String TEXT_309 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >+ protected final String TEXT_310 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >+ 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"; >+ protected final String TEXT_312 = "Command("; >+ protected final String TEXT_313 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; >+ protected final String TEXT_314 = ") {" + NL + "\t\t\t\tsource = ("; >+ 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 "; >+ protected final String TEXT_316 = ") {" + NL + "\t\t\t\ttarget = ("; >+ 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 = "; >+ protected final String TEXT_318 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; >+ protected final String TEXT_319 = ".eINSTANCE.createEdge();"; >+ protected final String TEXT_320 = NL + "\t\t\t"; >+ protected final String TEXT_321 = " createdDomainElement = "; >+ protected final String TEXT_322 = ".eINSTANCE.create"; >+ protected final String TEXT_323 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; >+ protected final String TEXT_324 = NL + "\t\t\t"; >+ protected final String TEXT_325 = "."; >+ protected final String TEXT_326 = ".initializeElement(createdDomainElement);"; >+ protected final String TEXT_327 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?"; >+ protected final String TEXT_328 = NL + "\t\t\t"; >+ protected final String TEXT_329 = ".decorateView(createdEdge);" + NL + "\t\t\t"; >+ protected final String TEXT_330 = " domainModelEditDomain = "; >+ protected final String TEXT_331 = ".getEditingDomain(source.getDiagram().getElement());"; >+ protected final String TEXT_332 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; >+ protected final String TEXT_333 = NL + "\t\t\t"; >+ protected final String TEXT_334 = " container = getRelationshipContainer(source.getElement(), "; >+ protected final String TEXT_335 = ".eINSTANCE.get"; >+ 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("; >+ protected final String TEXT_337 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; >+ protected final String TEXT_338 = ".eINSTANCE.get"; >+ protected final String TEXT_339 = "(), createdDomainElement));"; >+ protected final String TEXT_340 = NL + "\t\t\taddLinkEndsCommand.append("; >+ protected final String TEXT_341 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; >+ protected final String TEXT_342 = ".eINSTANCE.get"; >+ protected final String TEXT_343 = "(), createdDomainElement));"; >+ protected final String TEXT_344 = NL + "\t\t\taddLinkEndsCommand.append("; >+ protected final String TEXT_345 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; >+ protected final String TEXT_346 = ".eINSTANCE.get"; >+ protected final String TEXT_347 = "(), source.getElement()));"; >+ protected final String TEXT_348 = NL + "\t\t\taddLinkEndsCommand.append("; >+ protected final String TEXT_349 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; >+ protected final String TEXT_350 = ".eINSTANCE.get"; >+ protected final String TEXT_351 = "(), target.getElement()));"; >+ protected final String TEXT_352 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; >+ protected final String TEXT_353 = NL + "\t\t\tdomainModelAddCommand = "; >+ protected final String TEXT_354 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; >+ protected final String TEXT_355 = ".eINSTANCE.get"; >+ protected final String TEXT_356 = "(), target.getElement());"; >+ protected final String TEXT_357 = NL + "\t\t}" + NL; >+ 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 "; >+ protected final String TEXT_359 = " getRelationshipContainer("; >+ protected final String TEXT_360 = " element, "; >+ 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}"; >+ 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}"; >+ protected final String TEXT_363 = NL; > protected final String TEXT_364 = NL; >- protected final String TEXT_365 = NL; >- 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}"; >- protected final String TEXT_367 = NL + "}"; >- protected final String TEXT_368 = NL; >+ 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}"; >+ protected final String TEXT_366 = NL + "}"; >+ protected final String TEXT_367 = NL; > > public String generate(Object argument) > { >@@ -447,8 +446,18 @@ > stringBuffer.append(TEXT_22); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); > stringBuffer.append(TEXT_23); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_24); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_25); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_26); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_27); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >+ stringBuffer.append(TEXT_28); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); >+ stringBuffer.append(TEXT_29); > > { > TypeModelFacet facet = genNode.getModelFacet(); >@@ -456,78 +465,68 @@ > GenFeature containmentFeature = facet.getContainmentMetaFeature(); > if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { > >- stringBuffer.append(TEXT_25); >+ stringBuffer.append(TEXT_30); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_26); >+ stringBuffer.append(TEXT_31); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_27); >+ stringBuffer.append(TEXT_32); > > if (containmentFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_28); >+ stringBuffer.append(TEXT_33); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_29); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_30); >+ stringBuffer.append(TEXT_34); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_31); >+ stringBuffer.append(TEXT_35); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_36); > > } else { > >- stringBuffer.append(TEXT_33); >+ stringBuffer.append(TEXT_37); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_34); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_38); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_36); >+ stringBuffer.append(TEXT_39); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_37); >+ stringBuffer.append(TEXT_40); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_38); >+ stringBuffer.append(TEXT_41); > > } > > > if (childFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_39); >+ stringBuffer.append(TEXT_42); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_40); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_41); >+ stringBuffer.append(TEXT_43); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_42); >+ stringBuffer.append(TEXT_44); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_43); >+ stringBuffer.append(TEXT_45); > > } else { > >- stringBuffer.append(TEXT_44); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_45); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); > stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_47); >- stringBuffer.append(childFeature.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_48); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(childFeature.getFeatureAccessorName()); > stringBuffer.append(TEXT_49); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_50); > > } > >- stringBuffer.append(TEXT_50); >+ stringBuffer.append(TEXT_51); > > } else { > if (containmentFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_52); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_53); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_54); >@@ -539,64 +538,64 @@ > stringBuffer.append(TEXT_56); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_57); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_58); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_59); >+ stringBuffer.append(TEXT_58); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_60); >+ stringBuffer.append(TEXT_59); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_61); >+ stringBuffer.append(TEXT_60); > > } > } > >- stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_64); >+ stringBuffer.append(TEXT_61); > > } /*restrict local vars used in component edit policy*/ > >- stringBuffer.append(TEXT_65); >+ stringBuffer.append(TEXT_62); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >- stringBuffer.append(TEXT_66); >+ stringBuffer.append(TEXT_63); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); >- stringBuffer.append(TEXT_67); >+ stringBuffer.append(TEXT_64); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_65); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest")); >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_66); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >- stringBuffer.append(TEXT_70); >+ stringBuffer.append(TEXT_67); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_68); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_69); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(TEXT_70); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >+ stringBuffer.append(TEXT_71); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_72); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_73); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); > stringBuffer.append(TEXT_74); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); > stringBuffer.append(TEXT_75); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >- stringBuffer.append(TEXT_76); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >+ stringBuffer.append(TEXT_76); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); > stringBuffer.append(TEXT_77); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); > stringBuffer.append(TEXT_78); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >+ stringBuffer.append(genNode.getEditPartClassName()); > stringBuffer.append(TEXT_79); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_80); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy")); > stringBuffer.append(TEXT_81); >- stringBuffer.append(genNode.getEditPartClassName()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_82); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); > stringBuffer.append(TEXT_83); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_84); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_85); >@@ -606,22 +605,16 @@ > stringBuffer.append(TEXT_87); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_88); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); >- stringBuffer.append(TEXT_89); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >- stringBuffer.append(TEXT_90); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_91); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); >- stringBuffer.append(TEXT_92); >+ stringBuffer.append(TEXT_89); > if (palette != null) { >- stringBuffer.append(TEXT_93); >+ stringBuffer.append(TEXT_90); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_94); >+ stringBuffer.append(TEXT_91); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_95); >+ stringBuffer.append(TEXT_92); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_96); >+ stringBuffer.append(TEXT_93); > > for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { > GenLink genLink = (GenLink)it.next(); >@@ -644,41 +637,41 @@ > continue; > } > >- stringBuffer.append(TEXT_97); >+ stringBuffer.append(TEXT_94); > stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_98); >+ stringBuffer.append(TEXT_95); > > } > >- stringBuffer.append(TEXT_99); >+ stringBuffer.append(TEXT_96); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >- stringBuffer.append(TEXT_100); >+ stringBuffer.append(TEXT_97); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(TEXT_98); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(TEXT_99); >+ }/*when there's palette*/ >+ stringBuffer.append(TEXT_100); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_101); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_102); >- }/*when there's palette*/ >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); > stringBuffer.append(TEXT_103); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ if (palette != null) { > stringBuffer.append(TEXT_104); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_105); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); >+ stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); > stringBuffer.append(TEXT_106); >- if (palette != null) { >+ stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); > stringBuffer.append(TEXT_107); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >- stringBuffer.append(TEXT_108); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >+ stringBuffer.append(TEXT_108); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_109); >- stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_110); >- stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_111); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); >- stringBuffer.append(TEXT_112); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.CompoundCommand")); >- stringBuffer.append(TEXT_113); > > for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { > GenLink genLink = (GenLink)it.next(); >@@ -702,36 +695,38 @@ > continue; > } > >- stringBuffer.append(TEXT_114); >+ stringBuffer.append(TEXT_111); > stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_115); >+ stringBuffer.append(TEXT_112); > stringBuffer.append(createCommandNameInfix); > stringBuffer.append(genLink.getVisualID()); >- stringBuffer.append(TEXT_116); >+ stringBuffer.append(TEXT_113); > > } > >+ stringBuffer.append(TEXT_114); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_115); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_116); >+ }/*when there's palette*/ > stringBuffer.append(TEXT_117); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_118); >- }/*when there's palette*/ >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_119); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >- stringBuffer.append(TEXT_120); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(TEXT_120); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); > stringBuffer.append(TEXT_121); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); > stringBuffer.append(TEXT_122); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_123); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_124); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_125); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_126); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_127); > > String figureQualifiedClassName = null; > Viewmap viewmap = genNode.getViewmap(); >@@ -741,82 +736,82 @@ > figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure"; > } > >- stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_126); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_129); >+ stringBuffer.append(TEXT_127); > if (useFlowLayout) { >- stringBuffer.append(TEXT_130); >+ stringBuffer.append(TEXT_128); > } /* use flow layout*/ >- stringBuffer.append(TEXT_131); >+ stringBuffer.append(TEXT_129); > } else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_132); >+ stringBuffer.append(TEXT_130); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_133); >+ stringBuffer.append(TEXT_131); > } else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_134); >+ stringBuffer.append(TEXT_132); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_135); >+ stringBuffer.append(TEXT_133); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_136); >+ stringBuffer.append(TEXT_134); > stringBuffer.append(useFlowLayout ? "true" : "false"); >- stringBuffer.append(TEXT_137); >+ stringBuffer.append(TEXT_135); > } >- stringBuffer.append(TEXT_138); >+ stringBuffer.append(TEXT_136); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_139); >+ stringBuffer.append(TEXT_137); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_140); >+ stringBuffer.append(TEXT_138); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_141); >+ stringBuffer.append(TEXT_139); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); >- stringBuffer.append(TEXT_142); >+ stringBuffer.append(TEXT_140); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); >- stringBuffer.append(TEXT_143); >+ stringBuffer.append(TEXT_141); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); >- stringBuffer.append(TEXT_144); >+ stringBuffer.append(TEXT_142); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); >- stringBuffer.append(TEXT_145); >+ stringBuffer.append(TEXT_143); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); >- stringBuffer.append(TEXT_146); >+ stringBuffer.append(TEXT_144); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); >- stringBuffer.append(TEXT_147); >+ stringBuffer.append(TEXT_145); > stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); >- stringBuffer.append(TEXT_148); >+ stringBuffer.append(TEXT_146); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); >- stringBuffer.append(TEXT_149); >+ stringBuffer.append(TEXT_147); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); >- stringBuffer.append(TEXT_150); >+ stringBuffer.append(TEXT_148); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_151); >+ stringBuffer.append(TEXT_149); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_152); >+ stringBuffer.append(TEXT_150); > > if (!useFlowLayout) { > String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"); > >- stringBuffer.append(TEXT_153); >+ stringBuffer.append(TEXT_151); > stringBuffer.append(layoutClassName); >- stringBuffer.append(TEXT_154); >+ stringBuffer.append(TEXT_152); > stringBuffer.append(layoutClassName); >- stringBuffer.append(TEXT_155); >+ stringBuffer.append(TEXT_153); > } else { >- stringBuffer.append(TEXT_156); >+ stringBuffer.append(TEXT_154); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); >- stringBuffer.append(TEXT_157); >+ stringBuffer.append(TEXT_155); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_158); >+ stringBuffer.append(TEXT_156); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_159); >+ stringBuffer.append(TEXT_157); > } >- stringBuffer.append(TEXT_160); >+ stringBuffer.append(TEXT_158); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_161); >+ stringBuffer.append(TEXT_159); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >- stringBuffer.append(TEXT_162); >+ stringBuffer.append(TEXT_160); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >- stringBuffer.append(TEXT_163); >+ stringBuffer.append(TEXT_161); > > boolean hasFixedChildren = false; > List innerLabels = new ArrayList(genNode.getLabels().size()); >@@ -829,9 +824,9 @@ > if (!innerLabels.isEmpty()) { > hasFixedChildren = true; > >- stringBuffer.append(TEXT_164); >+ stringBuffer.append(TEXT_162); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_163); > > for (Iterator it = innerLabels.iterator(); it.hasNext(); ) { > GenNodeLabel genLabel = (GenNodeLabel) it.next(); >@@ -850,47 +845,47 @@ > isAccessor = false; > } > >- stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_164); > stringBuffer.append(labelEditPart); >- stringBuffer.append(TEXT_167); >+ stringBuffer.append(TEXT_165); > if (isAccessor) { >- stringBuffer.append(TEXT_168); >+ stringBuffer.append(TEXT_166); > stringBuffer.append(labelEditPart); >- stringBuffer.append(TEXT_169); >+ stringBuffer.append(TEXT_167); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_170); >+ stringBuffer.append(TEXT_168); > stringBuffer.append(labelFigureClassName); >- stringBuffer.append(TEXT_171); >+ stringBuffer.append(TEXT_169); > } else { >- stringBuffer.append(TEXT_172); >+ stringBuffer.append(TEXT_170); > stringBuffer.append(labelEditPart); >- stringBuffer.append(TEXT_173); >+ stringBuffer.append(TEXT_171); > stringBuffer.append(labelFigureClassName); >- stringBuffer.append(TEXT_174); >+ stringBuffer.append(TEXT_172); > } >- stringBuffer.append(TEXT_175); >+ stringBuffer.append(TEXT_173); > } >- stringBuffer.append(TEXT_176); >+ stringBuffer.append(TEXT_174); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_177); >+ stringBuffer.append(TEXT_175); > stringBuffer.append(importManager.getImportedName("java.util.Iterator")); >- stringBuffer.append(TEXT_178); >+ stringBuffer.append(TEXT_176); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_179); >+ stringBuffer.append(TEXT_177); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_180); >+ stringBuffer.append(TEXT_178); > stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); >- stringBuffer.append(TEXT_181); >+ stringBuffer.append(TEXT_179); > stringBuffer.append(importManager.getImportedName(((GenNodeLabel)innerLabels.get(0)).getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_182); >+ stringBuffer.append(TEXT_180); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_183); >+ stringBuffer.append(TEXT_181); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >- stringBuffer.append(TEXT_184); >+ stringBuffer.append(TEXT_182); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >- stringBuffer.append(TEXT_185); >+ stringBuffer.append(TEXT_183); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_186); >+ stringBuffer.append(TEXT_184); > > } > >@@ -905,199 +900,203 @@ > } > if (hasExternalLabels) { > >- stringBuffer.append(TEXT_187); >+ stringBuffer.append(TEXT_185); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_188); >+ stringBuffer.append(TEXT_186); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_189); >+ stringBuffer.append(TEXT_187); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); >- stringBuffer.append(TEXT_190); >+ stringBuffer.append(TEXT_188); > if (hasFixedChildren) { >- stringBuffer.append(TEXT_191); >+ stringBuffer.append(TEXT_189); > } else { >- stringBuffer.append(TEXT_192); >+ stringBuffer.append(TEXT_190); > } >- stringBuffer.append(TEXT_193); >+ stringBuffer.append(TEXT_191); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_194); >+ stringBuffer.append(TEXT_192); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_195); >+ stringBuffer.append(TEXT_193); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); >- stringBuffer.append(TEXT_196); >+ stringBuffer.append(TEXT_194); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_197); >+ stringBuffer.append(TEXT_195); > > for (Iterator labels = genNode.getLabels().iterator(); labels.hasNext();) { > GenNodeLabel label = (GenNodeLabel) labels.next(); > if (label instanceof GenExternalNodeLabel) { > >- stringBuffer.append(TEXT_198); >+ stringBuffer.append(TEXT_196); > stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_199); >+ stringBuffer.append(TEXT_197); > > } > } > >- stringBuffer.append(TEXT_200); >+ stringBuffer.append(TEXT_198); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_201); >+ stringBuffer.append(TEXT_199); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); >- stringBuffer.append(TEXT_202); >+ stringBuffer.append(TEXT_200); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); >- stringBuffer.append(TEXT_203); >+ stringBuffer.append(TEXT_201); > stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_204); >+ stringBuffer.append(TEXT_202); > > } else { > if (hasFixedChildren) { >- stringBuffer.append(TEXT_205); >+ stringBuffer.append(TEXT_203); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); >- stringBuffer.append(TEXT_206); >+ stringBuffer.append(TEXT_204); > > } > } > >- stringBuffer.append(TEXT_207); >+ stringBuffer.append(TEXT_205); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >+ stringBuffer.append(TEXT_206); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); >+ stringBuffer.append(TEXT_207); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); > stringBuffer.append(TEXT_208); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); > stringBuffer.append(TEXT_209); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); > stringBuffer.append(TEXT_210); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); > stringBuffer.append(TEXT_211); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); >+ stringBuffer.append(importManager.getImportedName("java.util.List")); > stringBuffer.append(TEXT_212); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >+ stringBuffer.append(importManager.getImportedName("java.util.List")); > stringBuffer.append(TEXT_213); > stringBuffer.append(importManager.getImportedName("java.util.List")); > stringBuffer.append(TEXT_214); >- stringBuffer.append(importManager.getImportedName("java.util.List")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); > stringBuffer.append(TEXT_215); >- stringBuffer.append(importManager.getImportedName("java.util.List")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); > stringBuffer.append(TEXT_216); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); > stringBuffer.append(TEXT_217); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); > stringBuffer.append(TEXT_218); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); > stringBuffer.append(TEXT_219); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); > stringBuffer.append(TEXT_220); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); > stringBuffer.append(TEXT_221); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); > stringBuffer.append(TEXT_222); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); > stringBuffer.append(TEXT_223); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); > stringBuffer.append(TEXT_224); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); > stringBuffer.append(TEXT_225); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); > stringBuffer.append(TEXT_226); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >+ /*@ include file="adapters/propertySource.javajetinc"*/ > stringBuffer.append(TEXT_227); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); > stringBuffer.append(TEXT_228); >- /*@ include file="adapters/propertySource.javajetinc"*/ > stringBuffer.append(TEXT_229); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); > stringBuffer.append(TEXT_230); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_231); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_232); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_233); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_234); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_235); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_236); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_237); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >- stringBuffer.append(TEXT_238); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >- stringBuffer.append(TEXT_239); > > final String primaryView = "getDiagramNode()"; > >+ stringBuffer.append(TEXT_238); >+ stringBuffer.append(TEXT_239); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_240); >- stringBuffer.append(TEXT_241); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(TEXT_241); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_242); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_243); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_244); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_245); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_246); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_247); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_248); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); > stringBuffer.append(TEXT_249); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_250); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); >- stringBuffer.append(TEXT_251); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(TEXT_251); > stringBuffer.append(TEXT_252); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_253); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); > stringBuffer.append(TEXT_254); >- stringBuffer.append(TEXT_255); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); >+ stringBuffer.append(TEXT_255); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_256); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_257); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_258); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_259); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_260); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_261); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); > stringBuffer.append(TEXT_262); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >- stringBuffer.append(TEXT_263); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); >+ stringBuffer.append(TEXT_263); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_264); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_265); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_266); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_267); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_268); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_269); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_270); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_271); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_272); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_273); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_274); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_275); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_276); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_277); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_278); >- stringBuffer.append(TEXT_279); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_279); > stringBuffer.append(TEXT_280); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_281); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_282); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_283); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_284); >@@ -1105,38 +1104,34 @@ > stringBuffer.append(TEXT_285); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_286); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_287); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_288); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_289); > stringBuffer.append(TEXT_290); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_291); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_292); > stringBuffer.append(TEXT_293); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_294); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_295); > stringBuffer.append(TEXT_296); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_297); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_298); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_299); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_300); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_301); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_302); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_303); >- stringBuffer.append(TEXT_304); >- stringBuffer.append(TEXT_305); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_306); >+ stringBuffer.append(TEXT_304); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_307); >+ stringBuffer.append(TEXT_305); > /*XXX: probably, this should go to a separate jet-template along with GraphicalNodeEditPolicy*/ > > for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { >@@ -1162,69 +1157,71 @@ > } > > if (palette != null) { >- stringBuffer.append(TEXT_308); >+ stringBuffer.append(TEXT_306); > stringBuffer.append(createCommandNameInfix); > stringBuffer.append(genLink.getVisualID()); >- stringBuffer.append(TEXT_309); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_310); >+ stringBuffer.append(TEXT_307); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); >+ stringBuffer.append(TEXT_308); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_311); >+ stringBuffer.append(TEXT_309); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_312); >+ stringBuffer.append(TEXT_310); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); >- stringBuffer.append(TEXT_313); >+ stringBuffer.append(TEXT_311); > stringBuffer.append(createCommandNameInfix); > stringBuffer.append(genLink.getVisualID()); >- stringBuffer.append(TEXT_314); >+ stringBuffer.append(TEXT_312); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >+ stringBuffer.append(TEXT_313); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >+ stringBuffer.append(TEXT_314); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_315); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_316); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_317); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); > stringBuffer.append(TEXT_318); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_319); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >- stringBuffer.append(TEXT_320); >+ stringBuffer.append(TEXT_319); > > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); > GenClass linkClass = modelFacet.getMetaClass(); > >- stringBuffer.append(TEXT_321); >+ stringBuffer.append(TEXT_320); > stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName()))); >- stringBuffer.append(TEXT_322); >+ stringBuffer.append(TEXT_321); > stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName())); >- stringBuffer.append(TEXT_323); >+ stringBuffer.append(TEXT_322); > stringBuffer.append(linkClass.getClassifierAccessorName()); >- stringBuffer.append(TEXT_324); >+ stringBuffer.append(TEXT_323); > /*XXX: Class name DomainElementInitializer should be user-customizable*/ >- stringBuffer.append(TEXT_325); >+ stringBuffer.append(TEXT_324); > stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); >- stringBuffer.append(TEXT_326); >+ stringBuffer.append(TEXT_325); > stringBuffer.append(genLink.getUniqueIdentifier()); >- stringBuffer.append(TEXT_327); >+ stringBuffer.append(TEXT_326); > > } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { > >- stringBuffer.append(TEXT_328); >+ stringBuffer.append(TEXT_327); > > } > >- stringBuffer.append(TEXT_329); >+ stringBuffer.append(TEXT_328); > stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())); >+ stringBuffer.append(TEXT_329); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_330); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_331); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_332); > > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > >- stringBuffer.append(TEXT_333); >+ stringBuffer.append(TEXT_332); > > TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); > GenFeature sourceFeature = modelFacet.getSourceMetaFeature(); >@@ -1251,85 +1248,85 @@ > } > } > >- stringBuffer.append(TEXT_334); >+ stringBuffer.append(TEXT_333); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >- stringBuffer.append(TEXT_335); >+ stringBuffer.append(TEXT_334); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_336); >+ stringBuffer.append(TEXT_335); > stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); >- stringBuffer.append(TEXT_337); >+ stringBuffer.append(TEXT_336); > stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_338); >+ stringBuffer.append(TEXT_337); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_339); >+ stringBuffer.append(TEXT_338); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_340); >+ stringBuffer.append(TEXT_339); > > } > if (addChild) { > >- stringBuffer.append(TEXT_341); >+ stringBuffer.append(TEXT_340); > stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_342); >+ stringBuffer.append(TEXT_341); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_343); >+ stringBuffer.append(TEXT_342); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_344); >+ stringBuffer.append(TEXT_343); > > } > if (addSource) { > >- stringBuffer.append(TEXT_345); >+ stringBuffer.append(TEXT_344); > stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_346); >+ stringBuffer.append(TEXT_345); > stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_347); >+ stringBuffer.append(TEXT_346); > stringBuffer.append(sourceFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_348); >+ stringBuffer.append(TEXT_347); > > } > if (addTarget) { > >- stringBuffer.append(TEXT_349); >+ stringBuffer.append(TEXT_348); > stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_350); >+ stringBuffer.append(TEXT_349); > stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_351); >+ stringBuffer.append(TEXT_350); > stringBuffer.append(targetFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_352); >+ stringBuffer.append(TEXT_351); > > } > >- stringBuffer.append(TEXT_353); >+ stringBuffer.append(TEXT_352); > > } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { > GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); > >- stringBuffer.append(TEXT_354); >+ stringBuffer.append(TEXT_353); > stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_355); >+ stringBuffer.append(TEXT_354); > stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_356); >+ stringBuffer.append(TEXT_355); > stringBuffer.append(metaFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_357); >+ stringBuffer.append(TEXT_356); > > } > >- stringBuffer.append(TEXT_358); >+ stringBuffer.append(TEXT_357); > > if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { > >+ stringBuffer.append(TEXT_358); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_359); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_360); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >- stringBuffer.append(TEXT_361); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); >- stringBuffer.append(TEXT_362); >+ stringBuffer.append(TEXT_361); > > } > >- stringBuffer.append(TEXT_363); >+ stringBuffer.append(TEXT_362); > > } > >@@ -1338,22 +1335,22 @@ > if (genNode.getViewmap() instanceof InnerClassViewmap) { > String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody(); > >- stringBuffer.append(TEXT_364); >+ stringBuffer.append(TEXT_363); > stringBuffer.append(classBody); >- stringBuffer.append(TEXT_365); >+ stringBuffer.append(TEXT_364); > > if (classBody.indexOf("DPtoLP") != -1) { > >- stringBuffer.append(TEXT_366); >+ stringBuffer.append(TEXT_365); > > } > > > } > >- stringBuffer.append(TEXT_367); >+ stringBuffer.append(TEXT_366); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_368); >+ stringBuffer.append(TEXT_367); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 CompartmentEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 26 Apr 2006 11:58:49 -0000 1.2 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 22 May 2006 13:59:34 -0000 >@@ -32,120 +32,126 @@ > protected final String TEXT_13 = NL + "\t\tinstallEditPolicy("; > protected final String TEXT_14 = ".LAYOUT_ROLE, new "; > protected final String TEXT_15 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final "; >- 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 "; >- protected final String TEXT_17 = " moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate "; >- 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("; >- protected final String TEXT_19 = " move, "; >- 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 "; >- protected final String TEXT_21 = ".INSTANCE;" + NL + "\t\t\t}"; >- protected final String TEXT_22 = NL + "\t\tinstallEditPolicy("; >- protected final String TEXT_23 = ".LAYOUT_ROLE, new "; >- protected final String TEXT_24 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; >- protected final String TEXT_25 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >- 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 "; >- protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t}"; >- protected final String TEXT_28 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; >- protected final String TEXT_29 = NL + "\t\t\t\tif (request instanceof "; >- protected final String TEXT_30 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; >- protected final String TEXT_31 = ".CreateRequestEx requestEx = ("; >- 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) {"; >- protected final String TEXT_33 = NL + "\t\t\t\t\t\tcase "; >- protected final String TEXT_34 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create"; >- protected final String TEXT_35 = "Command((View) getModel(), requestEx"; >- protected final String TEXT_36 = ", " + NL + "\t\t\t\t\t\t\t\t("; >- protected final String TEXT_37 = ")getConstraintFor(request)"; >- protected final String TEXT_38 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; >- 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}"; >- 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 \""; >- protected final String TEXT_41 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_42 = " createFigure() {" + NL + "\t\t"; >- protected final String TEXT_43 = " result = new "; >- protected final String TEXT_44 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; >- protected final String TEXT_45 = "());" + NL + "\t\t"; >- protected final String TEXT_46 = " scrollPane = new "; >- protected final String TEXT_47 = "();" + NL + "\t\tresult.add(scrollPane);"; >- protected final String TEXT_48 = NL + "\t\t"; >- protected final String TEXT_49 = " viewport = new "; >- protected final String TEXT_50 = "();" + NL + "\t\tcontentPane = new "; >- protected final String TEXT_51 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; >- protected final String TEXT_52 = "());"; >- protected final String TEXT_53 = NL + "\t\t"; >- protected final String TEXT_54 = " viewport = new "; >- protected final String TEXT_55 = "();" + NL + "\t\tcontentPane = new "; >- protected final String TEXT_56 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; >- protected final String TEXT_57 = "());"; >- 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 "; >- 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 ("; >- protected final String TEXT_60 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL; >- protected final String TEXT_61 = NL; >- protected final String TEXT_62 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_63 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >- protected final String TEXT_64 = " feature, "; >- 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();"; >- protected final String TEXT_66 = NL; >- 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("; >- protected final String TEXT_68 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_69 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >- protected final String TEXT_70 = NL; >- 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("; >- 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; >- protected final String TEXT_73 = NL; >- protected final String TEXT_74 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_75 = "static "; >- protected final String TEXT_76 = "class Create"; >- protected final String TEXT_77 = "Command extends "; >- protected final String TEXT_78 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >- protected final String TEXT_79 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >- protected final String TEXT_80 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; >- protected final String TEXT_81 = "Command("; >- protected final String TEXT_82 = " parent, "; >- protected final String TEXT_83 = ".CreateRequestEx request"; >- protected final String TEXT_84 = ", "; >- protected final String TEXT_85 = " constraint"; >- protected final String TEXT_86 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = "; >- protected final String TEXT_87 = ".eINSTANCE.createNode();"; >- protected final String TEXT_88 = NL + "\t\t\t"; >- protected final String TEXT_89 = " createdDomainElement = "; >- protected final String TEXT_90 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; >- protected final String TEXT_91 = ".eINSTANCE.get"; >- protected final String TEXT_92 = "());"; >- protected final String TEXT_93 = NL + "\t\t\t"; >- protected final String TEXT_94 = " createdDomainElement = "; >- protected final String TEXT_95 = ".eINSTANCE.create"; >- protected final String TEXT_96 = "();"; >- protected final String TEXT_97 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t"; >- protected final String TEXT_98 = NL + "\t\t\t"; >- protected final String TEXT_99 = "."; >- protected final String TEXT_100 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t"; >- protected final String TEXT_101 = ".decorateView(createdNode);"; >- protected final String TEXT_102 = NL + "\t\t\t"; >- protected final String TEXT_103 = " bounds = "; >- 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);"; >- protected final String TEXT_105 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; >- protected final String TEXT_106 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; >- protected final String TEXT_107 = "));"; >+ 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"; >+ protected final String TEXT_17 = " emfCommand = new "; >+ protected final String TEXT_18 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate "; >+ protected final String TEXT_19 = " moveDelta = request.getMoveDelta();" + NL + "\t\t\t\t\tprivate "; >+ 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("; >+ protected final String TEXT_21 = " move, "; >+ 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("; >+ 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 "; >+ protected final String TEXT_24 = ".INSTANCE;" + NL + "\t\t\t}"; >+ protected final String TEXT_25 = NL + "\t\tinstallEditPolicy("; >+ protected final String TEXT_26 = ".LAYOUT_ROLE, new "; >+ protected final String TEXT_27 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; >+ protected final String TEXT_28 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; >+ 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 "; >+ protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t}"; >+ protected final String TEXT_31 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; >+ protected final String TEXT_32 = NL + "\t\t\t\tif (request instanceof "; >+ protected final String TEXT_33 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_34 = ".CreateRequestEx requestEx = ("; >+ protected final String TEXT_35 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_36 = " result = new "; >+ 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) {"; >+ protected final String TEXT_38 = NL + "\t\t\t\t\t\tcase "; >+ protected final String TEXT_39 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; >+ protected final String TEXT_40 = "Command((View) getModel(), requestEx"; >+ protected final String TEXT_41 = ", " + NL + "\t\t\t\t\t\t\t\t("; >+ protected final String TEXT_42 = ")getConstraintFor(request)"; >+ protected final String TEXT_43 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; >+ 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("; >+ protected final String TEXT_45 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; >+ 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 \""; >+ protected final String TEXT_47 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_48 = " createFigure() {" + NL + "\t\t"; >+ protected final String TEXT_49 = " result = new "; >+ protected final String TEXT_50 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; >+ protected final String TEXT_51 = "());" + NL + "\t\t"; >+ protected final String TEXT_52 = " scrollPane = new "; >+ protected final String TEXT_53 = "();" + NL + "\t\tresult.add(scrollPane);"; >+ protected final String TEXT_54 = NL + "\t\t"; >+ protected final String TEXT_55 = " viewport = new "; >+ protected final String TEXT_56 = "();" + NL + "\t\tcontentPane = new "; >+ protected final String TEXT_57 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; >+ protected final String TEXT_58 = "());"; >+ protected final String TEXT_59 = NL + "\t\t"; >+ protected final String TEXT_60 = " viewport = new "; >+ protected final String TEXT_61 = "();" + NL + "\t\tcontentPane = new "; >+ protected final String TEXT_62 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; >+ protected final String TEXT_63 = "());"; >+ 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 "; >+ 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 ("; >+ protected final String TEXT_66 = ") view.getElement();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL; >+ protected final String TEXT_67 = NL; >+ protected final String TEXT_68 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_69 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >+ protected final String TEXT_70 = " feature, "; >+ 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();"; >+ protected final String TEXT_72 = NL; >+ 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("; >+ protected final String TEXT_74 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_75 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >+ protected final String TEXT_76 = NL; >+ 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("; >+ 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; >+ protected final String TEXT_79 = NL; >+ protected final String TEXT_80 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_81 = "static "; >+ protected final String TEXT_82 = "class Create"; >+ protected final String TEXT_83 = "Command extends "; >+ protected final String TEXT_84 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >+ protected final String TEXT_85 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >+ protected final String TEXT_86 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; >+ protected final String TEXT_87 = "Command("; >+ protected final String TEXT_88 = " parent, "; >+ protected final String TEXT_89 = ".CreateRequestEx request"; >+ protected final String TEXT_90 = ", "; >+ protected final String TEXT_91 = " constraint"; >+ protected final String TEXT_92 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = "; >+ protected final String TEXT_93 = ".eINSTANCE.createNode();"; >+ protected final String TEXT_94 = NL + "\t\t\t"; >+ protected final String TEXT_95 = " createdDomainElement = "; >+ protected final String TEXT_96 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; >+ protected final String TEXT_97 = ".eINSTANCE.get"; >+ protected final String TEXT_98 = "());"; >+ protected final String TEXT_99 = NL + "\t\t\t"; >+ protected final String TEXT_100 = " createdDomainElement = "; >+ protected final String TEXT_101 = ".eINSTANCE.create"; >+ protected final String TEXT_102 = "();"; >+ protected final String TEXT_103 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t"; >+ protected final String TEXT_104 = NL + "\t\t\t"; >+ protected final String TEXT_105 = "."; >+ protected final String TEXT_106 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t"; >+ protected final String TEXT_107 = ".decorateView(createdNode);"; > protected final String TEXT_108 = NL + "\t\t\t"; >- protected final String TEXT_109 = " domainModelEditDomain = "; >- protected final String TEXT_110 = ".getEditingDomainFor(parent.getDiagram().getElement());"; >- protected final String TEXT_111 = NL + "\t\t\t"; >- protected final String TEXT_112 = " compoundCommand = new "; >- protected final String TEXT_113 = "();" + NL + "\t\t\tcompoundCommand.append("; >- protected final String TEXT_114 = ".create(domainModelEditDomain, "; >- protected final String TEXT_115 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_116 = ".eINSTANCE.get"; >- protected final String TEXT_117 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append("; >- protected final String TEXT_118 = ".create(domainModelEditDomain, "; >- protected final String TEXT_119 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_120 = ".eINSTANCE.get"; >- protected final String TEXT_121 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; >- protected final String TEXT_122 = NL + "\t\t\tthis.domainModelAddCommand = "; >- protected final String TEXT_123 = ".create(domainModelEditDomain, "; >- protected final String TEXT_124 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_125 = ".eINSTANCE.get"; >- protected final String TEXT_126 = "(), createdNode.getElement());"; >- 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}"; >- protected final String TEXT_128 = NL + "}" + NL; >- protected final String TEXT_129 = NL; >+ protected final String TEXT_109 = " bounds = "; >+ 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);"; >+ protected final String TEXT_111 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; >+ protected final String TEXT_112 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; >+ protected final String TEXT_113 = "));"; >+ protected final String TEXT_114 = NL + "\t\t\t"; >+ protected final String TEXT_115 = " domainModelEditDomain = "; >+ protected final String TEXT_116 = ".getEditingDomain(parent.getDiagram().getElement());"; >+ protected final String TEXT_117 = NL + "\t\t\t"; >+ protected final String TEXT_118 = " compoundCommand = new "; >+ protected final String TEXT_119 = "();" + NL + "\t\t\tcompoundCommand.append("; >+ protected final String TEXT_120 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_121 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_122 = ".eINSTANCE.get"; >+ protected final String TEXT_123 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append("; >+ protected final String TEXT_124 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_125 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_126 = ".eINSTANCE.get"; >+ protected final String TEXT_127 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; >+ protected final String TEXT_128 = NL + "\t\t\tthis.domainModelAddCommand = "; >+ protected final String TEXT_129 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_130 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_131 = ".eINSTANCE.get"; >+ protected final String TEXT_132 = "(), createdNode.getElement());"; >+ 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}"; >+ protected final String TEXT_134 = NL + "}" + NL; >+ protected final String TEXT_135 = NL; > > public String generate(Object argument) > { >@@ -199,119 +205,131 @@ > stringBuffer.append(TEXT_15); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")); > stringBuffer.append(TEXT_16); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_17); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); > stringBuffer.append(TEXT_18); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); > stringBuffer.append(TEXT_19); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); > stringBuffer.append(TEXT_20); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); > stringBuffer.append(TEXT_21); >- } else { >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); > stringBuffer.append(TEXT_22); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_23); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_24); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >+ } else { > stringBuffer.append(TEXT_25); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_26); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); > stringBuffer.append(TEXT_27); >- } >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); > stringBuffer.append(TEXT_28); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); >+ stringBuffer.append(TEXT_29); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_30); >+ } >+ stringBuffer.append(TEXT_31); > if (null != genDiagram.getPalette()) { > final Palette palette = genDiagram.getPalette(); >- stringBuffer.append(TEXT_29); >+ stringBuffer.append(TEXT_32); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_30); >+ stringBuffer.append(TEXT_33); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_31); >+ stringBuffer.append(TEXT_34); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_35); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_36); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_37); > > for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { > GenChildNode next = (GenChildNode)it.next(); > >- stringBuffer.append(TEXT_33); >+ stringBuffer.append(TEXT_38); > stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_34); >+ stringBuffer.append(TEXT_39); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_40); > if (!genCompartment.isListLayout()) { >- stringBuffer.append(TEXT_36); >+ stringBuffer.append(TEXT_41); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_37); >+ stringBuffer.append(TEXT_42); > } >- stringBuffer.append(TEXT_38); >+ stringBuffer.append(TEXT_43); > > } > >- stringBuffer.append(TEXT_39); >- }/*when there's palette*/ >- stringBuffer.append(TEXT_40); >- stringBuffer.append(genCompartment.getTitle()); >- stringBuffer.append(TEXT_41); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_42); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); >- stringBuffer.append(TEXT_43); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); > stringBuffer.append(TEXT_44); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_45); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); >+ }/*when there's palette*/ > stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); >+ stringBuffer.append(genCompartment.getTitle()); > stringBuffer.append(TEXT_47); >- if (genCompartment.isListLayout()) { >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); > stringBuffer.append(TEXT_48); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); > stringBuffer.append(TEXT_49); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); > stringBuffer.append(TEXT_50); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); > stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); > stringBuffer.append(TEXT_52); >- } else { >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); > stringBuffer.append(TEXT_53); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); >+ if (genCompartment.isListLayout()) { > stringBuffer.append(TEXT_54); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); > stringBuffer.append(TEXT_55); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); > stringBuffer.append(TEXT_56); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); > stringBuffer.append(TEXT_57); >- } >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout")); > stringBuffer.append(TEXT_58); >- stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); >+ } else { > stringBuffer.append(TEXT_59); >- stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); > stringBuffer.append(TEXT_60); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport")); > stringBuffer.append(TEXT_61); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); > stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); > stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ } > stringBuffer.append(TEXT_64); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); > stringBuffer.append(TEXT_65); >+ stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); > stringBuffer.append(TEXT_66); > stringBuffer.append(TEXT_67); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_68); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_69); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_70); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_71); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_73); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_74); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_77); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_78); > > for(Iterator it = genCompartment.getChildNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) { > GenChildNode next = (GenChildNode)it.next(); >@@ -319,79 +337,79 @@ > boolean isListLayout = genCompartment.isListLayout(); > String resolvedSemanticElement = "resolveSemanticElement()"; > >- stringBuffer.append(TEXT_73); >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_80); > if (isStatic) { >- stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_81); > } >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_82); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_77); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_83); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); >+ stringBuffer.append(TEXT_84); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_85); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_86); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_81); >+ stringBuffer.append(TEXT_87); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_82); >+ stringBuffer.append(TEXT_88); > stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_83); >+ stringBuffer.append(TEXT_89); > if (!isListLayout) { >- stringBuffer.append(TEXT_84); >+ stringBuffer.append(TEXT_90); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_85); >+ stringBuffer.append(TEXT_91); > } >- stringBuffer.append(TEXT_86); >+ stringBuffer.append(TEXT_92); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >- stringBuffer.append(TEXT_87); >+ stringBuffer.append(TEXT_93); > > if (next.getDomainMetaClass().isMapEntry()) { > /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ > >- stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_94); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >- stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_95); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); >- stringBuffer.append(TEXT_90); >+ stringBuffer.append(TEXT_96); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_91); >+ stringBuffer.append(TEXT_97); > stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); >- stringBuffer.append(TEXT_92); >+ stringBuffer.append(TEXT_98); > > } else { > >- stringBuffer.append(TEXT_93); >+ stringBuffer.append(TEXT_99); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_94); >+ stringBuffer.append(TEXT_100); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); >- stringBuffer.append(TEXT_95); >+ stringBuffer.append(TEXT_101); > stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); >- stringBuffer.append(TEXT_96); >+ stringBuffer.append(TEXT_102); > > } > >- stringBuffer.append(TEXT_97); >+ stringBuffer.append(TEXT_103); > /*XXX: Class name DomainElementInitializer should be user-customizable*/ >- stringBuffer.append(TEXT_98); >+ stringBuffer.append(TEXT_104); > stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); >- stringBuffer.append(TEXT_99); >+ stringBuffer.append(TEXT_105); > stringBuffer.append(next.getUniqueIdentifier()); >- stringBuffer.append(TEXT_100); >+ stringBuffer.append(TEXT_106); > stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_101); >+ stringBuffer.append(TEXT_107); > > if (!isListLayout) { > >- stringBuffer.append(TEXT_102); >+ stringBuffer.append(TEXT_108); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); >- stringBuffer.append(TEXT_103); >+ stringBuffer.append(TEXT_109); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >- stringBuffer.append(TEXT_104); >+ stringBuffer.append(TEXT_110); > > int defaultWidth = 40; > int defaultHeight = 40; >@@ -401,68 +419,68 @@ > defaultHeight = defSizeAttrs.getHeight(); > } > >- stringBuffer.append(TEXT_105); >+ stringBuffer.append(TEXT_111); > stringBuffer.append(defaultWidth); >- stringBuffer.append(TEXT_106); >+ stringBuffer.append(TEXT_112); > stringBuffer.append(defaultHeight); >- stringBuffer.append(TEXT_107); >+ stringBuffer.append(TEXT_113); > > } > >- stringBuffer.append(TEXT_108); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >- stringBuffer.append(TEXT_109); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_110); >+ stringBuffer.append(TEXT_114); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); >+ stringBuffer.append(TEXT_115); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_116); > > TypeModelFacet facet = next.getModelFacet(); > GenFeature childFeature = facet.getChildMetaFeature(); > GenFeature containmentFeature = facet.getContainmentMetaFeature(); > if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { > >- stringBuffer.append(TEXT_111); >+ stringBuffer.append(TEXT_117); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_112); >+ stringBuffer.append(TEXT_118); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_113); >+ stringBuffer.append(TEXT_119); > stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_114); >+ stringBuffer.append(TEXT_120); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_115); >+ stringBuffer.append(TEXT_121); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_116); >+ stringBuffer.append(TEXT_122); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_117); >+ stringBuffer.append(TEXT_123); > stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_118); >+ stringBuffer.append(TEXT_124); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_119); >+ stringBuffer.append(TEXT_125); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_120); >+ stringBuffer.append(TEXT_126); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_121); >+ stringBuffer.append(TEXT_127); > > } else { > >- stringBuffer.append(TEXT_122); >+ stringBuffer.append(TEXT_128); > stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_123); >+ stringBuffer.append(TEXT_129); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_124); >+ stringBuffer.append(TEXT_130); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_125); >+ stringBuffer.append(TEXT_131); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_126); >+ stringBuffer.append(TEXT_132); > > } > >- stringBuffer.append(TEXT_127); >+ stringBuffer.append(TEXT_133); > > } > >- stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_134); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_129); >+ stringBuffer.append(TEXT_135); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 DiagramEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 26 Apr 2006 11:58:49 -0000 1.2 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 22 May 2006 13:59:34 -0000 >@@ -32,100 +32,106 @@ > protected final String TEXT_13 = NL + "\t\t\t\tif (request instanceof "; > protected final String TEXT_14 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; > protected final String TEXT_15 = ".CreateRequestEx requestEx = ("; >- 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) {"; >- protected final String TEXT_17 = NL + "\t\t\t\t\t\tcase "; >- protected final String TEXT_18 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.add(new Create"; >- protected final String TEXT_19 = "Command(getDiagram(), requestEx, ("; >- protected final String TEXT_20 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; >- 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}"; >- 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 ("; >- protected final String TEXT_23 = ".class == key) {" + NL + "\t\t\treturn new "; >- protected final String TEXT_24 = "(this);" + NL + "\t\t}"; >- 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; >- protected final String TEXT_26 = NL; >- protected final String TEXT_27 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_28 = "static "; >- protected final String TEXT_29 = "class Create"; >- protected final String TEXT_30 = "Command extends "; >- protected final String TEXT_31 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >- protected final String TEXT_32 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >- protected final String TEXT_33 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; >- protected final String TEXT_34 = "Command("; >- protected final String TEXT_35 = " parent, "; >- protected final String TEXT_36 = ".CreateRequestEx request"; >- protected final String TEXT_37 = ", "; >- protected final String TEXT_38 = " constraint"; >- protected final String TEXT_39 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = "; >- protected final String TEXT_40 = ".eINSTANCE.createNode();"; >- protected final String TEXT_41 = NL + "\t\t\t"; >- protected final String TEXT_42 = " createdDomainElement = "; >- protected final String TEXT_43 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; >- protected final String TEXT_44 = ".eINSTANCE.get"; >- protected final String TEXT_45 = "());"; >- protected final String TEXT_46 = NL + "\t\t\t"; >- protected final String TEXT_47 = " createdDomainElement = "; >- protected final String TEXT_48 = ".eINSTANCE.create"; >- protected final String TEXT_49 = "();"; >- protected final String TEXT_50 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t"; >- protected final String TEXT_51 = NL + "\t\t\t"; >- protected final String TEXT_52 = "."; >- protected final String TEXT_53 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t"; >- protected final String TEXT_54 = ".decorateView(createdNode);"; >- protected final String TEXT_55 = NL + "\t\t\t"; >- protected final String TEXT_56 = " bounds = "; >- 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);"; >- protected final String TEXT_58 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; >- protected final String TEXT_59 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; >- protected final String TEXT_60 = "));"; >+ protected final String TEXT_16 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; >+ protected final String TEXT_17 = " result = new "; >+ 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) {"; >+ protected final String TEXT_19 = NL + "\t\t\t\t\t\tcase "; >+ protected final String TEXT_20 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; >+ protected final String TEXT_21 = "Command(getDiagram(), requestEx, ("; >+ protected final String TEXT_22 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; >+ 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("; >+ protected final String TEXT_24 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; >+ 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"; >+ protected final String TEXT_26 = " emfCommand = new "; >+ 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("; >+ 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 ("; >+ protected final String TEXT_29 = ".class == key) {" + NL + "\t\t\treturn new "; >+ protected final String TEXT_30 = "(this);" + NL + "\t\t}"; >+ 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; >+ protected final String TEXT_32 = NL; >+ protected final String TEXT_33 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_34 = "static "; >+ protected final String TEXT_35 = "class Create"; >+ protected final String TEXT_36 = "Command extends "; >+ protected final String TEXT_37 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; >+ protected final String TEXT_38 = " parent;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >+ protected final String TEXT_39 = " createdNode;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; >+ protected final String TEXT_40 = "Command("; >+ protected final String TEXT_41 = " parent, "; >+ protected final String TEXT_42 = ".CreateRequestEx request"; >+ protected final String TEXT_43 = ", "; >+ protected final String TEXT_44 = " constraint"; >+ protected final String TEXT_45 = ") {" + NL + "\t\t\tthis.parent = parent;" + NL + "\t\t\tcreatedNode = "; >+ protected final String TEXT_46 = ".eINSTANCE.createNode();"; >+ protected final String TEXT_47 = NL + "\t\t\t"; >+ protected final String TEXT_48 = " createdDomainElement = "; >+ protected final String TEXT_49 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; >+ protected final String TEXT_50 = ".eINSTANCE.get"; >+ protected final String TEXT_51 = "());"; >+ protected final String TEXT_52 = NL + "\t\t\t"; >+ protected final String TEXT_53 = " createdDomainElement = "; >+ protected final String TEXT_54 = ".eINSTANCE.create"; >+ protected final String TEXT_55 = "();"; >+ protected final String TEXT_56 = "\t\t\tcreatedNode.setElement(createdDomainElement);" + NL + "\t\t\t"; >+ protected final String TEXT_57 = NL + "\t\t\t"; >+ protected final String TEXT_58 = "."; >+ protected final String TEXT_59 = ".initializeElement(createdDomainElement);" + NL + "\t\t\t"; >+ protected final String TEXT_60 = ".decorateView(createdNode);"; > protected final String TEXT_61 = NL + "\t\t\t"; >- protected final String TEXT_62 = " domainModelEditDomain = "; >- protected final String TEXT_63 = ".getEditingDomainFor(parent.getDiagram().getElement());"; >- protected final String TEXT_64 = NL + "\t\t\t"; >- protected final String TEXT_65 = " compoundCommand = new "; >- protected final String TEXT_66 = "();" + NL + "\t\t\tcompoundCommand.append("; >- protected final String TEXT_67 = ".create(domainModelEditDomain, "; >- protected final String TEXT_68 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_69 = ".eINSTANCE.get"; >- protected final String TEXT_70 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append("; >- protected final String TEXT_71 = ".create(domainModelEditDomain, "; >- protected final String TEXT_72 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_73 = ".eINSTANCE.get"; >- protected final String TEXT_74 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; >- protected final String TEXT_75 = NL + "\t\t\tthis.domainModelAddCommand = "; >- protected final String TEXT_76 = ".create(domainModelEditDomain, "; >- protected final String TEXT_77 = ", " + NL + "\t\t\t\t"; >- protected final String TEXT_78 = ".eINSTANCE.get"; >- protected final String TEXT_79 = "(), createdNode.getElement());"; >- 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}"; >- protected final String TEXT_81 = NL; >- protected final String TEXT_82 = NL; >- protected final String TEXT_83 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_84 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >- protected final String TEXT_85 = " feature, "; >- 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();"; >+ protected final String TEXT_62 = " bounds = "; >+ 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);"; >+ protected final String TEXT_64 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; >+ protected final String TEXT_65 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; >+ protected final String TEXT_66 = "));"; >+ protected final String TEXT_67 = NL + "\t\t\t"; >+ protected final String TEXT_68 = " domainModelEditDomain = "; >+ protected final String TEXT_69 = ".getEditingDomain(parent.getDiagram().getElement());"; >+ protected final String TEXT_70 = NL + "\t\t\t"; >+ protected final String TEXT_71 = " compoundCommand = new "; >+ protected final String TEXT_72 = "();" + NL + "\t\t\tcompoundCommand.append("; >+ protected final String TEXT_73 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_74 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_75 = ".eINSTANCE.get"; >+ protected final String TEXT_76 = "(), createdNode.getElement()));" + NL + "\t\t\tcompoundCommand.append("; >+ protected final String TEXT_77 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_78 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_79 = ".eINSTANCE.get"; >+ protected final String TEXT_80 = "(), createdNode.getElement()));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; >+ protected final String TEXT_81 = NL + "\t\t\tthis.domainModelAddCommand = "; >+ protected final String TEXT_82 = ".create(domainModelEditDomain, "; >+ protected final String TEXT_83 = ", " + NL + "\t\t\t\t"; >+ protected final String TEXT_84 = ".eINSTANCE.get"; >+ protected final String TEXT_85 = "(), createdNode.getElement());"; >+ 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}"; > protected final String TEXT_87 = NL; >- 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("; >- protected final String TEXT_89 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_90 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; >- protected final String TEXT_91 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >- 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"; >- protected final String TEXT_93 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; >- 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(("; >- 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 "; >- protected final String TEXT_96 = "/*<IUpdatableEditPart>*/ findAffectedParts("; >- protected final String TEXT_97 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; >- protected final String TEXT_98 = ") {" + NL + "\t\t\t\t"; >- 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 "; >- 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 "; >- protected final String TEXT_101 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >- 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 ("; >- 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; >- protected final String TEXT_104 = NL; >- 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 "; >- protected final String TEXT_106 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >- 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(("; >- 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 + "}"; >- protected final String TEXT_109 = NL; >+ protected final String TEXT_88 = NL; >+ protected final String TEXT_89 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_90 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >+ protected final String TEXT_91 = " feature, "; >+ 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();"; >+ protected final String TEXT_93 = NL; >+ 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("; >+ protected final String TEXT_95 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_96 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; >+ protected final String TEXT_97 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >+ 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"; >+ protected final String TEXT_99 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; >+ 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(("; >+ 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 "; >+ protected final String TEXT_102 = "/*<IUpdatableEditPart>*/ findAffectedParts("; >+ protected final String TEXT_103 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; >+ protected final String TEXT_104 = ") {" + NL + "\t\t\t\t"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_107 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; >+ 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 ("; >+ 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; >+ protected final String TEXT_110 = NL; >+ 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 "; >+ protected final String TEXT_112 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >+ 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(("; >+ 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 + "}"; >+ protected final String TEXT_115 = NL; > > public String generate(Object argument) > { >@@ -195,30 +201,42 @@ > stringBuffer.append(TEXT_15); > stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); > stringBuffer.append(TEXT_16); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_17); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_18); > > for(Iterator it = genDiagram.getTopLevelNodes().iterator(); it.hasNext(); ) { > GenTopLevelNode next = (GenTopLevelNode)it.next(); > >- stringBuffer.append(TEXT_17); >+ stringBuffer.append(TEXT_19); > stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); >- stringBuffer.append(TEXT_18); >+ stringBuffer.append(TEXT_20); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_19); >+ stringBuffer.append(TEXT_21); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_20); >+ stringBuffer.append(TEXT_22); > > } > >- stringBuffer.append(TEXT_21); >+ stringBuffer.append(TEXT_23); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_24); > }/*when there's palette*/ >- stringBuffer.append(TEXT_22); >+ stringBuffer.append(TEXT_25); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(TEXT_26); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); >+ stringBuffer.append(TEXT_27); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_28); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper")); >- stringBuffer.append(TEXT_23); >+ stringBuffer.append(TEXT_29); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid")); >- stringBuffer.append(TEXT_24); >+ stringBuffer.append(TEXT_30); > /*@ include file="adapters/propertySource.javajetinc"*/ >- stringBuffer.append(TEXT_25); >+ stringBuffer.append(TEXT_31); > > for(Iterator it = genDiagram.getTopLevelNodes().iterator(); genDiagram.getPalette() != null && it.hasNext(); ) { > GenTopLevelNode next = (GenTopLevelNode)it.next(); >@@ -226,79 +244,79 @@ > boolean isListLayout = false; > String resolvedSemanticElement = "parent.getElement()"; > >- stringBuffer.append(TEXT_26); >- stringBuffer.append(TEXT_27); >+ stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_33); > if (isStatic) { >- stringBuffer.append(TEXT_28); >+ stringBuffer.append(TEXT_34); > } >- stringBuffer.append(TEXT_29); >+ stringBuffer.append(TEXT_35); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_30); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_31); >+ stringBuffer.append(TEXT_36); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); >+ stringBuffer.append(TEXT_37); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_32); >+ stringBuffer.append(TEXT_38); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >- stringBuffer.append(TEXT_33); >+ stringBuffer.append(TEXT_39); > stringBuffer.append(next.getDomainMetaClass().getName()); > stringBuffer.append(next.getVisualID()); >- stringBuffer.append(TEXT_34); >+ stringBuffer.append(TEXT_40); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >- stringBuffer.append(TEXT_35); >+ stringBuffer.append(TEXT_41); > stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_36); >+ stringBuffer.append(TEXT_42); > if (!isListLayout) { >- stringBuffer.append(TEXT_37); >+ stringBuffer.append(TEXT_43); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_38); >+ stringBuffer.append(TEXT_44); > } >- stringBuffer.append(TEXT_39); >+ stringBuffer.append(TEXT_45); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >- stringBuffer.append(TEXT_40); >+ stringBuffer.append(TEXT_46); > > if (next.getDomainMetaClass().isMapEntry()) { > /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ > >- stringBuffer.append(TEXT_41); >+ stringBuffer.append(TEXT_47); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >- stringBuffer.append(TEXT_42); >+ stringBuffer.append(TEXT_48); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); >- stringBuffer.append(TEXT_43); >+ stringBuffer.append(TEXT_49); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_44); >+ stringBuffer.append(TEXT_50); > stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); >- stringBuffer.append(TEXT_45); >+ stringBuffer.append(TEXT_51); > > } else { > >- stringBuffer.append(TEXT_46); >+ stringBuffer.append(TEXT_52); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_47); >+ stringBuffer.append(TEXT_53); > stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); >- stringBuffer.append(TEXT_48); >+ stringBuffer.append(TEXT_54); > stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); >- stringBuffer.append(TEXT_49); >+ stringBuffer.append(TEXT_55); > > } > >- stringBuffer.append(TEXT_50); >+ stringBuffer.append(TEXT_56); > /*XXX: Class name DomainElementInitializer should be user-customizable*/ >- stringBuffer.append(TEXT_51); >+ stringBuffer.append(TEXT_57); > stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); >- stringBuffer.append(TEXT_52); >+ stringBuffer.append(TEXT_58); > stringBuffer.append(next.getUniqueIdentifier()); >- stringBuffer.append(TEXT_53); >+ stringBuffer.append(TEXT_59); > stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); >- stringBuffer.append(TEXT_54); >+ stringBuffer.append(TEXT_60); > > if (!isListLayout) { > >- stringBuffer.append(TEXT_55); >+ stringBuffer.append(TEXT_61); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); >- stringBuffer.append(TEXT_56); >+ stringBuffer.append(TEXT_62); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); >- stringBuffer.append(TEXT_57); >+ stringBuffer.append(TEXT_63); > > int defaultWidth = 40; > int defaultHeight = 40; >@@ -308,116 +326,116 @@ > defaultHeight = defSizeAttrs.getHeight(); > } > >- stringBuffer.append(TEXT_58); >+ stringBuffer.append(TEXT_64); > stringBuffer.append(defaultWidth); >- stringBuffer.append(TEXT_59); >+ stringBuffer.append(TEXT_65); > stringBuffer.append(defaultHeight); >- stringBuffer.append(TEXT_60); >+ stringBuffer.append(TEXT_66); > > } > >- stringBuffer.append(TEXT_61); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >- stringBuffer.append(TEXT_62); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_63); >+ stringBuffer.append(TEXT_67); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); >+ stringBuffer.append(TEXT_68); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); >+ stringBuffer.append(TEXT_69); > > TypeModelFacet facet = next.getModelFacet(); > GenFeature childFeature = facet.getChildMetaFeature(); > GenFeature containmentFeature = facet.getContainmentMetaFeature(); > if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { > >- stringBuffer.append(TEXT_64); >+ stringBuffer.append(TEXT_70); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_65); >+ stringBuffer.append(TEXT_71); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_66); >+ stringBuffer.append(TEXT_72); > stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_67); >+ stringBuffer.append(TEXT_73); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_74); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_75); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_70); >+ stringBuffer.append(TEXT_76); > stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_77); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_78); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_73); >+ stringBuffer.append(TEXT_79); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_80); > > } else { > >- stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_81); > stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_82); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_77); >+ stringBuffer.append(TEXT_83); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_84); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_85); > > } > >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_86); > > } > >- stringBuffer.append(TEXT_81); >- stringBuffer.append(TEXT_82); >- stringBuffer.append(TEXT_83); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); >- stringBuffer.append(TEXT_84); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >- stringBuffer.append(TEXT_85); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >- stringBuffer.append(TEXT_86); > stringBuffer.append(TEXT_87); > stringBuffer.append(TEXT_88); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_89); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_90); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_91); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_92); >- stringBuffer.append(importManager.getImportedName("java.util.Collection")); > stringBuffer.append(TEXT_93); >- stringBuffer.append(importManager.getImportedName("java.util.Iterator")); > stringBuffer.append(TEXT_94); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_95); >- stringBuffer.append(importManager.getImportedName("java.util.Collection")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_96); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter")); > stringBuffer.append(TEXT_97); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_98); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >+ stringBuffer.append(importManager.getImportedName("java.util.Collection")); > stringBuffer.append(TEXT_99); >- stringBuffer.append(importManager.getImportedName("java.util.Collections")); >+ stringBuffer.append(importManager.getImportedName("java.util.Iterator")); > stringBuffer.append(TEXT_100); >- stringBuffer.append(importManager.getImportedName("java.util.Collections")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_101); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >+ stringBuffer.append(importManager.getImportedName("java.util.Collection")); > stringBuffer.append(TEXT_102); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_103); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); > stringBuffer.append(TEXT_104); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_105); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); >+ stringBuffer.append(importManager.getImportedName("java.util.Collections")); > stringBuffer.append(TEXT_106); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("java.util.Collections")); > stringBuffer.append(TEXT_107); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_108); >- importManager.emitSortedImports(); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); > stringBuffer.append(TEXT_109); >+ stringBuffer.append(TEXT_110); >+ stringBuffer.append(TEXT_111); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); >+ stringBuffer.append(TEXT_112); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(TEXT_113); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(TEXT_114); >+ importManager.emitSortedImports(); >+ stringBuffer.append(TEXT_115); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java,v >retrieving revision 1.3 >diff -u -r1.3 ChildNodeEditPartGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 15 May 2006 11:19:18 -0000 1.3 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 22 May 2006 13:59:34 -0000 >@@ -31,240 +31,236 @@ > protected final String TEXT_11 = NL; > protected final String TEXT_12 = NL; > protected final String TEXT_13 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- 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 "; >- protected final String TEXT_15 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_16 = " getDiagramNode() {" + NL + "\t\treturn ("; >- 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!"; >- protected final String TEXT_18 = NL; >- protected final String TEXT_19 = "\t\tinstallEditPolicy("; >- protected final String TEXT_20 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >- protected final String TEXT_21 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >- 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 "; >- protected final String TEXT_23 = " getDirectEditCommand("; >- 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 "; >- 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 "; >- 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 "; >- protected final String TEXT_27 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >- protected final String TEXT_28 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_29 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >- protected final String TEXT_30 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_31 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_32 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_33 = " element = "; >- protected final String TEXT_34 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_35 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_36 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_37 = " domainModelEditDomain = "; >- protected final String TEXT_38 = ".getEditingDomainFor("; >- protected final String TEXT_39 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_40 = " feature = ("; >- protected final String TEXT_41 = ") "; >- protected final String TEXT_42 = ".eINSTANCE.get"; >- 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 = "; >- 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 "; >- protected final String TEXT_45 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_46 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_47 = " result = new "; >- protected final String TEXT_48 = "();" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_49 = " values = new "; >- protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_51 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_52 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_53 = ".create(domainModelEditDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\t\t\treturn result;"; >- protected final String TEXT_54 = NL + "\t\t\t\t\t\t\t\treturn "; >- protected final String TEXT_55 = ".create(domainModelEditDomain, element, feature, valueToSet);"; >- protected final String TEXT_56 = NL + "\t\t\t\t\t\t\t}"; >- protected final String TEXT_57 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >- protected final String TEXT_58 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >- protected final String TEXT_59 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn new "; >- protected final String TEXT_60 = "() {" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_61 = " element = "; >- protected final String TEXT_62 = ";" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_63 = " domainModelCommand = createDomainModelCommand();" + NL + "\t\t\t\t\t\t\tprivate "; >- protected final String TEXT_64 = " createDomainModelCommand() {" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_65 = " domainModelEditDomain = "; >- protected final String TEXT_66 = ".getEditingDomainFor("; >- protected final String TEXT_67 = ".getDiagram().getElement());" + NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_68 = " result = new "; >- protected final String TEXT_69 = "();" + NL + "\t\t\t\t\t\t\t\tObject valueToSet;"; >- protected final String TEXT_70 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_71 = " "; >- protected final String TEXT_72 = "feature = ("; >- protected final String TEXT_73 = ") "; >- protected final String TEXT_74 = ".eINSTANCE.get"; >- protected final String TEXT_75 = "();" + NL + "\t\t\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\t\t\tvalueToSet = "; >- protected final String TEXT_76 = ".parseValue(feature, parseResult["; >- 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 "; >- protected final String TEXT_78 = ".INSTANCE;" + NL + "\t\t\t\t\t\t\t\t}"; >- protected final String TEXT_79 = NL + "\t\t\t\t\t\t\t\t"; >- protected final String TEXT_80 = " "; >- protected final String TEXT_81 = "values = new "; >- protected final String TEXT_82 = "();" + NL + "\t\t\t\t\t\t\t\tvalues.addAll(element.get"; >- protected final String TEXT_83 = "());" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_84 = ".create(domainModelEditDomain, element, feature, values));" + NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_85 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_86 = NL + "\t\t\t\t\t\t\t\tresult.append("; >- protected final String TEXT_87 = ".create(domainModelEditDomain, element, feature, valueToSet));"; >- protected final String TEXT_88 = NL + "\t\t\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t\t\t}"; >- 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});"; >- protected final String TEXT_90 = NL; >- protected final String TEXT_91 = "\t\tinstallEditPolicy("; >- protected final String TEXT_92 = ".COMPONENT_ROLE, new "; >- protected final String TEXT_93 = "() {" + NL + "\t\t\tprotected "; >- protected final String TEXT_94 = " createDeleteCommand("; >- protected final String TEXT_95 = " deleteRequest) {" + NL + "\t\t\t\treturn new "; >- protected final String TEXT_96 = "() {"; >- 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"; >- protected final String TEXT_98 = " result = new "; >- protected final String TEXT_99 = "();"; >- protected final String TEXT_100 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_101 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_102 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_103 = ".eINSTANCE.get"; >- protected final String TEXT_104 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));"; >- protected final String TEXT_105 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_106 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_107 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_108 = ".eINSTANCE.get"; >- protected final String TEXT_109 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_110 = ".UNSET_VALUE));"; >- protected final String TEXT_111 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_112 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_113 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_14 = " manager;" + NL; >+ 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 "; >+ protected final String TEXT_16 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_17 = " getDiagramNode() {" + NL + "\t\treturn ("; >+ 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!"; >+ protected final String TEXT_19 = NL; >+ protected final String TEXT_20 = "\t\tinstallEditPolicy("; >+ protected final String TEXT_21 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; >+ protected final String TEXT_22 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; >+ 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 "; >+ protected final String TEXT_24 = " getDirectEditCommand("; >+ 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 "; >+ 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 "; >+ 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 "; >+ protected final String TEXT_28 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; >+ protected final String TEXT_29 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_30 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_31 = " editingDomain = "; >+ protected final String TEXT_32 = ".getEditingDomain("; >+ protected final String TEXT_33 = ".getDiagram().getElement());"; >+ protected final String TEXT_34 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_35 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_37 = " createDomainModelCommand("; >+ protected final String TEXT_38 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_39 = " element = "; >+ protected final String TEXT_40 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_41 = " feature = ("; >+ protected final String TEXT_42 = ") "; >+ protected final String TEXT_43 = ".eINSTANCE.get"; >+ 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 = "; >+ 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 "; >+ protected final String TEXT_46 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_47 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_48 = " result = new "; >+ protected final String TEXT_49 = "();" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_50 = " values = new "; >+ protected final String TEXT_51 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_52 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_53 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_54 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; >+ protected final String TEXT_55 = NL + "\t\t\t\t\t\treturn "; >+ protected final String TEXT_56 = ".create(editingDomain, element, feature, valueToSet);"; >+ protected final String TEXT_57 = NL + "\t\t\t\t\t}"; >+ protected final String TEXT_58 = NL + "\t\t\t\t\t\tif (parseResult.length != "; >+ protected final String TEXT_59 = ") {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_60 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; >+ 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"; >+ protected final String TEXT_62 = " createDomainModelCommand("; >+ protected final String TEXT_63 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_64 = " element = "; >+ protected final String TEXT_65 = ";" + NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_66 = " result = new "; >+ protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; >+ protected final String TEXT_68 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_69 = " "; >+ protected final String TEXT_70 = "feature = ("; >+ protected final String TEXT_71 = ") "; >+ protected final String TEXT_72 = ".eINSTANCE.get"; >+ protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; >+ protected final String TEXT_74 = ".parseValue(feature, values["; >+ protected final String TEXT_75 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; >+ protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; >+ protected final String TEXT_77 = NL + "\t\t\t\t\t\t"; >+ protected final String TEXT_78 = " "; >+ protected final String TEXT_79 = "values = new "; >+ protected final String TEXT_80 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; >+ protected final String TEXT_81 = "());" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_82 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_83 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_84 = NL + "\t\t\t\t\t\tresult.append("; >+ protected final String TEXT_85 = ".create(editingDomain, element, feature, valueToSet));"; >+ protected final String TEXT_86 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; >+ protected final String TEXT_87 = NL + "\t\t\t\t});"; >+ protected final String TEXT_88 = NL; >+ protected final String TEXT_89 = "\t\tinstallEditPolicy("; >+ protected final String TEXT_90 = ".COMPONENT_ROLE, new "; >+ protected final String TEXT_91 = "() {" + NL + "\t\t\tprotected "; >+ protected final String TEXT_92 = " createDeleteCommand("; >+ protected final String TEXT_93 = " deleteRequest) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_94 = " editingDomain = "; >+ protected final String TEXT_95 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; >+ protected final String TEXT_96 = " cc = new "; >+ protected final String TEXT_97 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; >+ 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("; >+ protected final String TEXT_99 = " editingDomain) {"; >+ protected final String TEXT_100 = NL + "\t\t\t\t"; >+ protected final String TEXT_101 = " result = new "; >+ protected final String TEXT_102 = "();"; >+ protected final String TEXT_103 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_104 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_105 = ".eINSTANCE.get"; >+ protected final String TEXT_106 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; >+ protected final String TEXT_107 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_108 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_109 = ".eINSTANCE.get"; >+ protected final String TEXT_110 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_111 = ".UNSET_VALUE));"; >+ protected final String TEXT_112 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_113 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; > protected final String TEXT_114 = ".eINSTANCE.get"; >- protected final String TEXT_115 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement()));"; >- protected final String TEXT_116 = NL + "\t\t\t\t\t\tresult.append("; >- protected final String TEXT_117 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_118 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_119 = ".eINSTANCE.get"; >- protected final String TEXT_120 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_121 = ".UNSET_VALUE));"; >- protected final String TEXT_122 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; >- protected final String TEXT_123 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = "; >- protected final String TEXT_124 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_125 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_126 = ".eINSTANCE.get"; >- protected final String TEXT_127 = "()," + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement());"; >- protected final String TEXT_128 = NL + "\t\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command domainModelRemoveCommand = "; >- protected final String TEXT_129 = ".create(" + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_130 = ".getEditingDomainFor(getDiagramNode().getDiagram().getElement()), " + NL + "\t\t\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >- protected final String TEXT_131 = ".eINSTANCE.get"; >- protected final String TEXT_132 = "()," + NL + "\t\t\t\t\t\t\t"; >- protected final String TEXT_133 = ".UNSET_VALUE);"; >- protected final String TEXT_134 = NL + "\t\t\t\t\tprivate final org.eclipse.emf.common.command.Command viewRemoveCommand = "; >- protected final String TEXT_135 = ".create(" + NL + "\t\t\t\t\t\t"; >- 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});"; >- protected final String TEXT_137 = NL + "\t}" + NL; >- protected final String TEXT_138 = NL; >- protected final String TEXT_139 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >- protected final String TEXT_140 = " req) {" + NL + "\t\tif ("; >- 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 "; >- protected final String TEXT_142 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >- protected final String TEXT_143 = "(this, "; >- protected final String TEXT_144 = ".class, new "; >- protected final String TEXT_145 = "() {" + NL + "\t\t\t\tpublic void relocate("; >- protected final String TEXT_146 = " celleditor) {" + NL + "\t\t\t\t\t"; >- 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}"; >- protected final String TEXT_148 = NL; >- protected final String TEXT_149 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; >- protected final String TEXT_150 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; >- protected final String TEXT_151 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; >- protected final String TEXT_152 = " element = "; >- 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"; >- protected final String TEXT_154 = " element = "; >- 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("; >- protected final String TEXT_156 = " element, String pattern) {"; >- protected final String TEXT_157 = NL + "\t\tif (element.get"; >- protected final String TEXT_158 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; >+ protected final String TEXT_115 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; >+ protected final String TEXT_116 = NL + "\t\t\t\tresult.append("; >+ protected final String TEXT_117 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_118 = ".eINSTANCE.get"; >+ protected final String TEXT_119 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_120 = ".UNSET_VALUE));"; >+ protected final String TEXT_121 = NL + "\t\t\t\treturn result;"; >+ protected final String TEXT_122 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_123 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_124 = ".eINSTANCE.get"; >+ protected final String TEXT_125 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; >+ protected final String TEXT_126 = NL + "\t\t\t\treturn "; >+ protected final String TEXT_127 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; >+ protected final String TEXT_128 = ".eINSTANCE.get"; >+ protected final String TEXT_129 = "()," + NL + "\t\t\t\t\t"; >+ protected final String TEXT_130 = ".UNSET_VALUE);"; >+ protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t});"; >+ protected final String TEXT_132 = NL + "\t}" + NL; >+ protected final String TEXT_133 = NL; >+ protected final String TEXT_134 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; >+ protected final String TEXT_135 = " req) {" + NL + "\t\tif ("; >+ 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 "; >+ protected final String TEXT_137 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; >+ protected final String TEXT_138 = "(this, "; >+ protected final String TEXT_139 = ".class, new "; >+ protected final String TEXT_140 = "() {" + NL + "\t\t\t\tpublic void relocate("; >+ protected final String TEXT_141 = " celleditor) {" + NL + "\t\t\t\t\t"; >+ 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; >+ 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}"; >+ protected final String TEXT_144 = NL; >+ protected final String TEXT_145 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; >+ protected final String TEXT_146 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; >+ protected final String TEXT_147 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; >+ protected final String TEXT_148 = " element = "; >+ 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"; >+ protected final String TEXT_150 = " element = "; >+ 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("; >+ protected final String TEXT_152 = " element, String pattern) {"; >+ protected final String TEXT_153 = NL + "\t\tif (element.get"; >+ protected final String TEXT_154 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; >+ protected final String TEXT_155 = NL + "\t\treturn "; >+ protected final String TEXT_156 = ".format(pattern, new Object[] {"; >+ protected final String TEXT_157 = NL + "\t\t\t"; >+ protected final String TEXT_158 = NL + "\t\t});"; > protected final String TEXT_159 = NL + "\t\treturn "; > protected final String TEXT_160 = ".format(pattern, new Object[] {"; >- protected final String TEXT_161 = NL + "\t\t\t"; >- protected final String TEXT_162 = NL + "\t\t});"; >- protected final String TEXT_163 = NL + "\t\treturn "; >- protected final String TEXT_164 = ".format(pattern, new Object[] {"; >- protected final String TEXT_165 = NL + "\t\t"; >- protected final String TEXT_166 = ","; >- protected final String TEXT_167 = NL + "\t\t});"; >- protected final String TEXT_168 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; >- protected final String TEXT_169 = NL + "\t}"; >- protected final String TEXT_170 = NL; >- protected final String TEXT_171 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >- protected final String TEXT_172 = " style =" + NL + "\t\t\t("; >- protected final String TEXT_173 = ") "; >- protected final String TEXT_174 = ".getStyle(" + NL + "\t\t\t\t"; >- protected final String TEXT_175 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- 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 = "; >- protected final String TEXT_177 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_178 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >- protected final String TEXT_179 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >- protected final String TEXT_180 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >- 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 "; >- 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 "; >- protected final String TEXT_183 = " createdFont;"; >- protected final String TEXT_184 = NL; >- protected final String TEXT_185 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; >- protected final String TEXT_186 = " style = ("; >- protected final String TEXT_187 = ") "; >- protected final String TEXT_188 = ".getStyle("; >- protected final String TEXT_189 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >- 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"; >- 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 "; >- 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 "; >- protected final String TEXT_193 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- 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) {"; >- 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; >- protected final String TEXT_196 = NL; >- 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 "; >- protected final String TEXT_198 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >- 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(("; >- 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; >- protected final String TEXT_201 = NL; >- protected final String TEXT_202 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >- protected final String TEXT_203 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >- protected final String TEXT_204 = " feature, "; >- 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();"; >+ protected final String TEXT_161 = NL + "\t\t"; >+ protected final String TEXT_162 = ","; >+ protected final String TEXT_163 = NL + "\t\t});"; >+ protected final String TEXT_164 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; >+ protected final String TEXT_165 = NL + "\t}"; >+ protected final String TEXT_166 = NL; >+ protected final String TEXT_167 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; >+ protected final String TEXT_168 = " style =" + NL + "\t\t\t("; >+ protected final String TEXT_169 = ") "; >+ protected final String TEXT_170 = ".getStyle(" + NL + "\t\t\t\t"; >+ protected final String TEXT_171 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >+ 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 = "; >+ protected final String TEXT_173 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_174 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; >+ protected final String TEXT_175 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; >+ protected final String TEXT_176 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_179 = " createdFont;"; >+ protected final String TEXT_180 = NL; >+ protected final String TEXT_181 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; >+ protected final String TEXT_182 = " style = ("; >+ protected final String TEXT_183 = ") "; >+ protected final String TEXT_184 = ".getStyle("; >+ protected final String TEXT_185 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; >+ 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"; >+ 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 "; >+ 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 "; >+ protected final String TEXT_189 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ 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) {"; >+ 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; >+ protected final String TEXT_192 = NL; >+ 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 "; >+ protected final String TEXT_194 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; >+ 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(("; >+ 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; >+ protected final String TEXT_197 = NL; >+ protected final String TEXT_198 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; >+ protected final String TEXT_199 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; >+ protected final String TEXT_200 = " feature, "; >+ 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();"; >+ protected final String TEXT_202 = NL; >+ 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("; >+ protected final String TEXT_204 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_205 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; > protected final String TEXT_206 = NL; >- 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("; >- protected final String TEXT_208 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_209 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; >- protected final String TEXT_210 = NL; >- 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("; >- 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};"; >- protected final String TEXT_213 = NL + "\t\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_214 = ".eINSTANCE.get"; >- protected final String TEXT_215 = "(), labelRefresher);"; >- protected final String TEXT_216 = NL + "\t\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_217 = ".eINSTANCE.get"; >- protected final String TEXT_218 = "(), labelRefresher);"; >- protected final String TEXT_219 = NL; >- 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("; >- protected final String TEXT_221 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_222 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_223 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >- protected final String TEXT_224 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; >- protected final String TEXT_225 = NL; >- 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("; >- protected final String TEXT_227 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; >- protected final String TEXT_228 = NL; >- protected final String TEXT_229 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >- protected final String TEXT_230 = " createFigure() {" + NL + "\t\t"; >- 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 "; >- protected final String TEXT_232 = " createLabel() {"; >+ 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("; >+ 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};"; >+ protected final String TEXT_209 = NL + "\t\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_210 = ".eINSTANCE.get"; >+ protected final String TEXT_211 = "(), labelRefresher);"; >+ protected final String TEXT_212 = NL + "\t\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_213 = ".eINSTANCE.get"; >+ protected final String TEXT_214 = "(), labelRefresher);"; >+ protected final String TEXT_215 = NL; >+ 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("; >+ protected final String TEXT_217 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_218 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_219 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; >+ protected final String TEXT_220 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; >+ protected final String TEXT_221 = NL; >+ 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("; >+ protected final String TEXT_223 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; >+ protected final String TEXT_224 = NL; >+ protected final String TEXT_225 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; >+ protected final String TEXT_226 = " createFigure() {" + NL + "\t\t"; >+ 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 "; >+ protected final String TEXT_228 = " createLabel() {"; >+ protected final String TEXT_229 = NL + "\t\treturn new "; >+ protected final String TEXT_230 = "();"; >+ protected final String TEXT_231 = NL + "\t\treturn "; >+ protected final String TEXT_232 = ";"; > protected final String TEXT_233 = NL + "\t\treturn new "; > protected final String TEXT_234 = "();"; >- protected final String TEXT_235 = NL + "\t\treturn "; >- protected final String TEXT_236 = ";"; >- protected final String TEXT_237 = NL + "\t\treturn new "; >- protected final String TEXT_238 = "();"; >- protected final String TEXT_239 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >- protected final String TEXT_240 = " getLabel() {" + NL + "\t\treturn ("; >- protected final String TEXT_241 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel("; >- 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; >+ protected final String TEXT_235 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; >+ protected final String TEXT_236 = " getLabel() {" + NL + "\t\treturn ("; >+ protected final String TEXT_237 = ") getFigure();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabel("; >+ 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; >+ protected final String TEXT_239 = NL; >+ protected final String TEXT_240 = NL; >+ 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}"; >+ protected final String TEXT_242 = NL + "}"; > protected final String TEXT_243 = NL; >- protected final String TEXT_244 = NL; >- 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}"; >- protected final String TEXT_246 = NL + "}"; >- protected final String TEXT_247 = NL; > > public String generate(Object argument) > { >@@ -277,6 +273,7 @@ > GenDiagram genDiagram = genChildNode.getDiagram(); > final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; > LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet(); >+final boolean isReadOnly = genChildNode.isLabelReadOnly(); > > stringBuffer.append(TEXT_1); > >@@ -312,212 +309,222 @@ > } > stringBuffer.append(TEXT_11); > stringBuffer.append(TEXT_12); >+ >+if (!isReadOnly) { >+ > stringBuffer.append(TEXT_13); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); > stringBuffer.append(TEXT_14); >- stringBuffer.append(genChildNode.getEditPartClassName()); >+ >+} >+ > stringBuffer.append(TEXT_15); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >+ stringBuffer.append(genChildNode.getEditPartClassName()); > stringBuffer.append(TEXT_16); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); > stringBuffer.append(TEXT_17); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); >+ stringBuffer.append(TEXT_18); > > String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()"; > final String primaryView = "getDiagramNode()"; > > >-{ >-boolean isReadOnly = genChildNode.isLabelReadOnly(); >+if (!isReadOnly) { > >- stringBuffer.append(TEXT_18); > stringBuffer.append(TEXT_19); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_20); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_21); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); > stringBuffer.append(TEXT_22); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >- stringBuffer.append(TEXT_23); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); >+ stringBuffer.append(TEXT_23); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_24); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); > stringBuffer.append(TEXT_25); >- stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_26); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_26); >+ stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); > stringBuffer.append(TEXT_27); >- stringBuffer.append(importManager.getImportedName("java.text.ParseException")); >- stringBuffer.append(TEXT_28); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_28); >+ stringBuffer.append(importManager.getImportedName("java.text.ParseException")); > stringBuffer.append(TEXT_29); >- >-if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) { >- GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >- EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >- >- stringBuffer.append(TEXT_30); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(TEXT_30); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_31); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_32); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_33); >- stringBuffer.append(resolvedSemanticElement); >+ >+if (labelModelFacet instanceof FeatureLabelModelFacet) { >+ GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); >+ EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); >+ > stringBuffer.append(TEXT_34); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_35); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_36); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_37); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_38); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_39); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_40); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_41); >- stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); > stringBuffer.append(TEXT_42); >- stringBuffer.append(featureToSet.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_43); >- stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >+ stringBuffer.append(featureToSet.getFeatureAccessorName()); > stringBuffer.append(TEXT_44); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); > stringBuffer.append(TEXT_45); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >+ stringBuffer.append(TEXT_46); > > if (ecoreFeature.isMany()) { > >- stringBuffer.append(TEXT_46); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_47); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_48); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_49); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); > stringBuffer.append(TEXT_50); >- stringBuffer.append(featureToSet.getAccessorName()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); > stringBuffer.append(TEXT_51); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >+ stringBuffer.append(featureToSet.getAccessorName()); > stringBuffer.append(TEXT_52); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_53); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >+ stringBuffer.append(TEXT_54); > > } else { > >- stringBuffer.append(TEXT_54); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_55); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_56); > > } > >- stringBuffer.append(TEXT_56); >+ stringBuffer.append(TEXT_57); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); > >- stringBuffer.append(TEXT_57); >- stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_58); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); >+ stringBuffer.append(metaFeatures.size()); > stringBuffer.append(TEXT_59); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); > stringBuffer.append(TEXT_60); >- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); > stringBuffer.append(TEXT_61); >- stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_62); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(TEXT_62); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_63); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); >+ stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); > stringBuffer.append(TEXT_64); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.EditingDomain")); >+ stringBuffer.append(resolvedSemanticElement); > stringBuffer.append(TEXT_65); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_66); >- stringBuffer.append(primaryView); >- stringBuffer.append(TEXT_67); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_68); >+ stringBuffer.append(TEXT_66); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_69); >+ stringBuffer.append(TEXT_67); > > boolean haveDeclaredValues = false; > for(int i = 0; i < metaFeatures.size(); i++) { > GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); > EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); > >- stringBuffer.append(TEXT_70); >+ stringBuffer.append(TEXT_68); > if (i == 0) { > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_71); >+ stringBuffer.append(TEXT_69); > } >- stringBuffer.append(TEXT_72); >+ stringBuffer.append(TEXT_70); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); >- stringBuffer.append(TEXT_73); >+ stringBuffer.append(TEXT_71); > stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_74); >+ stringBuffer.append(TEXT_72); > stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); >- stringBuffer.append(TEXT_75); >+ stringBuffer.append(TEXT_73); > stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); >- stringBuffer.append(TEXT_76); >+ stringBuffer.append(TEXT_74); > stringBuffer.append(i); >- stringBuffer.append(TEXT_77); >+ stringBuffer.append(TEXT_75); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); >- stringBuffer.append(TEXT_78); >+ stringBuffer.append(TEXT_76); > > if (nextEcoreFeature.isMany()) { > >- stringBuffer.append(TEXT_79); >+ stringBuffer.append(TEXT_77); > if (!haveDeclaredValues) { haveDeclaredValues = true; > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); >- stringBuffer.append(TEXT_80); >+ stringBuffer.append(TEXT_78); > } >- stringBuffer.append(TEXT_81); >+ stringBuffer.append(TEXT_79); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); >- stringBuffer.append(TEXT_82); >+ stringBuffer.append(TEXT_80); > stringBuffer.append(nextFeatureToSet.getAccessorName()); >- stringBuffer.append(TEXT_83); >+ stringBuffer.append(TEXT_81); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_84); >+ stringBuffer.append(TEXT_82); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); >- stringBuffer.append(TEXT_85); >+ stringBuffer.append(TEXT_83); > > } else { > >- stringBuffer.append(TEXT_86); >+ stringBuffer.append(TEXT_84); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_87); >+ stringBuffer.append(TEXT_85); > > } > > > } > >- stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_86); > > } > >- stringBuffer.append(TEXT_89); >+ stringBuffer.append(TEXT_87); > > } > >+ stringBuffer.append(TEXT_88); >+ stringBuffer.append(TEXT_89); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); > stringBuffer.append(TEXT_90); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); > stringBuffer.append(TEXT_91); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); > stringBuffer.append(TEXT_92); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); > stringBuffer.append(TEXT_93); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); > stringBuffer.append(TEXT_94); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); > stringBuffer.append(TEXT_95); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); > stringBuffer.append(TEXT_96); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >+ stringBuffer.append(TEXT_97); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >+ stringBuffer.append(TEXT_98); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); >+ stringBuffer.append(TEXT_99); > > { > TypeModelFacet facet = genNode.getModelFacet(); >@@ -525,47 +532,41 @@ > GenFeature containmentFeature = facet.getContainmentMetaFeature(); > if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { > >- stringBuffer.append(TEXT_97); >+ stringBuffer.append(TEXT_100); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_98); >+ stringBuffer.append(TEXT_101); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); >- stringBuffer.append(TEXT_99); >+ stringBuffer.append(TEXT_102); > > if (containmentFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_100); >+ stringBuffer.append(TEXT_103); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_101); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_102); >+ stringBuffer.append(TEXT_104); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_103); >+ stringBuffer.append(TEXT_105); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_104); >+ stringBuffer.append(TEXT_106); > > } else { > >- stringBuffer.append(TEXT_105); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_106); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); > stringBuffer.append(TEXT_107); >- stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_108); >- stringBuffer.append(containmentFeature.getFeatureAccessorName()); >+ stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_109); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(containmentFeature.getFeatureAccessorName()); > stringBuffer.append(TEXT_110); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >+ stringBuffer.append(TEXT_111); > > } > > > if (childFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_111); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_112); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); > stringBuffer.append(TEXT_113); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); > stringBuffer.append(TEXT_114); >@@ -577,77 +578,74 @@ > stringBuffer.append(TEXT_116); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); > stringBuffer.append(TEXT_117); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_118); > stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_119); >+ stringBuffer.append(TEXT_118); > stringBuffer.append(childFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_120); >+ stringBuffer.append(TEXT_119); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_121); >+ stringBuffer.append(TEXT_120); > > } > >- stringBuffer.append(TEXT_122); >+ stringBuffer.append(TEXT_121); > > } else { > if (containmentFeature.getEcoreFeature().isMany()) { > >- stringBuffer.append(TEXT_123); >+ stringBuffer.append(TEXT_122); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_124); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_125); >+ stringBuffer.append(TEXT_123); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_126); >+ stringBuffer.append(TEXT_124); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_127); >+ stringBuffer.append(TEXT_125); > > } else { > >- stringBuffer.append(TEXT_128); >+ stringBuffer.append(TEXT_126); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_129); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_130); >+ stringBuffer.append(TEXT_127); > stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_131); >+ stringBuffer.append(TEXT_128); > stringBuffer.append(containmentFeature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_132); >+ stringBuffer.append(TEXT_129); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); >- stringBuffer.append(TEXT_133); >+ stringBuffer.append(TEXT_130); > > } > } > >- stringBuffer.append(TEXT_134); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); >- stringBuffer.append(TEXT_135); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain")); >- stringBuffer.append(TEXT_136); >+ stringBuffer.append(TEXT_131); > > } /*restrict local vars used in component edit policy*/ > >- stringBuffer.append(TEXT_137); >- stringBuffer.append(TEXT_138); >- stringBuffer.append(TEXT_139); >+ stringBuffer.append(TEXT_132); >+ >+if (!isReadOnly) { >+ >+ stringBuffer.append(TEXT_133); >+ stringBuffer.append(TEXT_134); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); >- stringBuffer.append(TEXT_140); >+ stringBuffer.append(TEXT_135); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); >- stringBuffer.append(TEXT_141); >+ stringBuffer.append(TEXT_136); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); >- stringBuffer.append(TEXT_142); >+ stringBuffer.append(TEXT_137); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); >- stringBuffer.append(TEXT_143); >+ stringBuffer.append(TEXT_138); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); >- stringBuffer.append(TEXT_144); >+ stringBuffer.append(TEXT_139); > stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); >- stringBuffer.append(TEXT_145); >+ stringBuffer.append(TEXT_140); > stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); >- stringBuffer.append(TEXT_146); >+ stringBuffer.append(TEXT_141); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); >- stringBuffer.append(TEXT_147); >- stringBuffer.append(TEXT_148); >+ stringBuffer.append(TEXT_142); >+ >+} >+ >+ stringBuffer.append(TEXT_143); >+ stringBuffer.append(TEXT_144); > > /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ > HashMap primitiveTypeToWrapperClassName = new HashMap(); >@@ -691,52 +689,52 @@ > } > } > >- stringBuffer.append(TEXT_149); >+ stringBuffer.append(TEXT_145); > stringBuffer.append(viewPattern); >- stringBuffer.append(TEXT_150); >+ stringBuffer.append(TEXT_146); > stringBuffer.append(editPattern); >- stringBuffer.append(TEXT_151); >+ stringBuffer.append(TEXT_147); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_152); >+ stringBuffer.append(TEXT_148); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_153); >+ stringBuffer.append(TEXT_149); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_154); >+ stringBuffer.append(TEXT_150); > stringBuffer.append(resolvedSemanticElement); >- stringBuffer.append(TEXT_155); >+ stringBuffer.append(TEXT_151); > stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_156); >+ stringBuffer.append(TEXT_152); > > if (labelModelFacet instanceof FeatureLabelModelFacet) { > FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; > GenFeature feature = featureLabelModelFacet.getMetaFeature(); > if (!feature.isPrimitiveType()) { > >- stringBuffer.append(TEXT_157); >+ stringBuffer.append(TEXT_153); > stringBuffer.append(feature.getCapName()); >- stringBuffer.append(TEXT_158); >+ stringBuffer.append(TEXT_154); > > } > >- stringBuffer.append(TEXT_159); >+ stringBuffer.append(TEXT_155); > stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_160); >+ stringBuffer.append(TEXT_156); > > String value = "element.get" + feature.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ > if (feature.isPrimitiveType()) { > value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; > } > >- stringBuffer.append(TEXT_161); >+ stringBuffer.append(TEXT_157); > stringBuffer.append(value); >- stringBuffer.append(TEXT_162); >+ stringBuffer.append(TEXT_158); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > >- stringBuffer.append(TEXT_163); >+ stringBuffer.append(TEXT_159); > stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); >- stringBuffer.append(TEXT_164); >+ stringBuffer.append(TEXT_160); > > for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { > GenFeature next = (GenFeature) it.next(); >@@ -745,146 +743,146 @@ > value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; > } > >- stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_161); > stringBuffer.append(value); > if (it.hasNext()) { >- stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_162); > } > > } > >- stringBuffer.append(TEXT_167); >+ stringBuffer.append(TEXT_163); > > } else { > >- stringBuffer.append(TEXT_168); >+ stringBuffer.append(TEXT_164); > > } > >+ stringBuffer.append(TEXT_165); >+ stringBuffer.append(TEXT_166); >+ stringBuffer.append(TEXT_167); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(TEXT_168); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_169); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_170); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_171); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_172); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_173); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_174); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); > stringBuffer.append(TEXT_175); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_176); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); > stringBuffer.append(TEXT_177); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); > stringBuffer.append(TEXT_178); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); >- stringBuffer.append(TEXT_179); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(TEXT_179); > stringBuffer.append(TEXT_180); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); > stringBuffer.append(TEXT_181); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_182); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); > stringBuffer.append(TEXT_183); >+ stringBuffer.append(primaryView); > stringBuffer.append(TEXT_184); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_185); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_186); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_187); >- stringBuffer.append(primaryView); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_188); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_189); > stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >+ stringBuffer.append(TEXT_189); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); > stringBuffer.append(TEXT_190); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); >+ /*@ include file="adapters/propertySource.javajetinc"*/ > stringBuffer.append(TEXT_191); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_192); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); > stringBuffer.append(TEXT_193); >- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); > stringBuffer.append(TEXT_194); >- /*@ include file="adapters/propertySource.javajetinc"*/ >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_195); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_196); > stringBuffer.append(TEXT_197); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); > stringBuffer.append(TEXT_198); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_199); > stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); > stringBuffer.append(TEXT_200); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); > stringBuffer.append(TEXT_201); > stringBuffer.append(TEXT_202); >- stringBuffer.append(importManager.getImportedName("java.util.HashMap")); > stringBuffer.append(TEXT_203); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_204); >- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_205); > stringBuffer.append(TEXT_206); > stringBuffer.append(TEXT_207); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_208); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_209); >- stringBuffer.append(TEXT_210); >- stringBuffer.append(TEXT_211); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_212); > > if (labelModelFacet instanceof FeatureLabelModelFacet) { > GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); > >- stringBuffer.append(TEXT_213); >+ stringBuffer.append(TEXT_209); > stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_214); >+ stringBuffer.append(TEXT_210); > stringBuffer.append(feature.getFeatureAccessorName()); >- stringBuffer.append(TEXT_215); >+ stringBuffer.append(TEXT_211); > > } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { > CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; > for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { > GenFeature next = (GenFeature) it.next(); > >- stringBuffer.append(TEXT_216); >+ stringBuffer.append(TEXT_212); > stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); >- stringBuffer.append(TEXT_217); >+ stringBuffer.append(TEXT_213); > stringBuffer.append(next.getFeatureAccessorName()); >- stringBuffer.append(TEXT_218); >+ stringBuffer.append(TEXT_214); > > } > } > >+ stringBuffer.append(TEXT_215); >+ stringBuffer.append(TEXT_216); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_217); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_218); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_219); >- stringBuffer.append(TEXT_220); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >+ stringBuffer.append(TEXT_220); > stringBuffer.append(TEXT_221); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_222); > stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); > stringBuffer.append(TEXT_223); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_224); >- stringBuffer.append(TEXT_225); >- stringBuffer.append(TEXT_226); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); >- stringBuffer.append(TEXT_227); > > final Viewmap viewmap = genChildNode.getViewmap(); > >- stringBuffer.append(TEXT_228); >- stringBuffer.append(TEXT_229); >+ stringBuffer.append(TEXT_224); >+ stringBuffer.append(TEXT_225); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); >- stringBuffer.append(TEXT_230); >+ stringBuffer.append(TEXT_226); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_231); >+ stringBuffer.append(TEXT_227); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_232); >+ stringBuffer.append(TEXT_228); > > String figureQualifiedClassName = null; > if (viewmap instanceof FigureViewmap) { >@@ -893,49 +891,49 @@ > figureQualifiedClassName = "org.eclipse.draw2d.Label"; > } > >- stringBuffer.append(TEXT_233); >+ stringBuffer.append(TEXT_229); > stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); >- stringBuffer.append(TEXT_234); >+ stringBuffer.append(TEXT_230); > } // instanceof FigureViewmap > else if (viewmap instanceof SnippetViewmap) { >- stringBuffer.append(TEXT_235); >+ stringBuffer.append(TEXT_231); > stringBuffer.append(((SnippetViewmap) viewmap).getBody()); >- stringBuffer.append(TEXT_236); >+ stringBuffer.append(TEXT_232); > } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter > else if (viewmap instanceof InnerClassViewmap) { > figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); > >- stringBuffer.append(TEXT_237); >+ stringBuffer.append(TEXT_233); > stringBuffer.append(figureQualifiedClassName); >- stringBuffer.append(TEXT_238); >+ stringBuffer.append(TEXT_234); > } >- stringBuffer.append(TEXT_239); >+ stringBuffer.append(TEXT_235); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_240); >+ stringBuffer.append(TEXT_236); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_241); >+ stringBuffer.append(TEXT_237); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); >- stringBuffer.append(TEXT_242); >+ stringBuffer.append(TEXT_238); > > if (viewmap instanceof InnerClassViewmap) { > String classBody = ((InnerClassViewmap) viewmap).getClassBody(); > >- stringBuffer.append(TEXT_243); >+ stringBuffer.append(TEXT_239); > stringBuffer.append(classBody); >- stringBuffer.append(TEXT_244); >+ stringBuffer.append(TEXT_240); > > if (classBody.indexOf("DPtoLP") != -1) { > >- stringBuffer.append(TEXT_245); >+ stringBuffer.append(TEXT_241); > > } > > > } > >- stringBuffer.append(TEXT_246); >+ stringBuffer.append(TEXT_242); > importManager.emitSortedImports(); >- stringBuffer.append(TEXT_247); >+ stringBuffer.append(TEXT_243); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java,v >retrieving revision 1.2 >diff -u -r1.2 ManifestGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java 20 Apr 2006 18:27:23 -0000 1.2 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java 22 May 2006 13:59:33 -0000 >@@ -22,12 +22,13 @@ > protected final String TEXT_4 = NL + "Bundle-Vendor: %providerName" + NL + "Bundle-Localization: plugin" + NL + "Export-Package: "; > protected final String TEXT_5 = NL + "Require-Bundle: org.eclipse.core.runtime,"; > protected final String TEXT_6 = "org.eclipse.core.resources," + NL + " org.eclipse.ui.ide,"; >- 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"; >- protected final String TEXT_8 = ","; >- protected final String TEXT_9 = NL + " "; >- protected final String TEXT_10 = ";visibility:=reexport"; >- protected final String TEXT_11 = NL + "Eclipse-LazyStart: true"; >- protected final String TEXT_12 = NL; >+ 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,"; >+ protected final String TEXT_8 = NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit"; >+ protected final String TEXT_9 = ","; >+ protected final String TEXT_10 = NL + " "; >+ protected final String TEXT_11 = ";visibility:=reexport"; >+ protected final String TEXT_12 = NL + "Eclipse-LazyStart: true"; >+ protected final String TEXT_13 = NL; > > public String generate(Object argument) > { >@@ -63,14 +64,16 @@ > stringBuffer.append(TEXT_6); > } > stringBuffer.append(TEXT_7); >- while(requiredBundleIterator.hasNext()) { >+ /*XXX: introduces dependency on org.eclipse.core.resources which may be problematic for RCP*/ > stringBuffer.append(TEXT_8); >+ while(requiredBundleIterator.hasNext()) { > stringBuffer.append(TEXT_9); >- stringBuffer.append(requiredBundleIterator.next()); > stringBuffer.append(TEXT_10); >- } >+ stringBuffer.append(requiredBundleIterator.next()); > stringBuffer.append(TEXT_11); >+ } > stringBuffer.append(TEXT_12); >+ stringBuffer.append(TEXT_13); > return stringBuffer.toString(); > } > } >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java,v >retrieving revision 1.4 >diff -u -r1.4 EditorGenerator.java >--- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 15 May 2006 15:54:30 -0000 1.4 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 22 May 2006 13:59:33 -0000 >@@ -74,7 +74,7 @@ > 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, "; > protected final String TEXT_56 = " command) {" + NL + "\t\t\t"; > protected final String TEXT_57 = " cc = new "; >- 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 "; >+ 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 "; > protected final String TEXT_59 = " "; > protected final String TEXT_60 = ";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; > 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; >@@ -107,46 +107,47 @@ > protected final String TEXT_88 = ") {" + NL + "\t\t\treturn URI.createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}"; > protected final String TEXT_89 = NL + "\t\tif (input instanceof "; > protected final String TEXT_90 = ") {" + NL + "\t\t\treturn URI.createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}"; >- 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());"; >- protected final String TEXT_92 = NL + "\t\t\tfactories.add(new "; >- protected final String TEXT_93 = "());"; >- 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"; >- 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"; >- protected final String TEXT_96 = " = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; >- protected final String TEXT_97 = " = ("; >- protected final String TEXT_98 = ") diagram.getElement();" + NL + "\t\tif ("; >- protected final String TEXT_99 = " == null) {"; >- protected final String TEXT_100 = NL + "\t\t\tURI modelFile = "; >- 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}"; >- protected final String TEXT_102 = NL + "\t\t\t"; >- protected final String TEXT_103 = " = ("; >- protected final String TEXT_104 = ") findInResource("; >- protected final String TEXT_105 = ", "; >- protected final String TEXT_106 = ".class);" + NL + "\t\t\tif ("; >- protected final String TEXT_107 = " == null) {" + NL + "\t\t\t\t"; >- protected final String TEXT_108 = " = "; >- protected final String TEXT_109 = ".eINSTANCE.create"; >- protected final String TEXT_110 = "();" + NL + "\t\t\t\t"; >- protected final String TEXT_111 = ".getContents().add(0, "; >- 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"; >- 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"; >- 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("; >- protected final String TEXT_115 = ");" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; >- 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 "; >- protected final String TEXT_117 = "());" + NL + "" + NL + "\t\t"; >- protected final String TEXT_118 = " printableLayers = ("; >- protected final String TEXT_119 = ") root.getLayer("; >- protected final String TEXT_120 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; >- protected final String TEXT_121 = " extLabelsLayer = new "; >- protected final String TEXT_122 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; >- protected final String TEXT_123 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; >- protected final String TEXT_124 = ".EXTERNAL_NODE_LABELS_LAYER, "; >- 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 "; >- protected final String TEXT_126 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; >- 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 "; >- protected final String TEXT_128 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; >- 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 + "}"; >- protected final String TEXT_130 = NL; >+ 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 = "; >+ 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());"; >+ protected final String TEXT_93 = NL + "\t\t\tfactories.add(new "; >+ protected final String TEXT_94 = "());"; >+ 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"; >+ 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"; >+ protected final String TEXT_97 = " = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; >+ protected final String TEXT_98 = " = ("; >+ protected final String TEXT_99 = ") diagram.getElement();" + NL + "\t\tif ("; >+ protected final String TEXT_100 = " == null) {"; >+ protected final String TEXT_101 = NL + "\t\t\tURI modelFile = "; >+ 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}"; >+ protected final String TEXT_103 = NL + "\t\t\t"; >+ protected final String TEXT_104 = " = ("; >+ protected final String TEXT_105 = ") findInResource("; >+ protected final String TEXT_106 = ", "; >+ protected final String TEXT_107 = ".class);" + NL + "\t\t\tif ("; >+ protected final String TEXT_108 = " == null) {" + NL + "\t\t\t\t"; >+ protected final String TEXT_109 = " = "; >+ protected final String TEXT_110 = ".eINSTANCE.create"; >+ protected final String TEXT_111 = "();" + NL + "\t\t\t\t"; >+ protected final String TEXT_112 = ".getContents().add(0, "; >+ 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"; >+ 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"; >+ 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("; >+ protected final String TEXT_116 = ");" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; >+ 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 "; >+ protected final String TEXT_118 = "());" + NL + "" + NL + "\t\t"; >+ protected final String TEXT_119 = " printableLayers = ("; >+ protected final String TEXT_120 = ") root.getLayer("; >+ protected final String TEXT_121 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; >+ protected final String TEXT_122 = " extLabelsLayer = new "; >+ protected final String TEXT_123 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; >+ protected final String TEXT_124 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; >+ protected final String TEXT_125 = ".EXTERNAL_NODE_LABELS_LAYER, "; >+ 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 "; >+ protected final String TEXT_127 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; >+ 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 "; >+ protected final String TEXT_129 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; >+ 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 + "}"; >+ protected final String TEXT_131 = NL; > > public String generate(Object argument) > { >@@ -184,12 +185,11 @@ > importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor"); > importManager.addImport("org.eclipse.core.runtime.Status"); > importManager.addImport("org.eclipse.draw2d.PositionConstants"); >-importManager.addImport("org.eclipse.emf.common.command.BasicCommandStack"); > importManager.addImport("org.eclipse.emf.common.util.URI"); > importManager.addImport("org.eclipse.emf.ecore.resource.Resource"); > importManager.addImport("org.eclipse.emf.ecore.resource.ResourceSet"); > importManager.addImport("org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain"); >-importManager.addImport("org.eclipse.emf.edit.domain.EditingDomain"); >+importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain"); > importManager.addImport("org.eclipse.emf.edit.provider.ComposedAdapterFactory"); > importManager.addImport("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory"); > importManager.addImport("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"); >@@ -449,26 +449,28 @@ > stringBuffer.append(TEXT_90); > } > stringBuffer.append(TEXT_91); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.workspace.WorkspaceEditingDomainFactory")); >+ stringBuffer.append(TEXT_92); > > final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true); > for (int i = 0; i < genPackages.size(); i++) { > GenPackage genPackage = (GenPackage) genPackages.get(i); > >- stringBuffer.append(TEXT_92); >- stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName())); > stringBuffer.append(TEXT_93); >- } >+ stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName())); > stringBuffer.append(TEXT_94); >- stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ } > stringBuffer.append(TEXT_95); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_96); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_97); >- stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); >- stringBuffer.append(TEXT_98); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ stringBuffer.append(TEXT_98); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); > stringBuffer.append(TEXT_99); >+ stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ stringBuffer.append(TEXT_100); > > { > >@@ -477,74 +479,74 @@ > String resourceToUse; > if (!sameFile) { > >- stringBuffer.append(TEXT_100); >- stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); > stringBuffer.append(TEXT_101); >+ stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); >+ stringBuffer.append(TEXT_102); > > resourceToUse = "modelResource"; > } else { > resourceToUse = "diagramResource"; > } > >- stringBuffer.append(TEXT_102); >- stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_103); >- stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); >+ stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_104); >- stringBuffer.append(resourceToUse); >- stringBuffer.append(TEXT_105); > stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); >+ stringBuffer.append(TEXT_105); >+ stringBuffer.append(resourceToUse); > stringBuffer.append(TEXT_106); >- stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); > stringBuffer.append(TEXT_107); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_108); >- stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName())); >+ stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_109); >- stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName()); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName())); > stringBuffer.append(TEXT_110); >- stringBuffer.append(resourceToUse); >+ stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName()); > stringBuffer.append(TEXT_111); >- stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >- stringBuffer.append(TEXT_112); > stringBuffer.append(resourceToUse); >- stringBuffer.append(TEXT_113); >+ stringBuffer.append(TEXT_112); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ stringBuffer.append(TEXT_113); >+ stringBuffer.append(resourceToUse); > stringBuffer.append(TEXT_114); > stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); > stringBuffer.append(TEXT_115); >+ stringBuffer.append(genDiagram.getDomainDiagramElement().getSafeUncapName()); >+ stringBuffer.append(TEXT_116); > > } > >- stringBuffer.append(TEXT_116); >- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); > stringBuffer.append(TEXT_117); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); > stringBuffer.append(TEXT_118); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); > stringBuffer.append(TEXT_119); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); > stringBuffer.append(TEXT_120); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); > stringBuffer.append(TEXT_121); > stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); > stringBuffer.append(TEXT_122); >- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); > stringBuffer.append(TEXT_123); >- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); > stringBuffer.append(TEXT_124); >- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); > stringBuffer.append(TEXT_125); >- stringBuffer.append(genEditor.getClassName()); >+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); > stringBuffer.append(TEXT_126); >- stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); >- stringBuffer.append(TEXT_127); > stringBuffer.append(genEditor.getClassName()); >+ stringBuffer.append(TEXT_127); >+ stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); > stringBuffer.append(TEXT_128); > stringBuffer.append(genEditor.getClassName()); > stringBuffer.append(TEXT_129); >- importManager.emitSortedImports(); >+ stringBuffer.append(genEditor.getClassName()); > stringBuffer.append(TEXT_130); >+ importManager.emitSortedImports(); >+ stringBuffer.append(TEXT_131); > return stringBuffer.toString(); > } > } >Index: src/org/eclipse/gmf/internal/codegen/lite/Generator.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java,v >retrieving revision 1.4 >diff -u -r1.4 Generator.java >--- src/org/eclipse/gmf/internal/codegen/lite/Generator.java 19 May 2006 14:30:20 -0000 1.4 >+++ src/org/eclipse/gmf/internal/codegen/lite/Generator.java 22 May 2006 13:59:35 -0000 >@@ -97,6 +97,7 @@ > internalGenerateJavaClass(myEmitters.getPaletteFactoryGenerator(), myDiagram.getPalette().getFactoryQualifiedClassName(), myDiagram); > } > internalGenerateJavaClass(myEmitters.getUpdatableEditPartGenerator(), myDiagram.getEditPartsPackageName(), "IUpdatableEditPart", myDiagram); // XXX: should be customizable >+ internalGenerateJavaClass(myEmitters.getWrappingCommandGenerator(), myDiagram.getEditPartsPackageName(), "WrappingCommand", myDiagram); // XXX: should be customizable or moved to a lite-runtime plugin > internalGenerateJavaClass(myEmitters.getEditPartFactoryGenerator(), myDiagram.getEditPartFactoryQualifiedClassName(), myDiagram); > internalGenerateJavaClass(myEmitters.getDiagramEditPartGenerator(), myDiagram.getEditPartQualifiedClassName(), myDiagram); > >@@ -201,4 +202,4 @@ > return myHits[index]; > } > } >-} >+} >\ No newline at end of file >Index: src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java,v >retrieving revision 1.2 >diff -u -r1.2 CodegenEmitters.java >--- src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java 18 May 2006 19:12:41 -0000 1.2 >+++ src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java 22 May 2006 13:59:35 -0000 >@@ -45,6 +45,7 @@ > import org.eclipse.gmf.codegen.templates.lite.parts.NodeEditPartGenerator; > import org.eclipse.gmf.codegen.templates.lite.parts.NodeLabelEditPartGenerator; > import org.eclipse.gmf.codegen.templates.lite.parts.UpdatableEditPartGenerator; >+import org.eclipse.gmf.codegen.templates.lite.parts.WrappingCommandGenerator; > import org.eclipse.gmf.codegen.templates.lite.providers.AbstractParserGenerator; > import org.eclipse.gmf.codegen.templates.lite.providers.CompartmentViewFactoryGenerator; > import org.eclipse.gmf.codegen.templates.lite.providers.DiagramViewFactoryGenerator; >@@ -97,6 +98,7 @@ > put(tr, "/parts/DiagramEditPart.javajet", DiagramEditPartGenerator.class); > put(tr, "/parts/EditPartFactory.javajet", EditPartFactoryGenerator.class); > put(tr, "/parts/IUpdatableEditPart.javajet", UpdatableEditPartGenerator.class); >+ put(tr, "/parts/WrappingCommand.javajet", WrappingCommandGenerator.class); > put(tr, "/providers/AbstractParser.javajet", AbstractParserGenerator.class); > put(tr, "/providers/DomainElementInitializer.javajet", DomainElementInitializerGenerator.class); > put(tr, "/providers/PropertySourceProvider.javajet", PropertySourceProviderGenerator.class); >@@ -164,6 +166,10 @@ > return retrieve(UpdatableEditPartGenerator.class); > } > >+ public TextEmitter getWrappingCommandGenerator() throws UnexpectedBehaviourException { >+ return retrieve(WrappingCommandGenerator.class); >+ } >+ > public TextEmitter getLinkEditPartGenerator() throws UnexpectedBehaviourException { > return retrieve(LinkEditPartGenerator.class); > } >Index: templates/parts/WrappingCommand.javajet >=================================================================== >RCS file: templates/parts/WrappingCommand.javajet >diff -N templates/parts/WrappingCommand.javajet >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ templates/parts/WrappingCommand.javajet 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,90 @@ >+<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="WrappingCommandGenerator" >+ imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.*"%> >+<% >+GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; >+ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; >+final GenPlugin genPlugin = genDiagram.getEditorGen().getPlugin(); >+%> >+<% >+importManager.emitPackageStatement(stringBuffer); >+importManager.addImport("org.eclipse.core.commands.ExecutionException"); >+importManager.addImport("org.eclipse.core.commands.operations.IUndoableOperation"); >+importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor"); >+importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain"); >+importManager.addImport("org.eclipse.emf.workspace.EMFCommandOperation"); >+importManager.addImport("org.eclipse.gef.commands.Command"); >+importManager.markImportLocation(stringBuffer); >+%> >+ >+/** >+ * Wraps a EMF command into a GEF command. The undelying EMF command will be executed within a transaction provided by the specified editing domain. >+ * @generated >+ */ >+public class WrappingCommand extends Command { >+ /** >+ * @generated >+ */ >+ private final IUndoableOperation operation; >+ >+ /** >+ * @generated >+ */ >+ protected WrappingCommand(IUndoableOperation operation) { >+ this.operation = operation; >+ } >+ >+ /** >+ * @generated >+ */ >+ public WrappingCommand(TransactionalEditingDomain editingDomain, org.eclipse.emf.common.command.Command emfCommand) { >+ this.operation = new EMFCommandOperation(editingDomain, emfCommand); >+ } >+ >+ /** >+ * @generated >+ */ >+ public void execute() { >+ try { >+ operation.execute(new NullProgressMonitor(), null); >+ } catch (ExecutionException e) { >+ <%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while executing operation", e); >+ } >+ } >+ >+ /** >+ * @generated >+ */ >+ public boolean canExecute() { >+ return operation.canExecute(); >+ } >+ >+ /** >+ * @generated >+ */ >+ public void undo() { >+ try { >+ operation.undo(new NullProgressMonitor(), null); >+ } catch (ExecutionException e) { >+ <%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while undoing operation", e); >+ } >+ } >+ >+ /** >+ * @generated >+ */ >+ public boolean canUndo() { >+ return operation.canUndo(); >+ } >+ >+ /** >+ * @generated >+ */ >+ public void redo() { >+ try { >+ operation.redo(new NullProgressMonitor(), null); >+ } catch (ExecutionException e) { >+ <%=importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())%>.getInstance().logError("exception occurred while redoing operation", e); >+ } >+ } >+} >+<%importManager.emitSortedImports();%> >Index: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/WrappingCommandGenerator.java >=================================================================== >RCS file: src-templates/org/eclipse/gmf/codegen/templates/lite/parts/WrappingCommandGenerator.java >diff -N src-templates/org/eclipse/gmf/codegen/templates/lite/parts/WrappingCommandGenerator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/WrappingCommandGenerator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,53 @@ >+package org.eclipse.gmf.codegen.templates.lite.parts; >+ >+import org.eclipse.gmf.codegen.gmfgen.*; >+import org.eclipse.gmf.common.codegen.*; >+import java.util.*; >+import org.eclipse.emf.codegen.ecore.genmodel.*; >+ >+public class WrappingCommandGenerator >+{ >+ protected static String nl; >+ public static synchronized WrappingCommandGenerator create(String lineSeparator) >+ { >+ nl = lineSeparator; >+ WrappingCommandGenerator result = new WrappingCommandGenerator(); >+ nl = null; >+ return result; >+ } >+ >+ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; >+ 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"; >+ 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"; >+ 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"; >+ protected final String TEXT_4 = ".getInstance().logError(\"exception occurred while redoing operation\", e);" + NL + "\t\t}" + NL + "\t}" + NL + "}"; >+ >+ public String generate(Object argument) >+ { >+ final StringBuffer stringBuffer = new StringBuffer(); >+ >+GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; >+ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; >+final GenPlugin genPlugin = genDiagram.getEditorGen().getPlugin(); >+ >+ >+importManager.emitPackageStatement(stringBuffer); >+importManager.addImport("org.eclipse.core.commands.ExecutionException"); >+importManager.addImport("org.eclipse.core.commands.operations.IUndoableOperation"); >+importManager.addImport("org.eclipse.core.runtime.NullProgressMonitor"); >+importManager.addImport("org.eclipse.emf.transaction.TransactionalEditingDomain"); >+importManager.addImport("org.eclipse.emf.workspace.EMFCommandOperation"); >+importManager.addImport("org.eclipse.gef.commands.Command"); >+importManager.markImportLocation(stringBuffer); >+ >+ stringBuffer.append(TEXT_1); >+ stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())); >+ stringBuffer.append(TEXT_2); >+ stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())); >+ stringBuffer.append(TEXT_3); >+ stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())); >+ stringBuffer.append(TEXT_4); >+ importManager.emitSortedImports(); >+ return stringBuffer.toString(); >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 138430
: 42146