### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.codegen.lite 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.6 diff -u -r1.6 NodeEditPart.javajet --- templates/parts/NodeEditPart.javajet 25 May 2006 14:26:26 -0000 1.6 +++ templates/parts/NodeEditPart.javajet 29 May 2006 07:54:16 -0000 @@ -85,7 +85,7 @@ if (request instanceof <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) { <%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx requestEx = (<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx) request; int[] visualIds = requestEx.getVisualIds(); - int matchingVisualIdsCount = 0; + <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%> result = new <%=importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")%>(); for (int i = 0; i < visualIds.length; i++) { int nextVisualId = visualIds[i]; switch (nextVisualId) { @@ -96,14 +96,17 @@ continue; } GenClass outgoingClass; + String createCommandNameInfix; if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); outgoingClass = modelFacet.getSourceMetaFeature() == null ? modelFacet.getContainmentMetaFeature().getGenClass() : modelFacet.getSourceMetaFeature().getTypeGenClass(); + createCommandNameInfix = modelFacet.getMetaClass().getName(); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); outgoingClass = metaFeature.getGenClass(); + createCommandNameInfix = metaFeature.getFeatureAccessorName(); } else { continue; } @@ -112,25 +115,24 @@ } %> case <%=importManager.getImportedName(genLink.getEditPartQualifiedClassName())%>.VISUAL_ID: - matchingVisualIdsCount++; + result.append(new Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>StartCommand(requestEx)); break; <% } %> } } - if (matchingVisualIdsCount != 1) { + if (result.getCommandList().size() != 1 || !result.canExecute()) { //Cannot create several connections at once. - return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; + //returning an unexecutable command does not change cursor to "No". + return null; } - <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> result = new <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%>() { - //XXX: check multiplicity requirements etc. - }; - request.setStartCommand(result); - return result; + <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> wrappedResult = new WrappingCommand(<%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(getDiagramNode().getDiagram().getElement()), result); + request.setStartCommand(wrappedResult); + return wrappedResult; } <%}/*when there's palette*/%> - return <%=importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")%>.INSTANCE; + return null; } protected <%=importManager.getImportedName("org.eclipse.gef.commands.Command")%> getConnectionCompleteCommand(<%=importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")%> request) { <%if (palette != null) {%> @@ -644,6 +646,167 @@ } <%/*XXX: probably, this should go to a separate jet-template along with GraphicalNodeEditPolicy*/%> +<%if (palette != null) {%> +<% +for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) { + continue; + } + GenClass outgoingClass; + String createCommandNameInfix; + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + outgoingClass = modelFacet.getSourceMetaFeature() == null + ? modelFacet.getContainmentMetaFeature().getGenClass() + : modelFacet.getSourceMetaFeature().getTypeGenClass(); + createCommandNameInfix = modelFacet.getMetaClass().getName(); + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + outgoingClass = metaFeature.getGenClass(); + createCommandNameInfix = metaFeature.getFeatureAccessorName(); + } else { + continue; + } + if (!outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) { + continue; + } +%> + /** + * @generated + */ + private static class Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>StartCommand extends <%=importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")%> { + /** + * @generated + */ + private <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> source; + /** + * @generated + */ + public Create<%=createCommandNameInfix%><%=genLink.getVisualID()%>StartCommand(<%=importManager.getImportedName(palette.getFactoryQualifiedClassName())%>.CreateConnectionRequestEx requestEx) { + //Until the mouse button is pressed, the source of the connection is in request.getTargetEditPart(), not in request.getSourceEditPart(). + source = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>)requestEx.getTargetEditPart().getModel(); + } + /** + * @generated + */ + public void execute() { + //This command never gets executed + } + /** + * @generated + */ + public void undo() { + //This command never gets executed + } + /** + * @generated + */ + public void redo() { + //This command never gets executed + } + /** + * @generated + */ + public boolean canUndo() { + return true; + } + /** + * @generated + */ + protected boolean prepare() { + if (source == null) { + return false; + } +<% + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + GenClass linkClass = modelFacet.getMetaClass(); + GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); + if (containmentFeature == null) { +%> + return false; +<% + } else { +%> + <%=importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())%> container = (<%=importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())%>)getRelationshipContainer(source.getElement(), <%=importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=containmentFeature.getGenClass().getClassifierAccessorName()%>()); + if (container == null) { + return false; + } +<% + { + GenFeature _feature = containmentFeature; + String _ownerInstance = "container"; + String _exceedsUpperBound = "return false;"; +%> +<%@ include file="linkMultiplicity.jetinc"%> +<% + } + GenFeature childFeature = modelFacet.getChildMetaFeature(); + if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { + { + GenFeature _feature = childFeature; + String _ownerInstance = "container"; + String _exceedsUpperBound = "return false;"; +%> +<%@ include file="linkMultiplicity.jetinc"%> +<% + } + } +%> + return true; +<% + } + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); +%> + <%=importManager.getImportedName(outgoingClass.getQualifiedInterfaceName())%> domainElement = (<%=importManager.getImportedName(outgoingClass.getQualifiedInterfaceName())%>)source.getElement(); +<% + { + GenFeature _feature = metaFeature; + String _ownerInstance = "domainElement"; + String _exceedsUpperBound = "return false;"; +%> +<%@ include file="linkMultiplicity.jetinc"%> +<% + } +%> + return true; +<% + } else { +%> + return false; +<% + } +%> + } +<% + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { +%> + /** + * Finds container element for the new relationship of the specified type. + * Default implementation goes up by containment hierarchy starting from + * the specified element and returns the first element that is instance of + * the specified container class. + * + * @generated + */ + protected <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> getRelationshipContainer(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> element, <%=importManager.getImportedName("org.eclipse.emf.ecore.EClass")%> containerClass) { + for (; element != null; element = element.eContainer()) { + if (containerClass.isSuperTypeOf(element.eClass())) { + return element; + } + } + return null; + } +<% + } +%> + + } +<% +} //outgoing links +%> <% for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -667,7 +830,6 @@ continue; } %> -<%if (palette != null) {%> /** * @generated */ @@ -772,12 +934,28 @@ <% } if (addSource) { + { + GenFeature _feature = sourceFeature; + String _ownerInstance = "createdDomainElement"; + String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; +%> +<%@ include file="linkMultiplicity.jetinc"%> +<% + } %> addLinkEndsCommand.append(<%=importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, createdDomainElement, <%=importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=sourceFeature.getFeatureAccessorName()%>(), source.getElement())); <% } if (addTarget) { + { + GenFeature _feature = targetFeature; + String _ownerInstance = "createdDomainElement"; + String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; +%> +<%@ include file="linkMultiplicity.jetinc"%> +<% + } %> addLinkEndsCommand.append(<%=importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")%>.create(domainModelEditDomain, createdDomainElement, <%=importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=targetFeature.getFeatureAccessorName()%>(), target.getElement())); 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.6 diff -u -r1.6 NodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 25 May 2006 14:26:26 -0000 1.6 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java 29 May 2006 07:54:16 -0000 @@ -111,293 +111,374 @@ protected final String TEXT_90 = NL + "\t\t\t\tif (request instanceof "; protected final String TEXT_91 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; protected final String TEXT_92 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_93 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\tint matchingVisualIdsCount = 0;" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_94 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_95 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tmatchingVisualIdsCount++;" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_96 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (matchingVisualIdsCount != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_97 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\t"; - protected final String TEXT_98 = " result = new "; - protected final String TEXT_99 = "() {" + NL + "\t\t\t\t\t\t//XXX: check multiplicity requirements etc." + NL + "\t\t\t\t\t};" + NL + "\t\t\t\t\trequest.setStartCommand(result);" + NL + "\t\t\t\t\treturn result;" + NL + "\t\t\t\t}"; - protected final String TEXT_100 = NL + "\t\t\t\treturn "; - protected final String TEXT_101 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; - protected final String TEXT_102 = " getConnectionCompleteCommand("; - protected final String TEXT_103 = " request) {"; - protected final String TEXT_104 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_105 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; - protected final String TEXT_106 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; - protected final String TEXT_107 = ".CreateConnectionRequestEx requestEx = ("; - protected final String TEXT_108 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; - protected final String TEXT_109 = " result = new "; - protected final String TEXT_110 = "();" + NL + "\t\t\t\t\tfor (int i = 0; i < visualIds.length; i++) {" + NL + "\t\t\t\t\t\tint nextVisualId = visualIds[i];" + NL + "\t\t\t\t\t\tswitch (nextVisualId) {"; - protected final String TEXT_111 = NL + "\t\t\t\t\t\tcase "; - protected final String TEXT_112 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; - protected final String TEXT_113 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; - protected final String TEXT_114 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (result.getCommandList().size() != 1) {" + NL + "\t\t\t\t\t\t//Cannot create several connections at once." + NL + "\t\t\t\t\t\treturn "; - protected final String TEXT_115 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; - protected final String TEXT_116 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; - protected final String TEXT_117 = NL + "\t\t\t\treturn "; - protected final String TEXT_118 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_119 = " createFigure() {" + NL + "\t\t"; - protected final String TEXT_120 = " invisibleRectangle = new "; - protected final String TEXT_121 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; - protected final String TEXT_122 = "());" + NL + "\t\t"; - protected final String TEXT_123 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_124 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tinvisibleRectangle.add(decorationShape);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_125 = " createNodeShape() {"; - protected final String TEXT_126 = NL + "\t\tprimaryShape = new "; - protected final String TEXT_127 = "()"; - protected final String TEXT_128 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_129 = ";"; - protected final String TEXT_130 = NL + "\t\tprimaryShape = "; - protected final String TEXT_131 = ";"; - protected final String TEXT_132 = NL + "\t\t"; - protected final String TEXT_133 = " figure = new "; - protected final String TEXT_134 = "();" + NL + " \t\tfigure.setUseLocalCoordinates("; - protected final String TEXT_135 = ");" + NL + " \t\tprimaryShape = figure;"; - protected final String TEXT_136 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_137 = " createDecorationPane() {" + NL + "\t\t"; - protected final String TEXT_138 = " view = ("; - protected final String TEXT_139 = ") getModel();" + NL + "\t\t"; - protected final String TEXT_140 = " annotation = view.getEAnnotation(\"Shortcut\"); //$NON-NLS-1$" + NL + "\t\tif (annotation == null) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t"; - protected final String TEXT_141 = " decorationPane = new "; - protected final String TEXT_142 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; - protected final String TEXT_143 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_144 = " imageFigure = new "; - protected final String TEXT_145 = "("; - protected final String TEXT_146 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; - protected final String TEXT_147 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; - protected final String TEXT_148 = ".BOTTOM);" + NL + " \t\treturn decorationPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Default implementation treats passed figure as content pane." + NL + "\t * Respects layout one may have set for generated figure." + NL + "\t * @param nodeShape instance of generated figure class" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_149 = " setupContentPane("; - protected final String TEXT_150 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; - protected final String TEXT_151 = NL + "\t\t\t"; - protected final String TEXT_152 = " layout = new "; - protected final String TEXT_153 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; - protected final String TEXT_154 = NL + "\t\tnodeShape.setLayoutManager(new "; - protected final String TEXT_155 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; - protected final String TEXT_156 = " figure) {" + NL + "\t\t\t\tObject result = constraints.get(figure);" + NL + "\t\t\t\tif (result == null) {" + NL + "\t\t\t\t\tresult = new "; - protected final String TEXT_157 = "(0, 0, -1, -1);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t});"; - protected final String TEXT_158 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_159 = " getContentPane() {" + NL + "\t\tif (contentPane == null) {" + NL + "\t\t\treturn super.getContentPane();" + NL + "\t\t}" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_160 = " getDiagramNode() {" + NL + "\t\treturn ("; - protected final String TEXT_161 = ") getModel();" + NL + "\t}" + NL; - protected final String TEXT_162 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; - protected final String TEXT_163 = " childEditPart) {"; - protected final String TEXT_164 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_165 = ") {"; - protected final String TEXT_166 = NL + "\t\t\t(("; - protected final String TEXT_167 = ") childEditPart).setLabel((("; - protected final String TEXT_168 = ") primaryShape).getFigure"; - protected final String TEXT_169 = "());"; - protected final String TEXT_170 = NL + "\t\t\t(("; - protected final String TEXT_171 = ") childEditPart).setLabel(new "; - protected final String TEXT_172 = "());"; - protected final String TEXT_173 = NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_174 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_175 = " getPrimaryLabelEditPart() {"; - protected final String TEXT_176 = NL + "\t\tfor("; - protected final String TEXT_177 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; - protected final String TEXT_178 = " nextChild = ("; - protected final String TEXT_179 = ")it.next();" + NL + "\t\t\tif ("; - protected final String TEXT_180 = ".getVisualID(nextChild) == "; - protected final String TEXT_181 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; - protected final String TEXT_182 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; - protected final String TEXT_183 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; - protected final String TEXT_184 = " req) {" + NL + "\t\tif ("; - protected final String TEXT_185 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; - protected final String TEXT_186 = " labelToEdit = getLabelEditPart(("; - protected final String TEXT_187 = ")req);" + 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_188 = " getLabelEditPart("; - protected final String TEXT_189 = " req) {" + NL + "\t\t"; - protected final String TEXT_190 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; - protected final String TEXT_191 = " view = ("; - protected final String TEXT_192 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; - protected final String TEXT_193 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; - protected final String TEXT_194 = NL + "\t\t\t\tcase "; - protected final String TEXT_195 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; - protected final String TEXT_196 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; - protected final String TEXT_197 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; - protected final String TEXT_198 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_199 = " labelFigure = (("; - protected final String TEXT_200 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {"; - protected final String TEXT_201 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}"; - protected final String TEXT_202 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);"; - protected final String TEXT_203 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; - protected final String TEXT_204 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; - protected final String TEXT_205 = " labelFigure = (("; - protected final String TEXT_206 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; - protected final String TEXT_207 = " childEditPart) {"; - protected final String TEXT_208 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_209 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_210 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_211 = " getExternalLabelsContainer() {" + NL + "\t\t"; - protected final String TEXT_212 = " root = ("; - protected final String TEXT_213 = ") getRoot();" + NL + "\t\treturn root.getLayer("; - protected final String TEXT_214 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; - protected final String TEXT_215 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; - protected final String TEXT_216 = " childEditPart, int index) {" + NL + "\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_217 = 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_218 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; - protected final String TEXT_219 = ";" + NL + "\t\t"; - protected final String TEXT_220 = " bounds = ("; - protected final String TEXT_221 = ") node.getLayoutConstraint();" + NL + "\t\t(("; - protected final String TEXT_222 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; - protected final String TEXT_223 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_224 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_225 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_226 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_227 = " getSourceConnectionAnchor("; - protected final String TEXT_228 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_229 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_230 = " getSourceConnectionAnchor("; - protected final String TEXT_231 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_232 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_233 = " getTargetConnectionAnchor("; - protected final String TEXT_234 = " connection) {" + NL + "\t\treturn new "; - protected final String TEXT_235 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_236 = " getTargetConnectionAnchor("; - protected final String TEXT_237 = " request) {" + NL + "\t\treturn new "; - protected final String TEXT_238 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; - protected final String TEXT_239 = 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_240 = NL; - protected final String TEXT_241 = "\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_242 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; - protected final String TEXT_243 = " 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_244 = ") 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_245 = NL; - protected final String TEXT_246 = "\tpublic void addRefresher("; - protected final String TEXT_247 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher("; - protected final String TEXT_248 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; - protected final String TEXT_249 = " 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_250 = NL; - protected final String TEXT_251 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; - protected final String TEXT_252 = " style =" + NL + "\t\t\t("; - protected final String TEXT_253 = ") "; - protected final String TEXT_254 = ".getStyle(" + NL + "\t\t\t\t"; - protected final String TEXT_255 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; - protected final String TEXT_256 = " 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_257 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_258 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; - protected final String TEXT_259 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_260 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; - protected final String TEXT_261 = " 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_262 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_263 = " createdFont;" + NL; - protected final String TEXT_264 = NL; - protected final String TEXT_265 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; - protected final String TEXT_266 = " style = ("; - protected final String TEXT_267 = ") "; - protected final String TEXT_268 = ".getStyle("; - protected final String TEXT_269 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; - protected final String TEXT_270 = " 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_271 = " 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_272 = "(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_273 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; - protected final String TEXT_274 = " style = ("; - protected final String TEXT_275 = ") "; - protected final String TEXT_276 = ".getStyle("; - protected final String TEXT_277 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; - protected final String TEXT_278 = " 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_279 = " 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_280 = "(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_281 = " createdBackgroundColor;" + NL; - protected final String TEXT_282 = NL; - protected final String TEXT_283 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_284 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; - protected final String TEXT_285 = " feature, "; - protected final String TEXT_286 = " 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_287 = "();"; - protected final String TEXT_288 = NL; - protected final String TEXT_289 = "\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_290 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_291 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; - protected final String TEXT_292 = NL; - protected final String TEXT_293 = "\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_294 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_295 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_296 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_297 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_298 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; - protected final String TEXT_299 = NL; - protected final String TEXT_300 = "\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_301 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; - protected final String TEXT_302 = NL; - protected final String TEXT_303 = "\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_304 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; - protected final String TEXT_305 = NL; - protected final String TEXT_306 = "\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_307 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; - protected final String TEXT_308 = NL; - protected final String TEXT_309 = "\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_310 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_311 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_312 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; - protected final String TEXT_313 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; - protected final String TEXT_314 = NL; - protected final String TEXT_315 = "\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_316 = ".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_317 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; - protected final String TEXT_318 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; - protected final String TEXT_319 = "Command extends "; - protected final String TEXT_320 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_321 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_322 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; - protected final String TEXT_323 = " 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_324 = "Command("; - protected final String TEXT_325 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; - protected final String TEXT_326 = ") {" + NL + "\t\t\t\tsource = ("; - protected final String TEXT_327 = ")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_328 = ") {" + NL + "\t\t\t\ttarget = ("; - protected final String TEXT_329 = ")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_330 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; - protected final String TEXT_331 = ".eINSTANCE.createEdge();"; - protected final String TEXT_332 = NL + "\t\t\t"; - protected final String TEXT_333 = " createdDomainElement = "; - protected final String TEXT_334 = ".eINSTANCE.create"; - protected final String TEXT_335 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; - protected final String TEXT_336 = NL + "\t\t\t"; - protected final String TEXT_337 = "."; - protected final String TEXT_338 = ".initializeElement(createdDomainElement);"; - protected final String TEXT_339 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?"; - protected final String TEXT_340 = NL + "\t\t\t"; - protected final String TEXT_341 = ".decorateView(createdEdge);" + NL + "\t\t\t"; - protected final String TEXT_342 = " domainModelEditDomain = "; - protected final String TEXT_343 = ".getEditingDomain(source.getDiagram().getElement());"; - protected final String TEXT_344 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; - protected final String TEXT_345 = NL + "\t\t\t"; - protected final String TEXT_346 = " container = getRelationshipContainer(source.getElement(), "; - protected final String TEXT_347 = ".eINSTANCE.get"; - protected final String TEXT_348 = "());" + 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_349 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_350 = ".eINSTANCE.get"; - protected final String TEXT_351 = "(), createdDomainElement));"; - protected final String TEXT_352 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_353 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; - protected final String TEXT_354 = ".eINSTANCE.get"; - protected final String TEXT_355 = "(), createdDomainElement));"; - protected final String TEXT_356 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_357 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; - protected final String TEXT_358 = ".eINSTANCE.get"; - protected final String TEXT_359 = "(), source.getElement()));"; - protected final String TEXT_360 = NL + "\t\t\taddLinkEndsCommand.append("; - protected final String TEXT_361 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; - protected final String TEXT_362 = ".eINSTANCE.get"; - protected final String TEXT_363 = "(), target.getElement()));"; - protected final String TEXT_364 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; - protected final String TEXT_365 = NL + "\t\t\tdomainModelAddCommand = "; - protected final String TEXT_366 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; - protected final String TEXT_367 = ".eINSTANCE.get"; - protected final String TEXT_368 = "(), target.getElement());"; - protected final String TEXT_369 = NL + "\t\t}" + NL; - protected final String TEXT_370 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the new relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_371 = " getRelationshipContainer("; - protected final String TEXT_372 = " element, "; - protected final String TEXT_373 = " 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_374 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canExecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_375 = NL; - protected final String TEXT_376 = NL; - protected final String TEXT_377 = 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_378 = NL + "}"; - protected final String TEXT_379 = NL; + protected final String TEXT_93 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_94 = " result = new "; + protected final String TEXT_95 = "();" + 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_96 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_97 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_98 = "StartCommand(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_99 = NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (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_100 = " wrappedResult = new WrappingCommand("; + protected final String TEXT_101 = ".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_102 = NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tprotected "; + protected final String TEXT_103 = " getConnectionCompleteCommand("; + protected final String TEXT_104 = " request) {"; + protected final String TEXT_105 = NL + "\t\t\t\tif (request.getStartCommand() == null || !request.getStartCommand().canExecute()) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_106 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (request instanceof "; + protected final String TEXT_107 = ".CreateConnectionRequestEx) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_108 = ".CreateConnectionRequestEx requestEx = ("; + protected final String TEXT_109 = ".CreateConnectionRequestEx) request;" + NL + "\t\t\t\t\tint[] visualIds = requestEx.getVisualIds();" + NL + "\t\t\t\t\t"; + protected final String TEXT_110 = " result = new "; + protected final String TEXT_111 = "();" + 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_112 = NL + "\t\t\t\t\t\tcase "; + protected final String TEXT_113 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\t\tresult.append(new Create"; + protected final String TEXT_114 = "Command(requestEx));" + NL + "\t\t\t\t\t\t\tbreak;"; + protected final String TEXT_115 = 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_116 = ".INSTANCE;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn new WrappingCommand("; + protected final String TEXT_117 = ".getEditingDomain(getDiagramNode().getDiagram().getElement()), result);" + NL + "\t\t\t\t}"; + protected final String TEXT_118 = NL + "\t\t\t\treturn "; + protected final String TEXT_119 = ".INSTANCE;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_120 = " createFigure() {" + NL + "\t\t"; + protected final String TEXT_121 = " invisibleRectangle = new "; + protected final String TEXT_122 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new "; + protected final String TEXT_123 = "());" + NL + "\t\t"; + protected final String TEXT_124 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\t" + NL + "\t\t"; + protected final String TEXT_125 = " 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_126 = " createNodeShape() {"; + protected final String TEXT_127 = NL + "\t\tprimaryShape = new "; + protected final String TEXT_128 = "()"; + protected final String TEXT_129 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_130 = ";"; + protected final String TEXT_131 = NL + "\t\tprimaryShape = "; + protected final String TEXT_132 = ";"; + protected final String TEXT_133 = NL + "\t\t"; + protected final String TEXT_134 = " figure = new "; + protected final String TEXT_135 = "();" + NL + " \t\tfigure.setUseLocalCoordinates("; + protected final String TEXT_136 = ");" + NL + " \t\tprimaryShape = figure;"; + protected final String TEXT_137 = NL + "\t\treturn primaryShape;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_138 = " createDecorationPane() {" + NL + "\t\t"; + protected final String TEXT_139 = " view = ("; + protected final String TEXT_140 = ") getModel();" + NL + "\t\t"; + protected final String TEXT_141 = " 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_142 = " decorationPane = new "; + protected final String TEXT_143 = "();" + NL + "\t\tdecorationPane.setLayoutManager(new "; + protected final String TEXT_144 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_145 = " imageFigure = new "; + protected final String TEXT_146 = "("; + protected final String TEXT_147 = ".getInstance().getBundledImage(\"icons/shortcut.gif\"), "; + protected final String TEXT_148 = ".EAST);" + NL + "\t\tdecorationPane.add(imageFigure, "; + protected final String TEXT_149 = ".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_150 = " setupContentPane("; + protected final String TEXT_151 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; + protected final String TEXT_152 = NL + "\t\t\t"; + protected final String TEXT_153 = " layout = new "; + protected final String TEXT_154 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; + protected final String TEXT_155 = NL + "\t\tnodeShape.setLayoutManager(new "; + protected final String TEXT_156 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint("; + protected final String TEXT_157 = " 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_158 = "(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_159 = 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_160 = " 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_161 = " getDiagramNode() {" + NL + "\t\treturn ("; + protected final String TEXT_162 = ") getModel();" + NL + "\t}" + NL; + protected final String TEXT_163 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild("; + protected final String TEXT_164 = " childEditPart) {"; + protected final String TEXT_165 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_166 = ") {"; + protected final String TEXT_167 = NL + "\t\t\t(("; + protected final String TEXT_168 = ") childEditPart).setLabel((("; + protected final String TEXT_169 = ") primaryShape).getFigure"; + protected final String TEXT_170 = "());"; + protected final String TEXT_171 = NL + "\t\t\t(("; + protected final String TEXT_172 = ") childEditPart).setLabel(new "; + protected final String TEXT_173 = "());"; + protected final String TEXT_174 = NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_175 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the label which should be direct-edited by default." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_176 = " getPrimaryLabelEditPart() {"; + protected final String TEXT_177 = NL + "\t\tfor("; + protected final String TEXT_178 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t"; + protected final String TEXT_179 = " nextChild = ("; + protected final String TEXT_180 = ")it.next();" + NL + "\t\t\tif ("; + protected final String TEXT_181 = ".getVisualID(nextChild) == "; + protected final String TEXT_182 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn ("; + protected final String TEXT_183 = ") getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}"; + protected final String TEXT_184 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest("; + protected final String TEXT_185 = " req) {" + NL + "\t\tif ("; + protected final String TEXT_186 = ".REQ_DIRECT_EDIT == req.getType()) {" + NL + "\t\t\t"; + protected final String TEXT_187 = " labelToEdit = getLabelEditPart(("; + protected final String TEXT_188 = ")req);" + 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_189 = " getLabelEditPart("; + protected final String TEXT_190 = " req) {" + NL + "\t\t"; + protected final String TEXT_191 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t"; + protected final String TEXT_192 = " view = ("; + protected final String TEXT_193 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = "; + protected final String TEXT_194 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {"; + protected final String TEXT_195 = NL + "\t\t\t\tcase "; + protected final String TEXT_196 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;"; + protected final String TEXT_197 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL; + protected final String TEXT_198 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; + protected final String TEXT_199 = " childEditPart, int index) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_200 = " labelFigure = (("; + protected final String TEXT_201 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t} else {"; + protected final String TEXT_202 = NL + "\t\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t\t}"; + protected final String TEXT_203 = NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);"; + protected final String TEXT_204 = NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; + protected final String TEXT_205 = " childEditPart) {" + NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t"; + protected final String TEXT_206 = " labelFigure = (("; + protected final String TEXT_207 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t} else {" + NL + "\t\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; + protected final String TEXT_208 = " childEditPart) {"; + protected final String TEXT_209 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_210 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_211 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_212 = " getExternalLabelsContainer() {" + NL + "\t\t"; + protected final String TEXT_213 = " root = ("; + protected final String TEXT_214 = ") getRoot();" + NL + "\t\treturn root.getLayer("; + protected final String TEXT_215 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; + protected final String TEXT_216 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; + protected final String TEXT_217 = " childEditPart, int index) {" + NL + "\t\tif (!addFixedChild(childEditPart)) {" + NL + "\t\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_218 = 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_219 = " node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof "; + protected final String TEXT_220 = ";" + NL + "\t\t"; + protected final String TEXT_221 = " bounds = ("; + protected final String TEXT_222 = ") node.getLayoutConstraint();" + NL + "\t\t(("; + protected final String TEXT_223 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew "; + protected final String TEXT_224 = "(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight()));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_225 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_226 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_227 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_228 = " getSourceConnectionAnchor("; + protected final String TEXT_229 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_230 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_231 = " getSourceConnectionAnchor("; + protected final String TEXT_232 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_233 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_234 = " getTargetConnectionAnchor("; + protected final String TEXT_235 = " connection) {" + NL + "\t\treturn new "; + protected final String TEXT_236 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_237 = " getTargetConnectionAnchor("; + protected final String TEXT_238 = " request) {" + NL + "\t\treturn new "; + protected final String TEXT_239 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {"; + protected final String TEXT_240 = 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_241 = NL; + protected final String TEXT_242 = "\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_243 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void notifyChanged("; + protected final String TEXT_244 = " 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_245 = ") 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_246 = NL; + protected final String TEXT_247 = "\tpublic void addRefresher("; + protected final String TEXT_248 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tpublic void removeRefresher("; + protected final String TEXT_249 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\tprivate CompositeRefresher getCompositeRefresher("; + protected final String TEXT_250 = " 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_251 = NL; + protected final String TEXT_252 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {" + NL + "\t\t"; + protected final String TEXT_253 = " style =" + NL + "\t\t\t("; + protected final String TEXT_254 = ") "; + protected final String TEXT_255 = ".getStyle(" + NL + "\t\t\t\t"; + protected final String TEXT_256 = ".eINSTANCE.getFontStyle());" + NL + "\t\t"; + protected final String TEXT_257 = " 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_258 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_259 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= "; + protected final String TEXT_260 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_261 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_262 = " 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_263 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The font (created by {@link #refreshFont()}) currently assigned to the label (unless the default font is assigned)." + NL + "\t * Whenever another non-default font is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_264 = " createdFont;" + NL; + protected final String TEXT_265 = NL; + protected final String TEXT_266 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t"; + protected final String TEXT_267 = " style = ("; + protected final String TEXT_268 = ") "; + protected final String TEXT_269 = ".getStyle("; + protected final String TEXT_270 = ".eINSTANCE.getLineStyle());" + NL + "\t\t"; + protected final String TEXT_271 = " 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_272 = " 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_273 = "(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_274 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t"; + protected final String TEXT_275 = " style = ("; + protected final String TEXT_276 = ") "; + protected final String TEXT_277 = ".getStyle("; + protected final String TEXT_278 = ".eINSTANCE.getFillStyle());" + NL + "\t\t"; + protected final String TEXT_279 = " 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_280 = " 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_281 = "(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_282 = " createdBackgroundColor;" + NL; + protected final String TEXT_283 = NL; + protected final String TEXT_284 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_285 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher("; + protected final String TEXT_286 = " feature, "; + protected final String TEXT_287 = " 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_288 = "();"; + protected final String TEXT_289 = NL; + protected final String TEXT_290 = "\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_291 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_292 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);"; + protected final String TEXT_293 = NL; + protected final String TEXT_294 = "\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_295 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_296 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_297 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_298 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_299 = ".eINSTANCE.getLocation_Y(), boundsRefresher);"; + protected final String TEXT_300 = NL; + protected final String TEXT_301 = "\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_302 = ".eINSTANCE.getView_Visible(), visibilityRefresher);"; + protected final String TEXT_303 = NL; + protected final String TEXT_304 = "\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_305 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);"; + protected final String TEXT_306 = NL; + protected final String TEXT_307 = "\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_308 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);"; + protected final String TEXT_309 = NL; + protected final String TEXT_310 = "\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_311 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_312 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_313 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put("; + protected final String TEXT_314 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t"; + protected final String TEXT_315 = NL; + protected final String TEXT_316 = "\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_317 = ".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_318 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL; + protected final String TEXT_319 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_320 = "StartCommand extends "; + protected final String TEXT_321 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_322 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Create"; + protected final String TEXT_323 = "StartCommand("; + protected final String TEXT_324 = ".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_325 = ")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_326 = NL + "\t\t\treturn false;"; + protected final String TEXT_327 = NL + "\t\t\t"; + protected final String TEXT_328 = " container = ("; + protected final String TEXT_329 = ")getRelationshipContainer(source.getElement(), "; + protected final String TEXT_330 = ".eINSTANCE.get"; + protected final String TEXT_331 = "());" + NL + "\t\t\tif (container == null) {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}"; + protected final String TEXT_332 = NL; + protected final String TEXT_333 = NL + "\t\tif ("; + protected final String TEXT_334 = "."; + protected final String TEXT_335 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_336 = NL + "\t\t}"; + protected final String TEXT_337 = NL + "\t\tif ("; + protected final String TEXT_338 = "."; + protected final String TEXT_339 = "().size() >= "; + protected final String TEXT_340 = ".eINSTANCE.get"; + protected final String TEXT_341 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_342 = NL + "\t\t}"; + protected final String TEXT_343 = NL; + protected final String TEXT_344 = NL + "\t\tif ("; + protected final String TEXT_345 = "."; + protected final String TEXT_346 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_347 = NL + "\t\t}"; + protected final String TEXT_348 = NL + "\t\tif ("; + protected final String TEXT_349 = "."; + protected final String TEXT_350 = "().size() >= "; + protected final String TEXT_351 = ".eINSTANCE.get"; + protected final String TEXT_352 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_353 = NL + "\t\t}"; + protected final String TEXT_354 = NL + "\t\t\treturn true;"; + protected final String TEXT_355 = NL + "\t\t\t"; + protected final String TEXT_356 = " domainElement = ("; + protected final String TEXT_357 = ")source.getElement();"; + protected final String TEXT_358 = NL; + protected final String TEXT_359 = NL + "\t\tif ("; + protected final String TEXT_360 = "."; + protected final String TEXT_361 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_362 = NL + "\t\t}"; + protected final String TEXT_363 = NL + "\t\tif ("; + protected final String TEXT_364 = "."; + protected final String TEXT_365 = "().size() >= "; + protected final String TEXT_366 = ".eINSTANCE.get"; + protected final String TEXT_367 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_368 = NL + "\t\t}"; + protected final String TEXT_369 = NL + "\t\t\treturn true;"; + protected final String TEXT_370 = NL + "\t\t\treturn false;"; + protected final String TEXT_371 = NL + "\t\t}"; + protected final String TEXT_372 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the new relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_373 = " getRelationshipContainer("; + protected final String TEXT_374 = " element, "; + protected final String TEXT_375 = " 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_376 = NL + NL + "\t}"; + protected final String TEXT_377 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class Create"; + protected final String TEXT_378 = "Command extends "; + protected final String TEXT_379 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_380 = " source;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_381 = " target;" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate final "; + protected final String TEXT_382 = " 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_383 = "Command("; + protected final String TEXT_384 = ".CreateConnectionRequestEx requestEx) {" + NL + "\t\t\tif (requestEx.getSourceEditPart().getModel() instanceof "; + protected final String TEXT_385 = ") {" + NL + "\t\t\t\tsource = ("; + protected final String TEXT_386 = ")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_387 = ") {" + NL + "\t\t\t\ttarget = ("; + protected final String TEXT_388 = ")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_389 = ".INSTANCE;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedEdge = "; + protected final String TEXT_390 = ".eINSTANCE.createEdge();"; + protected final String TEXT_391 = NL + "\t\t\t"; + protected final String TEXT_392 = " createdDomainElement = "; + protected final String TEXT_393 = ".eINSTANCE.create"; + protected final String TEXT_394 = "();" + NL + "\t\t\tcreatedEdge.setElement(createdDomainElement);" + NL + "\t\t\t"; + protected final String TEXT_395 = NL + "\t\t\t"; + protected final String TEXT_396 = "."; + protected final String TEXT_397 = ".initializeElement(createdDomainElement);"; + protected final String TEXT_398 = NL + "\t\t\tcreatedEdge.setElement(target.getElement());\t\t//XXX: is this correct?"; + protected final String TEXT_399 = NL + "\t\t\t"; + protected final String TEXT_400 = ".decorateView(createdEdge);" + NL + "\t\t\t"; + protected final String TEXT_401 = " domainModelEditDomain = "; + protected final String TEXT_402 = ".getEditingDomain(source.getDiagram().getElement());"; + protected final String TEXT_403 = NL + "\t\t\torg.eclipse.emf.common.command.CompoundCommand addLinkEndsCommand = new org.eclipse.emf.common.command.CompoundCommand();"; + protected final String TEXT_404 = NL + "\t\t\t"; + protected final String TEXT_405 = " container = getRelationshipContainer(source.getElement(), "; + protected final String TEXT_406 = ".eINSTANCE.get"; + protected final String TEXT_407 = "());" + 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_408 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_409 = ".eINSTANCE.get"; + protected final String TEXT_410 = "(), createdDomainElement));"; + protected final String TEXT_411 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_412 = ".create(domainModelEditDomain," + NL + "\t\t\t\tcontainer, "; + protected final String TEXT_413 = ".eINSTANCE.get"; + protected final String TEXT_414 = "(), createdDomainElement));"; + protected final String TEXT_415 = NL; + protected final String TEXT_416 = NL + "\t\tif ("; + protected final String TEXT_417 = "."; + protected final String TEXT_418 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_419 = NL + "\t\t}"; + protected final String TEXT_420 = NL + "\t\tif ("; + protected final String TEXT_421 = "."; + protected final String TEXT_422 = "().size() >= "; + protected final String TEXT_423 = ".eINSTANCE.get"; + protected final String TEXT_424 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_425 = NL + "\t\t}"; + protected final String TEXT_426 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_427 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_428 = ".eINSTANCE.get"; + protected final String TEXT_429 = "(), source.getElement()));"; + protected final String TEXT_430 = NL; + protected final String TEXT_431 = NL + "\t\tif ("; + protected final String TEXT_432 = "."; + protected final String TEXT_433 = "() != null) {" + NL + "\t\t\t"; + protected final String TEXT_434 = NL + "\t\t}"; + protected final String TEXT_435 = NL + "\t\tif ("; + protected final String TEXT_436 = "."; + protected final String TEXT_437 = "().size() >= "; + protected final String TEXT_438 = ".eINSTANCE.get"; + protected final String TEXT_439 = ".getUpperBound()) {" + NL + "\t\t\t"; + protected final String TEXT_440 = NL + "\t\t}"; + protected final String TEXT_441 = NL + "\t\t\taddLinkEndsCommand.append("; + protected final String TEXT_442 = ".create(domainModelEditDomain, " + NL + "\t\t\t\tcreatedDomainElement, "; + protected final String TEXT_443 = ".eINSTANCE.get"; + protected final String TEXT_444 = "(), target.getElement()));"; + protected final String TEXT_445 = NL + "\t\tdomainModelAddCommand = addLinkEndsCommand;"; + protected final String TEXT_446 = NL + "\t\t\tdomainModelAddCommand = "; + protected final String TEXT_447 = ".create(domainModelEditDomain, source.getElement(), " + NL + "\t\t\t\t"; + protected final String TEXT_448 = ".eINSTANCE.get"; + protected final String TEXT_449 = "(), target.getElement());"; + protected final String TEXT_450 = NL + "\t\t}" + NL; + protected final String TEXT_451 = NL + "\t\t/**" + NL + "\t\t * Finds container element for the new relationship of the specified type." + NL + "\t\t * Default implementation goes up by containment hierarchy starting from" + NL + "\t\t * the specified element and returns the first element that is instance of" + NL + "\t\t * the specified container class." + NL + "\t\t * " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_452 = " getRelationshipContainer("; + protected final String TEXT_453 = " element, "; + protected final String TEXT_454 = " 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_455 = NL + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canExecute() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canExecute();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic boolean canUndo() {" + NL + "\t\t\treturn source != null && target != null && createdEdge != null && domainModelAddCommand != null && domainModelAddCommand.canUndo();" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void execute() {" + NL + "\t\t\tdomainModelAddCommand.execute();" + NL + "\t\t\tsource.getDiagram().insertEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(source);" + NL + "\t\t\tcreatedEdge.setTarget(target);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void undo() {" + NL + "\t\t\tdomainModelAddCommand.undo();" + NL + "\t\t\tsource.getDiagram().removeEdge(createdEdge);" + NL + "\t\t\tcreatedEdge.setSource(null);" + NL + "\t\t\tcreatedEdge.setTarget(null);" + NL + "\t\t}" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void redo() {" + NL + "\t\t\texecute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_456 = NL; + protected final String TEXT_457 = NL; + protected final String TEXT_458 = 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_459 = NL + "}"; + protected final String TEXT_460 = NL; public String generate(Object argument) { @@ -627,6 +708,10 @@ stringBuffer.append(TEXT_92); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_93); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_94); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_95); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -634,14 +719,17 @@ continue; } GenClass outgoingClass; + String createCommandNameInfix; if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); outgoingClass = modelFacet.getSourceMetaFeature() == null ? modelFacet.getContainmentMetaFeature().getGenClass() : modelFacet.getSourceMetaFeature().getTypeGenClass(); + createCommandNameInfix = modelFacet.getMetaClass().getName(); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); outgoingClass = metaFeature.getGenClass(); + createCommandNameInfix = metaFeature.getFeatureAccessorName(); } else { continue; } @@ -649,41 +737,40 @@ continue; } - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_96); stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_97); + stringBuffer.append(createCommandNameInfix); + stringBuffer.append(genLink.getVisualID()); + stringBuffer.append(TEXT_98); } - stringBuffer.append(TEXT_96); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); - stringBuffer.append(TEXT_97); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); - stringBuffer.append(TEXT_98); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_99); - }/*when there's palette*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_100); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_101); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); + }/*when there's palette*/ stringBuffer.append(TEXT_102); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command")); stringBuffer.append(TEXT_103); - if (palette != null) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.CreateConnectionRequest")); stringBuffer.append(TEXT_104); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + if (palette != null) { stringBuffer.append(TEXT_105); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_108); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); stringBuffer.append(TEXT_110); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.CompoundCommand")); + stringBuffer.append(TEXT_111); for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -707,38 +794,38 @@ continue; } - stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_112); + stringBuffer.append(importManager.getImportedName(genLink.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_113); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_114); } - stringBuffer.append(TEXT_114); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_115); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_116); - }/*when there's palette*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); stringBuffer.append(TEXT_117); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); + }/*when there's palette*/ stringBuffer.append(TEXT_118); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.UnexecutableCommand")); stringBuffer.append(TEXT_119); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_120); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); stringBuffer.append(TEXT_122); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout")); stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_125); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(TEXT_126); String figureQualifiedClassName = null; Viewmap viewmap = genNode.getViewmap(); @@ -748,82 +835,82 @@ figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure"; } - stringBuffer.append(TEXT_126); - stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); stringBuffer.append(TEXT_127); - if (useFlowLayout) { + stringBuffer.append(importManager.getImportedName(figureQualifiedClassName)); stringBuffer.append(TEXT_128); - } /* use flow layout*/ + if (useFlowLayout) { stringBuffer.append(TEXT_129); - } else if (viewmap instanceof SnippetViewmap) { + } /* use flow layout*/ stringBuffer.append(TEXT_130); - stringBuffer.append(((SnippetViewmap) viewmap).getBody()); + } else if (viewmap instanceof SnippetViewmap) { stringBuffer.append(TEXT_131); + stringBuffer.append(((SnippetViewmap) viewmap).getBody()); + stringBuffer.append(TEXT_132); } else if (viewmap instanceof InnerClassViewmap) { figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName(); - stringBuffer.append(TEXT_132); - stringBuffer.append(figureQualifiedClassName); stringBuffer.append(TEXT_133); stringBuffer.append(figureQualifiedClassName); stringBuffer.append(TEXT_134); - stringBuffer.append(useFlowLayout ? "true" : "false"); + stringBuffer.append(figureQualifiedClassName); stringBuffer.append(TEXT_135); - } + stringBuffer.append(useFlowLayout ? "true" : "false"); stringBuffer.append(TEXT_136); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + } stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_138); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_139); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_140); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EAnnotation")); stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); stringBuffer.append(TEXT_142); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure")); stringBuffer.append(TEXT_143); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); stringBuffer.append(TEXT_145); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ImageFigure")); stringBuffer.append(TEXT_146); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); stringBuffer.append(TEXT_147); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants")); stringBuffer.append(TEXT_148); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BorderLayout")); stringBuffer.append(TEXT_149); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_150); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(TEXT_151); if (!useFlowLayout) { String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"); - stringBuffer.append(TEXT_151); - stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_152); stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_153); - } else { + stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); + } else { stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); stringBuffer.append(TEXT_156); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_157); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + } stringBuffer.append(TEXT_159); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_161); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); + stringBuffer.append(TEXT_162); boolean hasFixedChildren = false; List innerLabels = new ArrayList(genNode.getLabels().size()); @@ -836,9 +923,9 @@ if (!innerLabels.isEmpty()) { hasFixedChildren = true; - stringBuffer.append(TEXT_162); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_163); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_164); for (Iterator it = innerLabels.iterator(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -857,29 +944,29 @@ isAccessor = false; } - stringBuffer.append(TEXT_164); - stringBuffer.append(labelEditPart); stringBuffer.append(TEXT_165); - if (isAccessor) { - stringBuffer.append(TEXT_166); stringBuffer.append(labelEditPart); + stringBuffer.append(TEXT_166); + if (isAccessor) { stringBuffer.append(TEXT_167); - stringBuffer.append(figureQualifiedClassName); + stringBuffer.append(labelEditPart); stringBuffer.append(TEXT_168); - stringBuffer.append(labelFigureClassName); + stringBuffer.append(figureQualifiedClassName); stringBuffer.append(TEXT_169); - } else { + stringBuffer.append(labelFigureClassName); stringBuffer.append(TEXT_170); - stringBuffer.append(labelEditPart); + } else { stringBuffer.append(TEXT_171); - stringBuffer.append(labelFigureClassName); + stringBuffer.append(labelEditPart); stringBuffer.append(TEXT_172); - } + stringBuffer.append(labelFigureClassName); stringBuffer.append(TEXT_173); - } + } stringBuffer.append(TEXT_174); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + } stringBuffer.append(TEXT_175); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_176); GenNodeLabel firstEditableLabel = null; for (Iterator it = innerLabels.iterator(); it.hasNext(); ) { @@ -891,43 +978,43 @@ } if (firstEditableLabel != null) { - stringBuffer.append(TEXT_176); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_177); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_178); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_179); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_180); - stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_181); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName(firstEditableLabel.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_183); } - stringBuffer.append(TEXT_183); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_184); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_185); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants")); stringBuffer.append(TEXT_186); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_188); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_189); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")); stringBuffer.append(TEXT_190); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_192); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); stringBuffer.append(TEXT_193); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(TEXT_194); for (Iterator it = innerLabels.iterator(); it.hasNext(); ) { GenNodeLabel genLabel = (GenNodeLabel) it.next(); @@ -935,13 +1022,13 @@ continue; } - stringBuffer.append(TEXT_194); - stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_195); + stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_196); } - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_197); } @@ -956,159 +1043,157 @@ } if (hasExternalLabels) { - stringBuffer.append(TEXT_197); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_198); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_199); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_200); - if (hasFixedChildren) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_201); - } else { + if (hasFixedChildren) { stringBuffer.append(TEXT_202); - } + } else { stringBuffer.append(TEXT_203); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + } stringBuffer.append(TEXT_204); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_205); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_206); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_207); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_208); for (Iterator labels = genNode.getLabels().iterator(); labels.hasNext();) { GenNodeLabel label = (GenNodeLabel) labels.next(); if (label instanceof GenExternalNodeLabel) { - stringBuffer.append(TEXT_208); - stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_209); + stringBuffer.append(importManager.getImportedName(label.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_210); } } - stringBuffer.append(TEXT_210); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_211); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure")); stringBuffer.append(TEXT_212); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); stringBuffer.append(TEXT_213); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); stringBuffer.append(TEXT_214); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(TEXT_215); } else { if (hasFixedChildren) { - stringBuffer.append(TEXT_215); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_216); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_217); } } - stringBuffer.append(TEXT_217); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_218); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")); stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_220); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_221); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds")); stringBuffer.append(TEXT_222); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); stringBuffer.append(TEXT_223); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_225); stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_226); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_227); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_228); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); stringBuffer.append(TEXT_229); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_230); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_231); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_232); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_233); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_234); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart")); stringBuffer.append(TEXT_235); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_236); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor")); stringBuffer.append(TEXT_237); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request")); stringBuffer.append(TEXT_238); - /*@ include file="adapters/propertySource.javajetinc"*/ + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor")); stringBuffer.append(TEXT_239); + /*@ include file="adapters/propertySource.javajetinc"*/ stringBuffer.append(TEXT_240); stringBuffer.append(TEXT_241); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_242); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.impl.AdapterImpl")); stringBuffer.append(TEXT_243); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_244); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_245); stringBuffer.append(TEXT_246); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_248); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_249); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(TEXT_250); final String primaryView = "getDiagramNode()"; - stringBuffer.append(TEXT_250); stringBuffer.append(TEXT_251); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_253); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle")); stringBuffer.append(TEXT_254); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_255); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_256); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_257); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_258); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_259); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_260); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); - stringBuffer.append(TEXT_261); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); + stringBuffer.append(TEXT_261); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData")); stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_263); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font")); stringBuffer.append(TEXT_264); stringBuffer.append(TEXT_265); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); stringBuffer.append(TEXT_266); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); stringBuffer.append(TEXT_267); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle")); stringBuffer.append(TEXT_268); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_269); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_270); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_271); @@ -1116,15 +1201,15 @@ stringBuffer.append(TEXT_272); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_273); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_274); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); stringBuffer.append(TEXT_275); - stringBuffer.append(primaryView); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle")); stringBuffer.append(TEXT_276); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(primaryView); stringBuffer.append(TEXT_277); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_278); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_279); @@ -1132,25 +1217,25 @@ stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_281); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color")); stringBuffer.append(TEXT_282); stringBuffer.append(TEXT_283); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_284); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_285); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature")); stringBuffer.append(TEXT_286); - stringBuffer.append(importManager.getImportedName("java.util.HashMap")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification")); stringBuffer.append(TEXT_287); + stringBuffer.append(importManager.getImportedName("java.util.HashMap")); stringBuffer.append(TEXT_288); stringBuffer.append(TEXT_289); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_290); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_291); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_292); stringBuffer.append(TEXT_293); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_294); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_295); @@ -1160,21 +1245,21 @@ stringBuffer.append(TEXT_297); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_298); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_299); stringBuffer.append(TEXT_300); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_301); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_302); stringBuffer.append(TEXT_303); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_304); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_305); stringBuffer.append(TEXT_306); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_307); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_308); stringBuffer.append(TEXT_309); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_310); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_311); @@ -1182,13 +1267,234 @@ stringBuffer.append(TEXT_312); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_313); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_314); stringBuffer.append(TEXT_315); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_316); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); stringBuffer.append(TEXT_317); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")); + stringBuffer.append(TEXT_318); /*XXX: probably, this should go to a separate jet-template along with GraphicalNodeEditPolicy*/ + if (palette != null) { + +for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { + GenLink genLink = (GenLink)it.next(); + if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) { + continue; + } + GenClass outgoingClass; + String createCommandNameInfix; + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + outgoingClass = modelFacet.getSourceMetaFeature() == null + ? modelFacet.getContainmentMetaFeature().getGenClass() + : modelFacet.getSourceMetaFeature().getTypeGenClass(); + createCommandNameInfix = modelFacet.getMetaClass().getName(); + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + outgoingClass = metaFeature.getGenClass(); + createCommandNameInfix = metaFeature.getFeatureAccessorName(); + } else { + continue; + } + if (!outgoingClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) { + continue; + } + + stringBuffer.append(TEXT_319); + stringBuffer.append(createCommandNameInfix); + stringBuffer.append(genLink.getVisualID()); + stringBuffer.append(TEXT_320); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); + stringBuffer.append(TEXT_321); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_322); + stringBuffer.append(createCommandNameInfix); + stringBuffer.append(genLink.getVisualID()); + stringBuffer.append(TEXT_323); + stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(TEXT_324); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); + stringBuffer.append(TEXT_325); + + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); + GenClass linkClass = modelFacet.getMetaClass(); + GenFeature containmentFeature = modelFacet.getContainmentMetaFeature(); + if (containmentFeature == null) { + + stringBuffer.append(TEXT_326); + + } else { + + stringBuffer.append(TEXT_327); + stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_328); + stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_329); + stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_330); + stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); + stringBuffer.append(TEXT_331); + + { + GenFeature _feature = containmentFeature; + String _ownerInstance = "container"; + String _exceedsUpperBound = "return false;"; + + stringBuffer.append(TEXT_332); + +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { + + stringBuffer.append(TEXT_333); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_334); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_335); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_336); + + } else { + + stringBuffer.append(TEXT_337); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_338); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_339); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_340); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_341); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_342); + + } +} + + + } + GenFeature childFeature = modelFacet.getChildMetaFeature(); + if (childFeature != null && childFeature != containmentFeature && !childFeature.isDerived()) { + { + GenFeature _feature = childFeature; + String _ownerInstance = "container"; + String _exceedsUpperBound = "return false;"; + + stringBuffer.append(TEXT_343); + +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { + + stringBuffer.append(TEXT_344); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_345); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_346); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_347); + + } else { + + stringBuffer.append(TEXT_348); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_349); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_350); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_351); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_352); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_353); + + } +} + + + } + } + + stringBuffer.append(TEXT_354); + + } + } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { + GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); + + stringBuffer.append(TEXT_355); + stringBuffer.append(importManager.getImportedName(outgoingClass.getQualifiedInterfaceName())); + stringBuffer.append(TEXT_356); + stringBuffer.append(importManager.getImportedName(outgoingClass.getQualifiedInterfaceName())); + stringBuffer.append(TEXT_357); + + { + GenFeature _feature = metaFeature; + String _ownerInstance = "domainElement"; + String _exceedsUpperBound = "return false;"; + + stringBuffer.append(TEXT_358); + +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { + + stringBuffer.append(TEXT_359); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_360); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_361); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_362); + + } else { + + stringBuffer.append(TEXT_363); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_364); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_365); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_366); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_367); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_368); + + } +} + + + } + + stringBuffer.append(TEXT_369); + + } else { + + stringBuffer.append(TEXT_370); + + } + + stringBuffer.append(TEXT_371); + + if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { + + stringBuffer.append(TEXT_372); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_373); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + stringBuffer.append(TEXT_374); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); + stringBuffer.append(TEXT_375); + + } + + stringBuffer.append(TEXT_376); + +} //outgoing links + for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) { GenLink genLink = (GenLink)it.next(); @@ -1212,72 +1518,71 @@ continue; } - if (palette != null) { - stringBuffer.append(TEXT_318); + stringBuffer.append(TEXT_377); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_319); + stringBuffer.append(TEXT_378); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand")); - stringBuffer.append(TEXT_320); + stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_321); + stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_322); + stringBuffer.append(TEXT_381); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")); - stringBuffer.append(TEXT_323); + stringBuffer.append(TEXT_382); stringBuffer.append(createCommandNameInfix); stringBuffer.append(genLink.getVisualID()); - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_383); stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); - stringBuffer.append(TEXT_325); + stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_326); + stringBuffer.append(TEXT_385); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_327); + stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_328); + stringBuffer.append(TEXT_387); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_329); + stringBuffer.append(TEXT_388); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.UnexecutableCommand")); - stringBuffer.append(TEXT_330); + stringBuffer.append(TEXT_389); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); - stringBuffer.append(TEXT_331); + stringBuffer.append(TEXT_390); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenClass linkClass = modelFacet.getMetaClass(); - stringBuffer.append(TEXT_332); + stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName(importManager.getImportedName(linkClass.getQualifiedInterfaceName()))); - stringBuffer.append(TEXT_333); + stringBuffer.append(TEXT_392); stringBuffer.append(importManager.getImportedName(linkClass.getGenPackage().getQualifiedFactoryInterfaceName())); - stringBuffer.append(TEXT_334); + stringBuffer.append(TEXT_393); stringBuffer.append(linkClass.getClassifierAccessorName()); - stringBuffer.append(TEXT_335); + stringBuffer.append(TEXT_394); /*XXX: Class name DomainElementInitializer should be user-customizable*/ - stringBuffer.append(TEXT_336); + stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoriesPackageName() + ".DomainElementInitializer")); - stringBuffer.append(TEXT_337); + stringBuffer.append(TEXT_396); stringBuffer.append(genLink.getUniqueIdentifier()); - stringBuffer.append(TEXT_338); + stringBuffer.append(TEXT_397); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { - stringBuffer.append(TEXT_339); + stringBuffer.append(TEXT_398); } - stringBuffer.append(TEXT_340); + stringBuffer.append(TEXT_399); stringBuffer.append(importManager.getImportedName(genLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_341); + stringBuffer.append(TEXT_400); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); - stringBuffer.append(TEXT_342); + stringBuffer.append(TEXT_401); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")); - stringBuffer.append(TEXT_343); + stringBuffer.append(TEXT_402); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_344); + stringBuffer.append(TEXT_403); TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet(); GenFeature sourceFeature = modelFacet.getSourceMetaFeature(); @@ -1304,85 +1609,161 @@ } } - stringBuffer.append(TEXT_345); + stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_346); + stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenClass().getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_347); + stringBuffer.append(TEXT_406); stringBuffer.append(containmentFeature.getGenClass().getClassifierAccessorName()); - stringBuffer.append(TEXT_348); + stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName(containmentFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_349); + stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName(containmentFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_350); + stringBuffer.append(TEXT_409); stringBuffer.append(containmentFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_351); + stringBuffer.append(TEXT_410); } if (addChild) { - stringBuffer.append(TEXT_352); + stringBuffer.append(TEXT_411); stringBuffer.append(importManager.getImportedName(childFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_353); + stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName(childFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_354); + stringBuffer.append(TEXT_413); stringBuffer.append(childFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_355); + stringBuffer.append(TEXT_414); } if (addSource) { + { + GenFeature _feature = sourceFeature; + String _ownerInstance = "createdDomainElement"; + String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + + stringBuffer.append(TEXT_415); + +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { + + stringBuffer.append(TEXT_416); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_417); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_418); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_419); + + } else { - stringBuffer.append(TEXT_356); + stringBuffer.append(TEXT_420); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_421); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_422); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_423); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_424); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_425); + + } +} + + + } + + stringBuffer.append(TEXT_426); stringBuffer.append(importManager.getImportedName(sourceFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_357); + stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName(sourceFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_358); + stringBuffer.append(TEXT_428); stringBuffer.append(sourceFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_359); + stringBuffer.append(TEXT_429); } if (addTarget) { + { + GenFeature _feature = targetFeature; + String _ownerInstance = "createdDomainElement"; + String _exceedsUpperBound = "domainModelAddCommand = null;\nreturn;"; + + stringBuffer.append(TEXT_430); + +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { + + stringBuffer.append(TEXT_431); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_432); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_433); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_434); + + } else { - stringBuffer.append(TEXT_360); + stringBuffer.append(TEXT_435); + stringBuffer.append(_ownerInstance); + stringBuffer.append(TEXT_436); + stringBuffer.append(_feature.getGetAccessor()); + stringBuffer.append(TEXT_437); + stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())); + stringBuffer.append(TEXT_438); + stringBuffer.append(_feature.getFeatureAccessorName()); + stringBuffer.append(TEXT_439); + stringBuffer.append(_exceedsUpperBound); + stringBuffer.append(TEXT_440); + + } +} + + + } + + stringBuffer.append(TEXT_441); stringBuffer.append(importManager.getImportedName(targetFeature.getEcoreFeature().isMany() ? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_361); + stringBuffer.append(TEXT_442); stringBuffer.append(importManager.getImportedName(targetFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_362); + stringBuffer.append(TEXT_443); stringBuffer.append(targetFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_363); + stringBuffer.append(TEXT_444); } - stringBuffer.append(TEXT_364); + stringBuffer.append(TEXT_445); } else if (genLink.getModelFacet() instanceof FeatureModelFacet) { GenFeature metaFeature = ((FeatureModelFacet) genLink.getModelFacet()).getMetaFeature(); - stringBuffer.append(TEXT_365); + stringBuffer.append(TEXT_446); stringBuffer.append(importManager.getImportedName(metaFeature.getEcoreFeature().isMany()? "org.eclipse.emf.edit.command.AddCommand" : "org.eclipse.emf.edit.command.SetCommand")); - stringBuffer.append(TEXT_366); + stringBuffer.append(TEXT_447); stringBuffer.append(importManager.getImportedName(metaFeature.getGenPackage().getQualifiedPackageInterfaceName())); - stringBuffer.append(TEXT_367); + stringBuffer.append(TEXT_448); stringBuffer.append(metaFeature.getFeatureAccessorName()); - stringBuffer.append(TEXT_368); + stringBuffer.append(TEXT_449); } - stringBuffer.append(TEXT_369); + stringBuffer.append(TEXT_450); if (genLink.getModelFacet() instanceof TypeLinkModelFacet) { - stringBuffer.append(TEXT_370); + stringBuffer.append(TEXT_451); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_371); + stringBuffer.append(TEXT_452); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_372); + stringBuffer.append(TEXT_453); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EClass")); - stringBuffer.append(TEXT_373); + stringBuffer.append(TEXT_454); } - stringBuffer.append(TEXT_374); + stringBuffer.append(TEXT_455); } @@ -1391,22 +1772,22 @@ if (genNode.getViewmap() instanceof InnerClassViewmap) { String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody(); - stringBuffer.append(TEXT_375); + stringBuffer.append(TEXT_456); stringBuffer.append(classBody); - stringBuffer.append(TEXT_376); + stringBuffer.append(TEXT_457); if (classBody.indexOf("DPtoLP") != -1) { - stringBuffer.append(TEXT_377); + stringBuffer.append(TEXT_458); } } - stringBuffer.append(TEXT_378); + stringBuffer.append(TEXT_459); importManager.emitSortedImports(); - stringBuffer.append(TEXT_379); + stringBuffer.append(TEXT_460); return stringBuffer.toString(); } } Index: templates/parts/linkMultiplicity.jetinc =================================================================== RCS file: templates/parts/linkMultiplicity.jetinc diff -N templates/parts/linkMultiplicity.jetinc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates/parts/linkMultiplicity.jetinc 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,18 @@ +<% +int upperBound = _feature.getEcoreFeature().getUpperBound(); +if (upperBound > 0) { + if (upperBound == 1) { +%> + if (<%=_ownerInstance%>.<%=_feature.getGetAccessor()%>() != null) { + <%=_exceedsUpperBound%> + } +<% + } else { +%> + if (<%=_ownerInstance%>.<%=_feature.getGetAccessor()%>().size() >= <%=importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName())%>.eINSTANCE.get<%=_feature.getFeatureAccessorName()%>.getUpperBound()) { + <%=_exceedsUpperBound%> + } +<% + } +} +%>