### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.codegen Index: src-templates/org/eclipse/gmf/codegen/templates/parts/NodeEditPartGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/parts/NodeEditPartGenerator.java,v retrieving revision 1.98 diff -u -r1.98 NodeEditPartGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/parts/NodeEditPartGenerator.java 25 Aug 2006 18:32:58 -0000 1.98 +++ src-templates/org/eclipse/gmf/codegen/templates/parts/NodeEditPartGenerator.java 30 Aug 2006 15:25:18 -0000 @@ -182,62 +182,63 @@ protected final String TEXT_163 = "));"; protected final String TEXT_164 = NL + "\t\t//FIXME: workaround for #154536" + NL + "\t\tresult.getBounds().setSize(result.getPreferredSize());"; protected final String TEXT_165 = "\t\t" + NL + "\t\treturn result;" + NL + "\t}"; - protected final String TEXT_166 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditPolicy getPrimaryDragEditPolicy() {" + NL + "\t\t"; - protected final String TEXT_167 = " ep = ("; - protected final String TEXT_168 = ") super.getPrimaryDragEditPolicy();" + NL + "\t\t"; - protected final String TEXT_169 = NL + "\t\tep.setResizeDirections("; - protected final String TEXT_170 = ".NONE);" + NL + "\t\t"; - protected final String TEXT_171 = NL + "\t\tep.setResizeDirections("; - protected final String TEXT_172 = "."; - protected final String TEXT_173 = " | "; - protected final String TEXT_174 = ");" + NL + "\t\t"; - protected final String TEXT_175 = NL + "\t\treturn ep;" + NL + "\t}"; - protected final String TEXT_176 = NL; - protected final String TEXT_177 = "\t " + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove generated tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_178 = " createMainFigure() {"; - protected final String TEXT_179 = NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove generated tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_180 = " createNodeFigure() {"; - protected final String TEXT_181 = NL + "\t\t"; - protected final String TEXT_182 = " figure = createNodePlate();" + NL + "\t\tfigure.setLayoutManager(new StackLayout());" + NL + "\t\tIFigure shape = createNodeShape();" + NL + "\t\tfigure.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\treturn figure;" + 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 IFigure setupContentPane(IFigure nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; - protected final String TEXT_183 = NL + "\t\tnodeShape.setLayoutManager(new "; - protected final String TEXT_184 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(IFigure 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_185 = "(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_186 = NL + "\t\t\t"; - protected final String TEXT_187 = " layout = new "; - protected final String TEXT_188 = "();" + NL + "\t\t\tlayout.setSpacing(getMapMode().DPtoLP(5));" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; - protected final String TEXT_189 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\tif (contentPane != null) {" + NL + "\t\t\treturn contentPane;" + NL + "\t\t}" + NL + "\t\treturn super.getContentPane();" + NL + "\t}"; - protected final String TEXT_190 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_191 = " getPrimaryChildEditPart() {" + NL + "\t\treturn getChildBySemanticHint("; - protected final String TEXT_192 = ".getType("; - protected final String TEXT_193 = ".VISUAL_ID));" + NL + "\t}"; - protected final String TEXT_194 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; - protected final String TEXT_195 = " childEditPart) {"; - protected final String TEXT_196 = NL + "\t\tif (childEditPart instanceof "; - protected final String TEXT_197 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; - protected final String TEXT_198 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure getExternalLabelsContainer() {" + NL + "\t\t"; - protected final String TEXT_199 = " root = ("; - protected final String TEXT_200 = ") getRoot();" + NL + "\t\treturn root.getLayer("; - protected final String TEXT_201 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; - protected final String TEXT_202 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; - protected final String TEXT_203 = " childEditPart, int index) {"; - protected final String TEXT_204 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\tIFigure labelFigure = (("; - protected final String TEXT_205 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t} "; - protected final String TEXT_206 = "\t\t" + NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_207 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; - protected final String TEXT_208 = " childEditPart) {"; - protected final String TEXT_209 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\tIFigure labelFigure = (("; - protected final String TEXT_210 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t} "; - protected final String TEXT_211 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; - protected final String TEXT_212 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; - protected final String TEXT_213 = "\t\t" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; - protected final String TEXT_214 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; - protected final String TEXT_215 = " childEditPart = ("; - protected final String TEXT_216 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; - protected final String TEXT_217 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; - protected final String TEXT_218 = "\t" + NL; - protected final String TEXT_219 = NL; - protected final String TEXT_220 = NL + "}"; - protected final String TEXT_221 = NL; + protected final String TEXT_166 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditPolicy getPrimaryDragEditPolicy() {" + NL + "\t\tEditPolicy result = super.getPrimaryDragEditPolicy();" + NL + "\t\tif (result instanceof "; + protected final String TEXT_167 = "){" + NL + "\t\t\t"; + protected final String TEXT_168 = " ep = ("; + protected final String TEXT_169 = ") result;" + NL + "\t\t\t"; + protected final String TEXT_170 = NL + "\t\t\tep.setResizeDirections("; + protected final String TEXT_171 = ".NONE);" + NL + "\t\t\t"; + protected final String TEXT_172 = NL + "\t\t\tep.setResizeDirections("; + protected final String TEXT_173 = "."; + protected final String TEXT_174 = " | "; + protected final String TEXT_175 = ");" + NL + "\t\t\t"; + protected final String TEXT_176 = NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}"; + protected final String TEXT_177 = NL; + protected final String TEXT_178 = "\t " + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove generated tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_179 = " createMainFigure() {"; + protected final String TEXT_180 = NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove generated tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_181 = " createNodeFigure() {"; + protected final String TEXT_182 = NL + "\t\t"; + protected final String TEXT_183 = " figure = createNodePlate();" + NL + "\t\tfigure.setLayoutManager(new StackLayout());" + NL + "\t\tIFigure shape = createNodeShape();" + NL + "\t\tfigure.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);" + NL + "\t\treturn figure;" + 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 IFigure setupContentPane(IFigure nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {"; + protected final String TEXT_184 = NL + "\t\tnodeShape.setLayoutManager(new "; + protected final String TEXT_185 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(IFigure 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_186 = "(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_187 = NL + "\t\t\t"; + protected final String TEXT_188 = " layout = new "; + protected final String TEXT_189 = "();" + NL + "\t\t\tlayout.setSpacing(getMapMode().DPtoLP(5));" + NL + "\t\t\tnodeShape.setLayoutManager(layout);"; + protected final String TEXT_190 = NL + "\t\t}" + NL + "\t\treturn nodeShape; // use nodeShape itself as contentPane" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\tif (contentPane != null) {" + NL + "\t\t\treturn contentPane;" + NL + "\t\t}" + NL + "\t\treturn super.getContentPane();" + NL + "\t}"; + protected final String TEXT_191 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_192 = " getPrimaryChildEditPart() {" + NL + "\t\treturn getChildBySemanticHint("; + protected final String TEXT_193 = ".getType("; + protected final String TEXT_194 = ".VISUAL_ID));" + NL + "\t}"; + protected final String TEXT_195 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isExternalLabel("; + protected final String TEXT_196 = " childEditPart) {"; + protected final String TEXT_197 = NL + "\t\tif (childEditPart instanceof "; + protected final String TEXT_198 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}"; + protected final String TEXT_199 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure getExternalLabelsContainer() {" + NL + "\t\t"; + protected final String TEXT_200 = " root = ("; + protected final String TEXT_201 = ") getRoot();" + NL + "\t\treturn root.getLayer("; + protected final String TEXT_202 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL; + protected final String TEXT_203 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void addChildVisual("; + protected final String TEXT_204 = " childEditPart, int index) {"; + protected final String TEXT_205 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\tIFigure labelFigure = (("; + protected final String TEXT_206 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t} "; + protected final String TEXT_207 = "\t\t" + NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_208 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual("; + protected final String TEXT_209 = " childEditPart) {"; + protected final String TEXT_210 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\tIFigure labelFigure = (("; + protected final String TEXT_211 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t} "; + protected final String TEXT_212 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}"; + protected final String TEXT_213 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}"; + protected final String TEXT_214 = "\t\t" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor ("; + protected final String TEXT_215 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t"; + protected final String TEXT_216 = " childEditPart = ("; + protected final String TEXT_217 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = (("; + protected final String TEXT_218 = ") childEditPart).getFigure();" + NL + "\t\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tsuper.removeNotify();" + NL + "\t}"; + protected final String TEXT_219 = "\t" + NL; + protected final String TEXT_220 = NL; + protected final String TEXT_221 = NL + "}"; + protected final String TEXT_222 = NL; protected final String getFeatureValueGetter(String containerName, GenFeature feature, boolean isContainerEObject, ImportAssistant importManager) { StringBuffer result = new StringBuffer(); @@ -907,141 +908,143 @@ stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); stringBuffer.append(TEXT_168); - if (rc.getResizeHandleNames().isEmpty()) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")); stringBuffer.append(TEXT_169); - stringBuffer.append(draw2dPC); + if (rc.getResizeHandleNames().isEmpty()) { stringBuffer.append(TEXT_170); - } else { + stringBuffer.append(draw2dPC); stringBuffer.append(TEXT_171); + } else { + stringBuffer.append(TEXT_172); for (Iterator rcNamesIter = rc.getResizeHandleNames().iterator(); rcNamesIter.hasNext();) { - String nextConstantName = (String) rcNamesIter.next(); + String nextConstantName = (String) rcNamesIter.next(); stringBuffer.append(draw2dPC); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_173); stringBuffer.append(nextConstantName); if (rcNamesIter.hasNext()) { - stringBuffer.append(TEXT_173); - }} stringBuffer.append(TEXT_174); - } + }} stringBuffer.append(TEXT_175); } stringBuffer.append(TEXT_176); - if (myHelper.hasSideAffixedChildren()) { + } stringBuffer.append(TEXT_177); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure")); + if (myHelper.hasSideAffixedChildren()) { stringBuffer.append(TEXT_178); - } else { - stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure")); + stringBuffer.append(TEXT_179); + } else { stringBuffer.append(TEXT_180); - } - stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure")); + stringBuffer.append(TEXT_181); + } stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure")); + stringBuffer.append(TEXT_183); if (isXYLayout) { - stringBuffer.append(TEXT_183); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); stringBuffer.append(TEXT_184); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")); stringBuffer.append(TEXT_185); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); + stringBuffer.append(TEXT_186); } else { String layoutClassName = importManager.getImportedName("org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout"); - stringBuffer.append(TEXT_186); - stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_187); stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_188); - } + stringBuffer.append(layoutClassName); stringBuffer.append(TEXT_189); + } + stringBuffer.append(TEXT_190); if (myHelper.getPrimaryLabel() != null) { GenNodeLabel primaryLabel = myHelper.getPrimaryLabel(); - stringBuffer.append(TEXT_190); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_191); - stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_192); - stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); + stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); stringBuffer.append(TEXT_193); + stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())); + stringBuffer.append(TEXT_194); } if (myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_194); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_195); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(TEXT_196); for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) { GenNodeLabel next = (GenNodeLabel) externalLabels.next(); - stringBuffer.append(TEXT_196); - stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_197); - } + stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName())); stringBuffer.append(TEXT_198); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); + } stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); stringBuffer.append(TEXT_200); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager")); stringBuffer.append(TEXT_201); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(TEXT_202); } if (myHelper.hasFixedChildren() || myHelper.hasExternalLabels()) { - stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_203); - if (myHelper.hasExternalLabels()) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_204); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + if (myHelper.hasExternalLabels()) { stringBuffer.append(TEXT_205); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(TEXT_206); } if (myHelper.hasFixedChildren()) { - stringBuffer.append(TEXT_206); - } stringBuffer.append(TEXT_207); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + } stringBuffer.append(TEXT_208); - if (myHelper.hasExternalLabels()) { + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_209); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + if (myHelper.hasExternalLabels()) { stringBuffer.append(TEXT_210); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(TEXT_211); } if (myHelper.hasFixedChildren()){ - stringBuffer.append(TEXT_211); - } stringBuffer.append(TEXT_212); - if (myHelper.hasExternalLabels()) { + } stringBuffer.append(TEXT_213); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + if (myHelper.hasExternalLabels()) { stringBuffer.append(TEXT_214); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_216); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart")); stringBuffer.append(TEXT_217); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(TEXT_218); } } // if hasFixedChildren || hasExternalLabels - stringBuffer.append(TEXT_218); - if (genNode.getViewmap() instanceof InnerClassViewmap) { stringBuffer.append(TEXT_219); + if (genNode.getViewmap() instanceof InnerClassViewmap) { + stringBuffer.append(TEXT_220); stringBuffer.append(((InnerClassViewmap) genNode.getViewmap()).getClassBody()); } - stringBuffer.append(TEXT_220); - importManager.emitSortedImports(); stringBuffer.append(TEXT_221); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_222); return stringBuffer.toString(); } } \ No newline at end of file Index: templates/parts/NodeEditPart.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen/templates/parts/NodeEditPart.javajet,v retrieving revision 1.88 diff -u -r1.88 NodeEditPart.javajet --- templates/parts/NodeEditPart.javajet 25 Aug 2006 18:32:58 -0000 1.88 +++ templates/parts/NodeEditPart.javajet 30 Aug 2006 15:25:19 -0000 @@ -555,14 +555,17 @@ * @generated */ public EditPolicy getPrimaryDragEditPolicy() { - <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")%> ep = (<%=importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")%>) super.getPrimaryDragEditPolicy(); - <%if (rc.getResizeHandleNames().isEmpty()) {%> - ep.setResizeDirections(<%=draw2dPC%>.NONE); - <% } else {%> - ep.setResizeDirections(<%for (Iterator rcNamesIter = rc.getResizeHandleNames().iterator(); rcNamesIter.hasNext();) { - String nextConstantName = (String) rcNamesIter.next();%><%=draw2dPC%>.<%=nextConstantName%><%if (rcNamesIter.hasNext()) {%> | <%}}%>); - <%}%> - return ep; + EditPolicy result = super.getPrimaryDragEditPolicy(); + if (result instanceof <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")%>){ + <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")%> ep = (<%=importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy")%>) result; + <%if (rc.getResizeHandleNames().isEmpty()) {%> + ep.setResizeDirections(<%=draw2dPC%>.NONE); + <% } else {%> + ep.setResizeDirections(<%for (Iterator rcNamesIter = rc.getResizeHandleNames().iterator(); rcNamesIter.hasNext();) { + String nextConstantName = (String) rcNamesIter.next();%><%=draw2dPC%>.<%=nextConstantName%><%if (rcNamesIter.hasNext()) {%> | <%}}%>); + <%}%> + } + return result; } <%}%>