### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.tests.lite Index: src/org/eclipse/gmf/tests/lite/gen/LiteCompilationTest.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/tests/org.eclipse.gmf.tests.lite/src/org/eclipse/gmf/tests/lite/gen/LiteCompilationTest.java,v retrieving revision 1.4 diff -u -r1.4 LiteCompilationTest.java --- src/org/eclipse/gmf/tests/lite/gen/LiteCompilationTest.java 1 Aug 2006 18:02:03 -0000 1.4 +++ src/org/eclipse/gmf/tests/lite/gen/LiteCompilationTest.java 3 Aug 2006 18:47:07 -0000 @@ -31,13 +31,4 @@ protected ViewmapProducer getViewmapProducer() { return new InnerClassViewmapProducer(new RuntimeLiteFQNSwitch(), new MapModeCodeGenStrategy.StaticIdentityMapMode()); } - - public void testCompileInstanceClassNames() throws Exception { - // TODO Temporary commented-out. Codegenerator should be corrected. - } - - public void testCompileNONsynchronizedInstanceClassNames() throws Exception { - // TODO Temporary commented-out. Codegenerator should be corrected. - } - } #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.6 diff -u -r1.6 Editor.javajet --- templates/editor/Editor.javajet 25 May 2006 14:19:01 -0000 1.6 +++ templates/editor/Editor.javajet 3 Aug 2006 18:47:12 -0000 @@ -1096,7 +1096,7 @@ } } if (!diagram.isSetElement()) { - diagram.setElement(diagramRoot); + diagram.setElement(<%if (genDiagram.getDomainDiagramElement().isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>diagramRoot); } } } Index: templates/editor/CreationWizardPage.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet,v retrieving revision 1.2 diff -u -r1.2 CreationWizardPage.javajet --- templates/editor/CreationWizardPage.javajet 20 Apr 2006 18:27:23 -0000 1.2 +++ templates/editor/CreationWizardPage.javajet 3 Aug 2006 18:47:12 -0000 @@ -421,7 +421,7 @@ } %> <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> diagram = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDiagram(); - diagram.setElement(model); + diagram.setElement(<%if (genDiagram.getDomainDiagramElement().isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>model); <%=importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())%>.decorateView(diagram); diagramResource.getContents().add(diagram); try { Index: templates/parts/linkMultiplicity.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/linkMultiplicity.jetinc,v retrieving revision 1.1 diff -u -r1.1 linkMultiplicity.jetinc --- templates/parts/linkMultiplicity.jetinc 29 May 2006 12:23:05 -0000 1.1 +++ templates/parts/linkMultiplicity.jetinc 3 Aug 2006 18:47:13 -0000 @@ -3,13 +3,13 @@ if (upperBound > 0) { if (upperBound == 1) { %> - if (<%=_ownerInstance%>.<%=_feature.getGetAccessor()%>() != null) { + if (<%myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false);%> != null) { <%=_exceedsUpperBound%> } <% } else { %> - if (<%=_ownerInstance%>.<%=_feature.getGetAccessor()%>().size() >= <%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>.getUpperBound()) { + if (<%myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true);%>.size() >= <%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>.getUpperBound()) { <%=_exceedsUpperBound%> } <% 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.15 diff -u -r1.15 NodeEditPart.javajet --- templates/parts/NodeEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.15 +++ templates/parts/NodeEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -10,7 +10,11 @@ final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc +%> + +<%@ include file="../common/featureGetAccessor.jetinc"%> +<% class NodeEditPartHelper { private final List myInnerLabels = new LinkedList(); private final List myAllInnerLabels = new LinkedList(); @@ -959,7 +963,6 @@ { final String _getViewCode = "getDiagramNode()"; final String _getDiagramCode = "getDiagramNode().getDiagram()"; - final String _getSemanticElementCode = "getDiagramNode().getElement()"; final boolean _includeUncontainedLinks = false; %> <%@ include file="linkNotationModelRefresher.jetinc"%> @@ -1154,6 +1157,7 @@ GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1164,6 +1168,7 @@ GenFeature _feature = childFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1185,8 +1190,9 @@ GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); { GenFeature _feature = metaFeature; - String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") newSource.getElement())"; + String _ownerInstance = "newSource.getElement()"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = null; %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1416,6 +1422,7 @@ GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1426,6 +1433,7 @@ GenFeature _feature = childFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1446,8 +1454,9 @@ GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); { GenFeature _feature = metaFeature; - String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") source.getElement())"; + String _ownerInstance = "source.getElement()"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = null; %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1755,9 +1764,9 @@ GenClass linkClass = modelFacet.getMetaClass(); %> <%=importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName()))%> createdDomainElement = <%=importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName())%>.eINSTANCE.create<%=linkClass.getClassifierAccessorName()%>(); - createdEdge.setElement(createdDomainElement); + createdEdge.setElement(<%if (linkClass.isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>createdDomainElement); <%/*XXX: Class name DomainElementInitializer should be user-customizable*/%> - <%=importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")%>.<%=genLink.getUniqueIdentifier()%>.initializeElement(createdDomainElement); + <%=importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")%>.<%=genLink.getUniqueIdentifier()%>.initializeElement(<%if (linkClass.isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>createdDomainElement); <% } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { %> @@ -1817,6 +1826,7 @@ GenFeature _feature = sourceFeature; String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + GenClass _ownerGenClass = modelFacet.getMetaClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% @@ -1831,6 +1841,7 @@ GenFeature _feature = targetFeature; String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + GenClass _ownerGenClass = modelFacet.getMetaClass(); %> <%@ include file="linkMultiplicity.jetinc"%> <% Index: templates/parts/labelText.javajetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/labelText.javajetinc,v retrieving revision 1.1 diff -u -r1.1 labelText.javajetinc --- templates/parts/labelText.javajetinc 13 Apr 2006 21:20:15 -0000 1.1 +++ templates/parts/labelText.javajetinc 3 Aug 2006 18:47:13 -0000 @@ -83,7 +83,7 @@ GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { %> - if (element.get<%=feature.getCapName()%>() == null) { + if (<%myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false);%> == null) { return defaultText; } <% @@ -91,12 +91,15 @@ %> return <%=importManager.getImportedName("java.text.MessageFormat")%>.format(pattern, new Object[] { <% - 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 + ")"; +%> + new <%=primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())%>(<% + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + if (feature.isPrimitiveType()) { +%>)<% } %> - <%=value%> }); <% } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { @@ -106,12 +109,15 @@ <% for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - String value = "element.get" + next.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ if (next.isPrimitiveType()) { - value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; - } %> - <%=value%><%if (it.hasNext()) {%>,<%}%> + new <%=primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())%>(<% + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); + if (next.isPrimitiveType()) { +%>)<% + } + if (it.hasNext()) {%>,<%}%> <% } %> 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.7 diff -u -r1.7 ChildNodeEditPart.javajet --- templates/parts/ChildNodeEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.7 +++ templates/parts/ChildNodeEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -13,6 +13,8 @@ %> <%@ include file="../copyright4java.jetinc"%> +<%@ include file="../common/featureGetAccessor.jetinc"%> + <%importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.gef.EditPolicy"); Index: templates/parts/linkNotationModelRefresher.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/linkNotationModelRefresher.jetinc,v retrieving revision 1.1 diff -u -r1.1 linkNotationModelRefresher.jetinc --- templates/parts/linkNotationModelRefresher.jetinc 2 Aug 2006 10:43:51 -0000 1.1 +++ templates/parts/linkNotationModelRefresher.jetinc 3 Aug 2006 18:47:13 -0000 @@ -489,7 +489,7 @@ <% } %> - if (next.getElement().eContainer() == <%=_getSemanticElementCode%>) { + if (next.getElement().eContainer() == <%=_getViewCode%>.getElement()) { int linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next); switch (linkVID) { <% 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.7 diff -u -r1.7 NodeLabelEditPart.javajet --- templates/parts/NodeLabelEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.7 +++ templates/parts/NodeLabelEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -3,7 +3,7 @@ <% final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0]; final GenNodeLabel genLabel = (GenNodeLabel) genElement; -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; GenNode genHost = genLabel.getNode(); GenClass underlyingMetaClass = genHost.getDomainMetaClass(); GenDiagram genDiagram = genLabel.getDiagram(); @@ -11,6 +11,9 @@ final boolean isReadOnly = genLabel.isReadOnly(); %> <%@ include file="../copyright4java.jetinc"%> + +<%@ include file="../common/featureGetAccessor.jetinc"%> + <%importManager.emitPackageStatement(stringBuffer);%> <% 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.8 diff -u -r1.8 LinkLabelEditPart.javajet --- templates/parts/LinkLabelEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.8 +++ templates/parts/LinkLabelEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -3,7 +3,7 @@ <% final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0]; final GenLinkLabel genLabel = (GenLinkLabel)genElement; -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; GenLink genHost = genLabel.getLink(); GenDiagram genDiagram = genLabel.getDiagram(); LabelModelFacet labelModelFacet = genLabel.getModelFacet(); @@ -20,6 +20,9 @@ final boolean isReadOnly = genLabel.isReadOnly(); %> <%@ include file="../copyright4java.jetinc"%> + +<%@ include file="../common/featureGetAccessor.jetinc"%> + <%importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.draw2d.geometry.Point"); importManager.addImport("org.eclipse.gef.EditPart"); 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.6 diff -u -r1.6 DiagramEditPart.javajet --- templates/parts/DiagramEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.6 +++ templates/parts/DiagramEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -2,12 +2,16 @@ 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 ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc List childNodes = genDiagram.getTopLevelNodes(); +%> + +<%@ include file="../common/featureGetAccessor.jetinc"%> +<% class DiagramEditPartHelper { private final List myContainedFeatureModelFacetLinks = new LinkedList(); private final List myContainedTypeModelFacetLinks = new LinkedList(); @@ -366,7 +370,6 @@ { String _getDiagramCode = "getDiagram()"; String _getViewCode = "getDiagram()"; -String _getSemanticElementCode = "getDiagram().getElement()"; boolean isListLayout = false; final boolean _includeUncontainedLinks = true; %> 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.6 diff -u -r1.6 CompartmentEditPart.javajet --- templates/parts/CompartmentEditPart.javajet 2 Aug 2006 10:43:51 -0000 1.6 +++ templates/parts/CompartmentEditPart.javajet 3 Aug 2006 18:47:12 -0000 @@ -9,6 +9,9 @@ importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc %> <%@ include file="../copyright4java.jetinc"%> + +<%@ include file="../common/featureGetAccessor.jetinc"%> + <%importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.gmf.runtime.notation.View"); importManager.addImport("org.eclipse.gef.commands.Command"); @@ -217,7 +220,6 @@ { String _getViewCode = "getDiagramNode()"; String _getDiagramCode = _getViewCode + ".getDiagram()"; -String _getSemanticElementCode = "resolveSemanticElement()"; boolean isListLayout = genCompartment.isListLayout(); %> <%@ include file="notationModelRefresher.jetinc"%> Index: templates/parts/semanticChildren.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/semanticChildren.jetinc,v retrieving revision 1.1 diff -u -r1.1 semanticChildren.jetinc --- templates/parts/semanticChildren.jetinc 19 Jun 2006 19:14:13 -0000 1.1 +++ templates/parts/semanticChildren.jetinc 3 Aug 2006 18:47:13 -0000 @@ -24,7 +24,7 @@ if (entrySet.size() > 0) { %> <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> viewObject = <%=_getViewCode%>; - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getSemanticElementCode%>; + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = viewObject.getElement(); <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue; int nodeVID; <% @@ -35,12 +35,12 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { %> - for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=childMetaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) { + for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);%>.iterator(); it.hasNext(); ) { nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next(); <% } else { %> - nextValue = ((<%=importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=childMetaFeature.getGetAccessor()%>(); + nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);%>; <% } %> Index: templates/parts/semanticChildLinks.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/semanticChildLinks.jetinc,v retrieving revision 1.1 diff -u -r1.1 semanticChildLinks.jetinc --- templates/parts/semanticChildLinks.jetinc 2 Aug 2006 10:43:51 -0000 1.1 +++ templates/parts/semanticChildLinks.jetinc 3 Aug 2006 18:47:13 -0000 @@ -21,7 +21,7 @@ } if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { %> - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getSemanticElementCode%>; + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getViewCode%>.getElement(); <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue; <% } @@ -36,12 +36,12 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { %> - for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) { + for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);%>.iterator(); it.hasNext(); ) { nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next(); <% } else { %> - nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>(); + nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);%>; <% } %> @@ -67,20 +67,20 @@ } if (modelFacet.getSourceMetaFeature() != null) { %> - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = ((<%=importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getSourceMetaFeature().getGetAccessor()%>(); + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);%>; <% } else { %> - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = <%=_getSemanticElementCode%>; + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = <%=_getViewCode%>.getElement(); <% } if (modelFacet.getTargetMetaFeature() != null) { %> - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = ((<%=importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())%>)nextValue).<%=modelFacet.getTargetMetaFeature().getGetAccessor()%>(); + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);%>; <% } else { %> - <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = <%=_getSemanticElementCode%>; + <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = <%=_getViewCode%>.getElement(); <% } %> @@ -118,12 +118,12 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { %> - for(<%=importManager.getImportedName("java.util.Iterator")%> it = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>().iterator(); it.hasNext(); ) { + for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);%>.iterator(); it.hasNext(); ) { nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next(); <% } else { %> - nextValue = ((<%=importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())%>)modelObject).<%=metaFeature.getGetAccessor()%>(); + nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);%>; <% } %> 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.3 diff -u -r1.3 createNodeCommand.javajetinc --- templates/parts/createNodeCommand.javajetinc 19 Jun 2006 19:14:13 -0000 1.3 +++ templates/parts/createNodeCommand.javajetinc 3 Aug 2006 18:47:13 -0000 @@ -67,7 +67,7 @@ } %> <%/*XXX: Class name DomainElementInitializer should be user-customizable*/%> - <%=importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")%>.<%=next.getUniqueIdentifier()%>.initializeElement(createdDomainElement); + <%=importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")%>.<%=next.getUniqueIdentifier()%>.initializeElement(<%if (next.getDomainMetaClass().isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>createdDomainElement); <% TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); @@ -88,7 +88,7 @@ <% } %> - this.notationAddCommand = new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>NotationCommand(parent, createdDomainElement<%if(!isListLayout) {%>, constraint<%}%>); + this.notationAddCommand = new Create<%=next.getDomainMetaClass().getName()%><%=next.getVisualID()%>NotationCommand(parent, <%if (next.getDomainMetaClass().isExternalInterface()) {%>(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) <%}%>createdDomainElement<%if(!isListLayout) {%>, constraint<%}%>); request.setCreatedObject(notationAddCommand.getCreatedView()); } Index: templates/parts/notationModelRefresher.jetinc =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/parts/notationModelRefresher.jetinc,v retrieving revision 1.2 diff -u -r1.2 notationModelRefresher.jetinc --- templates/parts/notationModelRefresher.jetinc 2 Aug 2006 10:43:51 -0000 1.2 +++ templates/parts/notationModelRefresher.jetinc 3 Aug 2006 18:47:13 -0000 @@ -117,11 +117,11 @@ <% if (hasDeclaredFilter) { %> - filter = filter.and(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>)); + filter = filter.and(<%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getViewCode%>.getElement())); <% } else { %> - filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getSemanticElementCode%>); + filter = <%=importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")%>.createNotifierFilter(<%=_getViewCode%>.getElement()); <% } } //local declaration of hasDeclaredFilter 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.9 diff -u -r1.9 LinkLabelEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.9 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java 3 Aug 2006 18:47:10 -0000 @@ -21,242 +21,264 @@ protected final String TEXT_1 = ""; protected final String TEXT_2 = NL + "/*" + NL + " * "; protected final String TEXT_3 = NL + " */"; - protected final String TEXT_4 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_5 = " extends "; - protected final String TEXT_6 = " {"; - protected final String TEXT_7 = NL; - protected final String TEXT_8 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_9 = ";"; - 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; - 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 = " parent = getUpdatableParent();" + NL + "\t\t"; - protected final String TEXT_100 = " connection = ("; - protected final String TEXT_101 = ") parent.getFigure();"; - protected final String TEXT_102 = NL + "\t\t(("; - protected final String TEXT_103 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; - protected final String TEXT_104 = "(connection, "; - protected final String TEXT_105 = "."; - protected final String TEXT_106 = ") {" + NL + "\t\t\t\t\tprotected "; - protected final String TEXT_107 = " getReferencePoint() {" + NL + "\t\t\t\t\t\treturn super.getReferencePoint().translate(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\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL; - protected final String TEXT_108 = NL; - protected final String TEXT_109 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; - protected final String TEXT_110 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; - protected final String TEXT_111 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; - protected final String TEXT_112 = " element = "; - protected final String TEXT_113 = ";" + 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_114 = " element = "; - protected final String TEXT_115 = ";" + 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_116 = " element, String pattern) {"; - protected final String TEXT_117 = NL + "\t\tif (element.get"; - protected final String TEXT_118 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_119 = NL + "\t\treturn "; - protected final String TEXT_120 = ".format(pattern, new Object[] {"; - protected final String TEXT_121 = NL + "\t\t\t"; - protected final String TEXT_122 = NL + "\t\t});"; - protected final String TEXT_123 = NL + "\t\treturn "; - protected final String TEXT_124 = ".format(pattern, new Object[] {"; - protected final String TEXT_125 = NL + "\t\t"; - protected final String TEXT_126 = ","; - protected final String TEXT_127 = NL + "\t\t});"; - protected final String TEXT_128 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_129 = NL + "\t}"; - protected final String TEXT_130 = NL; - protected final String TEXT_131 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_132 = 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}"; - protected final String TEXT_144 = "\t" + NL + "\t}"; - protected final String TEXT_145 = 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_146 = " createdFont;"; - protected final String TEXT_147 = "\t"; - protected final String TEXT_148 = NL; - protected final String TEXT_149 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_150 = " style = ("; - protected final String TEXT_151 = ") "; - protected final String TEXT_152 = ".getStyle("; - protected final String TEXT_153 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_154 = " 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_155 = " 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_156 = "(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_157 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_158 = " getLabelIcon() {"; - protected final String TEXT_159 = NL + "\t\t"; - protected final String TEXT_160 = " imageDescriptor = "; - protected final String TEXT_161 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_162 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_163 = " resolveSemanticElement() {" + NL + "\t\t"; - protected final String TEXT_164 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof "; - protected final String TEXT_165 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_166 = NL + "\t\t"; - protected final String TEXT_167 = " view = ("; - protected final String TEXT_168 = ") parent.getModel();" + NL + "\t\treturn ("; - protected final String TEXT_169 = ") view.getElement();"; - protected final String TEXT_170 = NL + "\t\t"; - protected final String TEXT_171 = " target = (("; - protected final String TEXT_172 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof "; - protected final String TEXT_173 = ") ? ("; - protected final String TEXT_174 = ") target.getElement() : null;"; - protected final String TEXT_175 = NL + "\t\treturn null;"; - protected final String TEXT_176 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_177 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; - protected final String TEXT_178 = ") {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_179 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t"; - protected final String TEXT_180 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_181 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_184 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_186 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_187 = ".eINSTANCE.get"; - protected final String TEXT_188 = "(), labelRefresher);"; - protected final String TEXT_189 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_190 = ".eINSTANCE.get"; - protected final String TEXT_191 = "(), labelRefresher);"; - protected final String TEXT_192 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t"; - protected final String TEXT_193 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_194 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_195 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_196 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_197 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_198 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_199 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_200 = ".eINSTANCE.get"; - protected final String TEXT_201 = "(), labelRefresher);"; - protected final String TEXT_202 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_203 = ".eINSTANCE.get"; - protected final String TEXT_204 = "(), labelRefresher);"; - protected final String TEXT_205 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL; - protected final String TEXT_206 = NL; - protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_208 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_209 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_210 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_211 = " createLabel() {"; - protected final String TEXT_212 = NL + "\t\treturn new "; - protected final String TEXT_213 = "();"; - protected final String TEXT_214 = NL + "\t\treturn "; - protected final String TEXT_215 = ";"; - protected final String TEXT_216 = NL + "\t\treturn new "; - protected final String TEXT_217 = "();"; - protected final String TEXT_218 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_219 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_220 = " label = createLabel();"; - protected final String TEXT_221 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_222 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_223 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_224 = NL + NL + "\t/**"; - protected final String TEXT_225 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_226 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_227 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_228 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_229 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_230 = "("; - protected final String TEXT_231 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_232 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_233 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_234 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_235 = NL; - protected final String TEXT_236 = NL; - protected final String TEXT_237 = 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_238 = NL + "}"; - protected final String TEXT_239 = NL; + protected final String TEXT_4 = NL; + protected final String TEXT_5 = NL; + protected final String TEXT_6 = "(("; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = "(("; + protected final String TEXT_9 = ")"; + protected final String TEXT_10 = ")"; + protected final String TEXT_11 = ".eGet("; + protected final String TEXT_12 = ".eINSTANCE.get"; + protected final String TEXT_13 = "())"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "(("; + protected final String TEXT_16 = ")"; + protected final String TEXT_17 = ")"; + protected final String TEXT_18 = "."; + protected final String TEXT_19 = "()"; + protected final String TEXT_20 = NL; + protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_22 = " extends "; + protected final String TEXT_23 = " {"; + protected final String TEXT_24 = NL; + protected final String TEXT_25 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_26 = ";"; + protected final String TEXT_27 = NL; + protected final String TEXT_28 = NL; + protected final String TEXT_29 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_30 = " manager;" + NL; + protected final String TEXT_31 = 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_32 = "(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_33 = NL + "\t\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new "; + protected final String TEXT_34 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_35 = NL; + protected final String TEXT_36 = "\t\tinstallEditPolicy("; + protected final String TEXT_37 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; + protected final String TEXT_38 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; + protected final String TEXT_39 = " 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_40 = " getDirectEditCommand("; + protected final String TEXT_41 = " 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_42 = ".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_43 = "(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_44 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; + protected final String TEXT_45 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_46 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_47 = " editingDomain = "; + protected final String TEXT_48 = ".getEditingDomain("; + protected final String TEXT_49 = ".getDiagram().getElement());"; + protected final String TEXT_50 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_51 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_52 = " 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_53 = " createDomainModelCommand("; + protected final String TEXT_54 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_55 = " element = "; + protected final String TEXT_56 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_57 = " feature = ("; + protected final String TEXT_58 = ") "; + protected final String TEXT_59 = ".eINSTANCE.get"; + protected final String TEXT_60 = "();" + 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_61 = ".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_62 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_63 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_64 = " result = new "; + protected final String TEXT_65 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_66 = " values = new "; + protected final String TEXT_67 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_68 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_69 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_70 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; + protected final String TEXT_71 = NL + "\t\t\t\t\t\treturn "; + protected final String TEXT_72 = ".create(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_73 = NL + "\t\t\t\t\t}"; + protected final String TEXT_74 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_75 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_76 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_77 = " 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_78 = " createDomainModelCommand("; + protected final String TEXT_79 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_80 = " element = "; + protected final String TEXT_81 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_82 = " result = new "; + protected final String TEXT_83 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; + protected final String TEXT_84 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_85 = " "; + protected final String TEXT_86 = "feature = ("; + protected final String TEXT_87 = ") "; + protected final String TEXT_88 = ".eINSTANCE.get"; + protected final String TEXT_89 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_90 = ".parseValue(feature, values["; + protected final String TEXT_91 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_92 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_93 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_94 = " "; + protected final String TEXT_95 = "values = new "; + protected final String TEXT_96 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_97 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_98 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_99 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_100 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_101 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_102 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_103 = NL + "\t\t\t\t});"; + protected final String TEXT_104 = NL + "\t}" + NL; + protected final String TEXT_105 = NL; + protected final String TEXT_106 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_107 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_108 = ".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_109 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_110 = "(this, "; + protected final String TEXT_111 = ".class, new "; + protected final String TEXT_112 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_113 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_114 = " 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_115 = 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_116 = " parent = getUpdatableParent();" + NL + "\t\t"; + protected final String TEXT_117 = " connection = ("; + protected final String TEXT_118 = ") parent.getFigure();"; + protected final String TEXT_119 = NL + "\t\t(("; + protected final String TEXT_120 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new "; + protected final String TEXT_121 = "(connection, "; + protected final String TEXT_122 = "."; + protected final String TEXT_123 = ") {" + NL + "\t\t\t\t\tprotected "; + protected final String TEXT_124 = " getReferencePoint() {" + NL + "\t\t\t\t\t\treturn super.getReferencePoint().translate(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\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL; + protected final String TEXT_125 = NL; + protected final String TEXT_126 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_127 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_128 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; + protected final String TEXT_129 = " element = "; + protected final String TEXT_130 = ";" + 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_131 = " element = "; + protected final String TEXT_132 = ";" + 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_133 = " element, String pattern) {"; + protected final String TEXT_134 = NL + "\t\tif ("; + protected final String TEXT_135 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_136 = NL + "\t\treturn "; + protected final String TEXT_137 = ".format(pattern, new Object[] {"; + protected final String TEXT_138 = NL + "\t\t\tnew "; + protected final String TEXT_139 = "("; + protected final String TEXT_140 = ")"; + protected final String TEXT_141 = NL + "\t\t});"; + protected final String TEXT_142 = NL + "\t\treturn "; + protected final String TEXT_143 = ".format(pattern, new Object[] {"; + protected final String TEXT_144 = NL + "\t\t\tnew "; + protected final String TEXT_145 = "("; + protected final String TEXT_146 = ")"; + protected final String TEXT_147 = ","; + protected final String TEXT_148 = NL + "\t\t});"; + protected final String TEXT_149 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_150 = NL + "\t}"; + protected final String TEXT_151 = NL; + protected final String TEXT_152 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_153 = NL + "\t\t"; + protected final String TEXT_154 = " style =" + NL + "\t\t\t("; + protected final String TEXT_155 = ") "; + protected final String TEXT_156 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_157 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_158 = " 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_159 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_160 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_161 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_162 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_163 = " 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_164 = "(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}"; + protected final String TEXT_165 = "\t" + NL + "\t}"; + protected final String TEXT_166 = 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_167 = " createdFont;"; + protected final String TEXT_168 = "\t"; + protected final String TEXT_169 = NL; + protected final String TEXT_170 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_171 = " style = ("; + protected final String TEXT_172 = ") "; + protected final String TEXT_173 = ".getStyle("; + protected final String TEXT_174 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_175 = " 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_176 = " 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_177 = "(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_178 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_179 = " getLabelIcon() {"; + protected final String TEXT_180 = NL + "\t\t"; + protected final String TEXT_181 = " imageDescriptor = "; + protected final String TEXT_182 = ".getInstance().getItemImageDescriptor(resolveSemanticElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_183 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_184 = " resolveSemanticElement() {" + NL + "\t\t"; + protected final String TEXT_185 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof "; + protected final String TEXT_186 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}"; + protected final String TEXT_187 = NL + "\t\t"; + protected final String TEXT_188 = " view = ("; + protected final String TEXT_189 = ") parent.getModel();" + NL + "\t\treturn ("; + protected final String TEXT_190 = ") view.getElement();"; + protected final String TEXT_191 = NL + "\t\t"; + protected final String TEXT_192 = " target = (("; + protected final String TEXT_193 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof "; + protected final String TEXT_194 = ") ? ("; + protected final String TEXT_195 = ") target.getElement() : null;"; + protected final String TEXT_196 = NL + "\t\treturn null;"; + protected final String TEXT_197 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_198 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; + protected final String TEXT_199 = ") {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_200 = ") 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_201 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_202 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_203 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_204 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_205 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_206 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_207 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_208 = ".eINSTANCE.get"; + protected final String TEXT_209 = "(), labelRefresher);"; + protected final String TEXT_210 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_211 = ".eINSTANCE.get"; + protected final String TEXT_212 = "(), labelRefresher);"; + protected final String TEXT_213 = 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_214 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_215 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_216 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_217 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_218 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_219 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_220 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_221 = ".eINSTANCE.get"; + protected final String TEXT_222 = "(), labelRefresher);"; + protected final String TEXT_223 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_224 = ".eINSTANCE.get"; + protected final String TEXT_225 = "(), labelRefresher);"; + protected final String TEXT_226 = 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_227 = NL; + protected final String TEXT_228 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_229 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_230 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_231 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_232 = " createLabel() {"; + 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 + "\tprotected "; + protected final String TEXT_240 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_241 = " label = createLabel();"; + protected final String TEXT_242 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_243 = ".LEFT);"; + protected final String TEXT_244 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_245 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_246 = NL + NL + "\t/**"; + protected final String TEXT_247 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_248 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_249 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_250 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_251 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_252 = "("; + protected final String TEXT_253 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_254 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_255 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_256 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_257 = NL; + protected final String TEXT_258 = NL; + protected final String TEXT_259 = 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_260 = NL + "}"; + protected final String TEXT_261 = NL; public String generate(Object argument) { @@ -264,7 +286,7 @@ final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0]; final GenLinkLabel genLabel = (GenLinkLabel)genElement; -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; GenLink genHost = genLabel.getLink(); GenDiagram genDiagram = genLabel.getDiagram(); LabelModelFacet labelModelFacet = genLabel.getModelFacet(); @@ -289,6 +311,81 @@ stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } + stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_5); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_6); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_7); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_9); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_10); + + } + + stringBuffer.append(TEXT_11); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_12); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_13); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_14); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_16); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_17); + + } + + stringBuffer.append(TEXT_18); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_19); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_20); importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.draw2d.geometry.Point"); importManager.addImport("org.eclipse.gef.EditPart"); @@ -299,245 +396,245 @@ importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_21); stringBuffer.append(genLabel.getEditPartClassName()); - stringBuffer.append(TEXT_5); + stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_23); { GenCommonBase genCommonBase = genLabel; - stringBuffer.append(TEXT_7); - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_25); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_26); } - stringBuffer.append(TEXT_10); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_28); if (!isReadOnly) { - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_30); } - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_31); stringBuffer.append(genLabel.getEditPartClassName()); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_32); final String primaryView = "getUpdatableParent().getDiagramEdge()"; final String resolvedSemanticElement = "resolveSemanticElement()"; - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_34); if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { - stringBuffer.append(TEXT_18); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_48); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_49); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_55); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_59); stringBuffer.append(featureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_62); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_67); stringBuffer.append(featureToSet.getAccessorName()); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_70); } else { - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_72); } - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_73); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_74); stringBuffer.append(metaFeatures.size()); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_80); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_83); 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_84); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_85); } - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_88); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_90); stringBuffer.append(i); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_92); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_93); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_94); } - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_96); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_99); } else { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_101); } } - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_102); } - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_103); } - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_104); if (labelModelFacet instanceof FeatureLabelModelFacet || labelModelFacet instanceof CompositeFeatureLabelModelFacet && !isReadOnly) { - stringBuffer.append(TEXT_88); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_114); } - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_118); final String alignment; LinkLabelAlignment genAlignment = genLabel.getAlignment(); @@ -560,18 +657,18 @@ } } - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_122); stringBuffer.append(alignment); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_107); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_125); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -615,78 +712,91 @@ } } - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_126); stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_127); stringBuffer.append(editPattern); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_129); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_131); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_133); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_117); - stringBuffer.append(feature.getCapName()); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_134); + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + stringBuffer.append(TEXT_135); } - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_137); - 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_138); + stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_139); + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_121); - stringBuffer.append(value); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_140); + + } + + stringBuffer.append(TEXT_141); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_143); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - String value = "element.get" + next.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ if (next.isPrimitiveType()) { - value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; + + stringBuffer.append(TEXT_144); + stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_145); + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); + if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_125); - stringBuffer.append(value); - if (it.hasNext()) { - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_146); + + } + if (it.hasNext()) { + stringBuffer.append(TEXT_147); } } - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_148); } else { - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_149); } - stringBuffer.append(TEXT_129); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_151); boolean isFixedFontSetInFigure; { @@ -694,199 +804,199 @@ isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_152); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_155); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_164); } - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_165); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_167); } - stringBuffer.append(TEXT_147); - stringBuffer.append(TEXT_148); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_172); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_179); if (genLabel.isElementIcon()) { - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_182); } - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_186); if (genHost.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_190); } else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) { - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_195); } else { - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_196); } - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_206); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_208); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_209); } 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_189); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_211); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_212); } } - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_213); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_219); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_220); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_221); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_222); } 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_202); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_224); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_225); } } - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_226); final Viewmap viewmap = genLabel.getViewmap(); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_227); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -915,64 +1025,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_229); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_230); } else { - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_231); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_232); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_233); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_234); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_235); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_236); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_237); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_238); } - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_240); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_241); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_242); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_243); } else { - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_244); } - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_245); } /*not parent-assigned*/ - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_246); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_247); } - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_248); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_250); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -986,43 +1098,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_251); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_253); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_254); } else { - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_255); } - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_256); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_257); stringBuffer.append(classBody); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_258); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_259); } } - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_260); importManager.emitSortedImports(); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_261); 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.8 diff -u -r1.8 NodeLabelEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.8 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java 3 Aug 2006 18:47:12 -0000 @@ -22,220 +22,242 @@ protected final String TEXT_2 = NL + "/*" + NL + " * "; protected final String TEXT_3 = NL + " */"; protected final String TEXT_4 = NL; - protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_6 = " extends "; - protected final String TEXT_7 = " {"; - protected final String TEXT_8 = NL; - protected final String TEXT_9 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - 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; - 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 = \""; - protected final String TEXT_100 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; - protected final String TEXT_101 = " element = "; - protected final String TEXT_102 = ";" + 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_103 = " element = "; - protected final String TEXT_104 = ";" + 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_105 = " element, String pattern) {"; - protected final String TEXT_106 = NL + "\t\tif (element.get"; - protected final String TEXT_107 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_108 = NL + "\t\treturn "; - protected final String TEXT_109 = ".format(pattern, new Object[] {"; - protected final String TEXT_110 = NL + "\t\t\t"; - protected final String TEXT_111 = NL + "\t\t});"; - protected final String TEXT_112 = NL + "\t\treturn "; - protected final String TEXT_113 = ".format(pattern, new Object[] {"; - protected final String TEXT_114 = NL + "\t\t"; - protected final String TEXT_115 = ","; - protected final String TEXT_116 = NL + "\t\t});"; - protected final String TEXT_117 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_118 = NL + "\t}"; - protected final String TEXT_119 = NL; - protected final String TEXT_120 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_121 = NL + "\t\t"; - protected final String TEXT_122 = " style =" + NL + "\t\t\t("; - protected final String TEXT_123 = ") "; - protected final String TEXT_124 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_125 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_126 = " 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_127 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_128 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_129 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_130 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_131 = " 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_132 = "(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}"; - protected final String TEXT_133 = "\t" + NL + "\t}"; - protected final String TEXT_134 = 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_135 = " createdFont;"; - protected final String TEXT_136 = "\t"; - protected final String TEXT_137 = NL; - protected final String TEXT_138 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_139 = " style = ("; - protected final String TEXT_140 = ") "; - protected final String TEXT_141 = ".getStyle("; - protected final String TEXT_142 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_143 = " 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_144 = " 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_145 = "(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_146 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_147 = " getLabelIcon() {"; - protected final String TEXT_148 = NL + "\t\t"; - protected final String TEXT_149 = " element = resolveSemanticElement();" + NL + "\t\t"; - protected final String TEXT_150 = " imageDescriptor = "; - protected final String TEXT_151 = ".getInstance().getItemImageDescriptor(element);" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_152 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_153 = " resolveSemanticElement() {" + NL + "\t\tView view = (View) getModel();" + NL + "\t\treturn (view.getElement() instanceof "; - protected final String TEXT_154 = ") ? ("; - protected final String TEXT_155 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_156 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; - protected final String TEXT_157 = ") {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_158 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t"; - protected final String TEXT_159 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_160 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_161 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_162 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_163 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_164 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_165 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_166 = ".eINSTANCE.get"; - protected final String TEXT_167 = "(), labelRefresher);"; - protected final String TEXT_168 = NL + "\t\t\tupdatableParent.addRefresher("; - protected final String TEXT_169 = ".eINSTANCE.get"; - protected final String TEXT_170 = "(), labelRefresher);"; - protected final String TEXT_171 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t"; - protected final String TEXT_172 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_174 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_175 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_176 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_177 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; - protected final String TEXT_178 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_179 = ".eINSTANCE.get"; - protected final String TEXT_180 = "(), labelRefresher);"; - protected final String TEXT_181 = NL + "\t\t\tupdatableParent.removeRefresher("; - protected final String TEXT_182 = ".eINSTANCE.get"; - protected final String TEXT_183 = "(), labelRefresher);"; - protected final String TEXT_184 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};"; - protected final String TEXT_185 = NL; - protected final String TEXT_186 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_187 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_188 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_189 = 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 + "\tprotected "; - protected final String TEXT_198 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_199 = " label = createLabel();"; - protected final String TEXT_200 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_201 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_202 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_203 = NL + NL + "\t/**"; - protected final String TEXT_204 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_205 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_206 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_207 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_208 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_209 = "("; - protected final String TEXT_210 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_211 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_212 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_213 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_214 = NL; - protected final String TEXT_215 = NL; - protected final String TEXT_216 = 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_217 = NL + "}"; - protected final String TEXT_218 = NL; + protected final String TEXT_5 = NL; + protected final String TEXT_6 = "(("; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = "(("; + protected final String TEXT_9 = ")"; + protected final String TEXT_10 = ")"; + protected final String TEXT_11 = ".eGet("; + protected final String TEXT_12 = ".eINSTANCE.get"; + protected final String TEXT_13 = "())"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "(("; + protected final String TEXT_16 = ")"; + protected final String TEXT_17 = ")"; + protected final String TEXT_18 = "."; + protected final String TEXT_19 = "()"; + protected final String TEXT_20 = NL; + protected final String TEXT_21 = NL; + protected final String TEXT_22 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_23 = " extends "; + protected final String TEXT_24 = " {"; + protected final String TEXT_25 = NL; + protected final String TEXT_26 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_27 = ";"; + protected final String TEXT_28 = NL; + protected final String TEXT_29 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_30 = " manager;" + NL; + protected final String TEXT_31 = 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_32 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; + protected final String TEXT_33 = NL; + protected final String TEXT_34 = "\t\tinstallEditPolicy("; + protected final String TEXT_35 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; + protected final String TEXT_36 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; + protected final String TEXT_37 = " 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_38 = " getDirectEditCommand("; + protected final String TEXT_39 = " 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_40 = ".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_41 = "(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_42 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; + protected final String TEXT_43 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_44 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_45 = " editingDomain = "; + protected final String TEXT_46 = ".getEditingDomain("; + protected final String TEXT_47 = ".getDiagram().getElement());"; + protected final String TEXT_48 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_49 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_50 = " 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_51 = " createDomainModelCommand("; + protected final String TEXT_52 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_53 = " element = "; + protected final String TEXT_54 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_55 = " feature = ("; + protected final String TEXT_56 = ") "; + protected final String TEXT_57 = ".eINSTANCE.get"; + protected final String TEXT_58 = "();" + 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_59 = ".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_60 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_61 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_62 = " result = new "; + protected final String TEXT_63 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_64 = " values = new "; + protected final String TEXT_65 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_66 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_67 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_68 = ".create(editingDomain, element, feature, valueToSet));" + 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(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_71 = NL + "\t\t\t\t\t}"; + protected final String TEXT_72 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_73 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_74 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_75 = " 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_76 = " createDomainModelCommand("; + protected final String TEXT_77 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_78 = " element = "; + protected final String TEXT_79 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_80 = " result = new "; + protected final String TEXT_81 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; + protected final String TEXT_82 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_83 = " "; + protected final String TEXT_84 = "feature = ("; + protected final String TEXT_85 = ") "; + protected final String TEXT_86 = ".eINSTANCE.get"; + protected final String TEXT_87 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_88 = ".parseValue(feature, values["; + protected final String TEXT_89 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_90 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_91 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_92 = " "; + protected final String TEXT_93 = "values = new "; + protected final String TEXT_94 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_95 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_96 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_97 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_98 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_99 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_100 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_101 = NL + "\t\t\t\t});"; + protected final String TEXT_102 = NL + "\t}" + NL; + protected final String TEXT_103 = NL; + protected final String TEXT_104 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_105 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_106 = ".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_107 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_108 = "(this, "; + protected final String TEXT_109 = ".class, new "; + protected final String TEXT_110 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_111 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_112 = " 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_113 = 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_114 = NL; + protected final String TEXT_115 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_116 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_117 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; + protected final String TEXT_118 = " element = "; + protected final String TEXT_119 = ";" + 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_120 = " element = "; + protected final String TEXT_121 = ";" + 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_122 = " element, String pattern) {"; + protected final String TEXT_123 = NL + "\t\tif ("; + protected final String TEXT_124 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_125 = NL + "\t\treturn "; + protected final String TEXT_126 = ".format(pattern, new Object[] {"; + protected final String TEXT_127 = NL + "\t\t\tnew "; + protected final String TEXT_128 = "("; + protected final String TEXT_129 = ")"; + protected final String TEXT_130 = NL + "\t\t});"; + protected final String TEXT_131 = NL + "\t\treturn "; + protected final String TEXT_132 = ".format(pattern, new Object[] {"; + protected final String TEXT_133 = NL + "\t\t\tnew "; + protected final String TEXT_134 = "("; + protected final String TEXT_135 = ")"; + protected final String TEXT_136 = ","; + protected final String TEXT_137 = NL + "\t\t});"; + protected final String TEXT_138 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_139 = NL + "\t}"; + protected final String TEXT_140 = NL; + protected final String TEXT_141 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_142 = NL + "\t\t"; + protected final String TEXT_143 = " style =" + NL + "\t\t\t("; + protected final String TEXT_144 = ") "; + protected final String TEXT_145 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_146 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_147 = " 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_148 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_149 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_150 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_151 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_152 = " 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_153 = "(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}"; + protected final String TEXT_154 = "\t" + NL + "\t}"; + protected final String TEXT_155 = 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_156 = " createdFont;"; + protected final String TEXT_157 = "\t"; + protected final String TEXT_158 = NL; + protected final String TEXT_159 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_160 = " style = ("; + protected final String TEXT_161 = ") "; + protected final String TEXT_162 = ".getStyle("; + protected final String TEXT_163 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_164 = " 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_165 = " 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_166 = "(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_167 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_168 = " getLabelIcon() {"; + protected final String TEXT_169 = NL + "\t\t"; + protected final String TEXT_170 = " element = resolveSemanticElement();" + NL + "\t\t"; + protected final String TEXT_171 = " imageDescriptor = "; + protected final String TEXT_172 = ".getInstance().getItemImageDescriptor(element);" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_173 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_174 = " resolveSemanticElement() {" + NL + "\t\tView view = (View) getModel();" + NL + "\t\treturn (view.getElement() instanceof "; + protected final String TEXT_175 = ") ? ("; + protected final String TEXT_176 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_177 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof "; + protected final String TEXT_178 = ") {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_179 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t"; + protected final String TEXT_180 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_181 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_182 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_183 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_184 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_185 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_186 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_187 = ".eINSTANCE.get"; + protected final String TEXT_188 = "(), labelRefresher);"; + protected final String TEXT_189 = NL + "\t\t\tupdatableParent.addRefresher("; + protected final String TEXT_190 = ".eINSTANCE.get"; + protected final String TEXT_191 = "(), labelRefresher);"; + protected final String TEXT_192 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t"; + protected final String TEXT_193 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_194 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_195 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_196 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_197 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_198 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);"; + protected final String TEXT_199 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_200 = ".eINSTANCE.get"; + protected final String TEXT_201 = "(), labelRefresher);"; + protected final String TEXT_202 = NL + "\t\t\tupdatableParent.removeRefresher("; + protected final String TEXT_203 = ".eINSTANCE.get"; + protected final String TEXT_204 = "(), labelRefresher);"; + protected final String TEXT_205 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher labelRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshLabel();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontColorRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IUpdatableEditPart.Refresher fontRefresher = new IUpdatableEditPart.Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};"; + protected final String TEXT_206 = NL; + protected final String TEXT_207 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_208 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_209 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_210 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_211 = " createLabel() {"; + protected final String TEXT_212 = NL + "\t\treturn new "; + protected final String TEXT_213 = "();"; + protected final String TEXT_214 = NL + "\t\treturn "; + protected final String TEXT_215 = ";"; + protected final String TEXT_216 = NL + "\t\treturn new "; + protected final String TEXT_217 = "();"; + protected final String TEXT_218 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_219 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_220 = " label = createLabel();"; + protected final String TEXT_221 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_222 = ".LEFT);"; + protected final String TEXT_223 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_224 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_225 = NL + NL + "\t/**"; + protected final String TEXT_226 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_227 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_228 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_229 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_230 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_231 = "("; + protected final String TEXT_232 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_233 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_234 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_235 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_236 = NL; + protected final String TEXT_237 = NL; + protected final String TEXT_238 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; + protected final String TEXT_239 = NL + "}"; + protected final String TEXT_240 = NL; public String generate(Object argument) { @@ -243,7 +265,7 @@ final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0]; final GenNodeLabel genLabel = (GenNodeLabel) genElement; -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; GenNode genHost = genLabel.getNode(); GenClass underlyingMetaClass = genHost.getDomainMetaClass(); GenDiagram genDiagram = genLabel.getDiagram(); @@ -259,242 +281,317 @@ stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } - importManager.emitPackageStatement(stringBuffer); stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_5); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_6); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_7); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_9); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_10); + + } + + stringBuffer.append(TEXT_11); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_12); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_13); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_14); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_16); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_17); + + } + + stringBuffer.append(TEXT_18); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_19); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_20); + importManager.emitPackageStatement(stringBuffer); + stringBuffer.append(TEXT_21); importManager.addImport("org.eclipse.gef.EditPart"); importManager.addImport("org.eclipse.gef.EditPolicy"); importManager.addImport("org.eclipse.gmf.runtime.notation.View"); importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_5); + stringBuffer.append(TEXT_22); stringBuffer.append(genLabel.getEditPartClassName()); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_24); { GenCommonBase genCommonBase = genLabel; - stringBuffer.append(TEXT_8); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_26); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_27); } - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_28); if (!isReadOnly) { - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_30); } - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_31); stringBuffer.append(genLabel.getEditPartClassName()); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_32); final String primaryView = "getUpdatableParent().getDiagramNode()"; final String resolvedSemanticElement = "resolveSemanticElement()"; if (!isReadOnly) { - stringBuffer.append(TEXT_16); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_46); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_47); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_53); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_57); stringBuffer.append(featureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_60); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_65); stringBuffer.append(featureToSet.getAccessorName()); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_68); } else { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_70); } - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_71); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_72); stringBuffer.append(metaFeatures.size()); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_78); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_81); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_82); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_83); } - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_86); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_88); stringBuffer.append(i); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_90); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_91); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_92); } - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_94); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_97); } else { - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_99); } } - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_100); } - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_101); } - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_102); if (!isReadOnly) { - stringBuffer.append(TEXT_86); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_112); } - stringBuffer.append(TEXT_96); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_114); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -538,78 +635,91 @@ } } - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_115); stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_116); stringBuffer.append(editPattern); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_118); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_120); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_122); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_106); - stringBuffer.append(feature.getCapName()); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_123); + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + stringBuffer.append(TEXT_124); } - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_126); - 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_127); + stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_128); + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + if (feature.isPrimitiveType()) { - stringBuffer.append(TEXT_110); - stringBuffer.append(value); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_129); + + } + + stringBuffer.append(TEXT_130); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_132); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - String value = "element.get" + next.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ if (next.isPrimitiveType()) { - value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; + + stringBuffer.append(TEXT_133); + stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_134); + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); + if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_114); - stringBuffer.append(value); - if (it.hasNext()) { - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_135); + + } + if (it.hasNext()) { + stringBuffer.append(TEXT_136); } } - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_137); } else { - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_138); } - stringBuffer.append(TEXT_118); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_140); boolean isFixedFontSetInFigure; { @@ -617,171 +727,171 @@ isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_141); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_144); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_153); } - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_154); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_156); } - stringBuffer.append(TEXT_136); - stringBuffer.append(TEXT_137); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_161); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_168); if (genLabel.isElementIcon()) { - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_172); } - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_185); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_187); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_188); } 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_168); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_190); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_191); } } - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_196); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_198); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_200); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_201); } 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_181); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_203); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_204); } } - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_205); final Viewmap viewmap = genLabel.getViewmap(); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_206); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -810,64 +920,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_208); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_209); } else { - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_210); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_211); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_212); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_213); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_214); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_215); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_216); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_217); } - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_219); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_220); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_221); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_222); } else { - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_223); } - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_224); } /*not parent-assigned*/ - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_225); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_226); } - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_227); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_229); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -881,43 +993,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_230); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_232); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_233); } else { - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_234); } - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_235); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_236); stringBuffer.append(classBody); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_237); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_238); } } - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_239); importManager.emitSortedImports(); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_240); return stringBuffer.toString(); } } 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.16 diff -u -r1.16 NodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.16 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 3 Aug 2006 18:47:11 -0000 @@ -20,1158 +20,1163 @@ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL + "/*" + NL + " * "; - protected final String TEXT_3 = NL + " */"; - protected final String TEXT_4 = NL; - protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_6 = " extends "; - protected final String TEXT_7 = " implements "; - protected final String TEXT_8 = ", IUpdatableEditPart {"; - protected final String TEXT_9 = NL; - protected final String TEXT_10 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_11 = ";"; - protected final String TEXT_12 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_13 = " contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_14 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_15 = "("; - protected final String TEXT_16 = " model) {" + NL + "\t\tassert model instanceof "; - protected final String TEXT_17 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL; + protected final String TEXT_2 = NL; + protected final String TEXT_3 = "(("; + protected final String TEXT_4 = ")"; + protected final String TEXT_5 = "(("; + protected final String TEXT_6 = ")"; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = ".eGet("; + protected final String TEXT_9 = ".eINSTANCE.get"; + protected final String TEXT_10 = "())"; + protected final String TEXT_11 = ")"; + protected final String TEXT_12 = "(("; + protected final String TEXT_13 = ")"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "."; + protected final String TEXT_16 = "()"; + protected final String TEXT_17 = NL; protected final String TEXT_18 = NL; - protected final String TEXT_19 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_20 = " view = ("; - protected final String TEXT_21 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_22 = " view = ("; - protected final String TEXT_23 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; - protected final String TEXT_24 = NL; - protected final String TEXT_25 = "\t\tinstallEditPolicy("; - protected final String TEXT_26 = ".COMPONENT_ROLE, new "; - protected final String TEXT_27 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_28 = " createDeleteCommand("; - protected final String TEXT_29 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_30 = " editingDomain = "; - protected final String TEXT_31 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_32 = " cc = new "; - protected final String TEXT_33 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_34 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand("; - protected final String TEXT_35 = " editingDomain) {"; - protected final String TEXT_36 = NL + "\t\t\t\t"; - protected final String TEXT_37 = " result = new "; - protected final String TEXT_38 = "();"; - protected final String TEXT_39 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_40 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_41 = ".eINSTANCE.get"; - protected final String TEXT_42 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_43 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_44 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_45 = ".eINSTANCE.get"; - protected final String TEXT_46 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_47 = ".UNSET_VALUE));"; - protected final String TEXT_48 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_49 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_50 = ".eINSTANCE.get"; - protected final String TEXT_51 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_52 = NL + "\t\t\t\tresult.append("; - 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"; - protected final String TEXT_56 = ".UNSET_VALUE));"; - protected final String TEXT_57 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_58 = NL + "\t\t\t\treturn "; - protected final String TEXT_59 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_60 = ".eINSTANCE.get"; - protected final String TEXT_61 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; - protected final String TEXT_62 = NL + "\t\t\t\treturn "; - protected final String TEXT_63 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_64 = ".eINSTANCE.get"; - protected final String TEXT_65 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_66 = ".UNSET_VALUE);"; - protected final String TEXT_67 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_68 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_69 = ".LAYOUT_ROLE, new "; - protected final String TEXT_70 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_71 = " getCreateCommand("; - protected final String TEXT_72 = " request) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_73 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_74 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_75 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_76 = " createChangeConstraintCommand("; - protected final String TEXT_77 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_78 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_79 = " createChildEditPolicy("; - protected final String TEXT_80 = " child) {" + NL + "\t\t\t\treturn new "; - protected final String TEXT_81 = "() {" + NL + "\t\t\t\t\tpublic "; - protected final String TEXT_82 = " getTargetEditPart("; - protected final String TEXT_83 = " request) {" + NL + "\t\t\t\t\t\tif ("; - protected final String TEXT_84 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_85 = ".this;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\treturn super.getTargetEditPart(request);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallEditPolicy("; - protected final String TEXT_86 = ".GRAPHICAL_NODE_ROLE, new "; + protected final String TEXT_19 = NL + "/*" + NL + " * "; + protected final String TEXT_20 = NL + " */"; + protected final String TEXT_21 = NL; + protected final String TEXT_22 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_23 = " extends "; + protected final String TEXT_24 = " implements "; + protected final String TEXT_25 = ", IUpdatableEditPart {"; + protected final String TEXT_26 = NL; + protected final String TEXT_27 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_28 = ";"; + protected final String TEXT_29 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_30 = " contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_31 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_32 = "("; + protected final String TEXT_33 = " model) {" + NL + "\t\tassert model instanceof "; + protected final String TEXT_34 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL; + protected final String TEXT_35 = NL; + protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_37 = " view = ("; + protected final String TEXT_38 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_39 = " view = ("; + protected final String TEXT_40 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; + protected final String TEXT_41 = NL; + protected final String TEXT_42 = "\t\tinstallEditPolicy("; + protected final String TEXT_43 = ".COMPONENT_ROLE, new "; + protected final String TEXT_44 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_45 = " createDeleteCommand("; + protected final String TEXT_46 = " deleteRequest) {" + NL + "\t\t\t\t"; + protected final String TEXT_47 = " editingDomain = "; + protected final String TEXT_48 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_49 = " cc = new "; + protected final String TEXT_50 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; + protected final String TEXT_51 = ".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_52 = " editingDomain) {"; + protected final String TEXT_53 = NL + "\t\t\t\t"; + protected final String TEXT_54 = " result = new "; + protected final String TEXT_55 = "();"; + 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\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_58 = ".eINSTANCE.get"; + protected final String TEXT_59 = "()," + NL + "\t\t\t\t\tgetDiagramNode().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\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_62 = ".eINSTANCE.get"; + protected final String TEXT_63 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_64 = ".UNSET_VALUE));"; + protected final String TEXT_65 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_66 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_67 = ".eINSTANCE.get"; + protected final String TEXT_68 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_69 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_70 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_71 = ".eINSTANCE.get"; + protected final String TEXT_72 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_73 = ".UNSET_VALUE));"; + protected final String TEXT_74 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_75 = NL + "\t\t\t\treturn "; + protected final String TEXT_76 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_77 = ".eINSTANCE.get"; + protected final String TEXT_78 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_79 = NL + "\t\t\t\treturn "; + protected final String TEXT_80 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_81 = ".eINSTANCE.get"; + protected final String TEXT_82 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_83 = ".UNSET_VALUE);"; + protected final String TEXT_84 = NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_85 = NL + "\t\tinstallEditPolicy("; + protected final String TEXT_86 = ".LAYOUT_ROLE, new "; protected final String TEXT_87 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_88 = " getReconnectTargetCommand("; - protected final String TEXT_89 = " request) {"; - protected final String TEXT_90 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_91 = ".INSTANCE;"; - protected final String TEXT_92 = NL + "\t\t\t\t"; - protected final String TEXT_93 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_94 = " == false) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_95 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_96 = " edge = ("; - protected final String TEXT_97 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_98 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_99 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_100 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_101 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_102 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_103 = NL + "\t\t\t\tcase "; - protected final String TEXT_104 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_105 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_106 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_107 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_108 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_109 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_110 = " getReconnectSourceCommand("; - protected final String TEXT_111 = " request) {"; - protected final String TEXT_112 = " " + NL + "\t\t\t\treturn "; - protected final String TEXT_113 = ".INSTANCE;"; - protected final String TEXT_114 = NL + "\t\t\t\t"; - protected final String TEXT_115 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; - protected final String TEXT_116 = " == false) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_88 = " getCreateCommand("; + protected final String TEXT_89 = " request) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_90 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_91 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_92 = " point) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_93 = " createChangeConstraintCommand("; + protected final String TEXT_94 = " child, Object constraint) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_95 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_96 = " createChildEditPolicy("; + protected final String TEXT_97 = " child) {" + NL + "\t\t\t\treturn new "; + protected final String TEXT_98 = "() {" + NL + "\t\t\t\t\tpublic "; + protected final String TEXT_99 = " getTargetEditPart("; + protected final String TEXT_100 = " request) {" + NL + "\t\t\t\t\t\tif ("; + protected final String TEXT_101 = ".REQ_SELECTION.equals(request.getType())) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_102 = ".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_103 = ".GRAPHICAL_NODE_ROLE, new "; + protected final String TEXT_104 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_105 = " getReconnectTargetCommand("; + protected final String TEXT_106 = " request) {"; + protected final String TEXT_107 = " " + NL + "\t\t\t\treturn "; + protected final String TEXT_108 = ".INSTANCE;"; + protected final String TEXT_109 = NL + "\t\t\t\t"; + protected final String TEXT_110 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; + protected final String TEXT_111 = " == false) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_112 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_113 = " edge = ("; + protected final String TEXT_114 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; + protected final String TEXT_115 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; + protected final String TEXT_116 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; protected final String TEXT_117 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_118 = " edge = ("; - protected final String TEXT_119 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; - protected final String TEXT_120 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; - protected final String TEXT_121 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_122 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; - protected final String TEXT_123 = " result = null;" + NL + "\t\t\t\tint visualID = "; - protected final String TEXT_124 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; - protected final String TEXT_125 = NL + "\t\t\t\tcase "; - protected final String TEXT_126 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; - protected final String TEXT_127 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;"; - protected final String TEXT_128 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_129 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_130 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; - protected final String TEXT_131 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_132 = " getConnectionCreateCommand("; - protected final String TEXT_133 = " request) {"; - protected final String TEXT_134 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_135 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_136 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_137 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_138 = " result = new "; - protected final String TEXT_139 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_140 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_141 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_142 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_143 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1 || !result.canExecute()) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\t//returning an unexecutable command does not change cursor to \"No\"." + NL + "\t\t\t\t\t\treturn null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_144 = " wrappedResult = new WrappingCommand("; - protected final String TEXT_145 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t\trequest.setStartCommand(wrappedResult);" + NL + "\t\t\t\t\treturn wrappedResult;" + NL + "\t\t\t\t}"; - protected final String TEXT_146 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_147 = " getConnectionCompleteCommand("; - protected final String TEXT_148 = " request) {"; - protected final String TEXT_149 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_150 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_151 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_152 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_153 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_154 = " result = new "; - protected final String TEXT_155 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_156 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_157 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_158 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_159 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_160 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_161 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_162 = NL + "\t\t\t\treturn "; - protected final String TEXT_163 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_164 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_165 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_166 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_167 = " invisibleRectangle = new "; - protected final String TEXT_168 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; - protected final String TEXT_169 = "());" + NL + "\t\t"; - protected final String TEXT_170 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_171 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tinvisibleRectangle.add(decorationShape);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_172 = " createNodeShape() {"; - protected final String TEXT_173 = NL + "\t\tprimaryShape = new "; - protected final String TEXT_174 = "()"; - protected final String TEXT_175 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_176 = ";"; - protected final String TEXT_177 = NL + "\t\tprimaryShape = "; - protected final String TEXT_178 = ";"; - protected final String TEXT_179 = NL + "\t\t"; - protected final String TEXT_180 = " figure = new "; - protected final String TEXT_181 = "();"; - protected final String TEXT_182 = NL + " \t\tfigure.setUseLocalCoordinates(true);"; - protected final String TEXT_183 = NL + " \t\tprimaryShape = figure;"; - protected final String TEXT_184 = NL + "\t\treturn primaryShape;" + NL + "\t}"; - protected final String TEXT_185 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_186 = " getPrimaryShape() {" + NL + "\t\treturn ("; - protected final String TEXT_187 = ") primaryShape;" + NL + "\t}"; - protected final String TEXT_188 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_189 = " createDecorationPane() {" + NL + "\t\t"; - protected final String TEXT_190 = " view = ("; - protected final String TEXT_191 = ") getModel();" + NL + "\t\t"; - protected final String TEXT_192 = " annotation = view.getEAnnotation(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_193 = " decorationPane = new "; - protected final String TEXT_194 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; - protected final String TEXT_195 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_196 = " imageFigure = new "; - protected final String TEXT_197 = "("; - protected final String TEXT_198 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; - protected final String TEXT_199 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; - protected final String TEXT_200 = ".BOTTOM);" + NL + " \t\treturn decorationPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Default implementation treats passed figure as content pane." + NL + "\t * Respects layout one may have set for generated figure." + NL + "\t * @param nodeShape instance of generated figure class" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_201 = " setupContentPane("; - protected final String TEXT_202 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; - protected final String TEXT_203 = NL + "\t\t\t"; - protected final String TEXT_204 = " layout = new "; - protected final String TEXT_205 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; - protected final String TEXT_206 = NL + "\t\tnodeShape.setLayoutManager(new "; - protected final String TEXT_207 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; - protected final String TEXT_208 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new "; - protected final String TEXT_209 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_210 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_211 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_212 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_213 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_214 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; - protected final String TEXT_215 = " childEditPart) {"; - protected final String TEXT_216 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_217 = ") {" + NL + "\t\t\t(("; - protected final String TEXT_218 = ") childEditPart)."; - protected final String TEXT_219 = "(getPrimaryShape()."; - protected final String TEXT_220 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_221 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_222 = ") {" + NL + "\t\t\t"; - protected final String TEXT_223 = " pane = getPrimaryShape()."; - protected final String TEXT_224 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add((("; - protected final String TEXT_225 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; - protected final String TEXT_226 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {"; - protected final String TEXT_227 = "\t\t" + NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_228 = ") {" + NL + "\t\t\t"; - protected final String TEXT_229 = " pane = getPrimaryShape()."; - protected final String TEXT_230 = "();" + NL + "\t\t\tpane.remove((("; - protected final String TEXT_231 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; - protected final String TEXT_232 = NL + "\t\treturn false;" + NL + "\t}"; - protected final String TEXT_233 = NL + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_234 = " getPrimaryLabelEditPart() {"; - protected final String TEXT_235 = NL + "\t\tfor("; - protected final String TEXT_236 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_237 = " nextChild = ("; - protected final String TEXT_238 = ")it.next();" + NL + "\t\t\tif ("; - protected final String TEXT_239 = ".getVisualID(nextChild) == "; - protected final String TEXT_240 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_241 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_242 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_243 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_244 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; - protected final String TEXT_245 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; - protected final String TEXT_246 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; - protected final String TEXT_247 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_248 = " getLabelEditPart("; - protected final String TEXT_249 = " req) {" + NL + "\t\t"; - protected final String TEXT_250 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; - protected final String TEXT_251 = " view = ("; - protected final String TEXT_252 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; - protected final String TEXT_253 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; - protected final String TEXT_254 = NL + "\t\t\t\tcase "; - protected final String TEXT_255 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; - protected final String TEXT_256 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; - protected final String TEXT_257 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; - protected final String TEXT_258 = " childEditPart) {"; - protected final String TEXT_259 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_260 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_261 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_262 = " getExternalLabelsContainer() {" + NL + "\t\t"; - protected final String TEXT_263 = " root = ("; - protected final String TEXT_264 = ") getRoot();" + NL + "\t\treturn root.getLayer("; - protected final String TEXT_265 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; - protected final String TEXT_266 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; - protected final String TEXT_267 = " childEditPart, int index) {"; - protected final String TEXT_268 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_269 = " labelFigure = (("; - protected final String TEXT_270 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_271 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_272 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; - protected final String TEXT_273 = " childEditPart) {"; - protected final String TEXT_274 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_275 = " labelFigure = (("; - protected final String TEXT_276 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_277 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_278 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; - protected final String TEXT_279 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; - protected final String TEXT_280 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; - protected final String TEXT_281 = " childEditPart = ("; - protected final String TEXT_282 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; - protected final String TEXT_283 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; - protected final String TEXT_284 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t\trefreshBackgroundColor();" + NL + "\t\trefreshForegroundColor();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\t"; - protected final String TEXT_285 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; - protected final String TEXT_286 = ";" + NL + "\t\t"; - protected final String TEXT_287 = " bounds = ("; - protected final String TEXT_288 = ") node.getLayoutConstraint();" + NL + "\t\t(("; - protected final String TEXT_289 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; - protected final String TEXT_290 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_291 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_292 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_293 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_294 = " getSourceConnectionAnchor("; - protected final String TEXT_295 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_296 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_297 = " getSourceConnectionAnchor("; - protected final String TEXT_298 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_299 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_300 = " getTargetConnectionAnchor("; - protected final String TEXT_301 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_302 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_303 = " getTargetConnectionAnchor("; - protected final String TEXT_304 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_305 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; - protected final String TEXT_306 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);"; - protected final String TEXT_307 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_308 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; - protected final String TEXT_309 = NL + "\t\tuninstallLinkNotationModelRefresher();"; - protected final String TEXT_310 = NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}"; - protected final String TEXT_311 = NL; - protected final String TEXT_312 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_313 = " domainModelEditDomain = "; - protected final String TEXT_314 = ".getEditingDomain("; - protected final String TEXT_315 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; - protected final String TEXT_316 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_317 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_318 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_319 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; - protected final String TEXT_320 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_321 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_322 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_323 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_324 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_325 = ".createEventTypeFilter("; - protected final String TEXT_326 = ".SET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_327 = ".createEventTypeFilter("; - protected final String TEXT_328 = ".UNSET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_329 = ".createEventTypeFilter("; - protected final String TEXT_330 = ".REMOVE).or(" + NL + "\t\t\t\t"; - protected final String TEXT_331 = ".createEventTypeFilter("; - protected final String TEXT_332 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; - protected final String TEXT_333 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_334 = NL; - protected final String TEXT_335 = NL + "\t\t\tfilter = "; - protected final String TEXT_336 = ".createFeatureFilter("; - protected final String TEXT_337 = ".eINSTANCE.get"; - protected final String TEXT_338 = "());"; - protected final String TEXT_339 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_340 = ".createFeatureFilter("; - protected final String TEXT_341 = ".eINSTANCE.get"; - protected final String TEXT_342 = "()));"; - protected final String TEXT_343 = NL; - protected final String TEXT_344 = NL + "\t\t\tfilter = "; - protected final String TEXT_345 = ".createFeatureFilter("; - protected final String TEXT_346 = ".eINSTANCE.get"; - protected final String TEXT_347 = "());"; - protected final String TEXT_348 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_349 = ".createFeatureFilter("; - protected final String TEXT_350 = ".eINSTANCE.get"; - protected final String TEXT_351 = "()));"; - protected final String TEXT_352 = NL; - protected final String TEXT_353 = NL + "\t\t\tfilter = "; - protected final String TEXT_354 = ".createFeatureFilter("; - protected final String TEXT_355 = ".eINSTANCE.get"; - protected final String TEXT_356 = "());"; - protected final String TEXT_357 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_358 = ".createFeatureFilter("; - protected final String TEXT_359 = ".eINSTANCE.get"; - protected final String TEXT_360 = "()));"; - protected final String TEXT_361 = NL; - protected final String TEXT_362 = NL + "\t\t\tfilter = "; - protected final String TEXT_363 = ".createFeatureFilter("; - protected final String TEXT_364 = ".eINSTANCE.get"; - protected final String TEXT_365 = "());"; - protected final String TEXT_366 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_367 = ".createFeatureFilter("; - protected final String TEXT_368 = ".eINSTANCE.get"; - protected final String TEXT_369 = "()));"; - protected final String TEXT_370 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; - protected final String TEXT_371 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; - protected final String TEXT_372 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; - protected final String TEXT_373 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; - protected final String TEXT_374 = NL + "\t\t\tfilter = "; - protected final String TEXT_375 = ".ANY.negated();"; - protected final String TEXT_376 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_377 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_378 = " transactionAboutToCommit("; - protected final String TEXT_379 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_380 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; - protected final String TEXT_381 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_382 = " domainModelEditDomain = "; - protected final String TEXT_383 = ".getEditingDomain("; - protected final String TEXT_384 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; - protected final String TEXT_385 = NL; - protected final String TEXT_386 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_387 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_388 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_389 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor("; - protected final String TEXT_390 = " source, "; - protected final String TEXT_391 = " destination, "; - protected final String TEXT_392 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor("; - protected final String TEXT_393 = " source, "; - protected final String TEXT_394 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_395 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_396 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_397 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_398 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_399 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; - protected final String TEXT_400 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; - protected final String TEXT_401 = " semanticToNotationalTypeBasedLinks = new "; - protected final String TEXT_402 = "();" + NL + "\t\tfinal "; - protected final String TEXT_403 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; - protected final String TEXT_404 = "();" + NL + "\t\tfor("; - protected final String TEXT_405 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_406 = " next = ("; - protected final String TEXT_407 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_408 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_409 = " featureBasedLinksForSource = ("; - protected final String TEXT_410 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; - protected final String TEXT_411 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_412 = " parentView = "; - protected final String TEXT_413 = ";" + NL + "\t\t"; - protected final String TEXT_414 = " command = new "; - protected final String TEXT_415 = "();" + NL + "\t\tfor("; - protected final String TEXT_416 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; - protected final String TEXT_417 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; - protected final String TEXT_418 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; - protected final String TEXT_419 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_420 = " featureBasedLinksForSource = ("; - protected final String TEXT_421 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = ("; - protected final String TEXT_422 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != "; - protected final String TEXT_423 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_424 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_425 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_426 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_427 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_428 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_429 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_430 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_431 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_432 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_433 = " obsoleteView = ("; - protected final String TEXT_434 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_435 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_436 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_437 = " obsoleteViews = ("; - protected final String TEXT_438 = ") it.next();" + NL + "\t\t\tfor("; - protected final String TEXT_439 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; - protected final String TEXT_440 = " obsoleteView = ("; - protected final String TEXT_441 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_442 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_443 = " findView("; - protected final String TEXT_444 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_445 = " editPart = ("; - protected final String TEXT_446 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; - protected final String TEXT_447 = ") {" + NL + "\t\t\treturn ("; - protected final String TEXT_448 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_449 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; - protected final String TEXT_450 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_451 = " findNode("; - protected final String TEXT_452 = " parentView, "; - protected final String TEXT_453 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_454 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_455 = " next = ("; - protected final String TEXT_456 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; - protected final String TEXT_457 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_458 = " findEdge("; - protected final String TEXT_459 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_460 = " it = "; - protected final String TEXT_461 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_462 = " next = ("; - protected final String TEXT_463 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_464 = " getCreateNotationalEdgeCommand("; - protected final String TEXT_465 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; - protected final String TEXT_466 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; - protected final String TEXT_467 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_468 = " createdEdge = "; - protected final String TEXT_469 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; - protected final String TEXT_470 = NL + "\t\tcase "; - protected final String TEXT_471 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; - protected final String TEXT_472 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; - protected final String TEXT_473 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_474 = NL + "\t\tcase "; - protected final String TEXT_475 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t"; - protected final String TEXT_476 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_477 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new "; - protected final String TEXT_478 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_479 = " getSemanticChildLinks() {"; - protected final String TEXT_480 = NL; - protected final String TEXT_481 = "\t"; - protected final String TEXT_482 = " result = new "; - protected final String TEXT_483 = "();"; - protected final String TEXT_484 = NL + "\t"; - protected final String TEXT_485 = " modelObject = "; - protected final String TEXT_486 = ";" + NL + "\t"; - protected final String TEXT_487 = " nextValue;"; - protected final String TEXT_488 = NL + "\tint linkVID;"; - protected final String TEXT_489 = NL + "\tfor("; - protected final String TEXT_490 = " it = (("; - protected final String TEXT_491 = ")modelObject)."; - protected final String TEXT_492 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_493 = ") it.next();"; - protected final String TEXT_494 = NL + "\tnextValue = (("; - protected final String TEXT_495 = ")modelObject)."; - protected final String TEXT_496 = "();"; - protected final String TEXT_497 = NL + "\tlinkVID = "; - protected final String TEXT_498 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; - protected final String TEXT_499 = NL + "\tswitch (linkVID) {"; - protected final String TEXT_500 = NL + "\tcase "; - protected final String TEXT_501 = ".VISUAL_ID: {"; - protected final String TEXT_502 = NL + "\tif ("; - protected final String TEXT_503 = ".VISUAL_ID == linkVID) {"; - protected final String TEXT_504 = NL + "\t\t"; - protected final String TEXT_505 = " source = (("; - protected final String TEXT_506 = ")nextValue)."; - protected final String TEXT_507 = "();"; - protected final String TEXT_508 = NL + "\t\t"; - protected final String TEXT_509 = " source = "; - protected final String TEXT_510 = ";"; - protected final String TEXT_511 = NL + "\t\t"; - protected final String TEXT_512 = " target = (("; - protected final String TEXT_513 = ")nextValue)."; - protected final String TEXT_514 = "();"; - protected final String TEXT_515 = NL + "\t\t"; - protected final String TEXT_516 = " target = "; - protected final String TEXT_517 = ";"; - protected final String TEXT_518 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}"; - protected final String TEXT_519 = NL + "\t\tbreak;" + NL + "\t}"; - protected final String TEXT_520 = NL + "\t}"; - protected final String TEXT_521 = NL + "\t}"; - protected final String TEXT_522 = NL + "\t}"; - protected final String TEXT_523 = NL + "\tfor("; - protected final String TEXT_524 = " it = (("; - protected final String TEXT_525 = ")modelObject)."; - protected final String TEXT_526 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_527 = ") it.next();"; - protected final String TEXT_528 = NL + "\tnextValue = (("; - protected final String TEXT_529 = ")modelObject)."; - protected final String TEXT_530 = "();"; - protected final String TEXT_531 = NL + "\tif (nextValue != null) {"; - protected final String TEXT_532 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; - protected final String TEXT_533 = ".VISUAL_ID));"; - protected final String TEXT_534 = NL + "\t}"; - protected final String TEXT_535 = NL + "\t}"; - protected final String TEXT_536 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_537 = " getNotationalChildLinks() {" + NL + "\t\t"; - protected final String TEXT_538 = " result = new "; - protected final String TEXT_539 = "();" + NL + "\t\t"; - protected final String TEXT_540 = " allLinks = "; - protected final String TEXT_541 = ".getEdges();" + NL + "\t\tfor("; - protected final String TEXT_542 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_543 = " next = ("; - protected final String TEXT_544 = ") it.next();"; - protected final String TEXT_545 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_546 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_547 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}"; - protected final String TEXT_548 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; - protected final String TEXT_549 = ") {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_550 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_551 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_552 = ".VISUAL_ID:"; - protected final String TEXT_553 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; - protected final String TEXT_554 = NL + "\t\t\t} else {"; - protected final String TEXT_555 = NL + "\t\t\t}"; - protected final String TEXT_556 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; - protected final String TEXT_557 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; - protected final String TEXT_558 = ") {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_559 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_560 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_561 = ".VISUAL_ID:"; - protected final String TEXT_562 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}"; - protected final String TEXT_563 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_564 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_565 = ";" + NL + "\t}"; - protected final String TEXT_566 = NL; - protected final String TEXT_567 = NL; - protected final String TEXT_568 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_569 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_570 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_571 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_572 = NL; - protected final String TEXT_573 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; - protected final String TEXT_574 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher("; - protected final String TEXT_575 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; - protected final String TEXT_576 = " feature) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\tRefresher refresher = (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t\tif (refresher instanceof CompositeRefresher) {" + NL + "\t\t\treturn (CompositeRefresher) refresher;" + NL + "\t\t}" + NL + "\t\tCompositeRefresher result = new CompositeRefresher();" + NL + "\t\tif (refresher != null) {" + NL + "\t\t\tresult.addRefresher(refresher);" + NL + "\t\t}" + NL + "\t\tstructuralFeatures2Refresher.put(feature, result);" + NL + "\t\treturn result;" + NL + "\t}" + NL; - protected final String TEXT_577 = NL; - protected final String TEXT_578 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_579 = NL + "\t\t"; - protected final String TEXT_580 = " style =" + NL + "\t\t\t("; - protected final String TEXT_581 = ") "; - protected final String TEXT_582 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_583 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_584 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; - protected final String TEXT_585 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_586 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_587 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_588 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_589 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; - protected final String TEXT_590 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; - protected final String TEXT_591 = "\t" + NL + "\t}"; - protected final String TEXT_592 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_593 = " createdFont;"; - protected final String TEXT_594 = "\t" + NL; - protected final String TEXT_595 = NL; - protected final String TEXT_596 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; - protected final String TEXT_597 = " style = ("; - protected final String TEXT_598 = ") "; - protected final String TEXT_599 = ".getStyle("; - protected final String TEXT_600 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; - protected final String TEXT_601 = " toDispose = createdForegroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint foregroundColor = style.getLineColor();" + NL + "\t\t\tint red = foregroundColor & 0x000000FF;" + NL + "\t\t\tint green = (foregroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (foregroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_602 = " currentColor = getFigure().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedForegroundColor = new "; - protected final String TEXT_603 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdForegroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedForegroundColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshForegroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_604 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; - protected final String TEXT_605 = " style = ("; - protected final String TEXT_606 = ") "; - protected final String TEXT_607 = ".getStyle("; - protected final String TEXT_608 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; - protected final String TEXT_609 = " toDispose = createdBackgroundColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint backgroundColor = style.getFillColor();" + NL + "\t\t\tint red = backgroundColor & 0x000000FF;" + NL + "\t\t\tint green = (backgroundColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (backgroundColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_610 = " currentColor = getFigure().getBackgroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedBackgroundColor = new "; - protected final String TEXT_611 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setBackgroundColor(createdBackgroundColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setBackgroundColor(getViewer().getControl().getBackground());" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshBackgroundColor()}) currently assigned to the figure." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_612 = " createdBackgroundColor;" + NL; - protected final String TEXT_613 = NL; - protected final String TEXT_614 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_615 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_616 = " feature, "; - protected final String TEXT_617 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new "; - protected final String TEXT_618 = "();"; - protected final String TEXT_619 = NL; - protected final String TEXT_620 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_621 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_622 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_623 = NL; - protected final String TEXT_624 = "\t\tRefresher boundsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBounds();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_625 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_626 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_627 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_628 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_629 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; - protected final String TEXT_630 = NL; - protected final String TEXT_631 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_632 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; - protected final String TEXT_633 = NL; - protected final String TEXT_634 = "\t\tRefresher sourceEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshSourceConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_635 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; - protected final String TEXT_636 = NL; - protected final String TEXT_637 = "\t\tRefresher targetEdgesRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshTargetConnections();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_638 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; - protected final String TEXT_639 = NL; - protected final String TEXT_640 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_641 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_642 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_643 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_644 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_118 = " result = null;" + NL + "\t\t\t\tint visualID = "; + protected final String TEXT_119 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; + protected final String TEXT_120 = NL + "\t\t\t\tcase "; + protected final String TEXT_121 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; + protected final String TEXT_122 = "TargetCommand(request);" + NL + "\t\t\t\t\tbreak;"; + protected final String TEXT_123 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_124 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_125 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; + protected final String TEXT_126 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_127 = " getReconnectSourceCommand("; + protected final String TEXT_128 = " request) {"; + protected final String TEXT_129 = " " + NL + "\t\t\t\treturn "; + protected final String TEXT_130 = ".INSTANCE;"; + protected final String TEXT_131 = NL + "\t\t\t\t"; + protected final String TEXT_132 = " connection = request.getConnectionEditPart();" + NL + "\t\t\t\tif (connection.getModel() instanceof "; + protected final String TEXT_133 = " == false) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_134 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_135 = " edge = ("; + protected final String TEXT_136 = ")connection.getModel();" + NL + "\t\t\t\tString modelID = "; + protected final String TEXT_137 = ".getModelID(edge);" + NL + "\t\t\t\tif (!"; + protected final String TEXT_138 = ".MODEL_ID.equals(modelID)) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_139 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t"; + protected final String TEXT_140 = " result = null;" + NL + "\t\t\t\tint visualID = "; + protected final String TEXT_141 = ".getVisualID(edge);" + NL + "\t\t\t\tswitch (visualID) {"; + protected final String TEXT_142 = NL + "\t\t\t\tcase "; + protected final String TEXT_143 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult = new Reconnect"; + protected final String TEXT_144 = "SourceCommand(request);" + NL + "\t\t\t\t\tbreak;"; + protected final String TEXT_145 = NL + "\t\t\t\t}" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_146 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_147 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);"; + protected final String TEXT_148 = NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_149 = " getConnectionCreateCommand("; + protected final String TEXT_150 = " request) {"; + protected final String TEXT_151 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_152 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_153 = ".CreateConnectionRequestEx requestEx = ("; + protected final String TEXT_154 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_155 = " result = new "; + protected final String TEXT_156 = "();" + 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_157 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_158 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_159 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_160 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1 || !result.canExecute()) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\t//returning an unexecutable command does not change cursor to \"No\"." + NL + "\t\t\t\t\t\treturn null;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; + protected final String TEXT_161 = " wrappedResult = new WrappingCommand("; + protected final String TEXT_162 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t\trequest.setStartCommand(wrappedResult);" + NL + "\t\t\t\t\treturn wrappedResult;" + NL + "\t\t\t\t}"; + protected final String TEXT_163 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_164 = " getConnectionCompleteCommand("; + protected final String TEXT_165 = " request) {"; + protected final String TEXT_166 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_167 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_168 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_169 = ".CreateConnectionRequestEx requestEx = ("; + protected final String TEXT_170 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_171 = " result = new "; + protected final String TEXT_172 = "();" + 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_173 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_174 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_175 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_176 = 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_177 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_178 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_179 = NL + "\t\t\t\treturn "; + protected final String TEXT_180 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_181 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_182 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_183 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_184 = " invisibleRectangle = new "; + protected final String TEXT_185 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; + protected final String TEXT_186 = "());" + NL + "\t\t"; + protected final String TEXT_187 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; + protected final String TEXT_188 = " 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_189 = " createNodeShape() {"; + protected final String TEXT_190 = NL + "\t\tprimaryShape = new "; + protected final String TEXT_191 = "()"; + protected final String TEXT_192 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_193 = ";"; + protected final String TEXT_194 = NL + "\t\tprimaryShape = "; + protected final String TEXT_195 = ";"; + protected final String TEXT_196 = NL + "\t\t"; + protected final String TEXT_197 = " figure = new "; + protected final String TEXT_198 = "();"; + protected final String TEXT_199 = NL + " \t\tfigure.setUseLocalCoordinates(true);"; + protected final String TEXT_200 = NL + " \t\tprimaryShape = figure;"; + protected final String TEXT_201 = NL + "\t\treturn primaryShape;" + NL + "\t}"; + protected final String TEXT_202 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_203 = " getPrimaryShape() {" + NL + "\t\treturn ("; + protected final String TEXT_204 = ") primaryShape;" + NL + "\t}"; + protected final String TEXT_205 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_206 = " createDecorationPane() {" + NL + "\t\t"; + protected final String TEXT_207 = " view = ("; + protected final String TEXT_208 = ") getModel();" + NL + "\t\t"; + protected final String TEXT_209 = " 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_210 = " decorationPane = new "; + protected final String TEXT_211 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; + protected final String TEXT_212 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_213 = " imageFigure = new "; + protected final String TEXT_214 = "("; + protected final String TEXT_215 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; + protected final String TEXT_216 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; + protected final String TEXT_217 = ".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_218 = " setupContentPane("; + protected final String TEXT_219 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; + protected final String TEXT_220 = NL + "\t\t\t"; + protected final String TEXT_221 = " layout = new "; + protected final String TEXT_222 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; + protected final String TEXT_223 = NL + "\t\tnodeShape.setLayoutManager(new "; + protected final String TEXT_224 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; + protected final String TEXT_225 = " 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_226 = "(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_227 = 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_228 = " 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_229 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_230 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_231 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; + protected final String TEXT_232 = " childEditPart) {"; + protected final String TEXT_233 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_234 = ") {" + NL + "\t\t\t(("; + protected final String TEXT_235 = ") childEditPart)."; + protected final String TEXT_236 = "(getPrimaryShape()."; + protected final String TEXT_237 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_238 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_239 = ") {" + NL + "\t\t\t"; + protected final String TEXT_240 = " pane = getPrimaryShape()."; + protected final String TEXT_241 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add((("; + protected final String TEXT_242 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; + protected final String TEXT_243 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {"; + protected final String TEXT_244 = "\t\t" + NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_245 = ") {" + NL + "\t\t\t"; + protected final String TEXT_246 = " pane = getPrimaryShape()."; + protected final String TEXT_247 = "();" + NL + "\t\t\tpane.remove((("; + protected final String TEXT_248 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t"; + protected final String TEXT_249 = NL + "\t\treturn false;" + NL + "\t}"; + protected final String TEXT_250 = 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_251 = " getPrimaryLabelEditPart() {"; + protected final String TEXT_252 = NL + "\t\tfor("; + protected final String TEXT_253 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_254 = " nextChild = ("; + protected final String TEXT_255 = ")it.next();" + NL + "\t\t\tif ("; + protected final String TEXT_256 = ".getVisualID(nextChild) == "; + protected final String TEXT_257 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_258 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_259 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_260 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_261 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; + protected final String TEXT_262 = " labelToEdit;" + NL + "\t\t\tif (req instanceof "; + protected final String TEXT_263 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart(("; + protected final String TEXT_264 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_265 = " getLabelEditPart("; + protected final String TEXT_266 = " req) {" + NL + "\t\t"; + protected final String TEXT_267 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; + protected final String TEXT_268 = " view = ("; + protected final String TEXT_269 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; + protected final String TEXT_270 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; + protected final String TEXT_271 = NL + "\t\t\t\tcase "; + protected final String TEXT_272 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; + protected final String TEXT_273 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; + protected final String TEXT_274 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; + protected final String TEXT_275 = " childEditPart) {"; + protected final String TEXT_276 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_277 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_278 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_279 = " getExternalLabelsContainer() {" + NL + "\t\t"; + protected final String TEXT_280 = " root = ("; + protected final String TEXT_281 = ") getRoot();" + NL + "\t\treturn root.getLayer("; + protected final String TEXT_282 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; + protected final String TEXT_283 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; + protected final String TEXT_284 = " childEditPart, int index) {"; + protected final String TEXT_285 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_286 = " labelFigure = (("; + protected final String TEXT_287 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_288 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_289 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; + protected final String TEXT_290 = " childEditPart) {"; + protected final String TEXT_291 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_292 = " labelFigure = (("; + protected final String TEXT_293 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_294 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_295 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; + protected final String TEXT_296 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; + protected final String TEXT_297 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; + protected final String TEXT_298 = " childEditPart = ("; + protected final String TEXT_299 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; + protected final String TEXT_300 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; + protected final String TEXT_301 = 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_302 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; + protected final String TEXT_303 = ";" + NL + "\t\t"; + protected final String TEXT_304 = " bounds = ("; + protected final String TEXT_305 = ") node.getLayoutConstraint();" + NL + "\t\t(("; + protected final String TEXT_306 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; + protected final String TEXT_307 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_308 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_309 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_310 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_311 = " getSourceConnectionAnchor("; + protected final String TEXT_312 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_313 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_314 = " getSourceConnectionAnchor("; + protected final String TEXT_315 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_316 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_317 = " getTargetConnectionAnchor("; + protected final String TEXT_318 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_319 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_320 = " getTargetConnectionAnchor("; + protected final String TEXT_321 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_322 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; + protected final String TEXT_323 = 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);"; + protected final String TEXT_324 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_325 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; + protected final String TEXT_326 = NL + "\t\tuninstallLinkNotationModelRefresher();"; + protected final String TEXT_327 = NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}"; + protected final String TEXT_328 = NL; + protected final String TEXT_329 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_330 = " domainModelEditDomain = "; + protected final String TEXT_331 = ".getEditingDomain("; + protected final String TEXT_332 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; + protected final String TEXT_333 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_334 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_335 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; + protected final String TEXT_336 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; + protected final String TEXT_337 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_338 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_339 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_340 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_341 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_342 = ".createEventTypeFilter("; + protected final String TEXT_343 = ".SET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_344 = ".createEventTypeFilter("; + protected final String TEXT_345 = ".UNSET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_346 = ".createEventTypeFilter("; + protected final String TEXT_347 = ".REMOVE).or(" + NL + "\t\t\t\t"; + protected final String TEXT_348 = ".createEventTypeFilter("; + protected final String TEXT_349 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; + protected final String TEXT_350 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; + protected final String TEXT_351 = NL; + protected final String TEXT_352 = NL + "\t\t\tfilter = "; + protected final String TEXT_353 = ".createFeatureFilter("; + protected final String TEXT_354 = ".eINSTANCE.get"; + protected final String TEXT_355 = "());"; + protected final String TEXT_356 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_357 = ".createFeatureFilter("; + protected final String TEXT_358 = ".eINSTANCE.get"; + protected final String TEXT_359 = "()));"; + protected final String TEXT_360 = NL; + protected final String TEXT_361 = NL + "\t\t\tfilter = "; + protected final String TEXT_362 = ".createFeatureFilter("; + protected final String TEXT_363 = ".eINSTANCE.get"; + protected final String TEXT_364 = "());"; + protected final String TEXT_365 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_366 = ".createFeatureFilter("; + protected final String TEXT_367 = ".eINSTANCE.get"; + protected final String TEXT_368 = "()));"; + protected final String TEXT_369 = NL; + protected final String TEXT_370 = NL + "\t\t\tfilter = "; + protected final String TEXT_371 = ".createFeatureFilter("; + protected final String TEXT_372 = ".eINSTANCE.get"; + protected final String TEXT_373 = "());"; + protected final String TEXT_374 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_375 = ".createFeatureFilter("; + protected final String TEXT_376 = ".eINSTANCE.get"; + protected final String TEXT_377 = "()));"; + protected final String TEXT_378 = NL; + protected final String TEXT_379 = NL + "\t\t\tfilter = "; + protected final String TEXT_380 = ".createFeatureFilter("; + protected final String TEXT_381 = ".eINSTANCE.get"; + protected final String TEXT_382 = "());"; + protected final String TEXT_383 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_384 = ".createFeatureFilter("; + protected final String TEXT_385 = ".eINSTANCE.get"; + protected final String TEXT_386 = "()));"; + protected final String TEXT_387 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; + protected final String TEXT_388 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; + protected final String TEXT_389 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; + protected final String TEXT_390 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; + protected final String TEXT_391 = NL + "\t\t\tfilter = "; + protected final String TEXT_392 = ".ANY.negated();"; + protected final String TEXT_393 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_394 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_395 = " transactionAboutToCommit("; + protected final String TEXT_396 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_397 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; + protected final String TEXT_398 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_399 = " domainModelEditDomain = "; + protected final String TEXT_400 = ".getEditingDomain("; + protected final String TEXT_401 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; + protected final String TEXT_402 = NL; + protected final String TEXT_403 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_404 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_405 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_406 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor("; + protected final String TEXT_407 = " source, "; + protected final String TEXT_408 = " destination, "; + protected final String TEXT_409 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor("; + protected final String TEXT_410 = " source, "; + protected final String TEXT_411 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_412 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_413 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_414 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_415 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_416 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; + protected final String TEXT_417 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; + protected final String TEXT_418 = " semanticToNotationalTypeBasedLinks = new "; + protected final String TEXT_419 = "();" + NL + "\t\tfinal "; + protected final String TEXT_420 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; + protected final String TEXT_421 = "();" + NL + "\t\tfor("; + protected final String TEXT_422 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_423 = " next = ("; + protected final String TEXT_424 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_425 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_426 = " featureBasedLinksForSource = ("; + protected final String TEXT_427 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; + protected final String TEXT_428 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_429 = " parentView = "; + protected final String TEXT_430 = ";" + NL + "\t\t"; + protected final String TEXT_431 = " command = new "; + protected final String TEXT_432 = "();" + NL + "\t\tfor("; + protected final String TEXT_433 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; + protected final String TEXT_434 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; + protected final String TEXT_435 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; + protected final String TEXT_436 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_437 = " featureBasedLinksForSource = ("; + protected final String TEXT_438 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = ("; + protected final String TEXT_439 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != "; + protected final String TEXT_440 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_441 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_442 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_443 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_444 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_445 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_446 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_447 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_448 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_449 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_450 = " obsoleteView = ("; + protected final String TEXT_451 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_452 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_453 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_454 = " obsoleteViews = ("; + protected final String TEXT_455 = ") it.next();" + NL + "\t\t\tfor("; + protected final String TEXT_456 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; + protected final String TEXT_457 = " obsoleteView = ("; + protected final String TEXT_458 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_459 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_460 = " findView("; + protected final String TEXT_461 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_462 = " editPart = ("; + protected final String TEXT_463 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; + protected final String TEXT_464 = ") {" + NL + "\t\t\treturn ("; + protected final String TEXT_465 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_466 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; + protected final String TEXT_467 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_468 = " findNode("; + protected final String TEXT_469 = " parentView, "; + protected final String TEXT_470 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_471 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_472 = " next = ("; + protected final String TEXT_473 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; + protected final String TEXT_474 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_475 = " findEdge("; + protected final String TEXT_476 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_477 = " it = "; + protected final String TEXT_478 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_479 = " next = ("; + protected final String TEXT_480 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_481 = " getCreateNotationalEdgeCommand("; + protected final String TEXT_482 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; + protected final String TEXT_483 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; + protected final String TEXT_484 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_485 = " createdEdge = "; + protected final String TEXT_486 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; + protected final String TEXT_487 = NL + "\t\tcase "; + protected final String TEXT_488 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; + protected final String TEXT_489 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; + protected final String TEXT_490 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_491 = NL + "\t\tcase "; + protected final String TEXT_492 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t"; + protected final String TEXT_493 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_494 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new "; + protected final String TEXT_495 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_496 = " getSemanticChildLinks() {"; + protected final String TEXT_497 = NL; + protected final String TEXT_498 = "\t"; + protected final String TEXT_499 = " result = new "; + protected final String TEXT_500 = "();"; + protected final String TEXT_501 = NL + "\t"; + protected final String TEXT_502 = " modelObject = "; + protected final String TEXT_503 = ".getElement();" + NL + "\t"; + protected final String TEXT_504 = " nextValue;"; + protected final String TEXT_505 = NL + "\tint linkVID;"; + protected final String TEXT_506 = NL + "\tfor("; + protected final String TEXT_507 = " it = "; + protected final String TEXT_508 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_509 = ") it.next();"; + protected final String TEXT_510 = NL + "\tnextValue = ("; + protected final String TEXT_511 = ")"; + protected final String TEXT_512 = ";"; + protected final String TEXT_513 = NL + "\tlinkVID = "; + protected final String TEXT_514 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_515 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_516 = NL + "\tcase "; + protected final String TEXT_517 = ".VISUAL_ID: {"; + protected final String TEXT_518 = NL + "\tif ("; + protected final String TEXT_519 = ".VISUAL_ID == linkVID) {"; + protected final String TEXT_520 = NL + "\t\t"; + protected final String TEXT_521 = " source = ("; + protected final String TEXT_522 = ")"; + protected final String TEXT_523 = ";"; + protected final String TEXT_524 = NL + "\t\t"; + protected final String TEXT_525 = " source = "; + protected final String TEXT_526 = ".getElement();"; + protected final String TEXT_527 = NL + "\t\t"; + protected final String TEXT_528 = " target = ("; + protected final String TEXT_529 = ")"; + protected final String TEXT_530 = ";"; + protected final String TEXT_531 = NL + "\t\t"; + protected final String TEXT_532 = " target = "; + protected final String TEXT_533 = ".getElement();"; + protected final String TEXT_534 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}"; + protected final String TEXT_535 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_536 = NL + "\t}"; + protected final String TEXT_537 = NL + "\t}"; + protected final String TEXT_538 = NL + "\t}"; + protected final String TEXT_539 = NL + "\tfor("; + protected final String TEXT_540 = " it = "; + protected final String TEXT_541 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_542 = ") it.next();"; + protected final String TEXT_543 = NL + "\tnextValue = ("; + protected final String TEXT_544 = ")"; + protected final String TEXT_545 = ";"; + protected final String TEXT_546 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_547 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; + protected final String TEXT_548 = ".VISUAL_ID));"; + protected final String TEXT_549 = NL + "\t}"; + protected final String TEXT_550 = NL + "\t}"; + protected final String TEXT_551 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_552 = " getNotationalChildLinks() {" + NL + "\t\t"; + protected final String TEXT_553 = " result = new "; + protected final String TEXT_554 = "();" + NL + "\t\t"; + protected final String TEXT_555 = " allLinks = "; + protected final String TEXT_556 = ".getEdges();" + NL + "\t\tfor("; + protected final String TEXT_557 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_558 = " next = ("; + protected final String TEXT_559 = ") it.next();"; + protected final String TEXT_560 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_561 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_562 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}"; + protected final String TEXT_563 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; + protected final String TEXT_564 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_565 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_566 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_567 = ".VISUAL_ID:"; + protected final String TEXT_568 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; + protected final String TEXT_569 = NL + "\t\t\t} else {"; + protected final String TEXT_570 = NL + "\t\t\t}"; + protected final String TEXT_571 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; + protected final String TEXT_572 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; + protected final String TEXT_573 = ".getElement()) {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_574 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_575 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_576 = ".VISUAL_ID:"; + protected final String TEXT_577 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}"; + protected final String TEXT_578 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns "; + protected final String TEXT_579 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn "; + protected final String TEXT_580 = ";" + NL + "\t}"; + protected final String TEXT_581 = NL; + protected final String TEXT_582 = NL; + protected final String TEXT_583 = "\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_584 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_585 = " 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_586 = ") 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_587 = NL; + protected final String TEXT_588 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher("; + protected final String TEXT_589 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher("; + protected final String TEXT_590 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; + protected final String TEXT_591 = " 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_592 = NL; + protected final String TEXT_593 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_594 = NL + "\t\t"; + protected final String TEXT_595 = " style =" + NL + "\t\t\t("; + protected final String TEXT_596 = ") "; + protected final String TEXT_597 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_598 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_599 = " 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_600 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_601 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_602 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_603 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_604 = " 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_605 = "(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}"; + protected final String TEXT_606 = "\t" + NL + "\t}"; + protected final String TEXT_607 = 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_608 = " createdFont;"; + protected final String TEXT_609 = "\t" + NL; + protected final String TEXT_610 = NL; + protected final String TEXT_611 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; + protected final String TEXT_612 = " style = ("; + protected final String TEXT_613 = ") "; + protected final String TEXT_614 = ".getStyle("; + protected final String TEXT_615 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; + protected final String TEXT_616 = " 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_617 = " 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_618 = "(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_619 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; + protected final String TEXT_620 = " style = ("; + protected final String TEXT_621 = ") "; + protected final String TEXT_622 = ".getStyle("; + protected final String TEXT_623 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; + protected final String TEXT_624 = " 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_625 = " 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_626 = "(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_627 = " createdBackgroundColor;" + NL; + protected final String TEXT_628 = NL; + protected final String TEXT_629 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_630 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_631 = " feature, "; + protected final String TEXT_632 = " 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_633 = "();"; + protected final String TEXT_634 = NL; + protected final String TEXT_635 = "\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_636 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_637 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_638 = NL; + protected final String TEXT_639 = "\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_640 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_641 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_642 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_643 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_644 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; protected final String TEXT_645 = NL; - protected final String TEXT_646 = "\t\tRefresher backgroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBackgroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_647 = ".eINSTANCE.getFillStyle_FillColor(), backgroundColorRefresher);" + NL + "\t\tRefresher foregroundColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshForegroundColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_648 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; - protected final String TEXT_649 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; - protected final String TEXT_650 = "SourceCommand extends "; - protected final String TEXT_651 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_652 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_653 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_654 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_655 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_656 = "SourceCommand("; - protected final String TEXT_657 = " request) {" + NL + "\t\t\tthis(("; - protected final String TEXT_658 = ")request.getConnectionEditPart().getModel(), ("; - protected final String TEXT_659 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_660 = "SourceCommand("; - protected final String TEXT_661 = " edge, "; - protected final String TEXT_662 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; - protected final String TEXT_663 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; - protected final String TEXT_664 = " domainModelEditDomain = "; - protected final String TEXT_665 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_666 = " command = new "; - protected final String TEXT_667 = "() {" + NL + "\t\t\t\tprivate "; - protected final String TEXT_668 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; - protected final String TEXT_669 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; - protected final String TEXT_670 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; - protected final String TEXT_671 = NL + "\t\t\treturn false;"; - protected final String TEXT_672 = NL + "\t\t\t"; - protected final String TEXT_673 = " container = ("; - protected final String TEXT_674 = ")getRelationshipContainer(newSource.getElement(), "; - protected final String TEXT_675 = ".eINSTANCE.get"; - protected final String TEXT_676 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_677 = NL; - protected final String TEXT_678 = NL + "\t\tif ("; - protected final String TEXT_679 = "."; - protected final String TEXT_680 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_681 = NL + "\t\t}"; - protected final String TEXT_682 = NL + "\t\tif ("; - protected final String TEXT_683 = "."; - protected final String TEXT_684 = "().size() >= "; - protected final String TEXT_685 = ".eINSTANCE.get"; - protected final String TEXT_686 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_687 = NL + "\t\t}"; - protected final String TEXT_688 = NL; - protected final String TEXT_689 = NL + "\t\tif ("; - protected final String TEXT_690 = "."; - protected final String TEXT_691 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_692 = NL + "\t\t}"; + protected final String TEXT_646 = "\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_647 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; + protected final String TEXT_648 = NL; + protected final String TEXT_649 = "\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_650 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; + protected final String TEXT_651 = NL; + protected final String TEXT_652 = "\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_653 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; + protected final String TEXT_654 = NL; + protected final String TEXT_655 = "\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_656 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_657 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_658 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_659 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_660 = NL; + protected final String TEXT_661 = "\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_662 = ".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_663 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_664 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; + protected final String TEXT_665 = "SourceCommand extends "; + protected final String TEXT_666 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_667 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_668 = " newSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_669 = " oldSource;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_670 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_671 = "SourceCommand("; + protected final String TEXT_672 = " request) {" + NL + "\t\t\tthis(("; + protected final String TEXT_673 = ")request.getConnectionEditPart().getModel(), ("; + protected final String TEXT_674 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_675 = "SourceCommand("; + protected final String TEXT_676 = " edge, "; + protected final String TEXT_677 = " newSource) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newSource = newSource;" + NL + "\t\t\tthis.oldSource = edge.getSource();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; + protected final String TEXT_678 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; + protected final String TEXT_679 = " domainModelEditDomain = "; + protected final String TEXT_680 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_681 = " command = new "; + protected final String TEXT_682 = "() {" + NL + "\t\t\t\tprivate "; + protected final String TEXT_683 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; + protected final String TEXT_684 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; + protected final String TEXT_685 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; + protected final String TEXT_686 = NL + "\t\t\treturn false;"; + protected final String TEXT_687 = NL + "\t\t\t"; + protected final String TEXT_688 = " container = ("; + protected final String TEXT_689 = ")getRelationshipContainer(newSource.getElement(), "; + protected final String TEXT_690 = ".eINSTANCE.get"; + protected final String TEXT_691 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_692 = NL; protected final String TEXT_693 = NL + "\t\tif ("; - protected final String TEXT_694 = "."; - protected final String TEXT_695 = "().size() >= "; - protected final String TEXT_696 = ".eINSTANCE.get"; - protected final String TEXT_697 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_698 = NL + "\t\t}"; - protected final String TEXT_699 = NL; - protected final String TEXT_700 = NL + "\t\t\tif(!"; - protected final String TEXT_701 = ".canCreateLink("; - protected final String TEXT_702 = ", "; - protected final String TEXT_703 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_704 = NL + "\t\t\treturn true;"; - protected final String TEXT_705 = NL; - protected final String TEXT_706 = NL + "\t\tif ("; - protected final String TEXT_707 = "."; - protected final String TEXT_708 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_694 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_695 = NL + "\t\t}"; + protected final String TEXT_696 = NL + "\t\tif ("; + protected final String TEXT_697 = ".size() >= "; + protected final String TEXT_698 = ".eINSTANCE.get"; + protected final String TEXT_699 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_700 = NL + "\t\t}"; + protected final String TEXT_701 = NL; + protected final String TEXT_702 = NL + "\t\tif ("; + protected final String TEXT_703 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_704 = NL + "\t\t}"; + protected final String TEXT_705 = NL + "\t\tif ("; + protected final String TEXT_706 = ".size() >= "; + protected final String TEXT_707 = ".eINSTANCE.get"; + protected final String TEXT_708 = ".getUpperBound()) {" + NL + "\t\t\t"; protected final String TEXT_709 = NL + "\t\t}"; - protected final String TEXT_710 = NL + "\t\tif ("; - protected final String TEXT_711 = "."; - protected final String TEXT_712 = "().size() >= "; - protected final String TEXT_713 = ".eINSTANCE.get"; - protected final String TEXT_714 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_715 = NL + "\t\t}"; + protected final String TEXT_710 = NL; + protected final String TEXT_711 = NL + "\t\t\tif(!"; + protected final String TEXT_712 = ".canCreateLink("; + protected final String TEXT_713 = ", "; + protected final String TEXT_714 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_715 = NL + "\t\t\treturn true;"; protected final String TEXT_716 = NL; - protected final String TEXT_717 = NL + "\t\t\tif(!"; - protected final String TEXT_718 = ".canCreateLink("; - protected final String TEXT_719 = ", "; - protected final String TEXT_720 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_721 = NL + "\t\t\treturn true;"; - protected final String TEXT_722 = NL + "\t\t\treturn false;"; - protected final String TEXT_723 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_724 = " createReconnectCommand() {" + NL + "\t\t\t"; - protected final String TEXT_725 = " editingDomain = "; - protected final String TEXT_726 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_727 = " result = new "; - protected final String TEXT_728 = "();" + NL + "\t\t\tresult.append(new "; - protected final String TEXT_729 = "(edge, newSource));"; - protected final String TEXT_730 = NL + "\t\t\t"; - protected final String TEXT_731 = " container = getRelationshipContainer(newSource.getElement(), "; - protected final String TEXT_732 = ".eINSTANCE.get"; - protected final String TEXT_733 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_734 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_735 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn "; - protected final String TEXT_736 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {"; - protected final String TEXT_737 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_738 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));"; - protected final String TEXT_739 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_740 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), "; - protected final String TEXT_741 = ".UNSET_VALUE));"; - protected final String TEXT_742 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_743 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; - protected final String TEXT_744 = ".eINSTANCE.get"; - protected final String TEXT_745 = "(), edge.getElement()));"; + protected final String TEXT_717 = NL + "\t\tif ("; + protected final String TEXT_718 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_719 = NL + "\t\t}"; + protected final String TEXT_720 = NL + "\t\tif ("; + protected final String TEXT_721 = ".size() >= "; + protected final String TEXT_722 = ".eINSTANCE.get"; + protected final String TEXT_723 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_724 = NL + "\t\t}"; + protected final String TEXT_725 = NL; + protected final String TEXT_726 = NL + "\t\t\tif(!"; + protected final String TEXT_727 = ".canCreateLink("; + protected final String TEXT_728 = ", "; + protected final String TEXT_729 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_730 = NL + "\t\t\treturn true;"; + protected final String TEXT_731 = NL + "\t\t\treturn false;"; + protected final String TEXT_732 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_733 = " createReconnectCommand() {" + NL + "\t\t\t"; + protected final String TEXT_734 = " editingDomain = "; + protected final String TEXT_735 = ".getEditingDomain(oldSource.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_736 = " result = new "; + protected final String TEXT_737 = "();" + NL + "\t\t\tresult.append(new "; + protected final String TEXT_738 = "(edge, newSource));"; + protected final String TEXT_739 = NL + "\t\t\t"; + protected final String TEXT_740 = " container = getRelationshipContainer(newSource.getElement(), "; + protected final String TEXT_741 = ".eINSTANCE.get"; + protected final String TEXT_742 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_743 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_744 = " oldContainer = edge.getElement().eContainer();" + NL + "\t\t\tif (oldContainer == null) {" + NL + "\t\t\t\treturn "; + protected final String TEXT_745 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tif (oldContainer != container) {"; protected final String TEXT_746 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_747 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; - protected final String TEXT_748 = ".eINSTANCE.get"; - protected final String TEXT_749 = "()," + NL + "\t\t\t\t\tedge.getElement()));"; - protected final String TEXT_750 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_751 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; - protected final String TEXT_752 = ".eINSTANCE.get"; - protected final String TEXT_753 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_754 = ".UNSET_VALUE));"; + protected final String TEXT_747 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), edge.getElement()));"; + protected final String TEXT_748 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_749 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), edge.getElement().eContainmentFeature(), "; + protected final String TEXT_750 = ".UNSET_VALUE));"; + protected final String TEXT_751 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_752 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; + protected final String TEXT_753 = ".eINSTANCE.get"; + protected final String TEXT_754 = "(), edge.getElement()));"; protected final String TEXT_755 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_756 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; + protected final String TEXT_756 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; protected final String TEXT_757 = ".eINSTANCE.get"; - protected final String TEXT_758 = "(), edge.getElement()));"; - protected final String TEXT_759 = NL + "\t\t\t}"; - protected final String TEXT_760 = NL + "\t\t\tresult.append("; - protected final String TEXT_761 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_762 = ".eINSTANCE.get"; - protected final String TEXT_763 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_764 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_765 = ".eINSTANCE.get"; - protected final String TEXT_766 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; - protected final String TEXT_767 = NL + "\t\t\tresult.append("; - protected final String TEXT_768 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_769 = ".eINSTANCE.get"; - protected final String TEXT_770 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; - protected final String TEXT_771 = NL + "\t\t\tresult.append("; - protected final String TEXT_772 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; - protected final String TEXT_773 = ".eINSTANCE.get"; - protected final String TEXT_774 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append("; - protected final String TEXT_775 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; - protected final String TEXT_776 = ".eINSTANCE.get"; - protected final String TEXT_777 = "(), edge.getTarget().getElement()));"; - protected final String TEXT_778 = NL + "\t\t\tresult.append("; - protected final String TEXT_779 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; - protected final String TEXT_780 = ".eINSTANCE.get"; - protected final String TEXT_781 = "(), "; - protected final String TEXT_782 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append("; - protected final String TEXT_783 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; - protected final String TEXT_784 = ".eINSTANCE.get"; - protected final String TEXT_785 = "(), edge.getTarget().getElement()));"; - protected final String TEXT_786 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL; - protected final String TEXT_787 = NL; - protected final String TEXT_788 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_789 = " getRelationshipContainer("; - protected final String TEXT_790 = " element, "; - protected final String TEXT_791 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_792 = NL; - protected final String TEXT_793 = NL + "\t\t\tprivate "; - protected final String TEXT_794 = " createDomainModelRemoveCommand("; - protected final String TEXT_795 = " editingDomain) {"; - protected final String TEXT_796 = NL + "\t\t\t\t"; - protected final String TEXT_797 = " result = new "; - protected final String TEXT_798 = "();"; - protected final String TEXT_799 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_800 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_801 = ".getElement().eContainer(), "; - protected final String TEXT_802 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_803 = ".getElement()));"; - protected final String TEXT_804 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_805 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_806 = ".getElement().eContainer(), "; - protected final String TEXT_807 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_808 = ".UNSET_VALUE));"; - protected final String TEXT_809 = NL + "\t\t\t\treturn "; - protected final String TEXT_810 = ".INSTANCE;"; - protected final String TEXT_811 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_812 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_813 = ".getElement().eContainer(), "; - protected final String TEXT_814 = ".eINSTANCE.get"; - protected final String TEXT_815 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_816 = ".getElement()));"; - protected final String TEXT_817 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_818 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_819 = ".getElement().eContainer(), "; - protected final String TEXT_820 = ".eINSTANCE.get"; - protected final String TEXT_821 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_822 = ".UNSET_VALUE));"; - protected final String TEXT_823 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_824 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_825 = ".getElement(), "; - protected final String TEXT_826 = ".eINSTANCE.get"; - protected final String TEXT_827 = "(), "; - protected final String TEXT_828 = ".getSource().getElement()));"; - protected final String TEXT_829 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_830 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_831 = ".getElement(), "; - protected final String TEXT_832 = ".eINSTANCE.get"; - protected final String TEXT_833 = "(), "; - protected final String TEXT_834 = ".UNSET_VALUE));"; - protected final String TEXT_835 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_836 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_837 = ".getElement(), "; - protected final String TEXT_838 = ".eINSTANCE.get"; - protected final String TEXT_839 = "(), "; - protected final String TEXT_840 = ".getTarget().getElement()));"; - protected final String TEXT_841 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_842 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_843 = ".getElement(), "; - protected final String TEXT_844 = ".eINSTANCE.get"; - protected final String TEXT_845 = "(), "; - protected final String TEXT_846 = ".UNSET_VALUE));"; - protected final String TEXT_847 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_848 = NL + "\t\t\t\treturn "; - protected final String TEXT_849 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_850 = ".getSource().getElement(), "; - protected final String TEXT_851 = ".eINSTANCE.get"; - protected final String TEXT_852 = "(), "; - protected final String TEXT_853 = ".getTarget().getElement());"; - protected final String TEXT_854 = NL + "\t\t\t\treturn "; - protected final String TEXT_855 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_856 = ".getSource().getElement(), "; - protected final String TEXT_857 = ".eINSTANCE.get"; - protected final String TEXT_858 = "(), "; - protected final String TEXT_859 = ".UNSET_VALUE);"; - protected final String TEXT_860 = NL + "\t\t\t}"; - protected final String TEXT_861 = NL + "\t}" + NL; - protected final String TEXT_862 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; - protected final String TEXT_863 = "StartCommand extends "; - protected final String TEXT_864 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_865 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_866 = "StartCommand("; - protected final String TEXT_867 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = ("; - protected final String TEXT_868 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_869 = NL + "\t\t\treturn false;"; - protected final String TEXT_870 = NL + "\t\t\t"; - protected final String TEXT_871 = " container = ("; - protected final String TEXT_872 = ")getRelationshipContainer(source.getElement(), "; - protected final String TEXT_873 = ".eINSTANCE.get"; - protected final String TEXT_874 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_875 = NL; - protected final String TEXT_876 = NL + "\t\tif ("; - protected final String TEXT_877 = "."; - protected final String TEXT_878 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_879 = NL + "\t\t}"; - protected final String TEXT_880 = NL + "\t\tif ("; - protected final String TEXT_881 = "."; - protected final String TEXT_882 = "().size() >= "; - protected final String TEXT_883 = ".eINSTANCE.get"; - protected final String TEXT_884 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_885 = NL + "\t\t}"; - protected final String TEXT_886 = NL; - protected final String TEXT_887 = NL + "\t\tif ("; - protected final String TEXT_888 = "."; - protected final String TEXT_889 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_890 = NL + "\t\t}"; - protected final String TEXT_891 = NL + "\t\tif ("; - protected final String TEXT_892 = "."; - protected final String TEXT_893 = "().size() >= "; - protected final String TEXT_894 = ".eINSTANCE.get"; - protected final String TEXT_895 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_758 = "()," + NL + "\t\t\t\t\tedge.getElement()));"; + protected final String TEXT_759 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_760 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tedge.getElement().eContainer(), "; + protected final String TEXT_761 = ".eINSTANCE.get"; + protected final String TEXT_762 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_763 = ".UNSET_VALUE));"; + protected final String TEXT_764 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_765 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\tcontainer, "; + protected final String TEXT_766 = ".eINSTANCE.get"; + protected final String TEXT_767 = "(), edge.getElement()));"; + protected final String TEXT_768 = NL + "\t\t\t}"; + protected final String TEXT_769 = NL + "\t\t\tresult.append("; + protected final String TEXT_770 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_771 = ".eINSTANCE.get"; + protected final String TEXT_772 = "()," + NL + "\t\t\t\toldSource.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_773 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_774 = ".eINSTANCE.get"; + protected final String TEXT_775 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; + protected final String TEXT_776 = NL + "\t\t\tresult.append("; + protected final String TEXT_777 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_778 = ".eINSTANCE.get"; + protected final String TEXT_779 = "()," + NL + "\t\t\t\tnewSource.getElement()));"; + protected final String TEXT_780 = NL + "\t\t\tresult.append("; + protected final String TEXT_781 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; + protected final String TEXT_782 = ".eINSTANCE.get"; + protected final String TEXT_783 = "(), edge.getTarget().getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_784 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; + protected final String TEXT_785 = ".eINSTANCE.get"; + protected final String TEXT_786 = "(), edge.getTarget().getElement()));"; + protected final String TEXT_787 = NL + "\t\t\tresult.append("; + protected final String TEXT_788 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\toldSource.getElement(), "; + protected final String TEXT_789 = ".eINSTANCE.get"; + protected final String TEXT_790 = "(), "; + protected final String TEXT_791 = ".UNSET_VALUE));" + NL + "\t\t\tresult.append("; + protected final String TEXT_792 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tnewSource.getElement(), "; + protected final String TEXT_793 = ".eINSTANCE.get"; + protected final String TEXT_794 = "(), edge.getTarget().getElement()));"; + protected final String TEXT_795 = NL + "\t\t\treturn result;" + NL + "\t\t}" + NL; + protected final String TEXT_796 = NL; + protected final String TEXT_797 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_798 = " getRelationshipContainer("; + protected final String TEXT_799 = " element, "; + protected final String TEXT_800 = " 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_801 = NL; + protected final String TEXT_802 = NL + "\t\t\tprivate "; + protected final String TEXT_803 = " createDomainModelRemoveCommand("; + protected final String TEXT_804 = " editingDomain) {"; + protected final String TEXT_805 = NL + "\t\t\t\t"; + protected final String TEXT_806 = " result = new "; + protected final String TEXT_807 = "();"; + protected final String TEXT_808 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_809 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_810 = ".getElement().eContainer(), "; + protected final String TEXT_811 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_812 = ".getElement()));"; + protected final String TEXT_813 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_814 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_815 = ".getElement().eContainer(), "; + protected final String TEXT_816 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_817 = ".UNSET_VALUE));"; + protected final String TEXT_818 = NL + "\t\t\t\treturn "; + protected final String TEXT_819 = ".INSTANCE;"; + protected final String TEXT_820 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_821 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_822 = ".getElement().eContainer(), "; + protected final String TEXT_823 = ".eINSTANCE.get"; + protected final String TEXT_824 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_825 = ".getElement()));"; + protected final String TEXT_826 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_827 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_828 = ".getElement().eContainer(), "; + protected final String TEXT_829 = ".eINSTANCE.get"; + protected final String TEXT_830 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_831 = ".UNSET_VALUE));"; + protected final String TEXT_832 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_833 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_834 = ".getElement(), "; + protected final String TEXT_835 = ".eINSTANCE.get"; + protected final String TEXT_836 = "(), "; + protected final String TEXT_837 = ".getSource().getElement()));"; + protected final String TEXT_838 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_839 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_840 = ".getElement(), "; + protected final String TEXT_841 = ".eINSTANCE.get"; + protected final String TEXT_842 = "(), "; + protected final String TEXT_843 = ".UNSET_VALUE));"; + protected final String TEXT_844 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_845 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_846 = ".getElement(), "; + protected final String TEXT_847 = ".eINSTANCE.get"; + protected final String TEXT_848 = "(), "; + protected final String TEXT_849 = ".getTarget().getElement()));"; + protected final String TEXT_850 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_851 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_852 = ".getElement(), "; + protected final String TEXT_853 = ".eINSTANCE.get"; + protected final String TEXT_854 = "(), "; + protected final String TEXT_855 = ".UNSET_VALUE));"; + protected final String TEXT_856 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_857 = NL + "\t\t\t\treturn "; + protected final String TEXT_858 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_859 = ".getSource().getElement(), "; + protected final String TEXT_860 = ".eINSTANCE.get"; + protected final String TEXT_861 = "(), "; + protected final String TEXT_862 = ".getTarget().getElement());"; + protected final String TEXT_863 = NL + "\t\t\t\treturn "; + protected final String TEXT_864 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_865 = ".getSource().getElement(), "; + protected final String TEXT_866 = ".eINSTANCE.get"; + protected final String TEXT_867 = "(), "; + protected final String TEXT_868 = ".UNSET_VALUE);"; + protected final String TEXT_869 = NL + "\t\t\t}"; + protected final String TEXT_870 = NL + "\t}" + NL; + protected final String TEXT_871 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_872 = "StartCommand extends "; + protected final String TEXT_873 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_874 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_875 = "StartCommand("; + protected final String TEXT_876 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\t//Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart()." + NL + "\t\t\tsource = ("; + protected final String TEXT_877 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\t//This command never gets executed" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {" + NL + "\t\t\tif (source == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_878 = NL + "\t\t\treturn false;"; + protected final String TEXT_879 = NL + "\t\t\t"; + protected final String TEXT_880 = " container = ("; + protected final String TEXT_881 = ")getRelationshipContainer(source.getElement(), "; + protected final String TEXT_882 = ".eINSTANCE.get"; + protected final String TEXT_883 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_884 = NL; + protected final String TEXT_885 = NL + "\t\tif ("; + protected final String TEXT_886 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_887 = NL + "\t\t}"; + protected final String TEXT_888 = NL + "\t\tif ("; + protected final String TEXT_889 = ".size() >= "; + protected final String TEXT_890 = ".eINSTANCE.get"; + protected final String TEXT_891 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_892 = NL + "\t\t}"; + protected final String TEXT_893 = NL; + protected final String TEXT_894 = NL + "\t\tif ("; + protected final String TEXT_895 = " != null) {" + NL + "\t\t\t"; protected final String TEXT_896 = NL + "\t\t}"; - protected final String TEXT_897 = NL; - protected final String TEXT_898 = NL + "\t\t\tif(!"; - protected final String TEXT_899 = ".canCreateLink("; - protected final String TEXT_900 = ", "; - protected final String TEXT_901 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_902 = NL + "\t\t\treturn true;"; - protected final String TEXT_903 = NL; - protected final String TEXT_904 = NL + "\t\tif ("; - protected final String TEXT_905 = "."; - protected final String TEXT_906 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_907 = NL + "\t\t}"; - protected final String TEXT_908 = NL + "\t\tif ("; - protected final String TEXT_909 = "."; - protected final String TEXT_910 = "().size() >= "; - protected final String TEXT_911 = ".eINSTANCE.get"; - protected final String TEXT_912 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_913 = NL + "\t\t}"; - protected final String TEXT_914 = NL; - protected final String TEXT_915 = NL + "\t\t\tif(!"; - protected final String TEXT_916 = ".canCreateLink("; - protected final String TEXT_917 = ", "; - protected final String TEXT_918 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_919 = NL + "\t\t\treturn true;"; - protected final String TEXT_920 = NL + "\t\t\treturn false;"; - protected final String TEXT_921 = NL + "\t\t}"; - protected final String TEXT_922 = NL; - protected final String TEXT_923 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_924 = " getRelationshipContainer("; - protected final String TEXT_925 = " element, "; - protected final String TEXT_926 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_927 = NL + NL + "\t}"; - protected final String TEXT_928 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; - protected final String TEXT_929 = "TargetCommand extends "; - protected final String TEXT_930 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_931 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_932 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_933 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_934 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_935 = "TargetCommand("; - protected final String TEXT_936 = " request) {" + NL + "\t\t\tthis(("; - protected final String TEXT_937 = ")request.getConnectionEditPart().getModel(), ("; - protected final String TEXT_938 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; - protected final String TEXT_939 = "TargetCommand("; - protected final String TEXT_940 = " edge, "; - protected final String TEXT_941 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; - protected final String TEXT_942 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; - protected final String TEXT_943 = " domainModelEditDomain = "; - protected final String TEXT_944 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_945 = " command = new "; - protected final String TEXT_946 = "() {" + NL + "\t\t\t\tprivate "; - protected final String TEXT_947 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; - protected final String TEXT_948 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; - protected final String TEXT_949 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; - protected final String TEXT_950 = NL; - protected final String TEXT_951 = NL + "\t\t\tif(!"; - protected final String TEXT_952 = ".canCreateLink("; - protected final String TEXT_953 = ", "; - protected final String TEXT_954 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_955 = NL + "\t\t\treturn true;"; - protected final String TEXT_956 = NL; - protected final String TEXT_957 = NL + "\t\t\tif(!"; - protected final String TEXT_958 = ".canCreateLink("; - protected final String TEXT_959 = ", "; - protected final String TEXT_960 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_961 = NL + "\t\t\treturn true;"; - protected final String TEXT_962 = NL + "\t\t\treturn false;"; - protected final String TEXT_963 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_964 = " createReconnectCommand() {" + NL + "\t\t\t"; - protected final String TEXT_965 = " editingDomain = "; - protected final String TEXT_966 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; - protected final String TEXT_967 = " result = new "; - protected final String TEXT_968 = "();" + NL + "\t\t\tresult.append(new "; - protected final String TEXT_969 = "(edge, newTarget));"; - protected final String TEXT_970 = NL + "\t\t\tresult.append("; - protected final String TEXT_971 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_972 = ".eINSTANCE.get"; - protected final String TEXT_973 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_897 = NL + "\t\tif ("; + protected final String TEXT_898 = ".size() >= "; + protected final String TEXT_899 = ".eINSTANCE.get"; + protected final String TEXT_900 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_901 = NL + "\t\t}"; + protected final String TEXT_902 = NL; + protected final String TEXT_903 = NL + "\t\t\tif(!"; + protected final String TEXT_904 = ".canCreateLink("; + protected final String TEXT_905 = ", "; + protected final String TEXT_906 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_907 = NL + "\t\t\treturn true;"; + protected final String TEXT_908 = NL; + protected final String TEXT_909 = NL + "\t\tif ("; + protected final String TEXT_910 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_911 = NL + "\t\t}"; + protected final String TEXT_912 = NL + "\t\tif ("; + protected final String TEXT_913 = ".size() >= "; + protected final String TEXT_914 = ".eINSTANCE.get"; + protected final String TEXT_915 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_916 = NL + "\t\t}"; + protected final String TEXT_917 = NL; + protected final String TEXT_918 = NL + "\t\t\tif(!"; + protected final String TEXT_919 = ".canCreateLink("; + protected final String TEXT_920 = ", "; + protected final String TEXT_921 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_922 = NL + "\t\t\treturn true;"; + protected final String TEXT_923 = NL + "\t\t\treturn false;"; + protected final String TEXT_924 = NL + "\t\t}"; + protected final String TEXT_925 = NL; + protected final String TEXT_926 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_927 = " getRelationshipContainer("; + protected final String TEXT_928 = " element, "; + protected final String TEXT_929 = " 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_930 = NL + NL + "\t}"; + protected final String TEXT_931 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Reconnect"; + protected final String TEXT_932 = "TargetCommand extends "; + protected final String TEXT_933 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_934 = " edge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_935 = " newTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_936 = " oldTarget;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_937 = " reconnectCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_938 = "TargetCommand("; + protected final String TEXT_939 = " request) {" + NL + "\t\t\tthis(("; + protected final String TEXT_940 = ")request.getConnectionEditPart().getModel(), ("; + protected final String TEXT_941 = ")request.getTarget().getModel());" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Reconnect"; + protected final String TEXT_942 = "TargetCommand("; + protected final String TEXT_943 = " edge, "; + protected final String TEXT_944 = " newTarget) {" + NL + "\t\t\tthis.edge = edge;" + NL + "\t\t\tthis.newTarget = newTarget;" + NL + "\t\t\tthis.oldTarget = edge.getTarget();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\treconnectCommand.execute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn reconnectCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\treconnectCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean prepare() {"; + protected final String TEXT_945 = NL + "\t\t\tfinal boolean[] resultHolder = new boolean[1];" + NL + "\t\t\t//To validate the reconnection against constraints, the current link should be deleted. Of course, we must then undo its deletion." + NL + "\t\t\tfinal "; + protected final String TEXT_946 = " domainModelEditDomain = "; + protected final String TEXT_947 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_948 = " command = new "; + protected final String TEXT_949 = "() {" + NL + "\t\t\t\tprivate "; + protected final String TEXT_950 = " deleteCommand = createDomainModelRemoveCommand(domainModelEditDomain);" + NL + "\t\t\t\tpublic boolean canExecute() {" + NL + "\t\t\t\t\treturn deleteCommand.canExecute();" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\treturn true;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t}" + NL + "\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\tdeleteCommand.execute();" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tresultHolder[0] = canReconnect();" + NL + "\t\t\t\t\t} finally {" + NL + "\t\t\t\t\t\tdeleteCommand.undo();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\tif (!command.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tnew WrappingCommand(domainModelEditDomain, command).execute();" + NL + "\t\t\tif (resultHolder[0]) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t}" + NL + "\t\t\treturn resultHolder[0] && reconnectCommand.canExecute();"; + protected final String TEXT_951 = NL + "\t\t\tif (canReconnect()) {" + NL + "\t\t\t\treconnectCommand = createReconnectCommand();" + NL + "\t\t\t\treturn reconnectCommand.canExecute();" + NL + "\t\t\t}" + NL + "\t\t\treturn false;"; + protected final String TEXT_952 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate boolean canReconnect() {"; + protected final String TEXT_953 = NL; + protected final String TEXT_954 = NL + "\t\t\tif(!"; + protected final String TEXT_955 = ".canCreateLink("; + protected final String TEXT_956 = ", "; + protected final String TEXT_957 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_958 = NL + "\t\t\treturn true;"; + protected final String TEXT_959 = NL; + protected final String TEXT_960 = NL + "\t\t\tif(!"; + protected final String TEXT_961 = ".canCreateLink("; + protected final String TEXT_962 = ", "; + protected final String TEXT_963 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_964 = NL + "\t\t\treturn true;"; + protected final String TEXT_965 = NL + "\t\t\treturn false;"; + protected final String TEXT_966 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_967 = " createReconnectCommand() {" + NL + "\t\t\t"; + protected final String TEXT_968 = " editingDomain = "; + protected final String TEXT_969 = ".getEditingDomain(oldTarget.getDiagram().getElement());" + NL + "\t\t\t"; + protected final String TEXT_970 = " result = new "; + protected final String TEXT_971 = "();" + NL + "\t\t\tresult.append(new "; + protected final String TEXT_972 = "(edge, newTarget));"; + protected final String TEXT_973 = NL + "\t\t\tresult.append("; protected final String TEXT_974 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; protected final String TEXT_975 = ".eINSTANCE.get"; - protected final String TEXT_976 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; - protected final String TEXT_977 = NL + "\t\t\tresult.append("; - protected final String TEXT_978 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; - protected final String TEXT_979 = ".eINSTANCE.get"; - protected final String TEXT_980 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; - protected final String TEXT_981 = NL + "\t\t\tresult.append("; - protected final String TEXT_982 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; - protected final String TEXT_983 = ".eINSTANCE.get"; - protected final String TEXT_984 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_976 = "()," + NL + "\t\t\t\toldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_977 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_978 = ".eINSTANCE.get"; + protected final String TEXT_979 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; + protected final String TEXT_980 = NL + "\t\t\tresult.append("; + protected final String TEXT_981 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getElement(), "; + protected final String TEXT_982 = ".eINSTANCE.get"; + protected final String TEXT_983 = "()," + NL + "\t\t\t\tnewTarget.getElement()));"; + protected final String TEXT_984 = NL + "\t\t\tresult.append("; protected final String TEXT_985 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; protected final String TEXT_986 = ".eINSTANCE.get"; - protected final String TEXT_987 = "(), newTarget.getElement()));"; - protected final String TEXT_988 = NL + "\t\t\tresult.append("; - protected final String TEXT_989 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; - protected final String TEXT_990 = ".eINSTANCE.get"; - protected final String TEXT_991 = "(), newTarget.getElement()));"; - protected final String TEXT_992 = NL + "\t\t\treturn result;" + NL + "\t\t}"; - protected final String TEXT_993 = NL; - protected final String TEXT_994 = NL + "\t\t\tprivate "; - protected final String TEXT_995 = " createDomainModelRemoveCommand("; - protected final String TEXT_996 = " editingDomain) {"; - protected final String TEXT_997 = NL + "\t\t\t\t"; - protected final String TEXT_998 = " result = new "; - protected final String TEXT_999 = "();"; - protected final String TEXT_1000 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1001 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1002 = ".getElement().eContainer(), "; - protected final String TEXT_1003 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_1004 = ".getElement()));"; - protected final String TEXT_1005 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1006 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1007 = ".getElement().eContainer(), "; - protected final String TEXT_1008 = ".getElement().eContainmentFeature(), "; - protected final String TEXT_1009 = ".UNSET_VALUE));"; - protected final String TEXT_1010 = NL + "\t\t\t\treturn "; - protected final String TEXT_1011 = ".INSTANCE;"; - protected final String TEXT_1012 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1013 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1014 = ".getElement().eContainer(), "; - protected final String TEXT_1015 = ".eINSTANCE.get"; - protected final String TEXT_1016 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_1017 = ".getElement()));"; - protected final String TEXT_1018 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1019 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1020 = ".getElement().eContainer(), "; - protected final String TEXT_1021 = ".eINSTANCE.get"; - protected final String TEXT_1022 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_1023 = ".UNSET_VALUE));"; - protected final String TEXT_1024 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1025 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1026 = ".getElement(), "; - protected final String TEXT_1027 = ".eINSTANCE.get"; - protected final String TEXT_1028 = "(), "; - protected final String TEXT_1029 = ".getSource().getElement()));"; - protected final String TEXT_1030 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1031 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1032 = ".getElement(), "; - protected final String TEXT_1033 = ".eINSTANCE.get"; - protected final String TEXT_1034 = "(), "; - protected final String TEXT_1035 = ".UNSET_VALUE));"; - protected final String TEXT_1036 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1037 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1038 = ".getElement(), "; - protected final String TEXT_1039 = ".eINSTANCE.get"; - protected final String TEXT_1040 = "(), "; - protected final String TEXT_1041 = ".getTarget().getElement()));"; - protected final String TEXT_1042 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_1043 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1044 = ".getElement(), "; - protected final String TEXT_1045 = ".eINSTANCE.get"; - protected final String TEXT_1046 = "(), "; - protected final String TEXT_1047 = ".UNSET_VALUE));"; - protected final String TEXT_1048 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_1049 = NL + "\t\t\t\treturn "; - protected final String TEXT_1050 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1051 = ".getSource().getElement(), "; - protected final String TEXT_1052 = ".eINSTANCE.get"; - protected final String TEXT_1053 = "(), "; - protected final String TEXT_1054 = ".getTarget().getElement());"; - protected final String TEXT_1055 = NL + "\t\t\t\treturn "; - protected final String TEXT_1056 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; - protected final String TEXT_1057 = ".getSource().getElement(), "; - protected final String TEXT_1058 = ".eINSTANCE.get"; - protected final String TEXT_1059 = "(), "; - protected final String TEXT_1060 = ".UNSET_VALUE);"; - protected final String TEXT_1061 = NL + "\t\t\t}"; - protected final String TEXT_1062 = NL + "\t}" + NL; - protected final String TEXT_1063 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; - protected final String TEXT_1064 = "Command extends "; - protected final String TEXT_1065 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_1066 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_1067 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_1068 = " createdEdge;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_1069 = "Command("; - protected final String TEXT_1070 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; - protected final String TEXT_1071 = ") {" + NL + "\t\t\t\tsource = ("; - protected final String TEXT_1072 = ")requestEx.getSourceEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\tsource = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (requestEx.getTargetEditPart().getModel() instanceof "; - protected final String TEXT_1073 = ") {" + NL + "\t\t\t\ttarget = ("; - protected final String TEXT_1074 = ")requestEx.getTargetEditPart().getModel();" + NL + "\t\t\t} else {" + NL + "\t\t\t\ttarget = null;" + NL + "\t\t\t}" + NL + "\t\t\tif (source == null || target == null) {" + NL + "\t\t\t\tcreatedEdge = null;" + NL + "\t\t\t\tdomainModelAddCommand = "; - protected final String TEXT_1075 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; - protected final String TEXT_1076 = ".eINSTANCE.createEdge();"; - protected final String TEXT_1077 = NL + "\t\t\t"; - protected final String TEXT_1078 = " createdDomainElement = "; - protected final String TEXT_1079 = ".eINSTANCE.create"; - protected final String TEXT_1080 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; - protected final String TEXT_1081 = NL + "\t\t\t"; - protected final String TEXT_1082 = "."; - protected final String TEXT_1083 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_1084 = NL + "\t\t\tcreatedEdge.setElement(null);"; - protected final String TEXT_1085 = NL + "\t\t\t"; - protected final String TEXT_1086 = ".decorateView(createdEdge);" + NL + "\t\t\t"; - protected final String TEXT_1087 = " domainModelEditDomain = "; - protected final String TEXT_1088 = ".getEditingDomain(source.getDiagram().getElement());"; - protected final String TEXT_1089 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; - protected final String TEXT_1090 = NL + "\t\t\t"; - protected final String TEXT_1091 = " container = getRelationshipContainer(source.getElement(), "; - protected final String TEXT_1092 = ".eINSTANCE.get"; - protected final String TEXT_1093 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\tdomainModelAddCommand = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_1094 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_1095 = ".eINSTANCE.get"; - protected final String TEXT_1096 = "(), createdDomainElement));"; - protected final String TEXT_1097 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_1098 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_1099 = ".eINSTANCE.get"; - protected final String TEXT_1100 = "(), createdDomainElement));"; - protected final String TEXT_1101 = NL; - protected final String TEXT_1102 = NL + "\t\tif ("; - protected final String TEXT_1103 = "."; - protected final String TEXT_1104 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_1105 = NL + "\t\t}"; - protected final String TEXT_1106 = NL + "\t\tif ("; - protected final String TEXT_1107 = "."; - protected final String TEXT_1108 = "().size() >= "; - protected final String TEXT_1109 = ".eINSTANCE.get"; - protected final String TEXT_1110 = ".getUpperBound()) {" + NL + "\t\t\t"; - protected final String TEXT_1111 = NL + "\t\t}"; - protected final String TEXT_1112 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_1113 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; - protected final String TEXT_1114 = ".eINSTANCE.get"; - protected final String TEXT_1115 = "(), source.getElement()));"; - protected final String TEXT_1116 = NL; - protected final String TEXT_1117 = NL + "\t\tif ("; - protected final String TEXT_1118 = "."; - protected final String TEXT_1119 = "() != null) {" + NL + "\t\t\t"; - protected final String TEXT_1120 = NL + "\t\t}"; - protected final String TEXT_1121 = NL + "\t\tif ("; - protected final String TEXT_1122 = "."; - protected final String TEXT_1123 = "().size() >= "; - protected final String TEXT_1124 = ".eINSTANCE.get"; - protected final String TEXT_1125 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_987 = "(), oldTarget.getElement()));" + NL + "\t\t\tresult.append("; + protected final String TEXT_988 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; + protected final String TEXT_989 = ".eINSTANCE.get"; + protected final String TEXT_990 = "(), newTarget.getElement()));"; + protected final String TEXT_991 = NL + "\t\t\tresult.append("; + protected final String TEXT_992 = ".create(" + NL + "\t\t\t\teditingDomain," + NL + "\t\t\t\tedge.getSource().getElement(), "; + protected final String TEXT_993 = ".eINSTANCE.get"; + protected final String TEXT_994 = "(), newTarget.getElement()));"; + protected final String TEXT_995 = NL + "\t\t\treturn result;" + NL + "\t\t}"; + protected final String TEXT_996 = NL; + protected final String TEXT_997 = NL + "\t\t\tprivate "; + protected final String TEXT_998 = " createDomainModelRemoveCommand("; + protected final String TEXT_999 = " editingDomain) {"; + protected final String TEXT_1000 = NL + "\t\t\t\t"; + protected final String TEXT_1001 = " result = new "; + protected final String TEXT_1002 = "();"; + protected final String TEXT_1003 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1004 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1005 = ".getElement().eContainer(), "; + protected final String TEXT_1006 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_1007 = ".getElement()));"; + protected final String TEXT_1008 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1009 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1010 = ".getElement().eContainer(), "; + protected final String TEXT_1011 = ".getElement().eContainmentFeature(), "; + protected final String TEXT_1012 = ".UNSET_VALUE));"; + protected final String TEXT_1013 = NL + "\t\t\t\treturn "; + protected final String TEXT_1014 = ".INSTANCE;"; + protected final String TEXT_1015 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1016 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1017 = ".getElement().eContainer(), "; + protected final String TEXT_1018 = ".eINSTANCE.get"; + protected final String TEXT_1019 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_1020 = ".getElement()));"; + protected final String TEXT_1021 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1022 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1023 = ".getElement().eContainer(), "; + protected final String TEXT_1024 = ".eINSTANCE.get"; + protected final String TEXT_1025 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_1026 = ".UNSET_VALUE));"; + protected final String TEXT_1027 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1028 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1029 = ".getElement(), "; + protected final String TEXT_1030 = ".eINSTANCE.get"; + protected final String TEXT_1031 = "(), "; + protected final String TEXT_1032 = ".getSource().getElement()));"; + protected final String TEXT_1033 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1034 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1035 = ".getElement(), "; + protected final String TEXT_1036 = ".eINSTANCE.get"; + protected final String TEXT_1037 = "(), "; + protected final String TEXT_1038 = ".UNSET_VALUE));"; + protected final String TEXT_1039 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1040 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1041 = ".getElement(), "; + protected final String TEXT_1042 = ".eINSTANCE.get"; + protected final String TEXT_1043 = "(), "; + protected final String TEXT_1044 = ".getTarget().getElement()));"; + protected final String TEXT_1045 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_1046 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1047 = ".getElement(), "; + protected final String TEXT_1048 = ".eINSTANCE.get"; + protected final String TEXT_1049 = "(), "; + protected final String TEXT_1050 = ".UNSET_VALUE));"; + protected final String TEXT_1051 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_1052 = NL + "\t\t\t\treturn "; + protected final String TEXT_1053 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1054 = ".getSource().getElement(), "; + protected final String TEXT_1055 = ".eINSTANCE.get"; + protected final String TEXT_1056 = "(), "; + protected final String TEXT_1057 = ".getTarget().getElement());"; + protected final String TEXT_1058 = NL + "\t\t\t\treturn "; + protected final String TEXT_1059 = ".create(" + NL + "\t\t\t\t\teditingDomain," + NL + "\t\t\t\t\t"; + protected final String TEXT_1060 = ".getSource().getElement(), "; + protected final String TEXT_1061 = ".eINSTANCE.get"; + protected final String TEXT_1062 = "(), "; + protected final String TEXT_1063 = ".UNSET_VALUE);"; + protected final String TEXT_1064 = NL + "\t\t\t}"; + protected final String TEXT_1065 = NL + "\t}" + NL; + protected final String TEXT_1066 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_1067 = "Command extends "; + protected final String TEXT_1068 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1069 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1070 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_1071 = " 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_1072 = "Command("; + protected final String TEXT_1073 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; + protected final String TEXT_1074 = ") {" + NL + "\t\t\t\tsource = ("; + protected final String TEXT_1075 = ")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_1076 = ") {" + NL + "\t\t\t\ttarget = ("; + protected final String TEXT_1077 = ")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_1078 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; + protected final String TEXT_1079 = ".eINSTANCE.createEdge();"; + protected final String TEXT_1080 = NL + "\t\t\t"; + protected final String TEXT_1081 = " createdDomainElement = "; + protected final String TEXT_1082 = ".eINSTANCE.create"; + protected final String TEXT_1083 = "();" + NL + "\t\t\tcreatedEdge.setElement("; + protected final String TEXT_1084 = "("; + protected final String TEXT_1085 = ") "; + protected final String TEXT_1086 = "createdDomainElement);" + NL + "\t\t\t"; + protected final String TEXT_1087 = NL + "\t\t\t"; + protected final String TEXT_1088 = "."; + protected final String TEXT_1089 = ".initializeElement("; + protected final String TEXT_1090 = "("; + protected final String TEXT_1091 = ") "; + protected final String TEXT_1092 = "createdDomainElement);"; + protected final String TEXT_1093 = NL + "\t\t\tcreatedEdge.setElement(null);"; + protected final String TEXT_1094 = NL + "\t\t\t"; + protected final String TEXT_1095 = ".decorateView(createdEdge);" + NL + "\t\t\t"; + protected final String TEXT_1096 = " domainModelEditDomain = "; + protected final String TEXT_1097 = ".getEditingDomain(source.getDiagram().getElement());"; + protected final String TEXT_1098 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; + protected final String TEXT_1099 = NL + "\t\t\t"; + protected final String TEXT_1100 = " container = getRelationshipContainer(source.getElement(), "; + protected final String TEXT_1101 = ".eINSTANCE.get"; + protected final String TEXT_1102 = "());" + 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_1103 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_1104 = ".eINSTANCE.get"; + protected final String TEXT_1105 = "(), createdDomainElement));"; + protected final String TEXT_1106 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1107 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_1108 = ".eINSTANCE.get"; + protected final String TEXT_1109 = "(), createdDomainElement));"; + protected final String TEXT_1110 = NL; + protected final String TEXT_1111 = NL + "\t\tif ("; + protected final String TEXT_1112 = " != null) {" + NL + "\t\t\t"; + protected final String TEXT_1113 = NL + "\t\t}"; + protected final String TEXT_1114 = NL + "\t\tif ("; + protected final String TEXT_1115 = ".size() >= "; + protected final String TEXT_1116 = ".eINSTANCE.get"; + protected final String TEXT_1117 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_1118 = NL + "\t\t}"; + protected final String TEXT_1119 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1120 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_1121 = ".eINSTANCE.get"; + protected final String TEXT_1122 = "(), source.getElement()));"; + protected final String TEXT_1123 = NL; + protected final String TEXT_1124 = NL + "\t\tif ("; + protected final String TEXT_1125 = " != null) {" + NL + "\t\t\t"; protected final String TEXT_1126 = NL + "\t\t}"; - protected final String TEXT_1127 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_1128 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_1127 = NL + "\t\tif ("; + protected final String TEXT_1128 = ".size() >= "; protected final String TEXT_1129 = ".eINSTANCE.get"; - protected final String TEXT_1130 = "(), target.getElement()));"; - protected final String TEXT_1131 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; - protected final String TEXT_1132 = NL + "\t\t\tdomainModelAddCommand = "; - protected final String TEXT_1133 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; + protected final String TEXT_1130 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_1131 = NL + "\t\t}"; + protected final String TEXT_1132 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_1133 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; protected final String TEXT_1134 = ".eINSTANCE.get"; - protected final String TEXT_1135 = "(), target.getElement());"; - protected final String TEXT_1136 = NL + "\t\t}" + NL; - protected final String TEXT_1137 = NL; - protected final String TEXT_1138 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_1139 = " getRelationshipContainer("; - protected final String TEXT_1140 = " element, "; - protected final String TEXT_1141 = " containerClass) {" + NL + "\t\t\tfor (; element != null; element = element.eContainer()) {" + NL + "\t\t\t\tif (containerClass.isSuperTypeOf(element.eClass())) {" + NL + "\t\t\t\t\treturn element;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}"; - protected final String TEXT_1142 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_1143 = NL; - protected final String TEXT_1144 = NL + "\t\t\tif(!"; - protected final String TEXT_1145 = ".canCreateLink("; - protected final String TEXT_1146 = ", "; - protected final String TEXT_1147 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; - protected final String TEXT_1148 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_1149 = NL; - protected final String TEXT_1150 = NL; - protected final String TEXT_1151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class MapModeWorkaround {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic int DPtoLP(int dp) {" + NL + "\t\t\treturn dp;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static MapModeWorkaround INSTANCE = new MapModeWorkaround();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate MapModeWorkaround getMapMode() {" + NL + "\t\treturn MapModeWorkaround.INSTANCE;" + NL + "\t}"; - protected final String TEXT_1152 = NL + "}"; - protected final String TEXT_1153 = NL; + protected final String TEXT_1135 = "(), target.getElement()));"; + protected final String TEXT_1136 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; + protected final String TEXT_1137 = NL + "\t\t\tdomainModelAddCommand = "; + protected final String TEXT_1138 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; + protected final String TEXT_1139 = ".eINSTANCE.get"; + protected final String TEXT_1140 = "(), target.getElement());"; + protected final String TEXT_1141 = NL + "\t\t}" + NL; + protected final String TEXT_1142 = NL; + protected final String TEXT_1143 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_1144 = " getRelationshipContainer("; + protected final String TEXT_1145 = " element, "; + protected final String TEXT_1146 = " 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_1147 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\tif (source == null || target == null || createdEdge == null || domainModelAddCommand == null || !domainModelAddCommand.canExecute()) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_1148 = NL; + protected final String TEXT_1149 = NL + "\t\t\tif(!"; + protected final String TEXT_1150 = ".canCreateLink("; + protected final String TEXT_1151 = ", "; + protected final String TEXT_1152 = ", false)) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_1153 = NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_1154 = NL; + protected final String TEXT_1155 = NL; + protected final String TEXT_1156 = 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_1157 = NL + "}"; + protected final String TEXT_1158 = NL; public String generate(Object argument) { @@ -1186,6 +1191,82 @@ importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc + stringBuffer.append(TEXT_1); + stringBuffer.append(TEXT_2); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_3); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_4); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_5); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_6); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_7); + + } + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_9); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_10); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_11); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_12); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_13); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_14); + + } + + stringBuffer.append(TEXT_15); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_16); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_17); + class NodeEditPartHelper { private final List myInnerLabels = new LinkedList(); private final List myAllInnerLabels = new LinkedList(); @@ -1338,77 +1419,77 @@ } final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode); - stringBuffer.append(TEXT_1); + stringBuffer.append(TEXT_18); String copyrightText = genDiagram.getEditorGen().getCopyrightText(); if (copyrightText != null && copyrightText.trim().length() > 0) { - stringBuffer.append(TEXT_2); + stringBuffer.append(TEXT_19); stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); - stringBuffer.append(TEXT_3); + stringBuffer.append(TEXT_20); } - stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_21); importManager.emitPackageStatement(stringBuffer); importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_5); + stringBuffer.append(TEXT_22); stringBuffer.append(genNode.getEditPartClassName()); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_24); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.NodeEditPart")); - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_25); { GenCommonBase genCommonBase = genNode; - stringBuffer.append(TEXT_9); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_27); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_28); } - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_31); stringBuffer.append(genNode.getEditPartClassName()); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_17); - stringBuffer.append(TEXT_18); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_23); - stringBuffer.append(TEXT_24); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_52); { TypeModelFacet facet = genNode.getModelFacet(); @@ -1416,166 +1497,166 @@ GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_54); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_55); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_58); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_59); } else { - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_62); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_64); } if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_67); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_68); } else { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_71); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_73); } - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_74); } else { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_77); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_78); } else { - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_81); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_83); } } - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_84); } /*restrict local vars used in component edit policy*/ - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateRequest")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_91); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_99); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_101); stringBuffer.append(genNode.getEditPartClassName()); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.GraphicalNodeEditPolicy")); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_106); if (!myHelper.hasIncomingLinks()) { - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_108); } else { - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_119); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1599,58 +1680,58 @@ continue; } - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_121); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_122); } - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_125); } - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_128); if (!myHelper.hasOutgoingLinks()) { - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_130); } else { - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_141); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1676,40 +1757,40 @@ continue; } - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_143); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_144); } - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_147); } - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_150); if (palette != null && myHelper.hasOutgoingLinks()) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_156); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1735,40 +1816,40 @@ continue; } - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_158); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_159); } - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_162); }/*when there's palette*/ - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_165); if (palette != null && myHelper.hasIncomingLinks()) { - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_172); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1792,46 +1873,46 @@ continue; } - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_174); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_175); } - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_178); }/*when there's palette*/ - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_180); if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_181); } - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_186); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_189); String figureQualifiedClassName = null; Viewmap viewmap = genNode.getViewmap(); @@ -1841,98 +1922,98 @@ figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure"; } - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_191); if (isXYLayout) { - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_192); } /* use flow layout*/ - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_193); } else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_194); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_195); } else if (viewmap instanceof InnerClassViewmap) { figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_196); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_197); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_198); if (!genNode.getChildNodes().isEmpty() && isXYLayout) { /*otherwise, leave to figure's default value*/ - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_199); } - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_200); } - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_201); if (figureQualifiedClassName != null) { - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_202); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_203); stringBuffer.append(figureQualifiedClassName); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_204); } - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_213); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_219); if (!isXYLayout) { String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_220); stringBuffer.append(layoutClassName); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_221); stringBuffer.append(layoutClassName); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_222); } else { - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_226); } - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_227); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_230); if (myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_231); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_232); for (Iterator it = myHelper.getInnerFixedLabels(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -1940,15 +2021,15 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) genLabel.getViewmap(); final String childSetterName = childViewmap.getSetterName() == null ? "setLabel" : childViewmap.getSetterName(); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_233); stringBuffer.append(labelEditPart); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_234); stringBuffer.append(labelEditPart); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_235); stringBuffer.append(childSetterName); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_236); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_237); } @@ -1957,19 +2038,19 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap(); String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName()); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_238); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_240); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_241); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_242); } // for pinned compartments - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_243); //XXX: ignore labels assuming that they never may be removed for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) { @@ -1977,25 +2058,25 @@ final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap(); String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName()); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_244); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_245); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_246); stringBuffer.append(childViewmap.getGetterName()); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_247); stringBuffer.append(compartmentEditPartFQN); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_248); } // for pinned compartments - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_249); } // if myHelper.hasFixedChildren() - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_251); GenNodeLabel firstEditableLabel = null; for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) { @@ -2007,45 +2088,45 @@ } if (firstEditableLabel != null) { - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_253); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_258); } - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_260); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_261); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_263); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_264); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_265); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_267); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_268); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_269); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_270); for (Iterator it = myHelper.getAllInnerLabels(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -2053,184 +2134,183 @@ continue; } - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_272); } - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_273); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_275); for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) { GenNodeLabel next = (GenNodeLabel) externalLabels.next(); - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_276); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_277); } - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_278); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_281); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_282); } if (myHelper.hasExternalLabels() || myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_283); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_284); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_285); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_286); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_287); } if (myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_288); } - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_289); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_290); if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_291); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_292); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_276); + stringBuffer.append(TEXT_293); } if (myHelper.hasFixedChildren()){ - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_294); } - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_295); } if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_279); + stringBuffer.append(TEXT_296); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_297); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_298); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_299); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_300); } - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_301); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_302); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_303); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_304); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_305); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_306); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_291); + stringBuffer.append(TEXT_308); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_292); + stringBuffer.append(TEXT_309); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_293); + stringBuffer.append(TEXT_310); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); - stringBuffer.append(TEXT_294); + stringBuffer.append(TEXT_311); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_295); + stringBuffer.append(TEXT_312); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); - stringBuffer.append(TEXT_296); + stringBuffer.append(TEXT_313); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); - stringBuffer.append(TEXT_297); + stringBuffer.append(TEXT_314); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_298); + stringBuffer.append(TEXT_315); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); - stringBuffer.append(TEXT_299); + stringBuffer.append(TEXT_316); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); - stringBuffer.append(TEXT_300); + stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); - stringBuffer.append(TEXT_301); + stringBuffer.append(TEXT_318); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); - stringBuffer.append(TEXT_302); + stringBuffer.append(TEXT_319); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); - stringBuffer.append(TEXT_303); + stringBuffer.append(TEXT_320); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_304); + stringBuffer.append(TEXT_321); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); - stringBuffer.append(TEXT_305); + stringBuffer.append(TEXT_322); /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_306); + stringBuffer.append(TEXT_323); if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_307); + stringBuffer.append(TEXT_324); } - stringBuffer.append(TEXT_308); + stringBuffer.append(TEXT_325); if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_309); + stringBuffer.append(TEXT_326); } - stringBuffer.append(TEXT_310); + stringBuffer.append(TEXT_327); { final String _getViewCode = "getDiagramNode()"; final String _getDiagramCode = "getDiagramNode().getDiagram()"; - final String _getSemanticElementCode = "getDiagramNode().getElement()"; final boolean _includeUncontainedLinks = false; - stringBuffer.append(TEXT_311); + stringBuffer.append(TEXT_328); if (myHelper.containsLinks() || _includeUncontainedLinks) { - stringBuffer.append(TEXT_312); + stringBuffer.append(TEXT_329); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_313); + stringBuffer.append(TEXT_330); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_314); + stringBuffer.append(TEXT_331); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_315); + stringBuffer.append(TEXT_332); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_316); + stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_317); + stringBuffer.append(TEXT_334); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_318); + stringBuffer.append(TEXT_335); boolean hasConstraintsInContainedLinks = false; for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -2243,40 +2323,40 @@ } if (hasConstraintsInContainedLinks) { - stringBuffer.append(TEXT_319); + stringBuffer.append(TEXT_336); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_320); + stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_321); + stringBuffer.append(TEXT_338); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_322); + stringBuffer.append(TEXT_339); } if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_323); + stringBuffer.append(TEXT_340); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_341); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_325); + stringBuffer.append(TEXT_342); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_326); + stringBuffer.append(TEXT_343); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_327); + stringBuffer.append(TEXT_344); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_328); + stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_329); + stringBuffer.append(TEXT_346); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_330); + stringBuffer.append(TEXT_347); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_331); + stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_332); + stringBuffer.append(TEXT_349); } - stringBuffer.append(TEXT_333); + stringBuffer.append(TEXT_350); { boolean hasDeclaredFilter = false; @@ -2289,7 +2369,7 @@ } GenFeature _feature = modelFacet.getChildMetaFeature(); - stringBuffer.append(TEXT_334); + stringBuffer.append(TEXT_351); /* * input: @@ -2303,30 +2383,30 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_335); + stringBuffer.append(TEXT_352); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_336); + stringBuffer.append(TEXT_353); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_337); + stringBuffer.append(TEXT_354); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_338); + stringBuffer.append(TEXT_355); } else { - stringBuffer.append(TEXT_339); + stringBuffer.append(TEXT_356); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_340); + stringBuffer.append(TEXT_357); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_341); + stringBuffer.append(TEXT_358); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_342); + stringBuffer.append(TEXT_359); } _feature = modelFacet.getSourceMetaFeature(); - stringBuffer.append(TEXT_343); + stringBuffer.append(TEXT_360); /* * input: @@ -2340,30 +2420,30 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_344); + stringBuffer.append(TEXT_361); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_345); + stringBuffer.append(TEXT_362); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_346); + stringBuffer.append(TEXT_363); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_347); + stringBuffer.append(TEXT_364); } else { - stringBuffer.append(TEXT_348); + stringBuffer.append(TEXT_365); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_349); + stringBuffer.append(TEXT_366); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_350); + stringBuffer.append(TEXT_367); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_351); + stringBuffer.append(TEXT_368); } _feature = modelFacet.getTargetMetaFeature(); - stringBuffer.append(TEXT_352); + stringBuffer.append(TEXT_369); /* * input: @@ -2377,23 +2457,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_353); + stringBuffer.append(TEXT_370); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_354); + stringBuffer.append(TEXT_371); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_355); + stringBuffer.append(TEXT_372); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_356); + stringBuffer.append(TEXT_373); } else { - stringBuffer.append(TEXT_357); + stringBuffer.append(TEXT_374); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_358); + stringBuffer.append(TEXT_375); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_359); + stringBuffer.append(TEXT_376); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_360); + stringBuffer.append(TEXT_377); } @@ -2403,7 +2483,7 @@ GenLink nextLink = (GenLink) it.next(); GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_361); + stringBuffer.append(TEXT_378); /* * input: @@ -2417,23 +2497,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_362); + stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_363); + stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_364); + stringBuffer.append(TEXT_381); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_365); + stringBuffer.append(TEXT_382); } else { - stringBuffer.append(TEXT_366); + stringBuffer.append(TEXT_383); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_367); + stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_368); + stringBuffer.append(TEXT_385); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_369); + stringBuffer.append(TEXT_386); } @@ -2442,222 +2522,222 @@ if (hasConstraintsInContainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_370); + stringBuffer.append(TEXT_387); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_371); + stringBuffer.append(TEXT_388); } } if (_includeUncontainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_372); + stringBuffer.append(TEXT_389); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_373); + stringBuffer.append(TEXT_390); } } if (!hasDeclaredFilter) { - stringBuffer.append(TEXT_374); + stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_375); + stringBuffer.append(TEXT_392); } } //local declaration of hasDeclaredFilter - stringBuffer.append(TEXT_376); + stringBuffer.append(TEXT_393); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_377); + stringBuffer.append(TEXT_394); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_378); + stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_379); + stringBuffer.append(TEXT_396); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_380); + stringBuffer.append(TEXT_397); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_381); + stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_382); + stringBuffer.append(TEXT_399); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_383); + stringBuffer.append(TEXT_400); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_384); - stringBuffer.append(TEXT_385); + stringBuffer.append(TEXT_401); + stringBuffer.append(TEXT_402); /*inner class*/ - stringBuffer.append(TEXT_386); + stringBuffer.append(TEXT_403); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_387); + stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_388); + stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_389); + stringBuffer.append(TEXT_406); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_390); + stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_391); + stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_392); + stringBuffer.append(TEXT_409); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_393); + stringBuffer.append(TEXT_410); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_394); + stringBuffer.append(TEXT_411); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_395); + stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_396); + stringBuffer.append(TEXT_413); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_397); + stringBuffer.append(TEXT_414); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_398); + stringBuffer.append(TEXT_415); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_399); + stringBuffer.append(TEXT_416); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_400); + stringBuffer.append(TEXT_417); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_401); + stringBuffer.append(TEXT_418); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_402); + stringBuffer.append(TEXT_419); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_403); + stringBuffer.append(TEXT_420); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_404); + stringBuffer.append(TEXT_421); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_405); + stringBuffer.append(TEXT_422); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_406); + stringBuffer.append(TEXT_423); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_407); + stringBuffer.append(TEXT_424); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_408); + stringBuffer.append(TEXT_425); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_409); + stringBuffer.append(TEXT_426); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_410); + stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_411); + stringBuffer.append(TEXT_428); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_412); + stringBuffer.append(TEXT_429); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_413); + stringBuffer.append(TEXT_430); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_414); + stringBuffer.append(TEXT_431); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_415); + stringBuffer.append(TEXT_432); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_416); + stringBuffer.append(TEXT_433); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_417); + stringBuffer.append(TEXT_434); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_418); + stringBuffer.append(TEXT_435); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_419); + stringBuffer.append(TEXT_436); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_420); + stringBuffer.append(TEXT_437); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_421); + stringBuffer.append(TEXT_438); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_422); + stringBuffer.append(TEXT_439); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_423); + stringBuffer.append(TEXT_440); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_424); + stringBuffer.append(TEXT_441); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_425); + stringBuffer.append(TEXT_442); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_426); + stringBuffer.append(TEXT_443); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_427); + stringBuffer.append(TEXT_444); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_428); + stringBuffer.append(TEXT_445); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); - stringBuffer.append(TEXT_429); + stringBuffer.append(TEXT_446); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_430); + stringBuffer.append(TEXT_447); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); - stringBuffer.append(TEXT_431); + stringBuffer.append(TEXT_448); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_432); + stringBuffer.append(TEXT_449); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_433); + stringBuffer.append(TEXT_450); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_434); + stringBuffer.append(TEXT_451); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_435); + stringBuffer.append(TEXT_452); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_436); + stringBuffer.append(TEXT_453); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_437); + stringBuffer.append(TEXT_454); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_438); + stringBuffer.append(TEXT_455); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_439); + stringBuffer.append(TEXT_456); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_440); + stringBuffer.append(TEXT_457); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_441); + stringBuffer.append(TEXT_458); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_442); + stringBuffer.append(TEXT_459); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_443); + stringBuffer.append(TEXT_460); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_444); + stringBuffer.append(TEXT_461); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_445); + stringBuffer.append(TEXT_462); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_446); + stringBuffer.append(TEXT_463); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_447); + stringBuffer.append(TEXT_464); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_448); + stringBuffer.append(TEXT_465); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_449); + stringBuffer.append(TEXT_466); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_450); + stringBuffer.append(TEXT_467); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_451); + stringBuffer.append(TEXT_468); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_452); + stringBuffer.append(TEXT_469); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_453); + stringBuffer.append(TEXT_470); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_454); + stringBuffer.append(TEXT_471); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_455); + stringBuffer.append(TEXT_472); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_456); + stringBuffer.append(TEXT_473); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_457); + stringBuffer.append(TEXT_474); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_458); + stringBuffer.append(TEXT_475); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_459); + stringBuffer.append(TEXT_476); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_460); + stringBuffer.append(TEXT_477); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_461); + stringBuffer.append(TEXT_478); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_462); + stringBuffer.append(TEXT_479); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_463); + stringBuffer.append(TEXT_480); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_464); + stringBuffer.append(TEXT_481); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_465); + stringBuffer.append(TEXT_482); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_466); + stringBuffer.append(TEXT_483); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_467); + stringBuffer.append(TEXT_484); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_468); + stringBuffer.append(TEXT_485); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_469); + stringBuffer.append(TEXT_486); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); @@ -2666,37 +2746,37 @@ continue; } - stringBuffer.append(TEXT_470); + stringBuffer.append(TEXT_487); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_471); + stringBuffer.append(TEXT_488); stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_472); + stringBuffer.append(TEXT_489); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_473); + stringBuffer.append(TEXT_490); } for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_474); + stringBuffer.append(TEXT_491); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_475); + stringBuffer.append(TEXT_492); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_476); + stringBuffer.append(TEXT_493); } - stringBuffer.append(TEXT_477); + stringBuffer.append(TEXT_494); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_478); + stringBuffer.append(TEXT_495); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_479); - stringBuffer.append(TEXT_480); - stringBuffer.append(TEXT_481); + stringBuffer.append(TEXT_496); + stringBuffer.append(TEXT_497); + stringBuffer.append(TEXT_498); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_482); + stringBuffer.append(TEXT_499); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_483); + stringBuffer.append(TEXT_500); Map genFeature2genLinkMap = new LinkedHashMap(); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -2719,18 +2799,18 @@ } if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { - stringBuffer.append(TEXT_484); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_485); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_486); + stringBuffer.append(TEXT_501); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_487); + stringBuffer.append(TEXT_502); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_503); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_504); } if (!genFeature2genLinkMap.isEmpty()) { - stringBuffer.append(TEXT_488); + stringBuffer.append(TEXT_505); } for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { @@ -2739,34 +2819,32 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_489); + stringBuffer.append(TEXT_506); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_490); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_491); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_492); + stringBuffer.append(TEXT_507); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); + stringBuffer.append(TEXT_508); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_493); + stringBuffer.append(TEXT_509); } else { - stringBuffer.append(TEXT_494); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_495); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_496); + stringBuffer.append(TEXT_510); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_511); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); + stringBuffer.append(TEXT_512); } - stringBuffer.append(TEXT_497); + stringBuffer.append(TEXT_513); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_498); + stringBuffer.append(TEXT_514); boolean generateSwitch = genLinksCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_499); + stringBuffer.append(TEXT_515); } for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { @@ -2774,65 +2852,65 @@ TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (generateSwitch) { - stringBuffer.append(TEXT_500); + stringBuffer.append(TEXT_516); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_501); + stringBuffer.append(TEXT_517); } else { - stringBuffer.append(TEXT_502); + stringBuffer.append(TEXT_518); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_503); + stringBuffer.append(TEXT_519); } if (modelFacet.getSourceMetaFeature() != null) { - stringBuffer.append(TEXT_504); + stringBuffer.append(TEXT_520); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_505); - stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_506); - stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor()); - stringBuffer.append(TEXT_507); + stringBuffer.append(TEXT_521); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_522); + myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false); + stringBuffer.append(TEXT_523); } else { - stringBuffer.append(TEXT_508); + stringBuffer.append(TEXT_524); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_509); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_510); + stringBuffer.append(TEXT_525); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_526); } if (modelFacet.getTargetMetaFeature() != null) { - stringBuffer.append(TEXT_511); + stringBuffer.append(TEXT_527); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_512); - stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_513); - stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor()); - stringBuffer.append(TEXT_514); + stringBuffer.append(TEXT_528); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_529); + myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false); + stringBuffer.append(TEXT_530); } else { - stringBuffer.append(TEXT_515); + stringBuffer.append(TEXT_531); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_516); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_517); + stringBuffer.append(TEXT_532); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_533); } - stringBuffer.append(TEXT_518); + stringBuffer.append(TEXT_534); if (generateSwitch) { - stringBuffer.append(TEXT_519); + stringBuffer.append(TEXT_535); } else { - stringBuffer.append(TEXT_520); + stringBuffer.append(TEXT_536); } @@ -2840,12 +2918,12 @@ } //iterate over genLinksCollection if (generateSwitch) { - stringBuffer.append(TEXT_521); + stringBuffer.append(TEXT_537); } if (metaFeature.isListType()) { - stringBuffer.append(TEXT_522); + stringBuffer.append(TEXT_538); } } @@ -2855,101 +2933,99 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_523); + stringBuffer.append(TEXT_539); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_524); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_525); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_526); + stringBuffer.append(TEXT_540); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); + stringBuffer.append(TEXT_541); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_527); + stringBuffer.append(TEXT_542); } else { - stringBuffer.append(TEXT_528); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_529); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_530); + stringBuffer.append(TEXT_543); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_544); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); + stringBuffer.append(TEXT_545); } - stringBuffer.append(TEXT_531); + stringBuffer.append(TEXT_546); for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); - stringBuffer.append(TEXT_532); + stringBuffer.append(TEXT_547); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_533); + stringBuffer.append(TEXT_548); } - stringBuffer.append(TEXT_534); + stringBuffer.append(TEXT_549); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_535); + stringBuffer.append(TEXT_550); } } - stringBuffer.append(TEXT_536); + stringBuffer.append(TEXT_551); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_537); + stringBuffer.append(TEXT_552); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_538); + stringBuffer.append(TEXT_553); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_539); + stringBuffer.append(TEXT_554); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_540); + stringBuffer.append(TEXT_555); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_541); + stringBuffer.append(TEXT_556); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_542); + stringBuffer.append(TEXT_557); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_543); + stringBuffer.append(TEXT_558); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_544); + stringBuffer.append(TEXT_559); if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_545); + stringBuffer.append(TEXT_560); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_546); + stringBuffer.append(TEXT_561); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_547); + stringBuffer.append(TEXT_562); } if (myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_548); + stringBuffer.append(TEXT_563); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_549); + stringBuffer.append(TEXT_564); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_550); + stringBuffer.append(TEXT_565); for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_551); + stringBuffer.append(TEXT_566); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_552); + stringBuffer.append(TEXT_567); } - stringBuffer.append(TEXT_553); + stringBuffer.append(TEXT_568); if (myHelper.containsTypeModelFacetLinks()) { - stringBuffer.append(TEXT_554); + stringBuffer.append(TEXT_569); } else { - stringBuffer.append(TEXT_555); + stringBuffer.append(TEXT_570); } } @@ -2959,61 +3035,61 @@ if (myHelper.containsTypeModelFacetLinks()) { if (!myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_556); + stringBuffer.append(TEXT_571); } - stringBuffer.append(TEXT_557); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_558); + stringBuffer.append(TEXT_572); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_573); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_559); + stringBuffer.append(TEXT_574); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_560); + stringBuffer.append(TEXT_575); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_561); + stringBuffer.append(TEXT_576); } - stringBuffer.append(TEXT_562); + stringBuffer.append(TEXT_577); } - stringBuffer.append(TEXT_563); + stringBuffer.append(TEXT_578); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_564); + stringBuffer.append(TEXT_579); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_565); + stringBuffer.append(TEXT_580); } } //end of local declarations - stringBuffer.append(TEXT_566); - stringBuffer.append(TEXT_567); - stringBuffer.append(TEXT_568); + stringBuffer.append(TEXT_581); + stringBuffer.append(TEXT_582); + stringBuffer.append(TEXT_583); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_569); + stringBuffer.append(TEXT_584); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_570); + stringBuffer.append(TEXT_585); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_571); - stringBuffer.append(TEXT_572); - stringBuffer.append(TEXT_573); + stringBuffer.append(TEXT_586); + stringBuffer.append(TEXT_587); + stringBuffer.append(TEXT_588); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_574); + stringBuffer.append(TEXT_589); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_575); + stringBuffer.append(TEXT_590); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_576); + stringBuffer.append(TEXT_591); final String primaryView = "getDiagramNode()"; - stringBuffer.append(TEXT_577); + stringBuffer.append(TEXT_592); boolean isFixedFontSetInFigure; { @@ -3021,137 +3097,137 @@ isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_578); + stringBuffer.append(TEXT_593); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_579); + stringBuffer.append(TEXT_594); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_580); + stringBuffer.append(TEXT_595); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_581); + stringBuffer.append(TEXT_596); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_582); + stringBuffer.append(TEXT_597); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_583); + stringBuffer.append(TEXT_598); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_584); + stringBuffer.append(TEXT_599); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_585); + stringBuffer.append(TEXT_600); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_586); + stringBuffer.append(TEXT_601); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_587); + stringBuffer.append(TEXT_602); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_588); + stringBuffer.append(TEXT_603); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_589); + stringBuffer.append(TEXT_604); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_590); + stringBuffer.append(TEXT_605); } - stringBuffer.append(TEXT_591); + stringBuffer.append(TEXT_606); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_592); + stringBuffer.append(TEXT_607); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_593); + stringBuffer.append(TEXT_608); } - stringBuffer.append(TEXT_594); - stringBuffer.append(TEXT_595); - stringBuffer.append(TEXT_596); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); - stringBuffer.append(TEXT_597); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); - stringBuffer.append(TEXT_598); - stringBuffer.append(primaryView); - stringBuffer.append(TEXT_599); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_600); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_601); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_602); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_603); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_604); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); - stringBuffer.append(TEXT_605); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); - stringBuffer.append(TEXT_606); - stringBuffer.append(primaryView); - stringBuffer.append(TEXT_607); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_608); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_609); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_610); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_611); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); stringBuffer.append(TEXT_612); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); stringBuffer.append(TEXT_613); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_614); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_615); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_616); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_617); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_618); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_619); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); stringBuffer.append(TEXT_620); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); stringBuffer.append(TEXT_621); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_622); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_623); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_624); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_625); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_626); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_627); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_628); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_629); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_630); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_631); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_632); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_633); stringBuffer.append(TEXT_634); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_635); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_636); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_637); + stringBuffer.append(TEXT_638); + stringBuffer.append(TEXT_639); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_640); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_641); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_642); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_643); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_644); + stringBuffer.append(TEXT_645); + stringBuffer.append(TEXT_646); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_647); + stringBuffer.append(TEXT_648); + stringBuffer.append(TEXT_649); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_650); + stringBuffer.append(TEXT_651); + stringBuffer.append(TEXT_652); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_638); - stringBuffer.append(TEXT_639); - stringBuffer.append(TEXT_640); + stringBuffer.append(TEXT_653); + stringBuffer.append(TEXT_654); + stringBuffer.append(TEXT_655); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_641); + stringBuffer.append(TEXT_656); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_642); + stringBuffer.append(TEXT_657); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_643); + stringBuffer.append(TEXT_658); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_644); - stringBuffer.append(TEXT_645); - stringBuffer.append(TEXT_646); + stringBuffer.append(TEXT_659); + stringBuffer.append(TEXT_660); + stringBuffer.append(TEXT_661); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_647); + stringBuffer.append(TEXT_662); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_648); + stringBuffer.append(TEXT_663); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -3179,110 +3255,107 @@ } GenLinkConstraints linkConstraints = genLink.getCreationConstraints(); - stringBuffer.append(TEXT_649); + stringBuffer.append(TEXT_664); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_650); + stringBuffer.append(TEXT_665); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_651); + stringBuffer.append(TEXT_666); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_652); + stringBuffer.append(TEXT_667); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_653); + stringBuffer.append(TEXT_668); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_654); + stringBuffer.append(TEXT_669); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_655); + stringBuffer.append(TEXT_670); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_656); + stringBuffer.append(TEXT_671); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_657); + stringBuffer.append(TEXT_672); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_658); + stringBuffer.append(TEXT_673); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_659); + stringBuffer.append(TEXT_674); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_660); + stringBuffer.append(TEXT_675); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_661); + stringBuffer.append(TEXT_676); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_662); + stringBuffer.append(TEXT_677); if (linkConstraints != null) { - stringBuffer.append(TEXT_663); + stringBuffer.append(TEXT_678); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_664); + stringBuffer.append(TEXT_679); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_665); + stringBuffer.append(TEXT_680); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_666); + stringBuffer.append(TEXT_681); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_667); + stringBuffer.append(TEXT_682); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_668); + stringBuffer.append(TEXT_683); } else { - stringBuffer.append(TEXT_669); + stringBuffer.append(TEXT_684); } - stringBuffer.append(TEXT_670); + stringBuffer.append(TEXT_685); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); if (containmentFeature == null) { - stringBuffer.append(TEXT_671); + stringBuffer.append(TEXT_686); } else { - stringBuffer.append(TEXT_672); + stringBuffer.append(TEXT_687); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_673); + stringBuffer.append(TEXT_688); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_674); + stringBuffer.append(TEXT_689); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_675); + stringBuffer.append(TEXT_690); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_676); + stringBuffer.append(TEXT_691); { GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); - stringBuffer.append(TEXT_677); + stringBuffer.append(TEXT_692); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_678); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_679); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_680); + stringBuffer.append(TEXT_693); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_694); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_681); + stringBuffer.append(TEXT_695); } else { - stringBuffer.append(TEXT_682); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_683); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_684); + stringBuffer.append(TEXT_696); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_697); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_685); + stringBuffer.append(TEXT_698); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_686); + stringBuffer.append(TEXT_699); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_687); + stringBuffer.append(TEXT_700); } } @@ -3295,34 +3368,31 @@ GenFeature _feature = childFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); - stringBuffer.append(TEXT_688); + stringBuffer.append(TEXT_701); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_689); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_690); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_691); + stringBuffer.append(TEXT_702); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_703); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_692); + stringBuffer.append(TEXT_704); } else { - stringBuffer.append(TEXT_693); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_694); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_695); + stringBuffer.append(TEXT_705); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_706); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_696); + stringBuffer.append(TEXT_707); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_697); + stringBuffer.append(TEXT_708); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_698); + stringBuffer.append(TEXT_709); } } @@ -3336,59 +3406,56 @@ String _source = "newSource.getElement()"; String _target = "edge.getTarget().getElement()"; - stringBuffer.append(TEXT_699); + stringBuffer.append(TEXT_710); if (linkConstraints != null) { - stringBuffer.append(TEXT_700); + stringBuffer.append(TEXT_711); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_701); + stringBuffer.append(TEXT_712); stringBuffer.append(_source); - stringBuffer.append(TEXT_702); + stringBuffer.append(TEXT_713); stringBuffer.append(_target); - stringBuffer.append(TEXT_703); + stringBuffer.append(TEXT_714); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_704); + stringBuffer.append(TEXT_715); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); { GenFeature _feature = metaFeature; - String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") newSource.getElement())"; + String _ownerInstance = "newSource.getElement()"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = null; - stringBuffer.append(TEXT_705); + stringBuffer.append(TEXT_716); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_706); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_707); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_708); + stringBuffer.append(TEXT_717); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_718); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_709); + stringBuffer.append(TEXT_719); } else { - stringBuffer.append(TEXT_710); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_711); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_712); + stringBuffer.append(TEXT_720); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_721); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_713); + stringBuffer.append(TEXT_722); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_714); + stringBuffer.append(TEXT_723); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_715); + stringBuffer.append(TEXT_724); } } @@ -3399,44 +3466,44 @@ String _source = "newSource.getElement()"; String _target = "edge.getTarget().getElement()"; - stringBuffer.append(TEXT_716); + stringBuffer.append(TEXT_725); if (linkConstraints != null) { - stringBuffer.append(TEXT_717); + stringBuffer.append(TEXT_726); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_718); + stringBuffer.append(TEXT_727); stringBuffer.append(_source); - stringBuffer.append(TEXT_719); + stringBuffer.append(TEXT_728); stringBuffer.append(_target); - stringBuffer.append(TEXT_720); + stringBuffer.append(TEXT_729); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_721); + stringBuffer.append(TEXT_730); } else { - stringBuffer.append(TEXT_722); + stringBuffer.append(TEXT_731); } - stringBuffer.append(TEXT_723); + stringBuffer.append(TEXT_732); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_724); + stringBuffer.append(TEXT_733); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_725); + stringBuffer.append(TEXT_734); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_726); + stringBuffer.append(TEXT_735); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_727); + stringBuffer.append(TEXT_736); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_728); + stringBuffer.append(TEXT_737); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); - stringBuffer.append(TEXT_729); + stringBuffer.append(TEXT_738); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -3455,110 +3522,110 @@ } if (containmentFeature != null || setChild) { - stringBuffer.append(TEXT_730); + stringBuffer.append(TEXT_739); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_731); + stringBuffer.append(TEXT_740); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_732); + stringBuffer.append(TEXT_741); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_733); + stringBuffer.append(TEXT_742); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_734); + stringBuffer.append(TEXT_743); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_735); + stringBuffer.append(TEXT_744); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_736); + stringBuffer.append(TEXT_745); } if (containmentFeature != null) { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_737); + stringBuffer.append(TEXT_746); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_738); + stringBuffer.append(TEXT_747); } else { - stringBuffer.append(TEXT_739); + stringBuffer.append(TEXT_748); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_740); + stringBuffer.append(TEXT_749); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_741); + stringBuffer.append(TEXT_750); } - stringBuffer.append(TEXT_742); + stringBuffer.append(TEXT_751); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_743); + stringBuffer.append(TEXT_752); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_744); + stringBuffer.append(TEXT_753); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_745); + stringBuffer.append(TEXT_754); } if (setChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_746); + stringBuffer.append(TEXT_755); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_747); + stringBuffer.append(TEXT_756); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_748); + stringBuffer.append(TEXT_757); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_749); + stringBuffer.append(TEXT_758); } else { - stringBuffer.append(TEXT_750); + stringBuffer.append(TEXT_759); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_751); + stringBuffer.append(TEXT_760); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_752); + stringBuffer.append(TEXT_761); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_753); + stringBuffer.append(TEXT_762); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_754); + stringBuffer.append(TEXT_763); } - stringBuffer.append(TEXT_755); + stringBuffer.append(TEXT_764); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_756); + stringBuffer.append(TEXT_765); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_757); + stringBuffer.append(TEXT_766); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_758); + stringBuffer.append(TEXT_767); } - stringBuffer.append(TEXT_759); + stringBuffer.append(TEXT_768); if (setSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_760); + stringBuffer.append(TEXT_769); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_761); + stringBuffer.append(TEXT_770); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_762); + stringBuffer.append(TEXT_771); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_763); + stringBuffer.append(TEXT_772); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_764); + stringBuffer.append(TEXT_773); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_765); + stringBuffer.append(TEXT_774); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_766); + stringBuffer.append(TEXT_775); } else { - stringBuffer.append(TEXT_767); + stringBuffer.append(TEXT_776); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_768); + stringBuffer.append(TEXT_777); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_769); + stringBuffer.append(TEXT_778); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_770); + stringBuffer.append(TEXT_779); } } @@ -3566,53 +3633,53 @@ GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_771); + stringBuffer.append(TEXT_780); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_772); + stringBuffer.append(TEXT_781); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_773); + stringBuffer.append(TEXT_782); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_774); + stringBuffer.append(TEXT_783); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_775); + stringBuffer.append(TEXT_784); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_776); + stringBuffer.append(TEXT_785); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_777); + stringBuffer.append(TEXT_786); } else { - stringBuffer.append(TEXT_778); + stringBuffer.append(TEXT_787); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_779); + stringBuffer.append(TEXT_788); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_780); + stringBuffer.append(TEXT_789); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_781); + stringBuffer.append(TEXT_790); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_782); + stringBuffer.append(TEXT_791); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_783); + stringBuffer.append(TEXT_792); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_784); + stringBuffer.append(TEXT_793); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_785); + stringBuffer.append(TEXT_794); } } - stringBuffer.append(TEXT_786); - stringBuffer.append(TEXT_787); + stringBuffer.append(TEXT_795); + stringBuffer.append(TEXT_796); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_788); + stringBuffer.append(TEXT_797); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_789); + stringBuffer.append(TEXT_798); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_790); + stringBuffer.append(TEXT_799); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_791); + stringBuffer.append(TEXT_800); } @@ -3620,15 +3687,15 @@ if (linkConstraints != null) { String _edge = "edge"; - stringBuffer.append(TEXT_792); + stringBuffer.append(TEXT_801); //input: _edge : String - stringBuffer.append(TEXT_793); + stringBuffer.append(TEXT_802); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_794); + stringBuffer.append(TEXT_803); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_795); + stringBuffer.append(TEXT_804); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -3655,250 +3722,247 @@ } } - stringBuffer.append(TEXT_796); + stringBuffer.append(TEXT_805); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_797); + stringBuffer.append(TEXT_806); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_798); + stringBuffer.append(TEXT_807); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_799); + stringBuffer.append(TEXT_808); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_800); + stringBuffer.append(TEXT_809); stringBuffer.append(_edge); - stringBuffer.append(TEXT_801); + stringBuffer.append(TEXT_810); stringBuffer.append(_edge); - stringBuffer.append(TEXT_802); + stringBuffer.append(TEXT_811); stringBuffer.append(_edge); - stringBuffer.append(TEXT_803); + stringBuffer.append(TEXT_812); } else { - stringBuffer.append(TEXT_804); + stringBuffer.append(TEXT_813); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_805); + stringBuffer.append(TEXT_814); stringBuffer.append(_edge); - stringBuffer.append(TEXT_806); + stringBuffer.append(TEXT_815); stringBuffer.append(_edge); - stringBuffer.append(TEXT_807); + stringBuffer.append(TEXT_816); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_808); + stringBuffer.append(TEXT_817); } } else { - stringBuffer.append(TEXT_809); + stringBuffer.append(TEXT_818); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_810); + stringBuffer.append(TEXT_819); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_811); + stringBuffer.append(TEXT_820); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_812); + stringBuffer.append(TEXT_821); stringBuffer.append(_edge); - stringBuffer.append(TEXT_813); + stringBuffer.append(TEXT_822); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_814); + stringBuffer.append(TEXT_823); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_815); + stringBuffer.append(TEXT_824); stringBuffer.append(_edge); - stringBuffer.append(TEXT_816); + stringBuffer.append(TEXT_825); } else { - stringBuffer.append(TEXT_817); + stringBuffer.append(TEXT_826); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_818); + stringBuffer.append(TEXT_827); stringBuffer.append(_edge); - stringBuffer.append(TEXT_819); + stringBuffer.append(TEXT_828); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_820); + stringBuffer.append(TEXT_829); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_821); + stringBuffer.append(TEXT_830); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_822); + stringBuffer.append(TEXT_831); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_823); + stringBuffer.append(TEXT_832); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_824); + stringBuffer.append(TEXT_833); stringBuffer.append(_edge); - stringBuffer.append(TEXT_825); + stringBuffer.append(TEXT_834); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_826); + stringBuffer.append(TEXT_835); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_827); + stringBuffer.append(TEXT_836); stringBuffer.append(_edge); - stringBuffer.append(TEXT_828); + stringBuffer.append(TEXT_837); } else { - stringBuffer.append(TEXT_829); + stringBuffer.append(TEXT_838); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_830); + stringBuffer.append(TEXT_839); stringBuffer.append(_edge); - stringBuffer.append(TEXT_831); + stringBuffer.append(TEXT_840); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_832); + stringBuffer.append(TEXT_841); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_833); + stringBuffer.append(TEXT_842); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_834); + stringBuffer.append(TEXT_843); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_835); + stringBuffer.append(TEXT_844); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_836); + stringBuffer.append(TEXT_845); stringBuffer.append(_edge); - stringBuffer.append(TEXT_837); + stringBuffer.append(TEXT_846); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_838); + stringBuffer.append(TEXT_847); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_839); + stringBuffer.append(TEXT_848); stringBuffer.append(_edge); - stringBuffer.append(TEXT_840); + stringBuffer.append(TEXT_849); } else { - stringBuffer.append(TEXT_841); + stringBuffer.append(TEXT_850); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_842); + stringBuffer.append(TEXT_851); stringBuffer.append(_edge); - stringBuffer.append(TEXT_843); + stringBuffer.append(TEXT_852); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_844); + stringBuffer.append(TEXT_853); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_845); + stringBuffer.append(TEXT_854); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_846); + stringBuffer.append(TEXT_855); } } - stringBuffer.append(TEXT_847); + stringBuffer.append(TEXT_856); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_848); + stringBuffer.append(TEXT_857); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_849); + stringBuffer.append(TEXT_858); stringBuffer.append(_edge); - stringBuffer.append(TEXT_850); + stringBuffer.append(TEXT_859); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_851); + stringBuffer.append(TEXT_860); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_852); + stringBuffer.append(TEXT_861); stringBuffer.append(_edge); - stringBuffer.append(TEXT_853); + stringBuffer.append(TEXT_862); } else { - stringBuffer.append(TEXT_854); + stringBuffer.append(TEXT_863); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_855); + stringBuffer.append(TEXT_864); stringBuffer.append(_edge); - stringBuffer.append(TEXT_856); + stringBuffer.append(TEXT_865); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_857); + stringBuffer.append(TEXT_866); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_858); + stringBuffer.append(TEXT_867); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_859); + stringBuffer.append(TEXT_868); } } - stringBuffer.append(TEXT_860); + stringBuffer.append(TEXT_869); } - stringBuffer.append(TEXT_861); + stringBuffer.append(TEXT_870); if (palette != null) { - stringBuffer.append(TEXT_862); + stringBuffer.append(TEXT_871); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_863); + stringBuffer.append(TEXT_872); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_864); + stringBuffer.append(TEXT_873); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_865); + stringBuffer.append(TEXT_874); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_866); + stringBuffer.append(TEXT_875); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_867); + stringBuffer.append(TEXT_876); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_868); + stringBuffer.append(TEXT_877); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); if (containmentFeature == null) { - stringBuffer.append(TEXT_869); + stringBuffer.append(TEXT_878); } else { - stringBuffer.append(TEXT_870); + stringBuffer.append(TEXT_879); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_871); + stringBuffer.append(TEXT_880); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_872); + stringBuffer.append(TEXT_881); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_873); + stringBuffer.append(TEXT_882); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_874); + stringBuffer.append(TEXT_883); { GenFeature _feature = containmentFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); - stringBuffer.append(TEXT_875); + stringBuffer.append(TEXT_884); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_876); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_877); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_878); + stringBuffer.append(TEXT_885); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_886); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_879); + stringBuffer.append(TEXT_887); } else { - stringBuffer.append(TEXT_880); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_881); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_882); + stringBuffer.append(TEXT_888); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_889); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_883); + stringBuffer.append(TEXT_890); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_884); + stringBuffer.append(TEXT_891); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_885); + stringBuffer.append(TEXT_892); } } @@ -3911,34 +3975,31 @@ GenFeature _feature = childFeature; String _ownerInstance = "container"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = containmentFeature.getGenClass(); - stringBuffer.append(TEXT_886); + stringBuffer.append(TEXT_893); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_887); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_888); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_889); + stringBuffer.append(TEXT_894); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_895); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_890); + stringBuffer.append(TEXT_896); } else { - stringBuffer.append(TEXT_891); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_892); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_893); + stringBuffer.append(TEXT_897); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_898); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_894); + stringBuffer.append(TEXT_899); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_895); + stringBuffer.append(TEXT_900); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_896); + stringBuffer.append(TEXT_901); } } @@ -3950,60 +4011,57 @@ String _source = "source.getElement()"; String _target = "null"; - stringBuffer.append(TEXT_897); + stringBuffer.append(TEXT_902); if (linkConstraints != null) { - stringBuffer.append(TEXT_898); + stringBuffer.append(TEXT_903); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_899); + stringBuffer.append(TEXT_904); stringBuffer.append(_source); - stringBuffer.append(TEXT_900); + stringBuffer.append(TEXT_905); stringBuffer.append(_target); - stringBuffer.append(TEXT_901); + stringBuffer.append(TEXT_906); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_902); + stringBuffer.append(TEXT_907); } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); { GenFeature _feature = metaFeature; - String _ownerInstance = "((" + importManager.getImportedName(outgoingClass.getQualifiedInterfaceName()) + ") source.getElement())"; + String _ownerInstance = "source.getElement()"; String _exceedsUpperBound = "return false;"; + GenClass _ownerGenClass = null; - stringBuffer.append(TEXT_903); + stringBuffer.append(TEXT_908); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_904); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_905); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_906); + stringBuffer.append(TEXT_909); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_910); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_907); + stringBuffer.append(TEXT_911); } else { - stringBuffer.append(TEXT_908); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_909); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_910); + stringBuffer.append(TEXT_912); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_913); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_911); + stringBuffer.append(TEXT_914); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_912); + stringBuffer.append(TEXT_915); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_913); + stringBuffer.append(TEXT_916); } } @@ -4014,47 +4072,47 @@ String _source = "source.getElement()"; String _target = "null"; - stringBuffer.append(TEXT_914); + stringBuffer.append(TEXT_917); if (linkConstraints != null) { - stringBuffer.append(TEXT_915); + stringBuffer.append(TEXT_918); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_916); + stringBuffer.append(TEXT_919); stringBuffer.append(_source); - stringBuffer.append(TEXT_917); + stringBuffer.append(TEXT_920); stringBuffer.append(_target); - stringBuffer.append(TEXT_918); + stringBuffer.append(TEXT_921); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_919); + stringBuffer.append(TEXT_922); } else { - stringBuffer.append(TEXT_920); + stringBuffer.append(TEXT_923); } - stringBuffer.append(TEXT_921); - stringBuffer.append(TEXT_922); + stringBuffer.append(TEXT_924); + stringBuffer.append(TEXT_925); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_923); + stringBuffer.append(TEXT_926); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_924); + stringBuffer.append(TEXT_927); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_925); + stringBuffer.append(TEXT_928); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_926); + stringBuffer.append(TEXT_929); } - stringBuffer.append(TEXT_927); + stringBuffer.append(TEXT_930); } //if there's palette } //outgoing links @@ -4084,202 +4142,202 @@ } GenLinkConstraints linkConstraints = genLink.getCreationConstraints(); - stringBuffer.append(TEXT_928); + stringBuffer.append(TEXT_931); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_929); + stringBuffer.append(TEXT_932); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_930); + stringBuffer.append(TEXT_933); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_931); + stringBuffer.append(TEXT_934); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_932); + stringBuffer.append(TEXT_935); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_933); + stringBuffer.append(TEXT_936); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_934); + stringBuffer.append(TEXT_937); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_935); + stringBuffer.append(TEXT_938); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ReconnectRequest")); - stringBuffer.append(TEXT_936); + stringBuffer.append(TEXT_939); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_937); + stringBuffer.append(TEXT_940); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_938); + stringBuffer.append(TEXT_941); stringBuffer.append(reconnectCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_939); + stringBuffer.append(TEXT_942); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_940); + stringBuffer.append(TEXT_943); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_941); + stringBuffer.append(TEXT_944); if (linkConstraints != null) { - stringBuffer.append(TEXT_942); + stringBuffer.append(TEXT_945); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_943); + stringBuffer.append(TEXT_946); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_944); + stringBuffer.append(TEXT_947); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_945); + stringBuffer.append(TEXT_948); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_946); + stringBuffer.append(TEXT_949); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_947); + stringBuffer.append(TEXT_950); } else { - stringBuffer.append(TEXT_948); + stringBuffer.append(TEXT_951); } - stringBuffer.append(TEXT_949); + stringBuffer.append(TEXT_952); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { { String _source = "edge.getSource().getElement()"; String _target = "newTarget.getElement()"; - stringBuffer.append(TEXT_950); + stringBuffer.append(TEXT_953); if (linkConstraints != null) { - stringBuffer.append(TEXT_951); + stringBuffer.append(TEXT_954); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_952); + stringBuffer.append(TEXT_955); stringBuffer.append(_source); - stringBuffer.append(TEXT_953); + stringBuffer.append(TEXT_956); stringBuffer.append(_target); - stringBuffer.append(TEXT_954); + stringBuffer.append(TEXT_957); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_955); + stringBuffer.append(TEXT_958); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { { String _source = "edge.getSource().getElement()"; String _target = "newTarget.getElement()"; - stringBuffer.append(TEXT_956); + stringBuffer.append(TEXT_959); if (linkConstraints != null) { - stringBuffer.append(TEXT_957); + stringBuffer.append(TEXT_960); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_958); + stringBuffer.append(TEXT_961); stringBuffer.append(_source); - stringBuffer.append(TEXT_959); + stringBuffer.append(TEXT_962); stringBuffer.append(_target); - stringBuffer.append(TEXT_960); + stringBuffer.append(TEXT_963); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_961); + stringBuffer.append(TEXT_964); } else { - stringBuffer.append(TEXT_962); + stringBuffer.append(TEXT_965); } - stringBuffer.append(TEXT_963); + stringBuffer.append(TEXT_966); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_964); + stringBuffer.append(TEXT_967); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_965); + stringBuffer.append(TEXT_968); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_966); + stringBuffer.append(TEXT_969); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_967); + stringBuffer.append(TEXT_970); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_968); + stringBuffer.append(TEXT_971); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); - stringBuffer.append(TEXT_969); + stringBuffer.append(TEXT_972); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature targetFeature = modelFacet.getTargetMetaFeature(); if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_970); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_971); - stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_972); - stringBuffer.append(targetFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_973); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_974); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_975); stringBuffer.append(targetFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_976); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(TEXT_977); + stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_978); + stringBuffer.append(targetFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_979); } else { - stringBuffer.append(TEXT_977); + stringBuffer.append(TEXT_980); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_978); + stringBuffer.append(TEXT_981); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_979); + stringBuffer.append(TEXT_982); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_980); + stringBuffer.append(TEXT_983); } } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_981); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_982); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_983); - stringBuffer.append(metaFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_984); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_985); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_986); stringBuffer.append(metaFeature.getFeatureAccessorName()); stringBuffer.append(TEXT_987); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); + stringBuffer.append(TEXT_988); + stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_989); + stringBuffer.append(metaFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_990); } else { - stringBuffer.append(TEXT_988); + stringBuffer.append(TEXT_991); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_989); + stringBuffer.append(TEXT_992); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_990); + stringBuffer.append(TEXT_993); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_991); + stringBuffer.append(TEXT_994); } } - stringBuffer.append(TEXT_992); + stringBuffer.append(TEXT_995); if (linkConstraints != null) { String _edge = "edge"; - stringBuffer.append(TEXT_993); + stringBuffer.append(TEXT_996); //input: _edge : String - stringBuffer.append(TEXT_994); + stringBuffer.append(TEXT_997); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_995); + stringBuffer.append(TEXT_998); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_996); + stringBuffer.append(TEXT_999); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); @@ -4306,248 +4364,260 @@ } } - stringBuffer.append(TEXT_997); + stringBuffer.append(TEXT_1000); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_998); + stringBuffer.append(TEXT_1001); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_999); + stringBuffer.append(TEXT_1002); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_1000); + stringBuffer.append(TEXT_1003); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_1001); + stringBuffer.append(TEXT_1004); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1002); + stringBuffer.append(TEXT_1005); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1003); + stringBuffer.append(TEXT_1006); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1004); + stringBuffer.append(TEXT_1007); } else { - stringBuffer.append(TEXT_1005); + stringBuffer.append(TEXT_1008); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1006); + stringBuffer.append(TEXT_1009); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1007); + stringBuffer.append(TEXT_1010); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1008); + stringBuffer.append(TEXT_1011); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1009); + stringBuffer.append(TEXT_1012); } } else { - stringBuffer.append(TEXT_1010); + stringBuffer.append(TEXT_1013); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_1011); + stringBuffer.append(TEXT_1014); } if (removeChild) { if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_1012); + stringBuffer.append(TEXT_1015); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_1013); + stringBuffer.append(TEXT_1016); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1014); + stringBuffer.append(TEXT_1017); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1015); + stringBuffer.append(TEXT_1018); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1016); + stringBuffer.append(TEXT_1019); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1017); + stringBuffer.append(TEXT_1020); } else { - stringBuffer.append(TEXT_1018); + stringBuffer.append(TEXT_1021); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1019); + stringBuffer.append(TEXT_1022); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1020); + stringBuffer.append(TEXT_1023); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1021); + stringBuffer.append(TEXT_1024); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1022); + stringBuffer.append(TEXT_1025); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1023); + stringBuffer.append(TEXT_1026); } } if (removeSource) { if (sourceFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_1024); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_1025); - stringBuffer.append(_edge); - stringBuffer.append(TEXT_1026); - stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); stringBuffer.append(TEXT_1027); - stringBuffer.append(sourceFeature.getFeatureAccessorName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); stringBuffer.append(TEXT_1028); stringBuffer.append(_edge); stringBuffer.append(TEXT_1029); + stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_1030); + stringBuffer.append(sourceFeature.getFeatureAccessorName()); + stringBuffer.append(TEXT_1031); + stringBuffer.append(_edge); + stringBuffer.append(TEXT_1032); } else { - stringBuffer.append(TEXT_1030); + stringBuffer.append(TEXT_1033); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1031); + stringBuffer.append(TEXT_1034); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1032); + stringBuffer.append(TEXT_1035); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1033); + stringBuffer.append(TEXT_1036); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1034); + stringBuffer.append(TEXT_1037); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1035); + stringBuffer.append(TEXT_1038); } } if (removeTarget) { if (targetFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_1036); + stringBuffer.append(TEXT_1039); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_1037); + stringBuffer.append(TEXT_1040); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1038); + stringBuffer.append(TEXT_1041); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1039); + stringBuffer.append(TEXT_1042); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1040); + stringBuffer.append(TEXT_1043); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1041); + stringBuffer.append(TEXT_1044); } else { - stringBuffer.append(TEXT_1042); + stringBuffer.append(TEXT_1045); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1043); + stringBuffer.append(TEXT_1046); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1044); + stringBuffer.append(TEXT_1047); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1045); + stringBuffer.append(TEXT_1048); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1046); + stringBuffer.append(TEXT_1049); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1047); + stringBuffer.append(TEXT_1050); } } - stringBuffer.append(TEXT_1048); + stringBuffer.append(TEXT_1051); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); if (metaFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_1049); + stringBuffer.append(TEXT_1052); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_1050); + stringBuffer.append(TEXT_1053); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1051); + stringBuffer.append(TEXT_1054); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1052); + stringBuffer.append(TEXT_1055); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1053); + stringBuffer.append(TEXT_1056); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1054); + stringBuffer.append(TEXT_1057); } else { - stringBuffer.append(TEXT_1055); + stringBuffer.append(TEXT_1058); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1056); + stringBuffer.append(TEXT_1059); stringBuffer.append(_edge); - stringBuffer.append(TEXT_1057); + stringBuffer.append(TEXT_1060); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1058); + stringBuffer.append(TEXT_1061); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1059); + stringBuffer.append(TEXT_1062); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1060); + stringBuffer.append(TEXT_1063); } } - stringBuffer.append(TEXT_1061); + stringBuffer.append(TEXT_1064); } - stringBuffer.append(TEXT_1062); + stringBuffer.append(TEXT_1065); if (palette != null) { - stringBuffer.append(TEXT_1063); + stringBuffer.append(TEXT_1066); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_1064); + stringBuffer.append(TEXT_1067); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_1065); + stringBuffer.append(TEXT_1068); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1066); + stringBuffer.append(TEXT_1069); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1067); + stringBuffer.append(TEXT_1070); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_1068); + stringBuffer.append(TEXT_1071); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_1069); + stringBuffer.append(TEXT_1072); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_1070); + stringBuffer.append(TEXT_1073); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1071); + stringBuffer.append(TEXT_1074); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1072); + stringBuffer.append(TEXT_1075); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1073); + stringBuffer.append(TEXT_1076); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_1074); + stringBuffer.append(TEXT_1077); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_1075); + stringBuffer.append(TEXT_1078); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_1076); + stringBuffer.append(TEXT_1079); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenClass linkClass = modelFacet.getMetaClass(); - stringBuffer.append(TEXT_1077); + stringBuffer.append(TEXT_1080); stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName()))); - stringBuffer.append(TEXT_1078); + stringBuffer.append(TEXT_1081); stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_1079); + stringBuffer.append(TEXT_1082); stringBuffer.append(linkClass.getClassifierAccessorName()); - stringBuffer.append(TEXT_1080); + stringBuffer.append(TEXT_1083); + if (linkClass.isExternalInterface()) { + stringBuffer.append(TEXT_1084); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_1085); + } + stringBuffer.append(TEXT_1086); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_1081); + stringBuffer.append(TEXT_1087); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_1082); + stringBuffer.append(TEXT_1088); stringBuffer.append(genLink.getUniqueIdentifier()); - stringBuffer.append(TEXT_1083); + stringBuffer.append(TEXT_1089); + if (linkClass.isExternalInterface()) { + stringBuffer.append(TEXT_1090); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_1091); + } + stringBuffer.append(TEXT_1092); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { - stringBuffer.append(TEXT_1084); + stringBuffer.append(TEXT_1093); } - stringBuffer.append(TEXT_1085); + stringBuffer.append(TEXT_1094); stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_1086); + stringBuffer.append(TEXT_1095); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_1087); + stringBuffer.append(TEXT_1096); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_1088); + stringBuffer.append(TEXT_1097); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_1089); + stringBuffer.append(TEXT_1098); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature sourceFeature = modelFacet.getSourceMetaFeature(); @@ -4574,30 +4644,30 @@ } } - stringBuffer.append(TEXT_1090); + stringBuffer.append(TEXT_1099); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_1091); + stringBuffer.append(TEXT_1100); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1092); + stringBuffer.append(TEXT_1101); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_1093); + stringBuffer.append(TEXT_1102); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1094); + stringBuffer.append(TEXT_1103); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1095); + stringBuffer.append(TEXT_1104); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1096); + stringBuffer.append(TEXT_1105); } if (addChild) { - stringBuffer.append(TEXT_1097); + stringBuffer.append(TEXT_1106); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1098); + stringBuffer.append(TEXT_1107); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1099); + stringBuffer.append(TEXT_1108); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1100); + stringBuffer.append(TEXT_1109); } if (addSource) { @@ -4605,34 +4675,31 @@ GenFeature _feature = sourceFeature; String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + GenClass _ownerGenClass = modelFacet.getMetaClass(); - stringBuffer.append(TEXT_1101); + stringBuffer.append(TEXT_1110); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_1102); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_1103); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_1104); + stringBuffer.append(TEXT_1111); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_1112); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_1105); + stringBuffer.append(TEXT_1113); } else { - stringBuffer.append(TEXT_1106); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_1107); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_1108); + stringBuffer.append(TEXT_1114); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_1115); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1109); + stringBuffer.append(TEXT_1116); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1110); + stringBuffer.append(TEXT_1117); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_1111); + stringBuffer.append(TEXT_1118); } } @@ -4640,13 +4707,13 @@ } - stringBuffer.append(TEXT_1112); + stringBuffer.append(TEXT_1119); stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1113); + stringBuffer.append(TEXT_1120); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1114); + stringBuffer.append(TEXT_1121); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1115); + stringBuffer.append(TEXT_1122); } if (addTarget) { @@ -4654,34 +4721,31 @@ GenFeature _feature = targetFeature; String _ownerInstance = "createdDomainElement"; String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + GenClass _ownerGenClass = modelFacet.getMetaClass(); - stringBuffer.append(TEXT_1116); + stringBuffer.append(TEXT_1123); int upperBound = _feature.getEcoreFeature().getUpperBound(); if (upperBound > 0) { if (upperBound == 1) { - stringBuffer.append(TEXT_1117); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_1118); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_1119); + stringBuffer.append(TEXT_1124); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, false); + stringBuffer.append(TEXT_1125); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_1120); + stringBuffer.append(TEXT_1126); } else { - stringBuffer.append(TEXT_1121); - stringBuffer.append(_ownerInstance); - stringBuffer.append(TEXT_1122); - stringBuffer.append(_feature.getGetAccessor()); - stringBuffer.append(TEXT_1123); + stringBuffer.append(TEXT_1127); + myFeatureGetAccessorHelper.appendFeatureValueGetter(_ownerInstance, _feature, _ownerGenClass, true); + stringBuffer.append(TEXT_1128); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1124); + stringBuffer.append(TEXT_1129); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1125); + stringBuffer.append(TEXT_1130); stringBuffer.append(_exceedsUpperBound); - stringBuffer.append(TEXT_1126); + stringBuffer.append(TEXT_1131); } } @@ -4689,70 +4753,70 @@ } - stringBuffer.append(TEXT_1127); + stringBuffer.append(TEXT_1132); stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1128); + stringBuffer.append(TEXT_1133); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1129); + stringBuffer.append(TEXT_1134); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1130); + stringBuffer.append(TEXT_1135); } - stringBuffer.append(TEXT_1131); + stringBuffer.append(TEXT_1136); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_1132); + stringBuffer.append(TEXT_1137); stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_1133); + stringBuffer.append(TEXT_1138); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_1134); + stringBuffer.append(TEXT_1139); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_1135); + stringBuffer.append(TEXT_1140); } - stringBuffer.append(TEXT_1136); - stringBuffer.append(TEXT_1137); + stringBuffer.append(TEXT_1141); + stringBuffer.append(TEXT_1142); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_1138); + stringBuffer.append(TEXT_1143); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_1139); + stringBuffer.append(TEXT_1144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_1140); + stringBuffer.append(TEXT_1145); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_1141); + stringBuffer.append(TEXT_1146); } - stringBuffer.append(TEXT_1142); + stringBuffer.append(TEXT_1147); { String _source = "source.getElement()"; String _target = "target.getElement()"; - stringBuffer.append(TEXT_1143); + stringBuffer.append(TEXT_1148); if (linkConstraints != null) { - stringBuffer.append(TEXT_1144); + stringBuffer.append(TEXT_1149); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")+"."+genDiagram.getLinkCreationConstraintsClassName()+"."+linkConstraints.getConstraintsInstanceFieldName()); - stringBuffer.append(TEXT_1145); + stringBuffer.append(TEXT_1150); stringBuffer.append(_source); - stringBuffer.append(TEXT_1146); + stringBuffer.append(TEXT_1151); stringBuffer.append(_target); - stringBuffer.append(TEXT_1147); + stringBuffer.append(TEXT_1152); } } //local declarations for linkConstraints.jetinc - stringBuffer.append(TEXT_1148); + stringBuffer.append(TEXT_1153); } @@ -4761,22 +4825,22 @@ if (genNode.getViewmap() instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody(); - stringBuffer.append(TEXT_1149); + stringBuffer.append(TEXT_1154); stringBuffer.append(classBody); - stringBuffer.append(TEXT_1150); + stringBuffer.append(TEXT_1155); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_1151); + stringBuffer.append(TEXT_1156); } } - stringBuffer.append(TEXT_1152); + stringBuffer.append(TEXT_1157); importManager.emitSortedImports(); - stringBuffer.append(TEXT_1153); + stringBuffer.append(TEXT_1158); 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.6 diff -u -r1.6 CompartmentEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.6 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java 3 Aug 2006 18:47:09 -0000 @@ -20,271 +20,292 @@ protected final String TEXT_1 = ""; protected final String TEXT_2 = NL + "/*" + NL + " * "; protected final String TEXT_3 = NL + " */"; - protected final String TEXT_4 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_5 = " extends "; - protected final String TEXT_6 = " implements IUpdatableEditPart {"; - protected final String TEXT_7 = NL; - protected final String TEXT_8 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_9 = ";"; - protected final String TEXT_10 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_11 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_12 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_13 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_14 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; - protected final String TEXT_15 = NL + "\t\tinstallEditPolicy("; - protected final String TEXT_16 = ".LAYOUT_ROLE, new "; - protected final String TEXT_17 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final "; - protected final String TEXT_18 = " request, final EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; - protected final String TEXT_19 = " emfCommand = new "; - protected final String TEXT_20 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate "; - protected final String TEXT_21 = " moveDelta;" + NL + "\t\t\t\t\tprivate "; - protected final String TEXT_22 = " resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_23 = " original = new "; - protected final String TEXT_24 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_25 = " referenceFigure = (("; - protected final String TEXT_26 = ")child).getFigure();" + NL + "\t\t\t\t\t\treferenceFigure.translateToAbsolute(original);" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_27 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(transformed);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute("; - protected final String TEXT_28 = " move, "; - protected final String TEXT_29 = " 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_30 = ".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_31 = ".INSTANCE;" + NL + "\t\t\t}"; + protected final String TEXT_4 = NL; + protected final String TEXT_5 = NL; + protected final String TEXT_6 = "(("; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = "(("; + protected final String TEXT_9 = ")"; + protected final String TEXT_10 = ")"; + protected final String TEXT_11 = ".eGet("; + protected final String TEXT_12 = ".eINSTANCE.get"; + protected final String TEXT_13 = "())"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "(("; + protected final String TEXT_16 = ")"; + protected final String TEXT_17 = ")"; + protected final String TEXT_18 = "."; + protected final String TEXT_19 = "()"; + protected final String TEXT_20 = NL; + protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_22 = " extends "; + protected final String TEXT_23 = " implements IUpdatableEditPart {"; + protected final String TEXT_24 = NL; + protected final String TEXT_25 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_26 = ";"; + protected final String TEXT_27 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_28 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_29 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_30 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_31 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {"; protected final String TEXT_32 = NL + "\t\tinstallEditPolicy("; protected final String TEXT_33 = ".LAYOUT_ROLE, new "; - protected final String TEXT_34 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_35 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; - protected final String TEXT_36 = " 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_37 = ".INSTANCE;" + NL + "\t\t\t}"; - protected final String TEXT_38 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; - protected final String TEXT_39 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_40 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_41 = ".CreateRequestEx requestEx = ("; - protected final String TEXT_42 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_43 = " result = new "; - protected final String TEXT_44 = "();" + 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_45 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_46 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_47 = "Command((View) getModel(), requestEx"; - protected final String TEXT_48 = ", " + NL + "\t\t\t\t\t\t\t\t("; - protected final String TEXT_49 = ")getConstraintFor(request)"; - protected final String TEXT_50 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_51 = 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_52 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_53 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \""; - protected final String TEXT_54 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_55 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_56 = " result = new "; - protected final String TEXT_57 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; - protected final String TEXT_58 = "());" + NL + "\t\t"; - protected final String TEXT_59 = " scrollPane = new "; - protected final String TEXT_60 = "();" + NL + "\t\tresult.add(scrollPane);"; - protected final String TEXT_61 = NL + "\t\t"; - protected final String TEXT_62 = " viewport = new "; - protected final String TEXT_63 = "();" + NL + "\t\tcontentPane = new "; - protected final String TEXT_64 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; - protected final String TEXT_65 = "());"; - protected final String TEXT_66 = NL + "\t\t"; - protected final String TEXT_67 = " viewport = new "; - protected final String TEXT_68 = "();" + NL + "\t\tcontentPane = new "; - protected final String TEXT_69 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; - protected final String TEXT_70 = "());"; - protected final String TEXT_71 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_72 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof "; - protected final String TEXT_73 = ") ? ("; - protected final String TEXT_74 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_75 = NL; - protected final String TEXT_76 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_77 = " domainModelEditDomain = "; - protected final String TEXT_78 = ".getEditingDomain("; - protected final String TEXT_79 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; - protected final String TEXT_80 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_81 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_82 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_83 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_84 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_85 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_86 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_87 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_88 = NL + "\t\t\tfilter = "; - protected final String TEXT_89 = ".createFeatureFilter("; - protected final String TEXT_90 = ".eINSTANCE.get"; - protected final String TEXT_91 = "());"; - protected final String TEXT_92 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_93 = ".createFeatureFilter("; - protected final String TEXT_94 = ".eINSTANCE.get"; - protected final String TEXT_95 = "()));"; - protected final String TEXT_96 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_97 = ".createNotifierFilter("; - protected final String TEXT_98 = "));"; - protected final String TEXT_99 = NL + "\t\t\tfilter = "; - protected final String TEXT_100 = ".createNotifierFilter("; - protected final String TEXT_101 = ");"; - protected final String TEXT_102 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_103 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_104 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_105 = " transactionAboutToCommit("; - protected final String TEXT_106 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_107 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; - protected final String TEXT_108 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_109 = " domainModelEditDomain = "; - protected final String TEXT_110 = ".getEditingDomain("; - protected final String TEXT_111 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_112 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_113 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_114 = " notationalChildren = "; - protected final String TEXT_115 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_116 = " semanticToNotational = new "; - protected final String TEXT_117 = "();" + NL + "\t\tfor("; - protected final String TEXT_118 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_119 = " next = ("; - protected final String TEXT_120 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_121 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_122 = " parentView = "; - protected final String TEXT_123 = ";" + NL + "\t\t"; - protected final String TEXT_124 = " command = new "; - protected final String TEXT_125 = "();" + NL + "\t\tfor("; - protected final String TEXT_126 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_127 = " next = ("; - protected final String TEXT_128 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_129 = " currentView = ("; - protected final String TEXT_130 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_131 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; - protected final String TEXT_132 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_133 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_134 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_135 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_136 = " obsoleteView = ("; - protected final String TEXT_137 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_138 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; - protected final String TEXT_139 = " getCreateNotationalElementCommand("; - protected final String TEXT_140 = " parentView, "; - protected final String TEXT_141 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_142 = NL + "\t\tcase "; - protected final String TEXT_143 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_144 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_145 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_146 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_147 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_148 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_149 = " getSemanticChildren() {"; - protected final String TEXT_150 = NL; - protected final String TEXT_151 = NL + "\treturn "; - protected final String TEXT_152 = ".EMPTY_LIST;"; - protected final String TEXT_153 = NL + "\t"; - protected final String TEXT_154 = " result = new "; - protected final String TEXT_155 = "();"; - protected final String TEXT_156 = NL + "\t"; - protected final String TEXT_157 = " viewObject = "; - protected final String TEXT_158 = ";" + NL + "\t"; - protected final String TEXT_159 = " modelObject = "; - protected final String TEXT_160 = ";" + NL + "\t"; - protected final String TEXT_161 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_162 = NL + "\tfor("; - protected final String TEXT_163 = " it = (("; - protected final String TEXT_164 = ")modelObject)."; - protected final String TEXT_165 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_166 = ") it.next();"; - protected final String TEXT_167 = NL + "\tnextValue = (("; - protected final String TEXT_168 = ")modelObject)."; - protected final String TEXT_169 = "();"; - protected final String TEXT_170 = NL + "\tnodeVID = "; - protected final String TEXT_171 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_172 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_173 = NL + "\tcase "; - protected final String TEXT_174 = ".VISUAL_ID: {"; - protected final String TEXT_175 = NL + "\tif ("; - protected final String TEXT_176 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_177 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_178 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_179 = NL + "\t\t}"; - protected final String TEXT_180 = NL + "\t}"; - protected final String TEXT_181 = NL + "\t}"; - protected final String TEXT_182 = NL + "\treturn result;"; - protected final String TEXT_183 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_184 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_185 = ";" + NL + "\t}"; - protected final String TEXT_186 = NL; - protected final String TEXT_187 = NL; - protected final String TEXT_188 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_189 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_190 = " feature, "; - protected final String TEXT_191 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_192 = NL; - protected final String TEXT_193 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_194 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_195 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_196 = NL; - protected final String TEXT_197 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_198 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL; - protected final String TEXT_199 = NL; - protected final String TEXT_200 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_201 = "static "; - protected final String TEXT_202 = "class Create"; - protected final String TEXT_203 = "NotationCommand extends "; - protected final String TEXT_204 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_205 = "NotationCommand("; - protected final String TEXT_206 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_207 = " domainElement"; - protected final String TEXT_208 = ", "; - protected final String TEXT_209 = " constraint"; - protected final String TEXT_210 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_211 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_212 = ".decorateView(createdNode);"; - protected final String TEXT_213 = NL + "\t\t\t"; - protected final String TEXT_214 = " bounds = "; - protected final String TEXT_215 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; - protected final String TEXT_216 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_217 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_218 = "));"; - protected final String TEXT_219 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_220 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_221 = "static "; - protected final String TEXT_222 = "class Create"; - protected final String TEXT_223 = "Command extends "; - protected final String TEXT_224 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_225 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_226 = "Command("; - protected final String TEXT_227 = " parent, "; - protected final String TEXT_228 = ".CreateRequestEx request"; - protected final String TEXT_229 = ", "; - protected final String TEXT_230 = " constraint"; - protected final String TEXT_231 = ") {" + NL + "\t\t\t"; - protected final String TEXT_232 = " domainModelEditDomain = "; - protected final String TEXT_233 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_234 = NL + "\t\t\t"; - protected final String TEXT_235 = " createdDomainElement = "; - protected final String TEXT_236 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_237 = ".eINSTANCE.get"; - protected final String TEXT_238 = "());"; - protected final String TEXT_239 = NL + "\t\t\t"; - protected final String TEXT_240 = " createdDomainElement = "; - protected final String TEXT_241 = ".eINSTANCE.create"; - protected final String TEXT_242 = "();"; - protected final String TEXT_243 = NL + "\t\t\t"; - protected final String TEXT_244 = NL + "\t\t\t"; - protected final String TEXT_245 = "."; - protected final String TEXT_246 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_247 = NL + "\t\t\t"; - protected final String TEXT_248 = " compoundCommand = new "; - protected final String TEXT_249 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_250 = ".create(domainModelEditDomain, "; - protected final String TEXT_251 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_34 = "() {" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final "; + protected final String TEXT_35 = " request, final EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; + protected final String TEXT_36 = " emfCommand = new "; + protected final String TEXT_37 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate "; + protected final String TEXT_38 = " moveDelta;" + NL + "\t\t\t\t\tprivate "; + protected final String TEXT_39 = " resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_40 = " original = new "; + protected final String TEXT_41 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_42 = " referenceFigure = (("; + protected final String TEXT_43 = ")child).getFigure();" + NL + "\t\t\t\t\t\treferenceFigure.translateToAbsolute(original);" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_44 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(transformed);" + NL + "\t\t\t\t\t\treferenceFigure.translateToRelative(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute("; + protected final String TEXT_45 = " move, "; + protected final String TEXT_46 = " 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_47 = ".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_48 = ".INSTANCE;" + NL + "\t\t\t}"; + protected final String TEXT_49 = NL + "\t\tinstallEditPolicy("; + protected final String TEXT_50 = ".LAYOUT_ROLE, new "; + protected final String TEXT_51 = "() {" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_52 = " rect) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Object getConstraintFor("; + protected final String TEXT_53 = " 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_54 = ".INSTANCE;" + NL + "\t\t\t}"; + protected final String TEXT_55 = NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; + protected final String TEXT_56 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_57 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_58 = ".CreateRequestEx requestEx = ("; + protected final String TEXT_59 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_60 = " result = new "; + protected final String TEXT_61 = "();" + 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_62 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_63 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_64 = "Command((View) getModel(), requestEx"; + protected final String TEXT_65 = ", " + NL + "\t\t\t\t\t\t\t\t("; + protected final String TEXT_66 = ")getConstraintFor(request)"; + protected final String TEXT_67 = "));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_68 = 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_69 = ".getEditingDomain(((View) getModel()).getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_70 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {" + NL + "\t\treturn \""; + protected final String TEXT_71 = "\";" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_72 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_73 = " result = new "; + protected final String TEXT_74 = "();" + NL + "\t\tresult.setLabel(getTitleName());" + NL + "\t\tresult.setOpaque(false);" + NL + "\t\tresult.setLayoutManager(new "; + protected final String TEXT_75 = "());" + NL + "\t\t"; + protected final String TEXT_76 = " scrollPane = new "; + protected final String TEXT_77 = "();" + NL + "\t\tresult.add(scrollPane);"; + protected final String TEXT_78 = NL + "\t\t"; + protected final String TEXT_79 = " viewport = new "; + protected final String TEXT_80 = "();" + NL + "\t\tcontentPane = new "; + protected final String TEXT_81 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; + protected final String TEXT_82 = "());"; + protected final String TEXT_83 = NL + "\t\t"; + protected final String TEXT_84 = " viewport = new "; + protected final String TEXT_85 = "();" + NL + "\t\tcontentPane = new "; + protected final String TEXT_86 = "();" + NL + "\t\tcontentPane.setLayoutManager(new "; + protected final String TEXT_87 = "());"; + protected final String TEXT_88 = 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_89 = " resolveSemanticElement() {" + NL + "\t\tView view = getDiagramNode();" + NL + "\t\treturn (view.getElement() instanceof "; + protected final String TEXT_90 = ") ? ("; + protected final String TEXT_91 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_92 = NL; + protected final String TEXT_93 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_94 = " domainModelEditDomain = "; + protected final String TEXT_95 = ".getEditingDomain("; + protected final String TEXT_96 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; + protected final String TEXT_97 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_98 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_99 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; + protected final String TEXT_100 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_101 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_102 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_103 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_104 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; + protected final String TEXT_105 = NL + "\t\t\tfilter = "; + protected final String TEXT_106 = ".createFeatureFilter("; + protected final String TEXT_107 = ".eINSTANCE.get"; + protected final String TEXT_108 = "());"; + protected final String TEXT_109 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_110 = ".createFeatureFilter("; + protected final String TEXT_111 = ".eINSTANCE.get"; + protected final String TEXT_112 = "()));"; + protected final String TEXT_113 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_114 = ".createNotifierFilter("; + protected final String TEXT_115 = ".getElement()));"; + protected final String TEXT_116 = NL + "\t\t\tfilter = "; + protected final String TEXT_117 = ".createNotifierFilter("; + protected final String TEXT_118 = ".getElement());"; + protected final String TEXT_119 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_120 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_121 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_122 = " transactionAboutToCommit("; + protected final String TEXT_123 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_124 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; + protected final String TEXT_125 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_126 = " domainModelEditDomain = "; + protected final String TEXT_127 = ".getEditingDomain("; + protected final String TEXT_128 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_129 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_130 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; + protected final String TEXT_131 = " notationalChildren = "; + protected final String TEXT_132 = ".getChildren();" + NL + "\t\tfinal "; + protected final String TEXT_133 = " semanticToNotational = new "; + protected final String TEXT_134 = "();" + NL + "\t\tfor("; + protected final String TEXT_135 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_136 = " next = ("; + protected final String TEXT_137 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_138 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_139 = " parentView = "; + protected final String TEXT_140 = ";" + NL + "\t\t"; + protected final String TEXT_141 = " command = new "; + protected final String TEXT_142 = "();" + NL + "\t\tfor("; + protected final String TEXT_143 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_144 = " next = ("; + protected final String TEXT_145 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_146 = " currentView = ("; + protected final String TEXT_147 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; + protected final String TEXT_148 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; + protected final String TEXT_149 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; + protected final String TEXT_150 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_151 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_152 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_153 = " obsoleteView = ("; + protected final String TEXT_154 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_155 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; + protected final String TEXT_156 = " getCreateNotationalElementCommand("; + protected final String TEXT_157 = " parentView, "; + protected final String TEXT_158 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; + protected final String TEXT_159 = NL + "\t\tcase "; + protected final String TEXT_160 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; + protected final String TEXT_161 = ") {" + NL + "\t\t\t\treturn new Create"; + protected final String TEXT_162 = "NotationCommand(parentView, domainElement"; + protected final String TEXT_163 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_164 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; + protected final String TEXT_165 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_166 = " getSemanticChildren() {"; + protected final String TEXT_167 = NL; + protected final String TEXT_168 = NL + "\treturn "; + protected final String TEXT_169 = ".EMPTY_LIST;"; + protected final String TEXT_170 = NL + "\t"; + protected final String TEXT_171 = " result = new "; + protected final String TEXT_172 = "();"; + protected final String TEXT_173 = NL + "\t"; + protected final String TEXT_174 = " viewObject = "; + protected final String TEXT_175 = ";" + NL + "\t"; + protected final String TEXT_176 = " modelObject = viewObject.getElement();" + NL + "\t"; + protected final String TEXT_177 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_178 = NL + "\tfor("; + protected final String TEXT_179 = " it = "; + protected final String TEXT_180 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_181 = ") it.next();"; + protected final String TEXT_182 = NL + "\tnextValue = ("; + protected final String TEXT_183 = ")"; + protected final String TEXT_184 = ";"; + protected final String TEXT_185 = NL + "\tnodeVID = "; + protected final String TEXT_186 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_187 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_188 = NL + "\tcase "; + protected final String TEXT_189 = ".VISUAL_ID: {"; + protected final String TEXT_190 = NL + "\tif ("; + protected final String TEXT_191 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_192 = NL + "\t\tresult.add(nextValue);"; + protected final String TEXT_193 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_194 = NL + "\t\t}"; + protected final String TEXT_195 = NL + "\t}"; + protected final String TEXT_196 = NL + "\t}"; + protected final String TEXT_197 = NL + "\treturn result;"; + protected final String TEXT_198 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; + protected final String TEXT_199 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; + protected final String TEXT_200 = ";" + NL + "\t}"; + protected final String TEXT_201 = NL; + protected final String TEXT_202 = NL; + protected final String TEXT_203 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_204 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_205 = " feature, "; + protected final String TEXT_206 = " 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_207 = NL; + protected final String TEXT_208 = "\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_209 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_210 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_211 = NL; + protected final String TEXT_212 = "\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_213 = ".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_214 = NL; + protected final String TEXT_215 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_216 = "static "; + protected final String TEXT_217 = "class Create"; + protected final String TEXT_218 = "NotationCommand extends "; + protected final String TEXT_219 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_220 = "NotationCommand("; + protected final String TEXT_221 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_222 = " domainElement"; + protected final String TEXT_223 = ", "; + protected final String TEXT_224 = " constraint"; + protected final String TEXT_225 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_226 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_227 = ".decorateView(createdNode);"; + protected final String TEXT_228 = NL + "\t\t\t"; + protected final String TEXT_229 = " bounds = "; + protected final String TEXT_230 = ".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_231 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_232 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_233 = "));"; + protected final String TEXT_234 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_235 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_236 = "static "; + protected final String TEXT_237 = "class Create"; + protected final String TEXT_238 = "Command extends "; + protected final String TEXT_239 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_240 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_241 = "Command("; + protected final String TEXT_242 = " parent, "; + protected final String TEXT_243 = ".CreateRequestEx request"; + protected final String TEXT_244 = ", "; + protected final String TEXT_245 = " constraint"; + protected final String TEXT_246 = ") {" + NL + "\t\t\t"; + protected final String TEXT_247 = " domainModelEditDomain = "; + protected final String TEXT_248 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_249 = NL + "\t\t\t"; + protected final String TEXT_250 = " createdDomainElement = "; + protected final String TEXT_251 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; protected final String TEXT_252 = ".eINSTANCE.get"; - protected final String TEXT_253 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_254 = ".create(domainModelEditDomain, "; - protected final String TEXT_255 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_256 = ".eINSTANCE.get"; - protected final String TEXT_257 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_258 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_259 = ".create(domainModelEditDomain, "; - protected final String TEXT_260 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_261 = ".eINSTANCE.get"; - protected final String TEXT_262 = "(), createdDomainElement);"; - protected final String TEXT_263 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_264 = "NotationCommand(parent, createdDomainElement"; - protected final String TEXT_265 = ", constraint"; - protected final String TEXT_266 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_267 = NL + "}" + NL; - protected final String TEXT_268 = NL; + protected final String TEXT_253 = "());"; + protected final String TEXT_254 = NL + "\t\t\t"; + protected final String TEXT_255 = " createdDomainElement = "; + protected final String TEXT_256 = ".eINSTANCE.create"; + protected final String TEXT_257 = "();"; + protected final String TEXT_258 = NL + "\t\t\t"; + protected final String TEXT_259 = NL + "\t\t\t"; + protected final String TEXT_260 = "."; + protected final String TEXT_261 = ".initializeElement("; + protected final String TEXT_262 = "("; + protected final String TEXT_263 = ") "; + protected final String TEXT_264 = "createdDomainElement);"; + protected final String TEXT_265 = NL + "\t\t\t"; + protected final String TEXT_266 = " compoundCommand = new "; + protected final String TEXT_267 = "();" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_268 = ".create(domainModelEditDomain, "; + protected final String TEXT_269 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_270 = ".eINSTANCE.get"; + protected final String TEXT_271 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; + protected final String TEXT_272 = ".create(domainModelEditDomain, "; + protected final String TEXT_273 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_274 = ".eINSTANCE.get"; + protected final String TEXT_275 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; + protected final String TEXT_276 = NL + "\t\t\tthis.domainModelAddCommand = "; + protected final String TEXT_277 = ".create(domainModelEditDomain, "; + protected final String TEXT_278 = ", " + NL + "\t\t\t\t"; + protected final String TEXT_279 = ".eINSTANCE.get"; + protected final String TEXT_280 = "(), createdDomainElement);"; + protected final String TEXT_281 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_282 = "NotationCommand(parent, "; + protected final String TEXT_283 = "("; + protected final String TEXT_284 = ") "; + protected final String TEXT_285 = "createdDomainElement"; + protected final String TEXT_286 = ", constraint"; + protected final String TEXT_287 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_288 = NL + "}" + NL; + protected final String TEXT_289 = NL; public String generate(Object argument) { @@ -306,6 +327,81 @@ stringBuffer.append(copyrightText.replaceAll("\n", "\n * ")); stringBuffer.append(TEXT_3); } + stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_5); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_6); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_7); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_9); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_10); + + } + + stringBuffer.append(TEXT_11); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_12); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_13); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_14); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_16); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_17); + + } + + stringBuffer.append(TEXT_18); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_19); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_20); importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.gmf.runtime.notation.View"); importManager.addImport("org.eclipse.gef.commands.Command"); @@ -315,175 +411,174 @@ importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_21); stringBuffer.append(genCompartment.getEditPartClassName()); - stringBuffer.append(TEXT_5); + stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_23); { GenCommonBase genCommonBase = genCompartment; - stringBuffer.append(TEXT_7); - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_25); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_26); } - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_27); stringBuffer.append(genCompartment.getEditPartClassName()); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_28); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_30); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_31); if (!genCompartment.isListLayout()) { - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.XYLayoutEditPolicy")); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.ChangeBoundsRequest")); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_35); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_48); } else { - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_54); } - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_55); if (null != genDiagram.getPalette()) { final Palette palette = genDiagram.getPalette(); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_61); for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { GenChildNode next = (GenChildNode)it.next(); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_63); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_64); if (!genCompartment.isListLayout()) { - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_65); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_66); } - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_67); } - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_68); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_69); }/*when there's palette*/ - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_70); stringBuffer.append(genCompartment.getTitle()); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_73); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LabeledContainer")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_76); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_77); if (genCompartment.isListLayout()) { - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_79); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_80); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout")); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_82); } else { - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport")); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_86); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_87); } - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_91); { String _getViewCode = "getDiagramNode()"; String _getDiagramCode = _getViewCode + ".getDiagram()"; -String _getSemanticElementCode = "resolveSemanticElement()"; boolean isListLayout = genCompartment.isListLayout(); - stringBuffer.append(TEXT_75); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_95); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_98); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_99); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -498,17 +593,17 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_100); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_103); } - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_104); { boolean hasDeclaredFilter = false; @@ -527,23 +622,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_107); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_108); } else { - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_111); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_112); } } //for @@ -551,19 +646,19 @@ if (hasDeclaredFilter) { - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_97); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_114); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_115); } else { - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_100); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_117); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_118); } } //local declaration of hasDeclaredFilter @@ -571,87 +666,87 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_119); } - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_121); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_127); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_128); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_131); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_139); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_140); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_158); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -661,39 +756,39 @@ } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_160); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_161); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_162); if (!isListLayout) { - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_163); } - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_164); } - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_149); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_167); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_168); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_169); } else { - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_172); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -711,17 +806,15 @@ Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_174); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_159); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_177); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -730,107 +823,105 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_163); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_164); - stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_179); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); + stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_181); } else { - stringBuffer.append(TEXT_167); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_168); - stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_183); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); + stringBuffer.append(TEXT_184); } - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_186); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_187); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_189); } else { - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_191); } - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_192); if (generateSwitch) { - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_193); } else { - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_194); } } if (generateSwitch) { - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_195); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_196); } } - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_197); } - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_198); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_199); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_200); } - stringBuffer.append(TEXT_186); - stringBuffer.append(TEXT_187); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_191); - stringBuffer.append(TEXT_192); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_195); - stringBuffer.append(TEXT_196); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_213); for(Iterator it = genCompartment.getChildNodes().iterator(); it.hasNext(); ) { GenChildNode next = (GenChildNode)it.next(); @@ -838,42 +929,42 @@ boolean isListLayout = genCompartment.isListLayout(); String resolvedSemanticElement = "resolveSemanticElement()"; - stringBuffer.append(TEXT_199); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_215); if (isStatic) { - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_216); } - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_217); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_219); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_220); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_222); if (!isListLayout) { - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_224); } - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_227); if (!isListLayout) { - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_230); int defaultWidth = 40; int defaultHeight = 40; @@ -883,140 +974,152 @@ defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_231); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_232); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_233); } - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_234); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_235); if (isStatic) { - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_236); } - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_237); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_238); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_239); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_240); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_242); stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_243); if (!isListLayout) { - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_245); } - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_246); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_248); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_251); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_252); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_253); } else { - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_256); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_257); } - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_258); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_260); stringBuffer.append(next.getUniqueIdentifier()); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_261); + if (next.getDomainMetaClass().isExternalInterface()) { + stringBuffer.append(TEXT_262); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_263); + } + stringBuffer.append(TEXT_264); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_265); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_267); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_268); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_269); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_270); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_272); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_273); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_274); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_275); } else { - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_276); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_277); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_278); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_279); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_280); } - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_281); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_282); + if (next.getDomainMetaClass().isExternalInterface()) { + stringBuffer.append(TEXT_283); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_284); + } + stringBuffer.append(TEXT_285); if(!isListLayout) { - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_286); } - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_287); } } - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_288); importManager.emitSortedImports(); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_289); 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.6 diff -u -r1.6 DiagramEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.6 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java 3 Aug 2006 18:47:10 -0000 @@ -18,527 +18,622 @@ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; - protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_3 = " extends AbstractGraphicalEditPart implements IUpdatableEditPart {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String MODEL_ID = \""; - protected final String TEXT_4 = "\";" + NL; - protected final String TEXT_5 = NL; - protected final String TEXT_6 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_7 = ";"; - protected final String TEXT_8 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_9 = "("; - protected final String TEXT_10 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_11 = " getDiagram() {" + NL + "\t\treturn ("; - protected final String TEXT_12 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_13 = NL; - protected final String TEXT_14 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_15 = " view = ("; - protected final String TEXT_16 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_17 = " view = ("; - protected final String TEXT_18 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tsuper.addNotify();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; - protected final String TEXT_19 = NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_20 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_21 = ".CreateRequestEx requestEx = ("; - protected final String TEXT_22 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_23 = " result = new "; - protected final String TEXT_24 = "();" + NL + "\t\t\t\t\tfor(int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_25 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_26 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_27 = "Command(getDiagram(), requestEx, ("; - protected final String TEXT_28 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_29 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_30 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_31 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(final ChangeBoundsRequest request, EditPart child, Object constraint) {" + NL + "\t\t\t\tfinal Node node = (Node) child.getModel();" + NL + "\t\t\t\t"; - protected final String TEXT_32 = " emfCommand = new "; - protected final String TEXT_33 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_34 = " original = new "; - protected final String TEXT_35 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_36 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_37 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();"; - protected final String TEXT_38 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_39 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif ("; - protected final String TEXT_40 = ".class == key) {" + NL + "\t\t\treturn new "; - protected final String TEXT_41 = "(this);" + NL + "\t\t}"; - protected final String TEXT_42 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL; - protected final String TEXT_43 = NL; - protected final String TEXT_44 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_45 = "static "; - protected final String TEXT_46 = "class Create"; - protected final String TEXT_47 = "NotationCommand extends "; - protected final String TEXT_48 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; - protected final String TEXT_49 = "NotationCommand("; - protected final String TEXT_50 = " parent, " + NL + "\t\t\t\t"; - protected final String TEXT_51 = " domainElement"; - protected final String TEXT_52 = ", "; - protected final String TEXT_53 = " constraint"; - protected final String TEXT_54 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; - protected final String TEXT_55 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; - protected final String TEXT_56 = ".decorateView(createdNode);"; - protected final String TEXT_57 = NL + "\t\t\t"; - protected final String TEXT_58 = " bounds = "; - protected final String TEXT_59 = ".eINSTANCE.createBounds();" + NL + "\t\t\tcreatedNode.setLayoutConstraint(bounds);" + NL + "\t\t\tbounds.setX(constraint.x);" + NL + "\t\t\tbounds.setY(constraint.y);"; - protected final String TEXT_60 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; - protected final String TEXT_61 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; - protected final String TEXT_62 = "));"; - protected final String TEXT_63 = NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_64 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_65 = "static "; - protected final String TEXT_66 = "class Create"; - protected final String TEXT_67 = "Command extends "; - protected final String TEXT_68 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; - protected final String TEXT_69 = "NotationCommand notationAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; - protected final String TEXT_70 = "Command("; - protected final String TEXT_71 = " parent, "; - protected final String TEXT_72 = ".CreateRequestEx request"; - protected final String TEXT_73 = ", "; - protected final String TEXT_74 = " constraint"; - protected final String TEXT_75 = ") {" + NL + "\t\t\t"; - protected final String TEXT_76 = " domainModelEditDomain = "; - protected final String TEXT_77 = ".getEditingDomain(parent.getDiagram().getElement());"; - protected final String TEXT_78 = NL + "\t\t\t"; - protected final String TEXT_79 = " createdDomainElement = "; - protected final String TEXT_80 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; - protected final String TEXT_81 = ".eINSTANCE.get"; - protected final String TEXT_82 = "());"; - protected final String TEXT_83 = NL + "\t\t\t"; - protected final String TEXT_84 = " createdDomainElement = "; - protected final String TEXT_85 = ".eINSTANCE.create"; - protected final String TEXT_86 = "();"; - protected final String TEXT_87 = NL + "\t\t\t"; - protected final String TEXT_88 = NL + "\t\t\t"; - protected final String TEXT_89 = "."; - protected final String TEXT_90 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_91 = NL + "\t\t\t"; - protected final String TEXT_92 = " compoundCommand = new "; - protected final String TEXT_93 = "();" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_94 = ".create(domainModelEditDomain, "; - protected final String TEXT_95 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_96 = ".eINSTANCE.get"; - protected final String TEXT_97 = "(), createdDomainElement));" + NL + "\t\t\tcompoundCommand.append("; - protected final String TEXT_98 = ".create(domainModelEditDomain, "; - protected final String TEXT_99 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_100 = ".eINSTANCE.get"; - protected final String TEXT_101 = "(), createdDomainElement));" + NL + "\t\t\tthis.domainModelAddCommand = compoundCommand;"; - protected final String TEXT_102 = NL + "\t\t\tthis.domainModelAddCommand = "; - protected final String TEXT_103 = ".create(domainModelEditDomain, "; - protected final String TEXT_104 = ", " + NL + "\t\t\t\t"; - protected final String TEXT_105 = ".eINSTANCE.get"; - protected final String TEXT_106 = "(), createdDomainElement);"; - protected final String TEXT_107 = NL + "\t\t\tthis.notationAddCommand = new Create"; - protected final String TEXT_108 = "NotationCommand(parent, createdDomainElement"; - protected final String TEXT_109 = ", constraint"; - protected final String TEXT_110 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_111 = NL; - protected final String TEXT_112 = NL; - protected final String TEXT_113 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_114 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_115 = " feature, "; - protected final String TEXT_116 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_117 = NL; - protected final String TEXT_118 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_119 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_120 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; - protected final String TEXT_121 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_122 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_123 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; - protected final String TEXT_124 = " it = affectedEditParts.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\tIUpdatableEditPart next = (IUpdatableEditPart) it.next();" + NL + "\t\t\t\tIUpdatableEditPart.Refresher refresher = next.getRefresher(("; - protected final String TEXT_125 = ")msg.getFeature(), msg);" + NL + "\t\t\t\tif (refresher != null) {" + NL + "\t\t\t\t\trefresher.refresh();" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_126 = "/**/ findAffectedParts("; - protected final String TEXT_127 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; - protected final String TEXT_128 = ") {" + NL + "\t\t\t\t"; - protected final String TEXT_129 = " view = getView((EObject) notifier);" + NL + "\t\t\t\tif (view != null) {" + NL + "\t\t\t\t\tEditPart affectedEditPart = (EditPart) getViewer().getEditPartRegistry().get(view);" + NL + "\t\t\t\t\tif (affectedEditPart != null) {" + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_130 = ".singleton(affectedEditPart);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn "; - protected final String TEXT_131 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_132 = " getView(EObject offspring) {" + NL + "\t\t\twhile (offspring != null && offspring instanceof View == false) {" + NL + "\t\t\t\toffspring = offspring.eContainer();" + NL + "\t\t\t}" + NL + "\t\t\treturn ("; - protected final String TEXT_133 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(updateManager)) {" + NL + "\t\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();"; - protected final String TEXT_134 = NL + "\t\tinstallLinkNotationModelRefresher();"; - protected final String TEXT_135 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; - protected final String TEXT_136 = NL + "\t\tuninstallLinkNotationModelRefresher();"; - protected final String TEXT_137 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_138 = NL; - protected final String TEXT_139 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_140 = " domainModelEditDomain = "; - protected final String TEXT_141 = ".getEditingDomain("; - protected final String TEXT_142 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; - protected final String TEXT_143 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_144 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_145 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_146 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; - protected final String TEXT_147 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_148 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_149 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_150 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_151 = NL + "\t\t\tfilter = "; - protected final String TEXT_152 = ".createFeatureFilter("; - protected final String TEXT_153 = ".eINSTANCE.get"; - protected final String TEXT_154 = "());"; - protected final String TEXT_155 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_156 = ".createFeatureFilter("; - protected final String TEXT_157 = ".eINSTANCE.get"; - protected final String TEXT_158 = "()));"; - protected final String TEXT_159 = NL + "\t\t\tfilter = filter.and("; - protected final String TEXT_160 = ".createNotifierFilter("; - protected final String TEXT_161 = "));"; - protected final String TEXT_162 = NL + "\t\t\tfilter = "; - protected final String TEXT_163 = ".createNotifierFilter("; - protected final String TEXT_164 = ");"; - protected final String TEXT_165 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; - protected final String TEXT_166 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_167 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_168 = " transactionAboutToCommit("; - protected final String TEXT_169 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_170 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; - protected final String TEXT_171 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_172 = " domainModelEditDomain = "; - protected final String TEXT_173 = ".getEditingDomain("; - protected final String TEXT_174 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_175 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_176 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; - protected final String TEXT_177 = " notationalChildren = "; - protected final String TEXT_178 = ".getChildren();" + NL + "\t\tfinal "; - protected final String TEXT_179 = " semanticToNotational = new "; - protected final String TEXT_180 = "();" + NL + "\t\tfor("; - protected final String TEXT_181 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_182 = " next = ("; - protected final String TEXT_183 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_184 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_185 = " parentView = "; - protected final String TEXT_186 = ";" + NL + "\t\t"; - protected final String TEXT_187 = " command = new "; - protected final String TEXT_188 = "();" + NL + "\t\tfor("; - protected final String TEXT_189 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_190 = " next = ("; - protected final String TEXT_191 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_192 = " currentView = ("; - protected final String TEXT_193 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; - protected final String TEXT_194 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; - protected final String TEXT_195 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; - protected final String TEXT_196 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_197 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_198 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_199 = " obsoleteView = ("; - protected final String TEXT_200 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_201 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; - protected final String TEXT_202 = " getCreateNotationalElementCommand("; - protected final String TEXT_203 = " parentView, "; - protected final String TEXT_204 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; - protected final String TEXT_205 = NL + "\t\tcase "; - protected final String TEXT_206 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; - protected final String TEXT_207 = ") {" + NL + "\t\t\t\treturn new Create"; - protected final String TEXT_208 = "NotationCommand(parentView, domainElement"; - protected final String TEXT_209 = ", new Rectangle(0, 0, 0, 0)"; - protected final String TEXT_210 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; - protected final String TEXT_211 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_212 = " getSemanticChildren() {"; - protected final String TEXT_213 = NL; - protected final String TEXT_214 = NL + "\treturn "; - protected final String TEXT_215 = ".EMPTY_LIST;"; - protected final String TEXT_216 = NL + "\t"; - protected final String TEXT_217 = " result = new "; - protected final String TEXT_218 = "();"; - protected final String TEXT_219 = NL + "\t"; - protected final String TEXT_220 = " viewObject = "; - protected final String TEXT_221 = ";" + NL + "\t"; - protected final String TEXT_222 = " modelObject = "; - protected final String TEXT_223 = ";" + NL + "\t"; - protected final String TEXT_224 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_225 = NL + "\tfor("; - protected final String TEXT_226 = " it = (("; - protected final String TEXT_227 = ")modelObject)."; - protected final String TEXT_228 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_229 = ") it.next();"; - protected final String TEXT_230 = NL + "\tnextValue = (("; - protected final String TEXT_231 = ")modelObject)."; - protected final String TEXT_232 = "();"; - protected final String TEXT_233 = NL + "\tnodeVID = "; - protected final String TEXT_234 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_235 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_236 = NL + "\tcase "; - protected final String TEXT_237 = ".VISUAL_ID: {"; - protected final String TEXT_238 = NL + "\tif ("; - protected final String TEXT_239 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_240 = NL + "\t\tresult.add(nextValue);"; - protected final String TEXT_241 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_242 = NL + "\t\t}"; - protected final String TEXT_243 = NL + "\t}"; - protected final String TEXT_244 = NL + "\t}"; - protected final String TEXT_245 = NL + "\treturn result;"; - protected final String TEXT_246 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_247 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_248 = ";" + NL + "\t}" + NL; - protected final String TEXT_249 = NL; - protected final String TEXT_250 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_251 = " domainModelEditDomain = "; - protected final String TEXT_252 = ".getEditingDomain("; - protected final String TEXT_253 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; - protected final String TEXT_254 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_255 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_256 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; - protected final String TEXT_257 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; - protected final String TEXT_258 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_259 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_260 = ".NOT_TOUCH;" + NL + "\t\t}"; - protected final String TEXT_261 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_262 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; - protected final String TEXT_263 = ".createEventTypeFilter("; - protected final String TEXT_264 = ".SET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_265 = ".createEventTypeFilter("; - protected final String TEXT_266 = ".UNSET).or(" + NL + "\t\t\t\t"; - protected final String TEXT_267 = ".createEventTypeFilter("; - protected final String TEXT_268 = ".REMOVE).or(" + NL + "\t\t\t\t"; - protected final String TEXT_269 = ".createEventTypeFilter("; - protected final String TEXT_270 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; - protected final String TEXT_271 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; - protected final String TEXT_272 = NL; - protected final String TEXT_273 = NL + "\t\t\tfilter = "; - protected final String TEXT_274 = ".createFeatureFilter("; - protected final String TEXT_275 = ".eINSTANCE.get"; - protected final String TEXT_276 = "());"; - protected final String TEXT_277 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_278 = ".createFeatureFilter("; - protected final String TEXT_279 = ".eINSTANCE.get"; - protected final String TEXT_280 = "()));"; - protected final String TEXT_281 = NL; - protected final String TEXT_282 = NL + "\t\t\tfilter = "; - protected final String TEXT_283 = ".createFeatureFilter("; - protected final String TEXT_284 = ".eINSTANCE.get"; - protected final String TEXT_285 = "());"; - protected final String TEXT_286 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_287 = ".createFeatureFilter("; - protected final String TEXT_288 = ".eINSTANCE.get"; - protected final String TEXT_289 = "()));"; - protected final String TEXT_290 = NL; - protected final String TEXT_291 = NL + "\t\t\tfilter = "; - protected final String TEXT_292 = ".createFeatureFilter("; - protected final String TEXT_293 = ".eINSTANCE.get"; - protected final String TEXT_294 = "());"; - protected final String TEXT_295 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_296 = ".createFeatureFilter("; - protected final String TEXT_297 = ".eINSTANCE.get"; - protected final String TEXT_298 = "()));"; - protected final String TEXT_299 = NL; - protected final String TEXT_300 = NL + "\t\t\tfilter = "; - protected final String TEXT_301 = ".createFeatureFilter("; - protected final String TEXT_302 = ".eINSTANCE.get"; - protected final String TEXT_303 = "());"; - protected final String TEXT_304 = NL + "\t\t\tfilter = filter.or("; - protected final String TEXT_305 = ".createFeatureFilter("; - protected final String TEXT_306 = ".eINSTANCE.get"; - protected final String TEXT_307 = "()));"; - protected final String TEXT_308 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; - protected final String TEXT_309 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; - protected final String TEXT_310 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; - protected final String TEXT_311 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; + protected final String TEXT_2 = NL; + protected final String TEXT_3 = "(("; + protected final String TEXT_4 = ")"; + protected final String TEXT_5 = "(("; + protected final String TEXT_6 = ")"; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = ".eGet("; + protected final String TEXT_9 = ".eINSTANCE.get"; + protected final String TEXT_10 = "())"; + protected final String TEXT_11 = ")"; + protected final String TEXT_12 = "(("; + protected final String TEXT_13 = ")"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "."; + protected final String TEXT_16 = "()"; + protected final String TEXT_17 = NL; + protected final String TEXT_18 = NL; + protected final String TEXT_19 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_20 = " extends AbstractGraphicalEditPart implements IUpdatableEditPart {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String MODEL_ID = \""; + protected final String TEXT_21 = "\";" + NL; + protected final String TEXT_22 = NL; + protected final String TEXT_23 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_24 = ";"; + protected final String TEXT_25 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_26 = "("; + protected final String TEXT_27 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_28 = " getDiagram() {" + NL + "\t\treturn ("; + protected final String TEXT_29 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_30 = NL; + protected final String TEXT_31 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_32 = " view = ("; + protected final String TEXT_33 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_34 = " view = ("; + protected final String TEXT_35 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\tsuper.addNotify();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\tinstallEditPolicy(EditPolicy.LAYOUT_ROLE, new XYLayoutEditPolicy() {" + NL + "\t\t\tprotected Command getCreateCommand(CreateRequest request) {"; + protected final String TEXT_36 = NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_37 = ".CreateRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_38 = ".CreateRequestEx requestEx = ("; + protected final String TEXT_39 = ".CreateRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_40 = " result = new "; + protected final String TEXT_41 = "();" + 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_42 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_43 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_44 = "Command(getDiagram(), requestEx, ("; + protected final String TEXT_45 = ")getConstraintFor(request)));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_46 = 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_47 = ".getEditingDomain(getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_48 = 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_49 = " emfCommand = new "; + protected final String TEXT_50 = "(\"Change node position/size\") {" + NL + "\t\t\t\t\tprivate Point moveDelta;" + NL + "\t\t\t\t\tprivate Dimension resizeDelta;" + NL + "" + NL + "\t\t\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\t\t\treturn canExecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\t\t\tif (node.getLayoutConstraint() instanceof Bounds == false) {" + NL + "\t\t\t\t\t\t\treturn false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_51 = " original = new "; + protected final String TEXT_52 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_53 = " transformed = request.getTransformedRectangle(original);" + NL + "\t\t\t\t\t\tresizeDelta = transformed.getSize().expand(original.getSize().negate());" + NL + "\t\t\t\t\t\tmoveDelta = transformed.getTopLeft().translate(original.getTopLeft().negate());" + NL + "\t\t\t\t\t\treturn true;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void undo() {" + NL + "\t\t\t\t\t\texecute(moveDelta.getNegated(), resizeDelta.getNegated());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void execute() {" + NL + "\t\t\t\t\t\texecute(moveDelta, resizeDelta);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tpublic void redo() {" + NL + "\t\t\t\t\t\texecute();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprivate void execute(Point move, Dimension resize) {" + NL + "\t\t\t\t\t\tBounds bounds = (Bounds) node.getLayoutConstraint();" + NL + "\t\t\t\t\t\tbounds.setX(bounds.getX() + move.x);" + NL + "\t\t\t\t\t\tbounds.setY(bounds.getY() + move.y);" + NL + "\t\t\t\t\t\tbounds.setWidth(bounds.getWidth() + resize.width);" + NL + "\t\t\t\t\t\tbounds.setHeight(bounds.getHeight() + resize.height);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t};" + NL + "\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_54 = ".getEditingDomain(getDiagram().getElement()), emfCommand);" + NL + "\t\t\t}" + NL + "\t\t\tprotected Command createChangeConstraintCommand(EditPart child, Object constraint) {" + NL + "\t\t\t\tassert false;" + NL + "\t\t\t\treturn UnexecutableCommand.INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t\tinstallNotationModelRefresher();"; + protected final String TEXT_55 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_56 = 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_57 = ".class == key) {" + NL + "\t\t\treturn new "; + protected final String TEXT_58 = "(this);" + NL + "\t\t}"; + protected final String TEXT_59 = 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_60 = NL; + protected final String TEXT_61 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_62 = "static "; + protected final String TEXT_63 = "class Create"; + protected final String TEXT_64 = "NotationCommand extends "; + protected final String TEXT_65 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate Create"; + protected final String TEXT_66 = "NotationCommand("; + protected final String TEXT_67 = " parent, " + NL + "\t\t\t\t"; + protected final String TEXT_68 = " domainElement"; + protected final String TEXT_69 = ", "; + protected final String TEXT_70 = " constraint"; + protected final String TEXT_71 = ") {" + NL + "\t\t\tsuper(parent);" + NL + "\t\t\tNode createdNode = "; + protected final String TEXT_72 = ".eINSTANCE.createNode();" + NL + "\t\t\tsetCreatedView(createdNode);" + NL + "\t\t\tcreatedNode.setElement(domainElement);" + NL + "\t\t\t"; + protected final String TEXT_73 = ".decorateView(createdNode);"; + protected final String TEXT_74 = NL + "\t\t\t"; + protected final String TEXT_75 = " bounds = "; + protected final String TEXT_76 = ".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_77 = NL + "\t\t\tbounds.setWidth(Math.max(constraint.width, "; + protected final String TEXT_78 = "));" + NL + "\t\t\tbounds.setHeight(Math.max(constraint.height, "; + protected final String TEXT_79 = "));"; + protected final String TEXT_80 = NL + "\t\t}" + NL + "\t}" + NL; + protected final String TEXT_81 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_82 = "static "; + protected final String TEXT_83 = "class Create"; + protected final String TEXT_84 = "Command extends "; + protected final String TEXT_85 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final Create"; + protected final String TEXT_86 = "NotationCommand notationAddCommand;" + NL + "" + 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\t"; + protected final String TEXT_93 = " domainModelEditDomain = "; + protected final String TEXT_94 = ".getEditingDomain(parent.getDiagram().getElement());"; + protected final String TEXT_95 = NL + "\t\t\t"; + protected final String TEXT_96 = " createdDomainElement = "; + protected final String TEXT_97 = ".eINSTANCE.create(" + NL + "\t\t\t\t"; + protected final String TEXT_98 = ".eINSTANCE.get"; + protected final String TEXT_99 = "());"; + protected final String TEXT_100 = NL + "\t\t\t"; + protected final String TEXT_101 = " createdDomainElement = "; + protected final String TEXT_102 = ".eINSTANCE.create"; + protected final String TEXT_103 = "();"; + protected final String TEXT_104 = NL + "\t\t\t"; + protected final String TEXT_105 = NL + "\t\t\t"; + protected final String TEXT_106 = "."; + protected final String TEXT_107 = ".initializeElement("; + protected final String TEXT_108 = "("; + protected final String TEXT_109 = ") "; + protected final String TEXT_110 = "createdDomainElement);"; + 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 = "(), createdDomainElement));" + 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 = "(), createdDomainElement));" + 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 = "(), createdDomainElement);"; + protected final String TEXT_127 = NL + "\t\t\tthis.notationAddCommand = new Create"; + protected final String TEXT_128 = "NotationCommand(parent, "; + protected final String TEXT_129 = "("; + protected final String TEXT_130 = ") "; + protected final String TEXT_131 = "createdDomainElement"; + protected final String TEXT_132 = ", constraint"; + protected final String TEXT_133 = ");" + NL + "\t\t\trequest.setCreatedObject(notationAddCommand.getCreatedView());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final org.eclipse.emf.common.command.Command domainModelAddCommand;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canExecute() && notationAddCommand != null && notationAddCommand.canExecute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn domainModelAddCommand != null" + NL + "\t\t\t\t\t&& domainModelAddCommand.canUndo() && notationAddCommand != null && notationAddCommand.canUndo();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tnotationAddCommand.execute();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tnotationAddCommand.undo();" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_134 = NL; + protected final String TEXT_135 = NL; + protected final String TEXT_136 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_137 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_138 = " feature, "; + protected final String TEXT_139 = " 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_140 = NL; + protected final String TEXT_141 = "\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_142 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_143 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class UpdateManager extends "; + protected final String TEXT_144 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_145 = " 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_146 = " affectedEditParts = findAffectedParts(msg);" + NL + "\t\t\tfor("; + protected final String TEXT_147 = " 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_148 = ")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_149 = "/**/ findAffectedParts("; + protected final String TEXT_150 = " msg) {" + NL + "\t\t\tObject notifier = msg.getNotifier();" + NL + "\t\t\tif (notifier instanceof "; + protected final String TEXT_151 = ") {" + NL + "\t\t\t\t"; + protected final String TEXT_152 = " 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_153 = ".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_154 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_155 = " 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_156 = ") offspring;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(updateManager)) {" + NL + "\t\t\tgetDiagram().eAdapters().add(updateManager);" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();"; + protected final String TEXT_157 = NL + "\t\tinstallLinkNotationModelRefresher();"; + protected final String TEXT_158 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {"; + protected final String TEXT_159 = NL + "\t\tuninstallLinkNotationModelRefresher();"; + protected final String TEXT_160 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(updateManager);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; + protected final String TEXT_161 = NL; + protected final String TEXT_162 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\tNotationModelRefresher refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_163 = " domainModelEditDomain = "; + protected final String TEXT_164 = ".getEditingDomain("; + protected final String TEXT_165 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate NotationModelRefresher getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends "; + protected final String TEXT_166 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_167 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_168 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic NotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; + protected final String TEXT_169 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in "; + protected final String TEXT_170 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_171 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_172 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_173 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; + protected final String TEXT_174 = NL + "\t\t\tfilter = "; + protected final String TEXT_175 = ".createFeatureFilter("; + protected final String TEXT_176 = ".eINSTANCE.get"; + protected final String TEXT_177 = "());"; + protected final String TEXT_178 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_179 = ".createFeatureFilter("; + protected final String TEXT_180 = ".eINSTANCE.get"; + protected final String TEXT_181 = "()));"; + protected final String TEXT_182 = NL + "\t\t\tfilter = filter.and("; + protected final String TEXT_183 = ".createNotifierFilter("; + protected final String TEXT_184 = ".getElement()));"; + protected final String TEXT_185 = NL + "\t\t\tfilter = "; + protected final String TEXT_186 = ".createNotifierFilter("; + protected final String TEXT_187 = ".getElement());"; + protected final String TEXT_188 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);"; + protected final String TEXT_189 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_190 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_191 = " transactionAboutToCommit("; + protected final String TEXT_192 = " event) {" + NL + "\t\t\treturn getRefreshNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_193 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t"; + protected final String TEXT_194 = " command = getRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_195 = " domainModelEditDomain = "; + protected final String TEXT_196 = ".getEditingDomain("; + protected final String TEXT_197 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_198 = " getRefreshNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_199 = " semanticChildren = getSemanticChildren();" + NL + "\t\t"; + protected final String TEXT_200 = " notationalChildren = "; + protected final String TEXT_201 = ".getChildren();" + NL + "\t\tfinal "; + protected final String TEXT_202 = " semanticToNotational = new "; + protected final String TEXT_203 = "();" + NL + "\t\tfor("; + protected final String TEXT_204 = " it = notationalChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_205 = " next = ("; + protected final String TEXT_206 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_207 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotational.put(nextSemantic, next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_208 = " parentView = "; + protected final String TEXT_209 = ";" + NL + "\t\t"; + protected final String TEXT_210 = " command = new "; + protected final String TEXT_211 = "();" + NL + "\t\tfor("; + protected final String TEXT_212 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_213 = " next = ("; + protected final String TEXT_214 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_215 = " currentView = ("; + protected final String TEXT_216 = ") semanticToNotational.remove(next);" + NL + "\t\t\tint nodeVisualID = "; + protected final String TEXT_217 = ".INSTANCE.getNodeVisualID(parentView, next);" + NL + "\t\t\tif (currentView == null) {" + NL + "\t\t\t\tif (shouldCreateView(next)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalElementCommand(parentView, next, nodeVisualID));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else if (nodeVisualID != "; + protected final String TEXT_218 = ".getVisualID(currentView)) {" + NL + "\t\t\t\t"; + protected final String TEXT_219 = " notationalCommand = getCreateNotationalElementCommand(parentView, next, nodeVisualID);" + NL + "\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_220 = "(parentView, notationalCommand, currentView));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_221 = " it = semanticToNotational.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_222 = " obsoleteView = ("; + protected final String TEXT_223 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_224 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\tprivate "; + protected final String TEXT_225 = " getCreateNotationalElementCommand("; + protected final String TEXT_226 = " parentView, "; + protected final String TEXT_227 = " domainElement, int nodeVisualID) {" + NL + "\t\tswitch (nodeVisualID) {"; + protected final String TEXT_228 = NL + "\t\tcase "; + protected final String TEXT_229 = ".VISUAL_ID:" + NL + "\t\t\tif (domainElement instanceof "; + protected final String TEXT_230 = ") {" + NL + "\t\t\t\treturn new Create"; + protected final String TEXT_231 = "NotationCommand(parentView, domainElement"; + protected final String TEXT_232 = ", new Rectangle(0, 0, 0, 0)"; + protected final String TEXT_233 = ");" + NL + "\t\t\t}" + NL + "\t\t\treturn null;"; + protected final String TEXT_234 = NL + "\t\tdefault:" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_235 = " getSemanticChildren() {"; + protected final String TEXT_236 = NL; + protected final String TEXT_237 = NL + "\treturn "; + protected final String TEXT_238 = ".EMPTY_LIST;"; + protected final String TEXT_239 = NL + "\t"; + protected final String TEXT_240 = " result = new "; + protected final String TEXT_241 = "();"; + protected final String TEXT_242 = NL + "\t"; + protected final String TEXT_243 = " viewObject = "; + protected final String TEXT_244 = ";" + NL + "\t"; + protected final String TEXT_245 = " modelObject = viewObject.getElement();" + NL + "\t"; + protected final String TEXT_246 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_247 = NL + "\tfor("; + protected final String TEXT_248 = " it = "; + protected final String TEXT_249 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_250 = ") it.next();"; + protected final String TEXT_251 = NL + "\tnextValue = ("; + protected final String TEXT_252 = ")"; + protected final String TEXT_253 = ";"; + protected final String TEXT_254 = NL + "\tnodeVID = "; + protected final String TEXT_255 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_256 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_257 = NL + "\tcase "; + protected final String TEXT_258 = ".VISUAL_ID: {"; + protected final String TEXT_259 = NL + "\tif ("; + protected final String TEXT_260 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_261 = NL + "\t\tresult.add(nextValue);"; + protected final String TEXT_262 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_263 = NL + "\t\t}"; + protected final String TEXT_264 = NL + "\t}"; + protected final String TEXT_265 = NL + "\t}"; + protected final String TEXT_266 = NL + "\treturn result;"; + protected final String TEXT_267 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t * The generated code always returns "; + protected final String TEXT_268 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateView(EObject domainElement) {" + NL + "\t\treturn "; + protected final String TEXT_269 = ";" + NL + "\t}" + NL; + protected final String TEXT_270 = NL; + protected final String TEXT_271 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_272 = " domainModelEditDomain = "; + protected final String TEXT_273 = ".getEditingDomain("; + protected final String TEXT_274 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends "; + protected final String TEXT_275 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_276 = " filter;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_277 = " editingDomain;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher() {" + NL + "\t\t\tcreateFilter();" + NL + "\t\t}"; + protected final String TEXT_278 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in "; + protected final String TEXT_279 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, any non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t *

User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_280 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_281 = ".NOT_TOUCH;" + NL + "\t\t}"; + protected final String TEXT_282 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_283 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn "; + protected final String TEXT_284 = ".createEventTypeFilter("; + protected final String TEXT_285 = ".SET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_286 = ".createEventTypeFilter("; + protected final String TEXT_287 = ".UNSET).or(" + NL + "\t\t\t\t"; + protected final String TEXT_288 = ".createEventTypeFilter("; + protected final String TEXT_289 = ".REMOVE).or(" + NL + "\t\t\t\t"; + protected final String TEXT_290 = ".createEventTypeFilter("; + protected final String TEXT_291 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}"; + protected final String TEXT_292 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createFilter() {"; + protected final String TEXT_293 = NL; + protected final String TEXT_294 = NL + "\t\t\tfilter = "; + protected final String TEXT_295 = ".createFeatureFilter("; + protected final String TEXT_296 = ".eINSTANCE.get"; + protected final String TEXT_297 = "());"; + protected final String TEXT_298 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_299 = ".createFeatureFilter("; + protected final String TEXT_300 = ".eINSTANCE.get"; + protected final String TEXT_301 = "()));"; + protected final String TEXT_302 = NL; + protected final String TEXT_303 = NL + "\t\t\tfilter = "; + protected final String TEXT_304 = ".createFeatureFilter("; + protected final String TEXT_305 = ".eINSTANCE.get"; + protected final String TEXT_306 = "());"; + protected final String TEXT_307 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_308 = ".createFeatureFilter("; + protected final String TEXT_309 = ".eINSTANCE.get"; + protected final String TEXT_310 = "()));"; + protected final String TEXT_311 = NL; protected final String TEXT_312 = NL + "\t\t\tfilter = "; - protected final String TEXT_313 = ".ANY.negated();"; - protected final String TEXT_314 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; - protected final String TEXT_315 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_316 = " transactionAboutToCommit("; - protected final String TEXT_317 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_318 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; - protected final String TEXT_319 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_320 = " domainModelEditDomain = "; - protected final String TEXT_321 = ".getEditingDomain("; - protected final String TEXT_322 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; - protected final String TEXT_323 = NL; - protected final String TEXT_324 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_325 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_326 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; - protected final String TEXT_327 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor("; - protected final String TEXT_328 = " source, "; - protected final String TEXT_329 = " destination, "; - protected final String TEXT_330 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor("; - protected final String TEXT_331 = " source, "; - protected final String TEXT_332 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_333 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_334 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; - protected final String TEXT_335 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_336 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; - protected final String TEXT_337 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; - protected final String TEXT_338 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; - protected final String TEXT_339 = " semanticToNotationalTypeBasedLinks = new "; - protected final String TEXT_340 = "();" + NL + "\t\tfinal "; - protected final String TEXT_341 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; - protected final String TEXT_342 = "();" + NL + "\t\tfor("; - protected final String TEXT_343 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_344 = " next = ("; - protected final String TEXT_345 = ") it.next();" + NL + "\t\t\t"; - protected final String TEXT_346 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_347 = " featureBasedLinksForSource = ("; - protected final String TEXT_348 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; - protected final String TEXT_349 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_350 = " parentView = "; - protected final String TEXT_351 = ";" + NL + "\t\t"; - protected final String TEXT_352 = " command = new "; - protected final String TEXT_353 = "();" + NL + "\t\tfor("; - protected final String TEXT_354 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; - protected final String TEXT_355 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; - protected final String TEXT_356 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; - protected final String TEXT_357 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; - protected final String TEXT_358 = " featureBasedLinksForSource = ("; - protected final String TEXT_359 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = ("; - protected final String TEXT_360 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != "; - protected final String TEXT_361 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_362 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_363 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_364 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_365 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_366 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_367 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_368 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_369 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_370 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_371 = " obsoleteView = ("; - protected final String TEXT_372 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_373 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; - protected final String TEXT_374 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_375 = " obsoleteViews = ("; - protected final String TEXT_376 = ") it.next();" + NL + "\t\t\tfor("; - protected final String TEXT_377 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; - protected final String TEXT_378 = " obsoleteView = ("; - protected final String TEXT_379 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; - protected final String TEXT_380 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_381 = " findView("; - protected final String TEXT_382 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_383 = " editPart = ("; - protected final String TEXT_384 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; - protected final String TEXT_385 = ") {" + NL + "\t\t\treturn ("; - protected final String TEXT_386 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_387 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; - protected final String TEXT_388 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_389 = " findNode("; - protected final String TEXT_390 = " parentView, "; - protected final String TEXT_391 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_392 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_393 = " next = ("; - protected final String TEXT_394 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; - protected final String TEXT_395 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_396 = " findEdge("; - protected final String TEXT_397 = " modelElement) {" + NL + "\t\tfor("; - protected final String TEXT_398 = " it = "; - protected final String TEXT_399 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_400 = " next = ("; - protected final String TEXT_401 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_402 = " getCreateNotationalEdgeCommand("; - protected final String TEXT_403 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; - protected final String TEXT_404 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; - protected final String TEXT_405 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_406 = " createdEdge = "; - protected final String TEXT_407 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; - protected final String TEXT_408 = NL + "\t\tcase "; - protected final String TEXT_409 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; - protected final String TEXT_410 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; - protected final String TEXT_411 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_412 = NL + "\t\tcase "; - protected final String TEXT_413 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t"; - protected final String TEXT_414 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; - protected final String TEXT_415 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new "; - protected final String TEXT_416 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_417 = " getSemanticChildLinks() {"; - protected final String TEXT_418 = NL; - protected final String TEXT_419 = "\t"; - protected final String TEXT_420 = " result = new "; - protected final String TEXT_421 = "();"; - protected final String TEXT_422 = NL + "\t"; - protected final String TEXT_423 = " modelObject = "; - protected final String TEXT_424 = ";" + NL + "\t"; - protected final String TEXT_425 = " nextValue;"; - protected final String TEXT_426 = NL + "\tint linkVID;"; - protected final String TEXT_427 = NL + "\tfor("; - protected final String TEXT_428 = " it = (("; - protected final String TEXT_429 = ")modelObject)."; - protected final String TEXT_430 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_431 = ") it.next();"; - protected final String TEXT_432 = NL + "\tnextValue = (("; - protected final String TEXT_433 = ")modelObject)."; - protected final String TEXT_434 = "();"; - protected final String TEXT_435 = NL + "\tlinkVID = "; - protected final String TEXT_436 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; - protected final String TEXT_437 = NL + "\tswitch (linkVID) {"; - protected final String TEXT_438 = NL + "\tcase "; - protected final String TEXT_439 = ".VISUAL_ID: {"; - protected final String TEXT_440 = NL + "\tif ("; - protected final String TEXT_441 = ".VISUAL_ID == linkVID) {"; - protected final String TEXT_442 = NL + "\t\t"; - protected final String TEXT_443 = " source = (("; - protected final String TEXT_444 = ")nextValue)."; - protected final String TEXT_445 = "();"; - protected final String TEXT_446 = NL + "\t\t"; - protected final String TEXT_447 = " source = "; - protected final String TEXT_448 = ";"; - protected final String TEXT_449 = NL + "\t\t"; - protected final String TEXT_450 = " target = (("; - protected final String TEXT_451 = ")nextValue)."; - protected final String TEXT_452 = "();"; - protected final String TEXT_453 = NL + "\t\t"; - protected final String TEXT_454 = " target = "; - protected final String TEXT_455 = ";"; - protected final String TEXT_456 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}"; - protected final String TEXT_457 = NL + "\t\tbreak;" + NL + "\t}"; - protected final String TEXT_458 = NL + "\t}"; - protected final String TEXT_459 = NL + "\t}"; - protected final String TEXT_460 = NL + "\t}"; - protected final String TEXT_461 = NL + "\tfor("; - protected final String TEXT_462 = " it = (("; - protected final String TEXT_463 = ")modelObject)."; - protected final String TEXT_464 = "().iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_465 = ") it.next();"; - protected final String TEXT_466 = NL + "\tnextValue = (("; - protected final String TEXT_467 = ")modelObject)."; - protected final String TEXT_468 = "();"; - protected final String TEXT_469 = NL + "\tif (nextValue != null) {"; - protected final String TEXT_470 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; - protected final String TEXT_471 = ".VISUAL_ID));"; - protected final String TEXT_472 = NL + "\t}"; - protected final String TEXT_473 = NL + "\t}"; - protected final String TEXT_474 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_475 = " getNotationalChildLinks() {" + NL + "\t\t"; - protected final String TEXT_476 = " result = new "; - protected final String TEXT_477 = "();" + NL + "\t\t"; - protected final String TEXT_478 = " allLinks = "; - protected final String TEXT_479 = ".getEdges();" + NL + "\t\tfor("; - protected final String TEXT_480 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_481 = " next = ("; - protected final String TEXT_482 = ") it.next();"; - protected final String TEXT_483 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_484 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_485 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}"; - protected final String TEXT_486 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; - protected final String TEXT_487 = ") {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_488 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_489 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_490 = ".VISUAL_ID:"; - protected final String TEXT_491 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; - protected final String TEXT_492 = NL + "\t\t\t} else {"; - protected final String TEXT_493 = NL + "\t\t\t}"; - protected final String TEXT_494 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; - protected final String TEXT_495 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; - protected final String TEXT_496 = ") {" + NL + "\t\t\t\t\tint linkVID = "; - protected final String TEXT_497 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; - protected final String TEXT_498 = NL + "\t\t\t\t\tcase "; - protected final String TEXT_499 = ".VISUAL_ID:"; - protected final String TEXT_500 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}"; - protected final String TEXT_501 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns "; - protected final String TEXT_502 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn "; - protected final String TEXT_503 = ";" + NL + "\t}"; - protected final String TEXT_504 = NL; - protected final String TEXT_505 = NL; - protected final String TEXT_506 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_507 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_508 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_509 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate UpdateManager updateManager = new UpdateManager();" + NL + "}"; - protected final String TEXT_510 = NL; + protected final String TEXT_313 = ".createFeatureFilter("; + protected final String TEXT_314 = ".eINSTANCE.get"; + protected final String TEXT_315 = "());"; + protected final String TEXT_316 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_317 = ".createFeatureFilter("; + protected final String TEXT_318 = ".eINSTANCE.get"; + protected final String TEXT_319 = "()));"; + protected final String TEXT_320 = NL; + protected final String TEXT_321 = NL + "\t\t\tfilter = "; + protected final String TEXT_322 = ".createFeatureFilter("; + protected final String TEXT_323 = ".eINSTANCE.get"; + protected final String TEXT_324 = "());"; + protected final String TEXT_325 = NL + "\t\t\tfilter = filter.or("; + protected final String TEXT_326 = ".createFeatureFilter("; + protected final String TEXT_327 = ".eINSTANCE.get"; + protected final String TEXT_328 = "()));"; + protected final String TEXT_329 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);"; + protected final String TEXT_330 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter();"; + protected final String TEXT_331 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());"; + protected final String TEXT_332 = NL + "\t\t\tfilter = createUncontainedLinksFilter();"; + protected final String TEXT_333 = NL + "\t\t\tfilter = "; + protected final String TEXT_334 = ".ANY.negated();"; + protected final String TEXT_335 = NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void install("; + protected final String TEXT_336 = " editingDomain) {" + NL + "\t\t\tif (this.editingDomain != null && !this.editingDomain.equals(editingDomain)) {" + NL + "\t\t\t\tthrow new IllegalStateException(\"Already listening to another editing domain\");" + NL + "\t\t\t}" + NL + "\t\t\tthis.editingDomain = editingDomain;" + NL + "\t\t\tthis.editingDomain.addResourceSetListener(this);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isInstalled() {" + NL + "\t\t\treturn editingDomain != null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void uninstall() {" + NL + "\t\t\tif (isInstalled()) {" + NL + "\t\t\t\teditingDomain.removeResourceSetListener(this);" + NL + "\t\t\t\teditingDomain = null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean isPrecommitOnly() {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_337 = " transactionAboutToCommit("; + protected final String TEXT_338 = " event) {" + NL + "\t\t\treturn getRefreshLinkNotationModelCommand();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_339 = " getFilter() {" + NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t"; + protected final String TEXT_340 = " command = getRefreshLinkNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_341 = " domainModelEditDomain = "; + protected final String TEXT_342 = ".getEditingDomain("; + protected final String TEXT_343 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new WrappingCommand(domainModelEditDomain, command));" + NL + "\t}" + NL; + protected final String TEXT_344 = NL; + protected final String TEXT_345 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private static class LinkDescriptor {" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_346 = " mySource;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_347 = " myDestination;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate "; + protected final String TEXT_348 = " myLinkElement;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate int myVisualID;" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected LinkDescriptor("; + protected final String TEXT_349 = " source, "; + protected final String TEXT_350 = " destination, "; + protected final String TEXT_351 = " linkElement, int linkVID) {" + NL + "\t\tthis(source, destination, linkVID);" + NL + "\t\tmyLinkElement = linkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprivate LinkDescriptor("; + protected final String TEXT_352 = " source, "; + protected final String TEXT_353 = " destination, int linkVID) {" + NL + "\t\tmySource = source;" + NL + "\t\tmyDestination = destination;" + NL + "\t\tmyVisualID = linkVID;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_354 = " getSource() {" + NL + "\t\treturn mySource;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_355 = " getDestination() {" + NL + "\t\treturn myDestination;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected "; + protected final String TEXT_356 = " getLinkElement() {" + NL + "\t\treturn myLinkElement;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " \t * @generated" + NL + " */" + NL + "\tprotected int getVisualID() {" + NL + "\t\treturn myVisualID;" + NL + "\t}" + NL + "}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_357 = " getRefreshLinkNotationModelCommand() {" + NL + "\t\t"; + protected final String TEXT_358 = "/**/ semanticChildLinks = getSemanticChildLinks();" + NL + "\t\t"; + protected final String TEXT_359 = "/**/ notationalChildLinks = getNotationalChildLinks();" + NL + "\t\tfinal "; + protected final String TEXT_360 = " semanticToNotationalTypeBasedLinks = new "; + protected final String TEXT_361 = "();" + NL + "\t\tfinal "; + protected final String TEXT_362 = "/*>*/ semanticToNotationalFeatureBasedLinks = new "; + protected final String TEXT_363 = "();" + NL + "\t\tfor("; + protected final String TEXT_364 = " it = notationalChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_365 = " next = ("; + protected final String TEXT_366 = ") it.next();" + NL + "\t\t\t"; + protected final String TEXT_367 = " nextSemantic = next.getElement();" + NL + "\t\t\tif (nextSemantic != null) {" + NL + "\t\t\t\tsemanticToNotationalTypeBasedLinks.put(nextSemantic, next);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_368 = " featureBasedLinksForSource = ("; + protected final String TEXT_369 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource().getElement());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null) {" + NL + "\t\t\t\t\tfeatureBasedLinksForSource = new "; + protected final String TEXT_370 = "();" + NL + "\t\t\t\t\tsemanticToNotationalFeatureBasedLinks.put(next.getSource().getElement(), featureBasedLinksForSource);" + NL + "\t\t\t\t}" + NL + "\t\t\t\tfeatureBasedLinksForSource.add(next);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_371 = " parentView = "; + protected final String TEXT_372 = ";" + NL + "\t\t"; + protected final String TEXT_373 = " command = new "; + protected final String TEXT_374 = "();" + NL + "\t\tfor("; + protected final String TEXT_375 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\tLinkDescriptor next = (LinkDescriptor) it.next();" + NL + "\t\t\t"; + protected final String TEXT_376 = " nextLinkElement = next.getLinkElement();" + NL + "\t\t\t"; + protected final String TEXT_377 = " currentEdge;" + NL + "\t\t\tif (nextLinkElement != null) {" + NL + "\t\t\t\tcurrentEdge = ("; + protected final String TEXT_378 = ") semanticToNotationalTypeBasedLinks.remove(nextLinkElement);" + NL + "\t\t\t} else {" + NL + "\t\t\t\t"; + protected final String TEXT_379 = " featureBasedLinksForSource = ("; + protected final String TEXT_380 = ") semanticToNotationalFeatureBasedLinks.get(next.getSource());" + NL + "\t\t\t\tif (featureBasedLinksForSource == null || featureBasedLinksForSource.isEmpty()) {" + NL + "\t\t\t\t\tcurrentEdge = null;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tcurrentEdge = ("; + protected final String TEXT_381 = ") featureBasedLinksForSource.remove(0);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tint linkVisualID = next.getVisualID();" + NL + "\t\t\tif (currentEdge == null) {" + NL + "\t\t\t\tif (nextLinkElement == null || shouldCreateEdge(nextLinkElement)) {" + NL + "\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t}" + NL + "\t\t\t} else {" + NL + "\t\t\t\tboolean changedSource = currentEdge.getSource().getElement() != next.getSource();" + NL + "\t\t\t\tboolean changedTarget = currentEdge.getTarget().getElement() != next.getDestination();" + NL + "\t\t\t\tboolean changedVID = linkVisualID != "; + protected final String TEXT_382 = ".getVisualID(currentEdge);" + NL + "\t\t\t\tif (!changedSource && !changedTarget) {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_383 = " notationalCommand = getCreateNotationalEdgeCommand(parentView, next);" + NL + "\t\t\t\t\t\tif (notationalCommand != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_384 = "(parentView, notationalCommand, currentEdge));" + NL + "\t\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_385 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\tif (changedVID) {" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_386 = "(parentView, currentEdge));" + NL + "\t\t\t\t\t\tcommand.appendIfCanExecute(getCreateNotationalEdgeCommand(parentView, next));" + NL + "\t\t\t\t\t} else {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_387 = " newSourceView = findView(next.getSource());" + NL + "\t\t\t\t\t\tif (changedSource && newSourceView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_388 = "(currentEdge, newSourceView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_389 = " newTargetView = findView(next.getDestination());" + NL + "\t\t\t\t\t\tif (changedTarget && newTargetView != null) {" + NL + "\t\t\t\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_390 = "(currentEdge, newTargetView));" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_391 = " it = semanticToNotationalTypeBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_392 = " obsoleteView = ("; + protected final String TEXT_393 = ") it.next();" + NL + "\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_394 = "(parentView, obsoleteView));" + NL + "\t\t}" + NL + "\t\tfor("; + protected final String TEXT_395 = " it = semanticToNotationalFeatureBasedLinks.values().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_396 = " obsoleteViews = ("; + protected final String TEXT_397 = ") it.next();" + NL + "\t\t\tfor("; + protected final String TEXT_398 = " obsoleteViewsIt = obsoleteViews.iterator(); obsoleteViewsIt.hasNext(); ) {" + NL + "\t\t\t\t"; + protected final String TEXT_399 = " obsoleteView = ("; + protected final String TEXT_400 = ") obsoleteViewsIt.next();" + NL + "\t\t\t\tcommand.appendIfCanExecute(new "; + protected final String TEXT_401 = "(parentView, obsoleteView));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn command.getCommandList().isEmpty() ? null : command;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_402 = " findView("; + protected final String TEXT_403 = " modelElement) {" + NL + "\t\tif (modelElement == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_404 = " editPart = ("; + protected final String TEXT_405 = ") getViewer().getEditPartRegistry().get(modelElement);" + NL + "\t\tif (editPart != null && editPart.getModel() instanceof "; + protected final String TEXT_406 = ") {" + NL + "\t\t\treturn ("; + protected final String TEXT_407 = ") editPart.getModel();" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_408 = " parentView = findView(modelElement.eContainer());" + NL + "\t\tif (parentView != null) {" + NL + "\t\t\t"; + protected final String TEXT_409 = " result = findNode(parentView, modelElement);" + NL + "\t\t\tif (result != null) {" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn findEdge(modelElement);" + NL + "\t}" + NL + "\t" + NL + "\t/**" + NL + "\t * Finds a notational node that corresponds to the given underlying domain element in a subtree starting from the given parent element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_410 = " findNode("; + protected final String TEXT_411 = " parentView, "; + protected final String TEXT_412 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_413 = " it = parentView.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_414 = " next = ("; + protected final String TEXT_415 = ") it.next();" + NL + "\t\t\tif (!next.isSetElement() || next.getElement() == parentView) {" + NL + "\t\t\t\t"; + protected final String TEXT_416 = " result = findNode(next, modelElement);" + NL + "\t\t\t\tif (result != null) {" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Finds a notational edge that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_417 = " findEdge("; + protected final String TEXT_418 = " modelElement) {" + NL + "\t\tfor("; + protected final String TEXT_419 = " it = "; + protected final String TEXT_420 = ".getEdges().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_421 = " next = ("; + protected final String TEXT_422 = ") it.next();" + NL + "\t\t\tif (next.isSetElement() && next.getElement() == modelElement) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_423 = " getCreateNotationalEdgeCommand("; + protected final String TEXT_424 = " parentView, LinkDescriptor linkDescriptor) {" + NL + "\t\t"; + protected final String TEXT_425 = " sourceView = findView(linkDescriptor.getSource());" + NL + "\t\t"; + protected final String TEXT_426 = " targetView = findView(linkDescriptor.getDestination());" + NL + "\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_427 = " createdEdge = "; + protected final String TEXT_428 = ".eINSTANCE.createEdge();" + NL + "\t\tswitch (linkDescriptor.getVisualID()) {"; + protected final String TEXT_429 = NL + "\t\tcase "; + protected final String TEXT_430 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() instanceof "; + protected final String TEXT_431 = ") {" + NL + "\t\t\t\tcreatedEdge.setElement(linkDescriptor.getLinkElement());" + NL + "\t\t\t\t"; + protected final String TEXT_432 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_433 = NL + "\t\tcase "; + protected final String TEXT_434 = ".VISUAL_ID:" + NL + "\t\t\tif (linkDescriptor.getLinkElement() == null) {" + NL + "\t\t\t\tcreatedEdge.setElement(null);" + NL + "\t\t\t\t"; + protected final String TEXT_435 = ".decorateView(createdEdge);" + NL + "\t\t\t}" + NL + "\t\t\tbreak;"; + protected final String TEXT_436 = NL + "\t\t}" + NL + "\t\tif (createdEdge.getType() == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn new "; + protected final String TEXT_437 = "(parentView, createdEdge, sourceView, targetView);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_438 = " getSemanticChildLinks() {"; + protected final String TEXT_439 = NL; + protected final String TEXT_440 = "\t"; + protected final String TEXT_441 = " result = new "; + protected final String TEXT_442 = "();"; + protected final String TEXT_443 = NL + "\t"; + protected final String TEXT_444 = " modelObject = "; + protected final String TEXT_445 = ".getElement();" + NL + "\t"; + protected final String TEXT_446 = " nextValue;"; + protected final String TEXT_447 = NL + "\tint linkVID;"; + protected final String TEXT_448 = NL + "\tfor("; + protected final String TEXT_449 = " it = "; + protected final String TEXT_450 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_451 = ") it.next();"; + protected final String TEXT_452 = NL + "\tnextValue = ("; + protected final String TEXT_453 = ")"; + protected final String TEXT_454 = ";"; + protected final String TEXT_455 = NL + "\tlinkVID = "; + protected final String TEXT_456 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_457 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_458 = NL + "\tcase "; + protected final String TEXT_459 = ".VISUAL_ID: {"; + protected final String TEXT_460 = NL + "\tif ("; + protected final String TEXT_461 = ".VISUAL_ID == linkVID) {"; + protected final String TEXT_462 = NL + "\t\t"; + protected final String TEXT_463 = " source = ("; + protected final String TEXT_464 = ")"; + protected final String TEXT_465 = ";"; + protected final String TEXT_466 = NL + "\t\t"; + protected final String TEXT_467 = " source = "; + protected final String TEXT_468 = ".getElement();"; + protected final String TEXT_469 = NL + "\t\t"; + protected final String TEXT_470 = " target = ("; + protected final String TEXT_471 = ")"; + protected final String TEXT_472 = ";"; + protected final String TEXT_473 = NL + "\t\t"; + protected final String TEXT_474 = " target = "; + protected final String TEXT_475 = ".getElement();"; + protected final String TEXT_476 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new LinkDescriptor(source, target, nextValue, linkVID));" + NL + "\t\t}"; + protected final String TEXT_477 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_478 = NL + "\t}"; + protected final String TEXT_479 = NL + "\t}"; + protected final String TEXT_480 = NL + "\t}"; + protected final String TEXT_481 = NL + "\tfor("; + protected final String TEXT_482 = " it = "; + protected final String TEXT_483 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_484 = ") it.next();"; + protected final String TEXT_485 = NL + "\tnextValue = ("; + protected final String TEXT_486 = ")"; + protected final String TEXT_487 = ";"; + protected final String TEXT_488 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_489 = NL + "\t\tresult.add(new LinkDescriptor(modelObject, nextValue, null, "; + protected final String TEXT_490 = ".VISUAL_ID));"; + protected final String TEXT_491 = NL + "\t}"; + protected final String TEXT_492 = NL + "\t}"; + protected final String TEXT_493 = NL + "\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_494 = " getNotationalChildLinks() {" + NL + "\t\t"; + protected final String TEXT_495 = " result = new "; + protected final String TEXT_496 = "();" + NL + "\t\t"; + protected final String TEXT_497 = " allLinks = "; + protected final String TEXT_498 = ".getEdges();" + NL + "\t\tfor("; + protected final String TEXT_499 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_500 = " next = ("; + protected final String TEXT_501 = ") it.next();"; + protected final String TEXT_502 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_503 = " source = next.getSource();" + NL + "\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_504 = " target = next.getTarget();" + NL + "\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\tresult.add(next);" + NL + "\t\t\t\tcontinue;" + NL + "\t\t\t}"; + protected final String TEXT_505 = NL + "\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\tif (next.getSource() == "; + protected final String TEXT_506 = ") {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_507 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_508 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_509 = ".VISUAL_ID:"; + protected final String TEXT_510 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}"; + protected final String TEXT_511 = NL + "\t\t\t} else {"; + protected final String TEXT_512 = NL + "\t\t\t}"; + protected final String TEXT_513 = NL + "\t\t\tif (next.isSetElement() && next.getElement() != null) {"; + protected final String TEXT_514 = NL + "\t\t\t\tif (next.getElement().eContainer() == "; + protected final String TEXT_515 = ".getElement()) {" + NL + "\t\t\t\t\tint linkVID = "; + protected final String TEXT_516 = ".getVisualID(next);" + NL + "\t\t\t\t\tswitch (linkVID) {"; + protected final String TEXT_517 = NL + "\t\t\t\t\tcase "; + protected final String TEXT_518 = ".VISUAL_ID:"; + protected final String TEXT_519 = NL + "\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}"; + protected final String TEXT_520 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t * The generated code always returns "; + protected final String TEXT_521 = ". " + NL + "\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate boolean shouldCreateEdge(EObject domainElement) {" + NL + "\t\treturn "; + protected final String TEXT_522 = ";" + NL + "\t}"; + protected final String TEXT_523 = NL; + protected final String TEXT_524 = NL; + protected final String TEXT_525 = "\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_526 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_527 = " 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_528 = ") 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_529 = NL; public String generate(Object argument) { final StringBuffer stringBuffer = new StringBuffer(); GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0]; -ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; +final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]; importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc importManager.registerInnerClass("LinkDescriptor"); //from linkNotationModelRefresher.jetinc List childNodes = genDiagram.getTopLevelNodes(); + stringBuffer.append(TEXT_1); + stringBuffer.append(TEXT_2); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_3); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_4); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_5); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_6); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_7); + + } + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_9); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_10); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_11); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_12); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_13); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_14); + + } + + stringBuffer.append(TEXT_15); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_16); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_17); + class DiagramEditPartHelper { private final List myContainedFeatureModelFacetLinks = new LinkedList(); private final List myContainedTypeModelFacetLinks = new LinkedList(); @@ -595,7 +690,7 @@ } final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram); - stringBuffer.append(TEXT_1); + stringBuffer.append(TEXT_18); importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.gef.editparts.AbstractGraphicalEditPart"); @@ -625,97 +720,97 @@ importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_2); + stringBuffer.append(TEXT_19); stringBuffer.append(genDiagram.getEditPartClassName()); - stringBuffer.append(TEXT_3); + stringBuffer.append(TEXT_20); stringBuffer.append(genDiagram.getEditorGen().getModelID()); - stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_21); { GenCommonBase genCommonBase = genDiagram; - stringBuffer.append(TEXT_5); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_23); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_24); } - stringBuffer.append(TEXT_8); + stringBuffer.append(TEXT_25); stringBuffer.append(genDiagram.getEditPartClassName()); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_26); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_27); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_11); + stringBuffer.append(TEXT_28); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_12); - stringBuffer.append(TEXT_13); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_31); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_34); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_18); + stringBuffer.append(TEXT_35); if (null != genDiagram.getPalette()) { final Palette palette = genDiagram.getPalette(); - stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_40); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_41); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_43); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_45); } - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_47); }/*when there's palette*/ - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_54); //link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_55); //} - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper")); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid")); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_58); /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_59); for(Iterator it = childNodes.iterator(); it.hasNext(); ) { GenTopLevelNode next = (GenTopLevelNode)it.next(); @@ -723,42 +818,42 @@ boolean isListLayout = false; String resolvedSemanticElement = "parent.getElement()"; - stringBuffer.append(TEXT_43); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_61); if (isStatic) { - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_62); } - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_63); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_65); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_68); if (!isListLayout) { - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_70); } - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName(next.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_73); if (!isListLayout) { - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_76); int defaultWidth = 40; int defaultHeight = 40; @@ -768,218 +863,229 @@ defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_77); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_78); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_79); } - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_80); if (genDiagram.getPalette() != null) { - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_81); if (isStatic) { - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_82); } - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_83); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_85); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_86); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName(genDiagram.getPalette().getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_89); if (!isListLayout) { - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_91); } - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_94); if (next.getDomainMetaClass().isMapEntry()) { /*Workaround for Ecore example: map entries cannot be created using factory, only using reflective EFactory.create() method*/ - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_98); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_99); } else { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_100); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName(next.getDomainMetaClass().getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_102); stringBuffer.append(next.getDomainMetaClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_103); } - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_104); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_105); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_106); stringBuffer.append(next.getUniqueIdentifier()); - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_107); + if (next.getDomainMetaClass().isExternalInterface()) { + stringBuffer.append(TEXT_108); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_109); + } + stringBuffer.append(TEXT_110); TypeModelFacet facet = next.getModelFacet(); GenFeature childFeature = facet.getChildMetaFeature(); GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_114); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_116); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_118); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_120); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_121); } else { - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_123); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_125); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_126); } - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_127); stringBuffer.append(next.getDomainMetaClass().getName()); stringBuffer.append(next.getVisualID()); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_128); + if (next.getDomainMetaClass().isExternalInterface()) { + stringBuffer.append(TEXT_129); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_130); + } + stringBuffer.append(TEXT_131); if(!isListLayout) { - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_132); } - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_133); } } - stringBuffer.append(TEXT_111); - stringBuffer.append(TEXT_112); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_137); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_116); - stringBuffer.append(TEXT_117); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_142); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_143); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.EContentAdapter")); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("java.util.Collection")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_146); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("java.util.Collection")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_154); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_156); //link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_157); //} - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_158); //link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links //if (myHelper.containsLinks()) { - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_159); //} - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_160); { String _getDiagramCode = "getDiagram()"; String _getViewCode = "getDiagram()"; -String _getSemanticElementCode = "getDiagram().getElement()"; boolean isListLayout = false; final boolean _includeUncontainedLinks = true; - stringBuffer.append(TEXT_138); - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_164); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_165); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_166); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_168); boolean hasConstraintsInChildren = false; for (Iterator it = childNodes.iterator(); it.hasNext(); ) { @@ -994,17 +1100,17 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_169); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_172); } - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_173); { boolean hasDeclaredFilter = false; @@ -1023,23 +1129,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_176); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_177); } else { - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_180); stringBuffer.append(childMetaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_181); } } //for @@ -1047,19 +1153,19 @@ if (hasDeclaredFilter) { - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_160); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_183); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_184); } else { - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_185); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_163); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_186); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_187); } } //local declaration of hasDeclaredFilter @@ -1067,87 +1173,87 @@ if (hasConstraintsInChildren) { - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_188); } - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_192); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_193); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_196); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_200); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_205); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_208); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_213); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_220); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_223); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalElementCommand")); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalElementCommand")); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_227); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -1157,39 +1263,39 @@ } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_229); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_230); stringBuffer.append(nextNode.getDomainMetaClass().getName()); stringBuffer.append(nextNode.getVisualID()); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_231); if (!isListLayout) { - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_232); } - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_233); } - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_234); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_212); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_236); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_238); } else { - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_240); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_241); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -1207,17 +1313,15 @@ Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_242); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_243); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_222); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_245); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_246); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -1226,102 +1330,100 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_226); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_227); - stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_248); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_250); } else { - stringBuffer.append(TEXT_230); - stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_231); - stringBuffer.append(childMetaFeature.getGetAccessor()); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_251); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_252); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); + stringBuffer.append(TEXT_253); } - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_254); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_255); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_256); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_258); } else { - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_260); } - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_261); if (generateSwitch) { - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_262); } else { - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_263); } } if (generateSwitch) { - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_264); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_265); } } - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_266); } - stringBuffer.append(TEXT_246); - stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_267); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_248); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_268); + stringBuffer.append(genDiagram.isSynchronized()); + stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_270); if (myHelper.containsLinks() || _includeUncontainedLinks) { - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_272); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_273); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetListenerImpl")); - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_275); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_276); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_277); boolean hasConstraintsInContainedLinks = false; for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -1334,40 +1436,40 @@ } if (hasConstraintsInContainedLinks) { - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_278); stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName()); - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_281); } if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_282); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_283); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_284); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_285); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_286); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_287); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_288); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_289); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_290); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_291); } - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_292); { boolean hasDeclaredFilter = false; @@ -1380,7 +1482,7 @@ } GenFeature _feature = modelFacet.getChildMetaFeature(); - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_293); /* * input: @@ -1394,30 +1496,30 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_294); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_295); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_296); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_276); + stringBuffer.append(TEXT_297); } else { - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_298); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_299); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_279); + stringBuffer.append(TEXT_300); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_301); } _feature = modelFacet.getSourceMetaFeature(); - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_302); /* * input: @@ -1431,30 +1533,30 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_303); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_304); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_305); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_306); } else { - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_308); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_309); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_310); } _feature = modelFacet.getTargetMetaFeature(); - stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_311); /* * input: @@ -1468,23 +1570,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_291); + stringBuffer.append(TEXT_312); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_292); + stringBuffer.append(TEXT_313); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_293); + stringBuffer.append(TEXT_314); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_294); + stringBuffer.append(TEXT_315); } else { - stringBuffer.append(TEXT_295); + stringBuffer.append(TEXT_316); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_296); + stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_297); + stringBuffer.append(TEXT_318); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_298); + stringBuffer.append(TEXT_319); } @@ -1494,7 +1596,7 @@ GenLink nextLink = (GenLink) it.next(); GenFeature _feature = ((FeatureModelFacet) nextLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_299); + stringBuffer.append(TEXT_320); /* * input: @@ -1508,23 +1610,23 @@ if (!hasDeclaredFilter) { hasDeclaredFilter = true; - stringBuffer.append(TEXT_300); + stringBuffer.append(TEXT_321); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_301); + stringBuffer.append(TEXT_322); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_302); + stringBuffer.append(TEXT_323); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_303); + stringBuffer.append(TEXT_324); } else { - stringBuffer.append(TEXT_304); + stringBuffer.append(TEXT_325); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_305); + stringBuffer.append(TEXT_326); stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_306); + stringBuffer.append(TEXT_327); stringBuffer.append(_feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_307); + stringBuffer.append(TEXT_328); } @@ -1533,222 +1635,222 @@ if (hasConstraintsInContainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_308); + stringBuffer.append(TEXT_329); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_309); + stringBuffer.append(TEXT_330); } } if (_includeUncontainedLinks) { if (hasDeclaredFilter) { - stringBuffer.append(TEXT_310); + stringBuffer.append(TEXT_331); } else { hasDeclaredFilter = true; - stringBuffer.append(TEXT_311); + stringBuffer.append(TEXT_332); } } if (!hasDeclaredFilter) { - stringBuffer.append(TEXT_312); + stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_313); + stringBuffer.append(TEXT_334); } } //local declaration of hasDeclaredFilter - stringBuffer.append(TEXT_314); + stringBuffer.append(TEXT_335); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_315); + stringBuffer.append(TEXT_336); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_316); + stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.ResourceSetChangeEvent")); - stringBuffer.append(TEXT_317); + stringBuffer.append(TEXT_338); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter")); - stringBuffer.append(TEXT_318); + stringBuffer.append(TEXT_339); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_319); + stringBuffer.append(TEXT_340); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_320); + stringBuffer.append(TEXT_341); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_321); + stringBuffer.append(TEXT_342); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_322); - stringBuffer.append(TEXT_323); + stringBuffer.append(TEXT_343); + stringBuffer.append(TEXT_344); /*inner class*/ - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_325); + stringBuffer.append(TEXT_346); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_326); + stringBuffer.append(TEXT_347); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_327); + stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_328); + stringBuffer.append(TEXT_349); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_329); + stringBuffer.append(TEXT_350); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_330); + stringBuffer.append(TEXT_351); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_331); + stringBuffer.append(TEXT_352); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_332); + stringBuffer.append(TEXT_353); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_333); + stringBuffer.append(TEXT_354); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_334); + stringBuffer.append(TEXT_355); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_335); + stringBuffer.append(TEXT_356); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_336); + stringBuffer.append(TEXT_357); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_337); + stringBuffer.append(TEXT_358); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_338); + stringBuffer.append(TEXT_359); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_339); + stringBuffer.append(TEXT_360); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_340); + stringBuffer.append(TEXT_361); stringBuffer.append(importManager.getImportedName("java.util.Map")); - stringBuffer.append(TEXT_341); + stringBuffer.append(TEXT_362); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_342); + stringBuffer.append(TEXT_363); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_343); + stringBuffer.append(TEXT_364); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_344); + stringBuffer.append(TEXT_365); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_345); + stringBuffer.append(TEXT_366); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_346); + stringBuffer.append(TEXT_367); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_347); + stringBuffer.append(TEXT_368); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_348); + stringBuffer.append(TEXT_369); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_349); + stringBuffer.append(TEXT_370); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_350); + stringBuffer.append(TEXT_371); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_351); + stringBuffer.append(TEXT_372); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_352); + stringBuffer.append(TEXT_373); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_353); + stringBuffer.append(TEXT_374); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_354); + stringBuffer.append(TEXT_375); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_355); + stringBuffer.append(TEXT_376); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_356); + stringBuffer.append(TEXT_377); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_357); + stringBuffer.append(TEXT_378); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_358); + stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_359); + stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_360); + stringBuffer.append(TEXT_381); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_361); + stringBuffer.append(TEXT_382); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_362); + stringBuffer.append(TEXT_383); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReplaceNotationalElementCommand")); - stringBuffer.append(TEXT_363); + stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_364); + stringBuffer.append(TEXT_385); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_365); + stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_366); + stringBuffer.append(TEXT_387); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeSourceCommand")); - stringBuffer.append(TEXT_367); + stringBuffer.append(TEXT_388); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_368); + stringBuffer.append(TEXT_389); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".ReconnectNotationalEdgeTargetCommand")); - stringBuffer.append(TEXT_369); + stringBuffer.append(TEXT_390); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_370); + stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_371); + stringBuffer.append(TEXT_392); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_372); + stringBuffer.append(TEXT_393); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_373); + stringBuffer.append(TEXT_394); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_374); + stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_375); + stringBuffer.append(TEXT_396); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_376); + stringBuffer.append(TEXT_397); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_377); + stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_378); + stringBuffer.append(TEXT_399); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_379); + stringBuffer.append(TEXT_400); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".RemoveNotationalEdgeCommand")); - stringBuffer.append(TEXT_380); + stringBuffer.append(TEXT_401); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_381); + stringBuffer.append(TEXT_402); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_382); + stringBuffer.append(TEXT_403); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_383); + stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_384); + stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_385); + stringBuffer.append(TEXT_406); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_386); + stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_387); + stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_388); + stringBuffer.append(TEXT_409); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_389); + stringBuffer.append(TEXT_410); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_390); + stringBuffer.append(TEXT_411); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_391); + stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_392); + stringBuffer.append(TEXT_413); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_393); + stringBuffer.append(TEXT_414); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_394); + stringBuffer.append(TEXT_415); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_395); + stringBuffer.append(TEXT_416); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_396); + stringBuffer.append(TEXT_417); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_397); + stringBuffer.append(TEXT_418); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_398); + stringBuffer.append(TEXT_419); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_399); + stringBuffer.append(TEXT_420); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_400); + stringBuffer.append(TEXT_421); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_401); + stringBuffer.append(TEXT_422); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_402); + stringBuffer.append(TEXT_423); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_403); + stringBuffer.append(TEXT_424); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_404); + stringBuffer.append(TEXT_425); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_405); + stringBuffer.append(TEXT_426); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_406); + stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_407); + stringBuffer.append(TEXT_428); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); @@ -1757,37 +1859,37 @@ continue; } - stringBuffer.append(TEXT_408); + stringBuffer.append(TEXT_429); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_409); + stringBuffer.append(TEXT_430); stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_410); + stringBuffer.append(TEXT_431); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_411); + stringBuffer.append(TEXT_432); } for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_412); + stringBuffer.append(TEXT_433); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_413); + stringBuffer.append(TEXT_434); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_414); + stringBuffer.append(TEXT_435); } - stringBuffer.append(TEXT_415); + stringBuffer.append(TEXT_436); stringBuffer.append(importManager.getImportedName(genDiagram.getEditCommandsPackageName() + ".CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_416); + stringBuffer.append(TEXT_437); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_417); - stringBuffer.append(TEXT_418); - stringBuffer.append(TEXT_419); + stringBuffer.append(TEXT_438); + stringBuffer.append(TEXT_439); + stringBuffer.append(TEXT_440); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_420); + stringBuffer.append(TEXT_441); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_421); + stringBuffer.append(TEXT_442); Map genFeature2genLinkMap = new LinkedHashMap(); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { @@ -1810,18 +1912,18 @@ } if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { - stringBuffer.append(TEXT_422); + stringBuffer.append(TEXT_443); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_423); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_424); + stringBuffer.append(TEXT_444); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_445); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_425); + stringBuffer.append(TEXT_446); } if (!genFeature2genLinkMap.isEmpty()) { - stringBuffer.append(TEXT_426); + stringBuffer.append(TEXT_447); } for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { @@ -1830,34 +1932,32 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_427); + stringBuffer.append(TEXT_448); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_428); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_429); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_430); + stringBuffer.append(TEXT_449); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); + stringBuffer.append(TEXT_450); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_431); + stringBuffer.append(TEXT_451); } else { - stringBuffer.append(TEXT_432); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_433); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_434); + stringBuffer.append(TEXT_452); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_453); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); + stringBuffer.append(TEXT_454); } - stringBuffer.append(TEXT_435); + stringBuffer.append(TEXT_455); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_436); + stringBuffer.append(TEXT_456); boolean generateSwitch = genLinksCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_437); + stringBuffer.append(TEXT_457); } for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { @@ -1865,65 +1965,65 @@ TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (generateSwitch) { - stringBuffer.append(TEXT_438); + stringBuffer.append(TEXT_458); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_439); + stringBuffer.append(TEXT_459); } else { - stringBuffer.append(TEXT_440); + stringBuffer.append(TEXT_460); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_441); + stringBuffer.append(TEXT_461); } if (modelFacet.getSourceMetaFeature() != null) { - stringBuffer.append(TEXT_442); + stringBuffer.append(TEXT_462); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_443); - stringBuffer.append(importManager.getImportedName(modelFacet.getSourceMetaFeature().getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_444); - stringBuffer.append(modelFacet.getSourceMetaFeature().getGetAccessor()); - stringBuffer.append(TEXT_445); + stringBuffer.append(TEXT_463); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_464); + myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false); + stringBuffer.append(TEXT_465); } else { - stringBuffer.append(TEXT_446); + stringBuffer.append(TEXT_466); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_447); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_448); + stringBuffer.append(TEXT_467); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_468); } if (modelFacet.getTargetMetaFeature() != null) { - stringBuffer.append(TEXT_449); + stringBuffer.append(TEXT_469); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_450); - stringBuffer.append(importManager.getImportedName(modelFacet.getTargetMetaFeature().getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_451); - stringBuffer.append(modelFacet.getTargetMetaFeature().getGetAccessor()); - stringBuffer.append(TEXT_452); + stringBuffer.append(TEXT_470); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_471); + myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false); + stringBuffer.append(TEXT_472); } else { - stringBuffer.append(TEXT_453); + stringBuffer.append(TEXT_473); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_454); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_455); + stringBuffer.append(TEXT_474); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_475); } - stringBuffer.append(TEXT_456); + stringBuffer.append(TEXT_476); if (generateSwitch) { - stringBuffer.append(TEXT_457); + stringBuffer.append(TEXT_477); } else { - stringBuffer.append(TEXT_458); + stringBuffer.append(TEXT_478); } @@ -1931,12 +2031,12 @@ } //iterate over genLinksCollection if (generateSwitch) { - stringBuffer.append(TEXT_459); + stringBuffer.append(TEXT_479); } if (metaFeature.isListType()) { - stringBuffer.append(TEXT_460); + stringBuffer.append(TEXT_480); } } @@ -1946,101 +2046,99 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_461); + stringBuffer.append(TEXT_481); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_462); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_463); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_464); + stringBuffer.append(TEXT_482); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); + stringBuffer.append(TEXT_483); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_465); + stringBuffer.append(TEXT_484); } else { - stringBuffer.append(TEXT_466); - stringBuffer.append(importManager.getImportedName(metaFeature.getGenClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_467); - stringBuffer.append(metaFeature.getGetAccessor()); - stringBuffer.append(TEXT_468); + stringBuffer.append(TEXT_485); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_486); + myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); + stringBuffer.append(TEXT_487); } - stringBuffer.append(TEXT_469); + stringBuffer.append(TEXT_488); for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); - stringBuffer.append(TEXT_470); + stringBuffer.append(TEXT_489); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_471); + stringBuffer.append(TEXT_490); } - stringBuffer.append(TEXT_472); + stringBuffer.append(TEXT_491); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_473); + stringBuffer.append(TEXT_492); } } - stringBuffer.append(TEXT_474); + stringBuffer.append(TEXT_493); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_475); + stringBuffer.append(TEXT_494); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_476); + stringBuffer.append(TEXT_495); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_477); + stringBuffer.append(TEXT_496); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_478); + stringBuffer.append(TEXT_497); stringBuffer.append(_getDiagramCode); - stringBuffer.append(TEXT_479); + stringBuffer.append(TEXT_498); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_480); + stringBuffer.append(TEXT_499); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_481); + stringBuffer.append(TEXT_500); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_482); + stringBuffer.append(TEXT_501); if (_includeUncontainedLinks) { - stringBuffer.append(TEXT_483); + stringBuffer.append(TEXT_502); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_484); + stringBuffer.append(TEXT_503); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_485); + stringBuffer.append(TEXT_504); } if (myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_486); + stringBuffer.append(TEXT_505); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_487); + stringBuffer.append(TEXT_506); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_488); + stringBuffer.append(TEXT_507); for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_489); + stringBuffer.append(TEXT_508); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_490); + stringBuffer.append(TEXT_509); } - stringBuffer.append(TEXT_491); + stringBuffer.append(TEXT_510); if (myHelper.containsTypeModelFacetLinks()) { - stringBuffer.append(TEXT_492); + stringBuffer.append(TEXT_511); } else { - stringBuffer.append(TEXT_493); + stringBuffer.append(TEXT_512); } } @@ -2050,51 +2148,51 @@ if (myHelper.containsTypeModelFacetLinks()) { if (!myHelper.containsFeatureModelFacetLinks()) { - stringBuffer.append(TEXT_494); + stringBuffer.append(TEXT_513); } - stringBuffer.append(TEXT_495); - stringBuffer.append(_getSemanticElementCode); - stringBuffer.append(TEXT_496); + stringBuffer.append(TEXT_514); + stringBuffer.append(_getViewCode); + stringBuffer.append(TEXT_515); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_497); + stringBuffer.append(TEXT_516); for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_498); + stringBuffer.append(TEXT_517); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_499); + stringBuffer.append(TEXT_518); } - stringBuffer.append(TEXT_500); + stringBuffer.append(TEXT_519); } - stringBuffer.append(TEXT_501); + stringBuffer.append(TEXT_520); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_502); + stringBuffer.append(TEXT_521); stringBuffer.append(genDiagram.isSynchronized()); - stringBuffer.append(TEXT_503); + stringBuffer.append(TEXT_522); } } - stringBuffer.append(TEXT_504); - stringBuffer.append(TEXT_505); - stringBuffer.append(TEXT_506); + stringBuffer.append(TEXT_523); + stringBuffer.append(TEXT_524); + stringBuffer.append(TEXT_525); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_507); + stringBuffer.append(TEXT_526); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_508); + stringBuffer.append(TEXT_527); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_509); + stringBuffer.append(TEXT_528); importManager.emitSortedImports(); - stringBuffer.append(TEXT_510); + stringBuffer.append(TEXT_529); 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.8 diff -u -r1.8 ChildNodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 2 Aug 2006 10:43:51 -0000 1.8 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java 3 Aug 2006 18:47:09 -0000 @@ -22,273 +22,294 @@ protected final String TEXT_2 = NL + "/*" + NL + " * "; protected final String TEXT_3 = NL + " */"; protected final String TEXT_4 = NL; - protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_6 = " extends "; - protected final String TEXT_7 = " implements IUpdatableEditPart {"; - protected final String TEXT_8 = NL; - protected final String TEXT_9 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; - protected final String TEXT_10 = ";"; - 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; - 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; - protected final String TEXT_19 = NL; - protected final String TEXT_20 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; - protected final String TEXT_21 = " view = ("; - protected final String TEXT_22 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; - protected final String TEXT_23 = " view = ("; - protected final String TEXT_24 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; - protected final String TEXT_25 = NL; - protected final String TEXT_26 = "\t\tinstallEditPolicy("; - protected final String TEXT_27 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; - protected final String TEXT_28 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; - protected final String TEXT_29 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tgetLabel().setText(value);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tprotected "; - protected final String TEXT_30 = " getDirectEditCommand("; - protected final String TEXT_31 = " request) {" + NL + "\t\t\t\t\t\tString value = (String) request.getCellEditor().getValue();" + NL + "\t\t\t\t\t\tif (value == null) {" + NL + "\t\t\t\t\t\t\t//Invalid value is transformed into a null by the validator." + NL + "\t\t\t\t\t\t\t//XXX: implement validator" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_32 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\tfinal Object[] parseResult;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tparseResult = new "; - protected final String TEXT_33 = "(EDIT_PATTERN).parse(value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_34 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; - protected final String TEXT_35 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_36 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_37 = " editingDomain = "; - protected final String TEXT_38 = ".getEditingDomain("; - protected final String TEXT_39 = ".getDiagram().getElement());"; - protected final String TEXT_40 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_41 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_42 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult[0]);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_43 = " createDomainModelCommand("; - protected final String TEXT_44 = " editingDomain, Object value) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_45 = " element = "; - protected final String TEXT_46 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_47 = " feature = ("; - protected final String TEXT_48 = ") "; - protected final String TEXT_49 = ".eINSTANCE.get"; - protected final String TEXT_50 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_51 = ".parseValue(feature, value);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_52 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_53 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_54 = " result = new "; - protected final String TEXT_55 = "();" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_56 = " values = new "; - protected final String TEXT_57 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_58 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_59 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_60 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; - protected final String TEXT_61 = NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_62 = ".create(editingDomain, element, feature, valueToSet);"; - protected final String TEXT_63 = NL + "\t\t\t\t\t}"; - protected final String TEXT_64 = NL + "\t\t\t\t\t\tif (parseResult.length != "; - protected final String TEXT_65 = ") {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_66 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_67 = " domainModelCommand = createDomainModelCommand(editingDomain, parseResult);" + NL + "\t\t\t\t\t\treturn new WrappingCommand(editingDomain, domainModelCommand);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_68 = " createDomainModelCommand("; - protected final String TEXT_69 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_70 = " element = "; - protected final String TEXT_71 = ";" + NL + "\t\t\t\t\t\t"; - protected final String TEXT_72 = " result = new "; - protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; - protected final String TEXT_74 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_75 = " "; - protected final String TEXT_76 = "feature = ("; - protected final String TEXT_77 = ") "; - protected final String TEXT_78 = ".eINSTANCE.get"; - protected final String TEXT_79 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; - protected final String TEXT_80 = ".parseValue(feature, values["; - protected final String TEXT_81 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; - protected final String TEXT_82 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; - protected final String TEXT_83 = NL + "\t\t\t\t\t\t"; - protected final String TEXT_84 = " "; - protected final String TEXT_85 = "values = new "; - protected final String TEXT_86 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; - protected final String TEXT_87 = "());" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_88 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_89 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_90 = NL + "\t\t\t\t\t\tresult.append("; - protected final String TEXT_91 = ".create(editingDomain, element, feature, valueToSet));"; - protected final String TEXT_92 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; - protected final String TEXT_93 = NL + "\t\t\t\t});"; - protected final String TEXT_94 = NL; - protected final String TEXT_95 = "\t\tinstallEditPolicy("; - protected final String TEXT_96 = ".COMPONENT_ROLE, new "; - protected final String TEXT_97 = "() {" + NL + "\t\t\tprotected "; - protected final String TEXT_98 = " createDeleteCommand("; - protected final String TEXT_99 = " deleteRequest) {" + NL + "\t\t\t\t"; - protected final String TEXT_100 = " editingDomain = "; - protected final String TEXT_101 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; - protected final String TEXT_102 = " cc = new "; - protected final String TEXT_103 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; - protected final String TEXT_104 = ".create(editingDomain, getDiagramNode()));" + NL + "\t\t\t\treturn new WrappingCommand(editingDomain, cc);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tprivate org.eclipse.emf.common.command.Command getDomainModelRemoveCommand("; - protected final String TEXT_105 = " editingDomain) {"; - protected final String TEXT_106 = NL + "\t\t\t\t"; - protected final String TEXT_107 = " result = new "; - protected final String TEXT_108 = "();"; - protected final String TEXT_109 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_110 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_111 = ".eINSTANCE.get"; - protected final String TEXT_112 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_113 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_114 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_115 = ".eINSTANCE.get"; - protected final String TEXT_116 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_117 = ".UNSET_VALUE));"; - protected final String TEXT_118 = NL + "\t\t\t\tresult.append("; - protected final String TEXT_119 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_120 = ".eINSTANCE.get"; - protected final String TEXT_121 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; - protected final String TEXT_122 = NL + "\t\t\t\tresult.append("; - 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\t"; - protected final String TEXT_126 = ".UNSET_VALUE));"; - protected final String TEXT_127 = NL + "\t\t\t\treturn result;"; - protected final String TEXT_128 = NL + "\t\t\t\treturn "; - protected final String TEXT_129 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_130 = ".eINSTANCE.get"; - protected final String TEXT_131 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; - protected final String TEXT_132 = NL + "\t\t\t\treturn "; - protected final String TEXT_133 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; - protected final String TEXT_134 = ".eINSTANCE.get"; - protected final String TEXT_135 = "()," + NL + "\t\t\t\t\t"; - protected final String TEXT_136 = ".UNSET_VALUE);"; - protected final String TEXT_137 = NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_138 = NL + "\t}" + NL; - protected final String TEXT_139 = NL; - protected final String TEXT_140 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_141 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_142 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t} else {" + NL + "\t\t\tsuper.performRequest(req);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_143 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; - protected final String TEXT_144 = "(this, "; - protected final String TEXT_145 = ".class, new "; - protected final String TEXT_146 = "() {" + NL + "\t\t\t\tpublic void relocate("; - protected final String TEXT_147 = " celleditor) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_148 = " rect = getLabel().getTextBounds();" + NL + "\t\t\t\t\tgetLabel().translateToAbsolute(rect);" + NL + "\t\t\t\t\tcelleditor.getControl().setBounds(rect.x, rect.y, rect.width, rect.height);" + NL + "\t\t\t\t}" + NL + "\t\t\t}) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelEditText());" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL; - protected final String TEXT_149 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}"; - protected final String TEXT_150 = NL; - protected final String TEXT_151 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; - protected final String TEXT_152 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; - protected final String TEXT_153 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + 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, VIEW_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelEditText() {" + NL + "\t\t"; - protected final String TEXT_156 = " element = "; - protected final String TEXT_157 = ";" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn buildTextByPattern(element, EDIT_PATTERN);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String buildTextByPattern("; - protected final String TEXT_158 = " element, String pattern) {"; - protected final String TEXT_159 = NL + "\t\tif (element.get"; - protected final String TEXT_160 = "() == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; - protected final String TEXT_161 = NL + "\t\treturn "; - protected final String TEXT_162 = ".format(pattern, new Object[] {"; - protected final String TEXT_163 = NL + "\t\t\t"; - protected final String TEXT_164 = NL + "\t\t});"; - protected final String TEXT_165 = NL + "\t\treturn "; - protected final String TEXT_166 = ".format(pattern, new Object[] {"; - protected final String TEXT_167 = NL + "\t\t"; - protected final String TEXT_168 = ","; - protected final String TEXT_169 = NL + "\t\t});"; - protected final String TEXT_170 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; - protected final String TEXT_171 = NL + "\t}"; - protected final String TEXT_172 = NL; - protected final String TEXT_173 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; - protected final String TEXT_174 = NL + "\t\t"; - protected final String TEXT_175 = " style =" + NL + "\t\t\t("; - protected final String TEXT_176 = ") "; - protected final String TEXT_177 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_178 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_179 = " toDispose = createdFont;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tString fontName = style.getFontName();" + NL + "\t\t\tint fontHeight = style.getFontHeight();" + NL + "\t\t\tint fontStyle = "; - protected final String TEXT_180 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_181 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_182 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_183 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_184 = " currentFontData = currentFont.getFontData()[0];" + NL + "\t\t\t\tif (currentFontData.getName().equals(fontName) && currentFontData.getHeight() == fontHeight && currentFontData.getStyle() == fontStyle) {" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFont = new "; - protected final String TEXT_185 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}"; - protected final String TEXT_186 = "\t" + NL + "\t}"; - protected final String TEXT_187 = NL + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_188 = " createdFont;"; - protected final String TEXT_189 = "\t"; - protected final String TEXT_190 = NL; - protected final String TEXT_191 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; - protected final String TEXT_192 = " style = ("; - protected final String TEXT_193 = ") "; - protected final String TEXT_194 = ".getStyle("; - protected final String TEXT_195 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_196 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t"; - protected final String TEXT_197 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new "; - protected final String TEXT_198 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_199 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_200 = " getLabelIcon() {"; - protected final String TEXT_201 = NL + "\t\t"; - protected final String TEXT_202 = " imageDescriptor = "; - protected final String TEXT_203 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; - protected final String TEXT_204 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; - protected final String TEXT_205 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL; - protected final String TEXT_206 = NL; - protected final String TEXT_207 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate DomainModelRefresher domainModelRefresher = new DomainModelRefresher();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class DomainModelRefresher extends "; - protected final String TEXT_208 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_209 = " msg) {" + NL + "\t\t\tsuper.notifyChanged(msg);" + NL + "\t\t\tif (msg.isTouch()) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tRefresher refresher = getRefresher(("; - protected final String TEXT_210 = ") msg.getFeature(), msg);" + NL + "\t\t\tif (refresher != null) {" + NL + "\t\t\t\trefresher.refresh();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL; - protected final String TEXT_211 = NL; - protected final String TEXT_212 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_213 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_214 = " feature, "; - protected final String TEXT_215 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();"; - protected final String TEXT_216 = NL; - protected final String TEXT_217 = "\t\tRefresher childrenRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshChildren();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_218 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_219 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_220 = NL; - protected final String TEXT_221 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_222 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t\tRefresher labelRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshLabel();" + NL + "\t\t\t}" + NL + "\t\t};"; - protected final String TEXT_223 = NL + "\t\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_224 = ".eINSTANCE.get"; - protected final String TEXT_225 = "(), labelRefresher);"; - protected final String TEXT_226 = NL + "\t\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_227 = ".eINSTANCE.get"; - protected final String TEXT_228 = "(), labelRefresher);"; - protected final String TEXT_229 = NL; - protected final String TEXT_230 = "\t\tRefresher fontRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFont();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_231 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_232 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_233 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_234 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; - protected final String TEXT_235 = NL; - protected final String TEXT_236 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_237 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; - protected final String TEXT_238 = NL; - protected final String TEXT_239 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_240 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; - protected final String TEXT_241 = " method" + NL + "\t\treturn null;" + NL + "\t}"; - protected final String TEXT_242 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_243 = " createLabel() {"; - protected final String TEXT_244 = NL + "\t\treturn new "; - protected final String TEXT_245 = "();"; - protected final String TEXT_246 = NL + "\t\treturn "; - protected final String TEXT_247 = ";"; - protected final String TEXT_248 = NL + "\t\treturn new "; - protected final String TEXT_249 = "();"; - protected final String TEXT_250 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_251 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_252 = " label = createLabel();"; - protected final String TEXT_253 = NL + "\t\tdefaultText = label.getText();"; - protected final String TEXT_254 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_255 = NL + "\t\treturn label;" + NL + "\t}"; - protected final String TEXT_256 = NL + NL + "\t/**"; - protected final String TEXT_257 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; - protected final String TEXT_258 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_259 = " getLabel() {" + NL + "\t\treturn ("; - protected final String TEXT_260 = ") getFigure();" + NL + "\t}" + NL; - protected final String TEXT_261 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; - protected final String TEXT_262 = "("; - protected final String TEXT_263 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; - protected final String TEXT_264 = NL + "\t\tdefaultText = figure.getText();"; - protected final String TEXT_265 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; - protected final String TEXT_266 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; - protected final String TEXT_267 = NL; - protected final String TEXT_268 = NL; - protected final String TEXT_269 = 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_270 = NL + "}"; - protected final String TEXT_271 = NL; + protected final String TEXT_5 = NL; + protected final String TEXT_6 = "(("; + protected final String TEXT_7 = ")"; + protected final String TEXT_8 = "(("; + protected final String TEXT_9 = ")"; + protected final String TEXT_10 = ")"; + protected final String TEXT_11 = ".eGet("; + protected final String TEXT_12 = ".eINSTANCE.get"; + protected final String TEXT_13 = "())"; + protected final String TEXT_14 = ")"; + protected final String TEXT_15 = "(("; + protected final String TEXT_16 = ")"; + protected final String TEXT_17 = ")"; + protected final String TEXT_18 = "."; + protected final String TEXT_19 = "()"; + protected final String TEXT_20 = NL; + protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; + protected final String TEXT_22 = " extends "; + protected final String TEXT_23 = " implements IUpdatableEditPart {"; + protected final String TEXT_24 = NL; + protected final String TEXT_25 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = "; + protected final String TEXT_26 = ";"; + protected final String TEXT_27 = NL; + protected final String TEXT_28 = NL; + protected final String TEXT_29 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_30 = " manager;" + NL; + protected final String TEXT_31 = 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_32 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_33 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_34 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_35 = NL; + protected final String TEXT_36 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t"; + protected final String TEXT_37 = " view = ("; + protected final String TEXT_38 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t"; + protected final String TEXT_39 = " view = ("; + protected final String TEXT_40 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\t//XXX: install correct edit policies!"; + protected final String TEXT_41 = NL; + protected final String TEXT_42 = "\t\tinstallEditPolicy("; + protected final String TEXT_43 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew "; + protected final String TEXT_44 = "() {" + NL + "\t\t\t\t\tprotected void showCurrentEditValue("; + protected final String TEXT_45 = " 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_46 = " getDirectEditCommand("; + protected final String TEXT_47 = " 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_48 = ".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_49 = "(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_50 = ".INSTANCE;" + NL + "\t\t\t\t\t\t} catch ("; + protected final String TEXT_51 = " e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_52 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_53 = " editingDomain = "; + protected final String TEXT_54 = ".getEditingDomain("; + protected final String TEXT_55 = ".getDiagram().getElement());"; + protected final String TEXT_56 = NL + "\t\t\t\t\t\tif (parseResult.length != 1) {" + 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[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_59 = " createDomainModelCommand("; + protected final String TEXT_60 = " editingDomain, Object value) {" + 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 = " feature = ("; + protected final String TEXT_64 = ") "; + protected final String TEXT_65 = ".eINSTANCE.get"; + protected final String TEXT_66 = "();" + 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_67 = ".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_68 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_69 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_70 = " result = new "; + protected final String TEXT_71 = "();" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_72 = " values = new "; + protected final String TEXT_73 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_74 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_75 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_76 = ".create(editingDomain, element, feature, valueToSet));" + NL + "\t\t\t\t\t\treturn result;"; + protected final String TEXT_77 = NL + "\t\t\t\t\t\treturn "; + protected final String TEXT_78 = ".create(editingDomain, element, feature, valueToSet);"; + protected final String TEXT_79 = NL + "\t\t\t\t\t}"; + protected final String TEXT_80 = NL + "\t\t\t\t\t\tif (parseResult.length != "; + protected final String TEXT_81 = ") {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_82 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_83 = " 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_84 = " createDomainModelCommand("; + protected final String TEXT_85 = " editingDomain, Object[] values) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_86 = " element = "; + protected final String TEXT_87 = ";" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_88 = " result = new "; + protected final String TEXT_89 = "();" + NL + "\t\t\t\t\t\tObject valueToSet;"; + protected final String TEXT_90 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_91 = " "; + protected final String TEXT_92 = "feature = ("; + protected final String TEXT_93 = ") "; + protected final String TEXT_94 = ".eINSTANCE.get"; + protected final String TEXT_95 = "();" + NL + "\t\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\t\tvalueToSet = "; + protected final String TEXT_96 = ".parseValue(feature, values["; + protected final String TEXT_97 = "]);" + NL + "\t\t\t\t\t\t} catch (IllegalArgumentException e) {" + NL + "\t\t\t\t\t\t\treturn "; + protected final String TEXT_98 = ".INSTANCE;" + NL + "\t\t\t\t\t\t}"; + protected final String TEXT_99 = NL + "\t\t\t\t\t\t"; + protected final String TEXT_100 = " "; + protected final String TEXT_101 = "values = new "; + protected final String TEXT_102 = "();" + NL + "\t\t\t\t\t\tvalues.addAll(element.get"; + protected final String TEXT_103 = "());" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_104 = ".create(editingDomain, element, feature, values));" + NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_105 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_106 = NL + "\t\t\t\t\t\tresult.append("; + protected final String TEXT_107 = ".create(editingDomain, element, feature, valueToSet));"; + protected final String TEXT_108 = NL + "\t\t\t\t\t\treturn result;" + NL + "\t\t\t\t\t}"; + protected final String TEXT_109 = NL + "\t\t\t\t});"; + protected final String TEXT_110 = NL; + protected final String TEXT_111 = "\t\tinstallEditPolicy("; + protected final String TEXT_112 = ".COMPONENT_ROLE, new "; + protected final String TEXT_113 = "() {" + NL + "\t\t\tprotected "; + protected final String TEXT_114 = " createDeleteCommand("; + protected final String TEXT_115 = " deleteRequest) {" + NL + "\t\t\t\t"; + protected final String TEXT_116 = " editingDomain = "; + protected final String TEXT_117 = ".getEditingDomain(getDiagramNode().getDiagram().getElement());" + NL + "\t\t\t\t"; + protected final String TEXT_118 = " cc = new "; + protected final String TEXT_119 = "();" + NL + "\t\t\t\tcc.append(getDomainModelRemoveCommand(editingDomain));" + NL + "\t\t\t\tcc.append("; + protected final String TEXT_120 = ".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_121 = " editingDomain) {"; + protected final String TEXT_122 = NL + "\t\t\t\t"; + protected final String TEXT_123 = " result = new "; + protected final String TEXT_124 = "();"; + protected final String TEXT_125 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_126 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_127 = ".eINSTANCE.get"; + protected final String TEXT_128 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_129 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_130 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\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"; + protected final String TEXT_133 = ".UNSET_VALUE));"; + protected final String TEXT_134 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_135 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_136 = ".eINSTANCE.get"; + protected final String TEXT_137 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement()));"; + protected final String TEXT_138 = NL + "\t\t\t\tresult.append("; + protected final String TEXT_139 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_140 = ".eINSTANCE.get"; + protected final String TEXT_141 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_142 = ".UNSET_VALUE));"; + protected final String TEXT_143 = NL + "\t\t\t\treturn result;"; + protected final String TEXT_144 = NL + "\t\t\t\treturn "; + protected final String TEXT_145 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_146 = ".eINSTANCE.get"; + protected final String TEXT_147 = "()," + NL + "\t\t\t\t\tgetDiagramNode().getElement());"; + protected final String TEXT_148 = NL + "\t\t\t\treturn "; + protected final String TEXT_149 = ".create(" + NL + "\t\t\t\t\teditingDomain, " + NL + "\t\t\t\t\tgetDiagramNode().getElement().eContainer(), "; + protected final String TEXT_150 = ".eINSTANCE.get"; + protected final String TEXT_151 = "()," + NL + "\t\t\t\t\t"; + protected final String TEXT_152 = ".UNSET_VALUE);"; + protected final String TEXT_153 = NL + "\t\t\t}" + NL + "\t\t});"; + protected final String TEXT_154 = NL + "\t}" + NL; + protected final String TEXT_155 = NL; + protected final String TEXT_156 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_157 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_158 = ".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_159 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new "; + protected final String TEXT_160 = "(this, "; + protected final String TEXT_161 = ".class, new "; + protected final String TEXT_162 = "() {" + NL + "\t\t\t\tpublic void relocate("; + protected final String TEXT_163 = " celleditor) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_164 = " 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_165 = 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_166 = NL; + protected final String TEXT_167 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String VIEW_PATTERN = \""; + protected final String TEXT_168 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static final String EDIT_PATTERN = \""; + protected final String TEXT_169 = "\";" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t"; + protected final String TEXT_170 = " element = "; + protected final String TEXT_171 = ";" + 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_172 = " element = "; + protected final String TEXT_173 = ";" + 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_174 = " element, String pattern) {"; + protected final String TEXT_175 = NL + "\t\tif ("; + protected final String TEXT_176 = " == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}"; + protected final String TEXT_177 = NL + "\t\treturn "; + protected final String TEXT_178 = ".format(pattern, new Object[] {"; + protected final String TEXT_179 = NL + "\t\t\tnew "; + protected final String TEXT_180 = "("; + protected final String TEXT_181 = ")"; + protected final String TEXT_182 = NL + "\t\t});"; + protected final String TEXT_183 = NL + "\t\treturn "; + protected final String TEXT_184 = ".format(pattern, new Object[] {"; + protected final String TEXT_185 = NL + "\t\t\tnew "; + protected final String TEXT_186 = "("; + protected final String TEXT_187 = ")"; + protected final String TEXT_188 = ","; + protected final String TEXT_189 = NL + "\t\t});"; + protected final String TEXT_190 = NL + "\t\t//XXX: unexpected model facet." + NL + "\t\treturn defaultText;"; + protected final String TEXT_191 = NL + "\t}"; + protected final String TEXT_192 = NL; + protected final String TEXT_193 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {"; + protected final String TEXT_194 = NL + "\t\t"; + protected final String TEXT_195 = " style =" + NL + "\t\t\t("; + protected final String TEXT_196 = ") "; + protected final String TEXT_197 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_198 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_199 = " 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_200 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_201 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_202 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_203 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_204 = " 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_205 = "(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}"; + protected final String TEXT_206 = "\t" + NL + "\t}"; + protected final String TEXT_207 = 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_208 = " createdFont;"; + protected final String TEXT_209 = "\t"; + protected final String TEXT_210 = NL; + protected final String TEXT_211 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t"; + protected final String TEXT_212 = " style = ("; + protected final String TEXT_213 = ") "; + protected final String TEXT_214 = ".getStyle("; + protected final String TEXT_215 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_216 = " 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_217 = " 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_218 = "(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_219 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_220 = " getLabelIcon() {"; + protected final String TEXT_221 = NL + "\t\t"; + protected final String TEXT_222 = " imageDescriptor = "; + protected final String TEXT_223 = ".getInstance().getItemImageDescriptor(getDiagramNode().getElement());" + NL + "\t\tif (imageDescriptor != null) {" + NL + "\t\t\treturn imageDescriptor.createImage();" + NL + "\t\t}"; + protected final String TEXT_224 = 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_225 = 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_226 = NL; + protected final String TEXT_227 = "\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_228 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_229 = " 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_230 = ") 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_231 = NL; + protected final String TEXT_232 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_233 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_234 = " feature, "; + protected final String TEXT_235 = " 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_236 = NL; + protected final String TEXT_237 = "\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_238 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_239 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_240 = NL; + protected final String TEXT_241 = "\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_242 = ".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_243 = NL + "\t\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_244 = ".eINSTANCE.get"; + protected final String TEXT_245 = "(), labelRefresher);"; + protected final String TEXT_246 = NL + "\t\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_247 = ".eINSTANCE.get"; + protected final String TEXT_248 = "(), labelRefresher);"; + protected final String TEXT_249 = NL; + protected final String TEXT_250 = "\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_251 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_252 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_253 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_254 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_255 = NL; + protected final String TEXT_256 = "\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_257 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_258 = NL; + protected final String TEXT_259 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_260 = " createFigure() {" + NL + "\t\t// Parent should assign one using "; + protected final String TEXT_261 = " method" + NL + "\t\treturn null;" + NL + "\t}"; + protected final String TEXT_262 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_263 = " createLabel() {"; + protected final String TEXT_264 = NL + "\t\treturn new "; + protected final String TEXT_265 = "();"; + protected final String TEXT_266 = NL + "\t\treturn "; + protected final String TEXT_267 = ";"; + protected final String TEXT_268 = NL + "\t\treturn new "; + protected final String TEXT_269 = "();"; + protected final String TEXT_270 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_271 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_272 = " label = createLabel();"; + protected final String TEXT_273 = NL + "\t\tdefaultText = label.getText();" + NL + "\t\tlabel.setLabelAlignment("; + protected final String TEXT_274 = ".LEFT);"; + protected final String TEXT_275 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_276 = NL + "\t\treturn label;" + NL + "\t}"; + protected final String TEXT_277 = NL + NL + "\t/**"; + protected final String TEXT_278 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label."; + protected final String TEXT_279 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_280 = " getLabel() {" + NL + "\t\treturn ("; + protected final String TEXT_281 = ") getFigure();" + NL + "\t}" + NL; + protected final String TEXT_282 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void "; + protected final String TEXT_283 = "("; + protected final String TEXT_284 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);"; + protected final String TEXT_285 = NL + "\t\tdefaultText = figure.getText();"; + protected final String TEXT_286 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$"; + protected final String TEXT_287 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL; + protected final String TEXT_288 = NL; + protected final String TEXT_289 = NL; + protected final String TEXT_290 = 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_291 = NL + "}"; + protected final String TEXT_292 = NL; public String generate(Object argument) { @@ -314,6 +335,80 @@ stringBuffer.append(TEXT_3); } stringBuffer.append(TEXT_4); + stringBuffer.append(TEXT_5); + +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { + + stringBuffer.append(TEXT_6); + stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_7); + + } + if (needsCastToEObject) { + + stringBuffer.append(TEXT_8); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_9); + + } + + stringBuffer.append(containerName); + + if (needsCastToEObject) { + + stringBuffer.append(TEXT_10); + + } + + stringBuffer.append(TEXT_11); + stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_12); + stringBuffer.append(feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_13); + + if (needsCastToResultType) { + + stringBuffer.append(TEXT_14); + + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_15); + stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_16); + + } + + stringBuffer.append(containerName); + + if (needsCastToFeatureGenType) { + + stringBuffer.append(TEXT_17); + + } + + stringBuffer.append(TEXT_18); + stringBuffer.append(feature.getGetAccessor()); + stringBuffer.append(TEXT_19); + + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); + + stringBuffer.append(TEXT_20); importManager.emitPackageStatement(stringBuffer); importManager.addImport("org.eclipse.gef.EditPolicy"); @@ -324,46 +419,46 @@ importManager.markImportLocation(stringBuffer); - stringBuffer.append(TEXT_5); + stringBuffer.append(TEXT_21); stringBuffer.append(genChildNode.getEditPartClassName()); - stringBuffer.append(TEXT_6); + stringBuffer.append(TEXT_22); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")); - stringBuffer.append(TEXT_7); + stringBuffer.append(TEXT_23); { GenCommonBase genCommonBase = genChildNode; - stringBuffer.append(TEXT_8); - stringBuffer.append(TEXT_9); + stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_25); stringBuffer.append(genCommonBase.getVisualID()); - stringBuffer.append(TEXT_10); + stringBuffer.append(TEXT_26); } - stringBuffer.append(TEXT_11); - stringBuffer.append(TEXT_12); + stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_28); if (!isReadOnly) { - stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_14); + stringBuffer.append(TEXT_30); } - stringBuffer.append(TEXT_15); + stringBuffer.append(TEXT_31); stringBuffer.append(genChildNode.getEditPartClassName()); - stringBuffer.append(TEXT_16); + stringBuffer.append(TEXT_32); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_17); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); - stringBuffer.append(TEXT_18); - stringBuffer.append(TEXT_19); - stringBuffer.append(TEXT_20); + stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_36); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_21); + stringBuffer.append(TEXT_37); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_22); + stringBuffer.append(TEXT_38); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_23); + stringBuffer.append(TEXT_39); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_40); String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()"; final String primaryView = "getDiagramNode()"; @@ -371,199 +466,199 @@ if (!isReadOnly) { - stringBuffer.append(TEXT_25); - stringBuffer.append(TEXT_26); + stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_42); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_27); + stringBuffer.append(TEXT_43); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.DirectEditPolicy")); - stringBuffer.append(TEXT_28); + stringBuffer.append(TEXT_44); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_29); + stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_30); + stringBuffer.append(TEXT_46); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_31); + stringBuffer.append(TEXT_47); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_32); + stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_33); + stringBuffer.append(TEXT_49); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_50); stringBuffer.append(importManager.getImportedName("java.text.ParseException")); - stringBuffer.append(TEXT_35); + stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_36); + stringBuffer.append(TEXT_52); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_37); + stringBuffer.append(TEXT_53); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_38); + stringBuffer.append(TEXT_54); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_39); + stringBuffer.append(TEXT_55); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature featureToSet = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); EStructuralFeature ecoreFeature = featureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_40); + stringBuffer.append(TEXT_56); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_41); + stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_42); + stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_43); + stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_44); + stringBuffer.append(TEXT_60); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_45); + stringBuffer.append(TEXT_61); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_46); + stringBuffer.append(TEXT_62); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_47); + stringBuffer.append(TEXT_63); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_48); + stringBuffer.append(TEXT_64); stringBuffer.append(importManager.getImportedName(featureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_49); + stringBuffer.append(TEXT_65); stringBuffer.append(featureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_50); + stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_51); + stringBuffer.append(TEXT_67); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_52); + stringBuffer.append(TEXT_68); if (ecoreFeature.isMany()) { - stringBuffer.append(TEXT_53); + stringBuffer.append(TEXT_69); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_54); + stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_55); + stringBuffer.append(TEXT_71); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_56); + stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_57); + stringBuffer.append(TEXT_73); stringBuffer.append(featureToSet.getAccessorName()); - stringBuffer.append(TEXT_58); + stringBuffer.append(TEXT_74); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_59); + stringBuffer.append(TEXT_75); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_60); + stringBuffer.append(TEXT_76); } else { - stringBuffer.append(TEXT_61); + stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_62); + stringBuffer.append(TEXT_78); } - stringBuffer.append(TEXT_63); + stringBuffer.append(TEXT_79); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; List metaFeatures = compositeFeatureLabelModelFacet.getMetaFeatures(); - stringBuffer.append(TEXT_64); + stringBuffer.append(TEXT_80); stringBuffer.append(metaFeatures.size()); - stringBuffer.append(TEXT_65); + stringBuffer.append(TEXT_81); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_66); + stringBuffer.append(TEXT_82); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_67); + stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); - stringBuffer.append(TEXT_68); + stringBuffer.append(TEXT_84); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_69); + stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_70); + stringBuffer.append(TEXT_86); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_71); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_72); + stringBuffer.append(TEXT_88); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_73); + stringBuffer.append(TEXT_89); boolean haveDeclaredValues = false; for(int i = 0; i < metaFeatures.size(); i++) { GenFeature nextFeatureToSet = (GenFeature) metaFeatures.get(i); EStructuralFeature nextEcoreFeature = nextFeatureToSet.getEcoreFeature(); - stringBuffer.append(TEXT_74); + stringBuffer.append(TEXT_90); if (i == 0) { stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_75); + stringBuffer.append(TEXT_91); } - stringBuffer.append(TEXT_76); + stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAttribute")); - stringBuffer.append(TEXT_77); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName(nextFeatureToSet.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_78); + stringBuffer.append(TEXT_94); stringBuffer.append(nextFeatureToSet.getFeatureAccessorName()); - stringBuffer.append(TEXT_79); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName(genDiagram.getAbstractParserQualifiedClassName())); - stringBuffer.append(TEXT_80); + stringBuffer.append(TEXT_96); stringBuffer.append(i); - stringBuffer.append(TEXT_81); + stringBuffer.append(TEXT_97); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_82); + stringBuffer.append(TEXT_98); if (nextEcoreFeature.isMany()) { - stringBuffer.append(TEXT_83); + stringBuffer.append(TEXT_99); if (!haveDeclaredValues) { haveDeclaredValues = true; stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.EList")); - stringBuffer.append(TEXT_84); + stringBuffer.append(TEXT_100); } - stringBuffer.append(TEXT_85); + stringBuffer.append(TEXT_101); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.BasicEList")); - stringBuffer.append(TEXT_86); + stringBuffer.append(TEXT_102); stringBuffer.append(nextFeatureToSet.getAccessorName()); - stringBuffer.append(TEXT_87); + stringBuffer.append(TEXT_103); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_104); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.AddCommand")); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_105); } else { - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_107); } } - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_108); } - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_109); } - stringBuffer.append(TEXT_94); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy")); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ComponentEditPolicy")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.GroupRequest")); - stringBuffer.append(TEXT_99); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_100); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_118); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_121); { TypeModelFacet facet = genNode.getModelFacet(); @@ -571,120 +666,120 @@ GenFeature containmentFeature = facet.getContainmentMetaFeature(); if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_124); if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_127); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_128); } else { - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_130); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_131); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_132); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_133); } if (childFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_136); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_137); } else { - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_140); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_142); } - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_143); } else { if (containmentFeature.getEcoreFeature().isMany()) { - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.RemoveCommand")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_146); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_147); } else { - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_148); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_150); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_151); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_152); } } - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_153); } /*restrict local vars used in component edit policy*/ - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_154); if (!isReadOnly) { - stringBuffer.append(TEXT_139); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_156); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_159); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager")); - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_161); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.CellEditorLocator")); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.CellEditor")); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_163); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_164); } - stringBuffer.append(TEXT_149); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_166); /*genFeature.getObjectType() throws NPE on primitive types. This is a workaround. */ HashMap primitiveTypeToWrapperClassName = new HashMap(); @@ -728,78 +823,91 @@ } } - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_167); stringBuffer.append(viewPattern); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_168); stringBuffer.append(editPattern); - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_169); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_170); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_172); stringBuffer.append(resolvedSemanticElement); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName())); - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_174); if (labelModelFacet instanceof FeatureLabelModelFacet) { FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet; GenFeature feature = featureLabelModelFacet.getMetaFeature(); if (!feature.isPrimitiveType()) { - stringBuffer.append(TEXT_159); - stringBuffer.append(feature.getCapName()); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_175); + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); + stringBuffer.append(TEXT_176); } - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_178); + + if (feature.isPrimitiveType()) { + + stringBuffer.append(TEXT_179); + stringBuffer.append(primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_180); - String value = "element.get" + feature.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", feature, underlyingMetaClass, false); if (feature.isPrimitiveType()) { - value = "new " + primitiveTypeToWrapperClassName.get(feature.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; + + stringBuffer.append(TEXT_181); + } - stringBuffer.append(TEXT_163); - stringBuffer.append(value); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_182); } else if (labelModelFacet instanceof CompositeFeatureLabelModelFacet) { CompositeFeatureLabelModelFacet compositeFeatureLabelModelFacet = (CompositeFeatureLabelModelFacet) labelModelFacet; - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("java.text.MessageFormat")); - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_184); for(Iterator it = compositeFeatureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) { GenFeature next = (GenFeature) it.next(); - String value = "element.get" + next.getCapName() + "()"; /*XXX: getTypedKey is not a part of public API!*/ if (next.isPrimitiveType()) { - value = "new " + primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass()) + "(" + value + ")"; + + stringBuffer.append(TEXT_185); + stringBuffer.append(primitiveTypeToWrapperClassName.get(next.getTypeGenClassifier().getEcoreClassifier().getInstanceClass())); + stringBuffer.append(TEXT_186); + } + myFeatureGetAccessorHelper.appendFeatureValueGetter("element", next, underlyingMetaClass, false); + if (next.isPrimitiveType()) { - stringBuffer.append(TEXT_167); - stringBuffer.append(value); - if (it.hasNext()) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_187); + + } + if (it.hasNext()) { + stringBuffer.append(TEXT_188); } } - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_189); } else { - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_190); } - stringBuffer.append(TEXT_171); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_192); boolean isFixedFontSetInFigure; { @@ -807,149 +915,149 @@ isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont(); } - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_193); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_195); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_196); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_197); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_198); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_201); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_202); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_203); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_205); } - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_206); if (!isFixedFontSetInFigure) { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_207); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_208); } - stringBuffer.append(TEXT_189); - stringBuffer.append(TEXT_190); - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_213); stringBuffer.append(primaryView); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_218); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_220); if (genChildNode.isLabelElementIcon()) { - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_221); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.resource.ImageDescriptor")); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_222); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_223); } - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_224); /*@ include file="adapters/propertySource.javajetinc"*/ - stringBuffer.append(TEXT_205); - stringBuffer.append(TEXT_206); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_227); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_228); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_210); - stringBuffer.append(TEXT_211); - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("java.util.HashMap")); - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_233); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_234); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); - stringBuffer.append(TEXT_215); - stringBuffer.append(TEXT_216); - stringBuffer.append(TEXT_217); + stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_238); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_219); - stringBuffer.append(TEXT_220); - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_242); if (labelModelFacet instanceof FeatureLabelModelFacet) { GenFeature feature = ((FeatureLabelModelFacet)labelModelFacet).getMetaFeature(); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_243); stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_244); stringBuffer.append(feature.getFeatureAccessorName()); - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_245); } 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_226); + stringBuffer.append(TEXT_246); stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_247); stringBuffer.append(next.getFeatureAccessorName()); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_248); } } - stringBuffer.append(TEXT_229); - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_250); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_251); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_253); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_234); - stringBuffer.append(TEXT_235); - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_256); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_257); final Viewmap viewmap = genChildNode.getViewmap(); - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_258); final String figureQualifiedClassName; if (viewmap instanceof ParentAssignedViewmap) { @@ -978,64 +1086,66 @@ if (viewmap instanceof ParentAssignedViewmap) { final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap; - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_260); stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName())); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_261); } else { - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_262); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_263); if (viewmap instanceof FigureViewmap) { - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_264); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_265); } // instanceof FigureViewmap else if (viewmap instanceof SnippetViewmap) { - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_266); stringBuffer.append(((SnippetViewmap) viewmap).getBody()); - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_267); } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter else if (viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_268); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_269); } - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_270); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_271); stringBuffer.append(figureImportedName); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_272); if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) { - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_273); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(TEXT_274); } else { - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_275); } - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_276); } /*not parent-assigned*/ - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_277); if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) { - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_278); } - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label")); - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_281); String labelSetterName = "setLabel"; // same assumption in NodeEditPart String labelFigureClassName = "org.eclipse.draw2d.IFigure"; @@ -1049,43 +1159,43 @@ } } // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned? - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_282); stringBuffer.append(labelSetterName); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_283); stringBuffer.append(importManager.getImportedName(labelFigureClassName)); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_284); if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) { - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_285); } else { - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_286); } - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_287); if (viewmap instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) viewmap).getClassBody(); - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_288); stringBuffer.append(classBody); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_289); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_290); } } - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_291); importManager.emitSortedImports(); - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_292); 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.6 diff -u -r1.6 EditorGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 25 May 2006 14:19:01 -0000 1.6 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 3 Aug 2006 18:47:09 -0000 @@ -118,22 +118,25 @@ protected final String TEXT_99 = ".eINSTANCE.create"; protected final String TEXT_100 = "();" + NL + "\t\t\t\t"; protected final String TEXT_101 = ".getContents().add(0, diagramRoot);" + 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_102 = ".save(Collections.EMPTY_MAP);" + NL + "\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = 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(diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_103 = 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_104 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_105 = " printableLayers = ("; - protected final String TEXT_106 = ") root.getLayer("; - protected final String TEXT_107 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; - protected final String TEXT_108 = " extLabelsLayer = new "; - protected final String TEXT_109 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; - protected final String TEXT_110 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; - protected final String TEXT_111 = ".EXTERNAL_NODE_LABELS_LAYER, "; - protected final String TEXT_112 = ".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_113 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; - protected final String TEXT_114 = ".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_115 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_116 = "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_117 = NL; + protected final String TEXT_102 = ".save(Collections.EMPTY_MAP);" + NL + "\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = 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_103 = "("; + protected final String TEXT_104 = ") "; + protected final String TEXT_105 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_106 = 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_107 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_108 = " printableLayers = ("; + protected final String TEXT_109 = ") root.getLayer("; + protected final String TEXT_110 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; + protected final String TEXT_111 = " extLabelsLayer = new "; + protected final String TEXT_112 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; + protected final String TEXT_113 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; + protected final String TEXT_114 = ".EXTERNAL_NODE_LABELS_LAYER, "; + protected final String TEXT_115 = ".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_116 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; + protected final String TEXT_117 = ".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_118 = "ContextMenuProvider extends ContextMenuProvider {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_119 = "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_120 = NL; public String generate(Object argument) { @@ -473,38 +476,44 @@ stringBuffer.append(TEXT_101); stringBuffer.append(resourceToUse); stringBuffer.append(TEXT_102); + if (genDiagram.getDomainDiagramElement().isExternalInterface()) { + stringBuffer.append(TEXT_103); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_104); + } + stringBuffer.append(TEXT_105); } - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_110); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_111); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_113); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_115); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_116); stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_117); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_118); stringBuffer.append(genEditor.getClassName()); - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_119); importManager.emitSortedImports(); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_120); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java,v retrieving revision 1.2 diff -u -r1.2 CreationWizardPageGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java 20 Apr 2006 18:27:23 -0000 1.2 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java 3 Aug 2006 18:47:08 -0000 @@ -100,17 +100,20 @@ protected final String TEXT_83 = NL + "\t\t\tdiagramResource.getContents().add(model);"; protected final String TEXT_84 = NL + "\t\t\t"; protected final String TEXT_85 = " diagram = "; - protected final String TEXT_86 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagram.setElement(model);" + NL + "\t\t\t"; - protected final String TEXT_87 = ".decorateView(diagram);" + NL + "\t\t\tdiagramResource.getContents().add(diagram);" + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(Collections.EMPTY_MAP);" + NL + "\t\t\t} catch (IOException e) {" + NL + "\t\t\t\thandleSaveException(e);" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_88 = NL + "\t\tboolean result = "; - protected final String TEXT_89 = ".openEditor(getDiagramFileURI());" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();"; - protected final String TEXT_90 = NL + "\t\ttry {" + NL + "\t\t\t"; - protected final String TEXT_91 = ".openEditor("; - protected final String TEXT_92 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch ("; - protected final String TEXT_93 = " e) {" + NL + "\t\t\t"; - protected final String TEXT_94 = ".getInstance().getLog().log(e.getStatus());" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;"; - protected final String TEXT_95 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void handleSaveException(IOException e) {" + NL + "\t\tthrow new RuntimeException(e);" + NL + "\t}" + NL + "}"; - protected final String TEXT_96 = NL; + protected final String TEXT_86 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagram.setElement("; + protected final String TEXT_87 = "("; + protected final String TEXT_88 = ") "; + protected final String TEXT_89 = "model);" + NL + "\t\t\t"; + protected final String TEXT_90 = ".decorateView(diagram);" + NL + "\t\t\tdiagramResource.getContents().add(diagram);" + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(Collections.EMPTY_MAP);" + NL + "\t\t\t} catch (IOException e) {" + NL + "\t\t\t\thandleSaveException(e);" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_91 = NL + "\t\tboolean result = "; + protected final String TEXT_92 = ".openEditor(getDiagramFileURI());" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();"; + protected final String TEXT_93 = NL + "\t\ttry {" + NL + "\t\t\t"; + protected final String TEXT_94 = ".openEditor("; + protected final String TEXT_95 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch ("; + protected final String TEXT_96 = " e) {" + NL + "\t\t\t"; + protected final String TEXT_97 = ".getInstance().getLog().log(e.getStatus());" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;"; + protected final String TEXT_98 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void handleSaveException(IOException e) {" + NL + "\t\tthrow new RuntimeException(e);" + NL + "\t}" + NL + "}"; + protected final String TEXT_99 = NL; public String generate(Object argument) { @@ -390,32 +393,38 @@ stringBuffer.append(TEXT_85); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); stringBuffer.append(TEXT_86); - stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())); + if (genDiagram.getDomainDiagramElement().isExternalInterface()) { stringBuffer.append(TEXT_87); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_88); + } + stringBuffer.append(TEXT_89); + stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())); + stringBuffer.append(TEXT_90); if (isRichClientPlatform) { - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_91); stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); - stringBuffer.append(TEXT_89); + stringBuffer.append(TEXT_92); } else { - stringBuffer.append(TEXT_90); + stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE")); - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_94); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_96); stringBuffer.append(genPlugin.getActivatorClassName()); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_97); } - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_98); importManager.emitSortedImports(); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_99); return stringBuffer.toString(); } } Index: templates/common/featureGetAccessor.jetinc =================================================================== RCS file: templates/common/featureGetAccessor.jetinc diff -N templates/common/featureGetAccessor.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/common/featureGetAccessor.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,40 @@ +<% +class FeatureGetAccessorHelper { + /** + * @param containerName the name of the container + * @param feature the feature whose value is in interest + * @param containerMetaClass the GenClass of the container, or null, if the container is declared as an EObject. + * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the EClass this feature belongs to is an external interface). + */ + public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) { + if (feature.getGenClass().isExternalInterface()) { + boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface(); + if (needsCastToResultType) { +%>((<%=importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName())%>)<% + } + if (needsCastToEObject) { +%>((<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<% + } +%><%=containerName%><% + if (needsCastToEObject) { +%>)<% + } +%>.eGet(<%=importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=feature.getFeatureAccessorName()%>())<% + if (needsCastToResultType) { +%>)<% + } + } else { + boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface(); + if (needsCastToFeatureGenType) { +%>((<%=importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName())%>)<% + } +%><%=containerName%><% + if (needsCastToFeatureGenType) { +%>)<% + } +%>.<%=feature.getGetAccessor()%>()<% + } + } +} +final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper(); +%>