Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2007-04-04 11:04:48 +0000
committerbblajer2007-04-04 11:04:48 +0000
commit3fcc9f6735538e31d158403abfe860f07520b5ad (patch)
tree8a666df6b5e3a1a15ea3b46074cdc2f2935b3ea6
parent024a88ed240a6a199334452c547f578d987ed579 (diff)
downloadorg.eclipse.gmf-tooling-3fcc9f6735538e31d158403abfe860f07520b5ad.tar.gz
org.eclipse.gmf-tooling-3fcc9f6735538e31d158403abfe860f07520b5ad.tar.xz
org.eclipse.gmf-tooling-3fcc9f6735538e31d158403abfe860f07520b5ad.zip
Rewrite editpart templates in xpt;
Unify what is refreshed for each edit part type; Preparation for side-affixed elements.
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java1262
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java943
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java888
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java1726
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramExternalNodeLabelEditPartGenerator.java85
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java640
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java901
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java3006
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java887
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java39
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/utils/SemanticSyncUtils.java183
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalEdgeCommand.jetinc38
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalNodeCommand.jetinc38
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/common/initDiagramContents.jetinc375
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildLinks.jetinc148
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildren.jetinc95
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/editor/DiagramEditorUtil.javajet178
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet279
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet237
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet337
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramExternalNodeLabelEditPart.javajet81
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkEditPart.javajet413
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkLabelEditPart.javajet274
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeEditPart.javajet1070
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/NodeLabelEditPart.javajet250
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/adapters/propertySource.javajetinc14
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/componentEditPolicy.javajetinc13
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/customBehaviour.jetinc5
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/directEdit.javajetinc24
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/directEditPolicy.javajetinc2
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/labelFigure.jetinc132
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/labelPerformRequest.jetinc17
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/labelText.javajetinc77
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/layoutEditPolicy.jetinc8
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/linkNotationModelRefresher.jetinc329
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/mapmodeWorkaround.javajetinc28
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/notationModelRefresher.jetinc193
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/notificationFilter.jetinc21
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/openEditPolicy.jetinc12
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/performOpen.jetinc7
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshMethods/font.javajetinc63
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshMethods/fontColor.javajetinc32
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshMethods/shapeColor.javajetinc64
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refresher.javajetinc15
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/bendpoints.javajetinc7
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/bounds.javajetinc10
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/children.javajetinc10
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/domainModelRefresher.javajetinc4
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/external.jetinc27
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/externalRefreshers.javajetinc34
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/font.javajetinc10
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/fontColor.javajetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/labelRefresher.jetinc15
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/shapeColor.javajetinc12
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/sourceEdges.javajetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/targetEdges.javajetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/refreshers.javajetinc/visibility.javajetinc6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/registerModel.jetinc21
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/textAwareFields.jetinc22
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/treeComponentEditPolicy.javajetinc18
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/parts/visualID.jetinc5
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/commands/CommandUtils.ext11
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/commands/Common.xpt13
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/commands/createNotationalElementCommand.xpt100
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/Helper.ext5
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/LinkFinder.ext81
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/ChildNodeEditPart.xpt76
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/Common.ext84
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/Common.xpt304
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/CompartmentEditPart.xpt129
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/DiagramEditPart.xpt95
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LabelController.ext79
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LabelController.xpt288
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LinkEditPart.xpt116
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LinkLabelEditPart.xpt64
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LinkNotationModelRefresher.ext88
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/LinkNotationModelRefresher.xpt296
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.ext35
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeEditPart.xpt452
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NodeLabelEditPart.xpt60
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NotationModelRefresher.ext55
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/NotationModelRefresher.xpt174
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/TreeEditPart.ext47
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/TreeEditPart.xpt255
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/decorations.xpt41
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/domainModelRefresher.xpt38
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/refresh.xpt642
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/requests.xpt123
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/semanticChildLinks.xpt107
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/parts/semanticChildren.xpt69
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/diagram/policies/GraphicalNodeEditPolicy.xpt36
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt160
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramInitializer.xpt184
94 files changed, 4467 insertions, 15494 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java
deleted file mode 100644
index 6056ca98d..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java
+++ /dev/null
@@ -1,1262 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.editor;
-
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import java.util.*;
-
-public class DiagramEditorUtilGenerator
-{
- protected static String nl;
- public static synchronized DiagramEditorUtilGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- DiagramEditorUtilGenerator result = new DiagramEditorUtilGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL;
- protected final String TEXT_3 = NL;
- protected final String TEXT_4 = "((";
- protected final String TEXT_5 = ")";
- protected final String TEXT_6 = "((";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = ")";
- protected final String TEXT_9 = ".eGet(";
- protected final String TEXT_10 = ".eINSTANCE.get";
- protected final String TEXT_11 = "())";
- protected final String TEXT_12 = ")";
- protected final String TEXT_13 = "((";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = ")";
- protected final String TEXT_16 = ".";
- protected final String TEXT_17 = "()";
- protected final String TEXT_18 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_19 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String openFilePathDialog(Shell shell, String fileExtensionFilter, int style) {" + NL + "\t\tFileDialog fileDialog = new FileDialog(shell, style);" + NL + "\t\tfileDialog.setFilterExtensions(new String[]{fileExtensionFilter});" + NL + "" + NL + "\t\tfileDialog.open();" + NL + "\t\tif (fileDialog.getFileName() != null && fileDialog.getFileName().length() > 0) {" + NL + "\t\t\treturn fileDialog.getFilterPath() + File.separator + fileDialog.getFileName();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL;
- protected final String TEXT_20 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
- protected final String TEXT_21 = " openEditor(URI fileURI) {" + NL + "\t\tIWorkbench workbench = PlatformUI.getWorkbench();" + NL + "\t\tIWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();" + NL + "\t\tIWorkbenchPage page = workbenchWindow.getActivePage();" + NL + "" + NL + "\t\tIEditorDescriptor editorDescriptor = workbench.getEditorRegistry().getDefaultEditor(fileURI.lastSegment());" + NL + "\t\tif (editorDescriptor == null) {" + NL + "\t\t\tMessageDialog.openError(" + NL + "\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\"Error\"," + NL + "\t\t\t\"There is no editor registered for the file \" + fileURI.toFileString());" + NL + "\t\t\treturn null;" + NL + "\t\t} else {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());" + NL + "\t\t\t} catch (PartInitException exception) {" + NL + "\t\t\t\tMessageDialog.openError(" + NL + "\t\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\t\"Error Opening Editor\"," + NL + "\t\t\t\texception.getMessage());" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_22 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
- protected final String TEXT_23 = " showView(URI fileURI) {" + NL + "\t\tIWorkbench workbench = PlatformUI.getWorkbench();" + NL + "\t\tIWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();" + NL + "\t\tIWorkbenchPage page = workbenchWindow.getActivePage();" + NL + "" + NL + "" + NL + "\t\ttry {" + NL + "\t\t\t";
- protected final String TEXT_24 = " diagramView = (";
- protected final String TEXT_25 = ") page.showView(";
- protected final String TEXT_26 = ".ID);" + NL + "\t\t\tif (!diagramView.showDiagram(null, fileURI)) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn diagramView;" + NL + "\t\t} catch (PartInitException exception) {" + NL + "\t\t\tMessageDialog.openError(" + NL + "\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\"Error Opening View\"," + NL + "\t\t\texception.getMessage());" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_27 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
- protected final String TEXT_28 = " createDiagramFor(";
- protected final String TEXT_29 = " diagramRoot) {" + NL + "\t\tif (";
- protected final String TEXT_30 = ".VISUAL_ID != ";
- protected final String TEXT_31 = ".INSTANCE.getDiagramVisualID(diagramRoot)) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_32 = " result = ";
- protected final String TEXT_33 = ".eINSTANCE.createDiagram();" + NL + "\t\tresult.setElement(diagramRoot);" + NL + "\t\t";
- protected final String TEXT_34 = ".INSTANCE.decorateView(result);" + NL + "\t\tnew DiagramInitializer().initDiagramContents(result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static class DiagramInitializer {";
- protected final String TEXT_35 = NL;
- protected final String TEXT_36 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents(";
- protected final String TEXT_37 = " diagram) {" + NL + "\tcreate";
- protected final String TEXT_38 = "Children(diagram);";
- protected final String TEXT_39 = NL + "\tmyViewService = new ";
- protected final String TEXT_40 = "(diagram);" + NL + "\tcreate";
- protected final String TEXT_41 = "ChildLinks(diagram);";
- protected final String TEXT_42 = NL + "}" + NL;
- protected final String TEXT_43 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
- protected final String TEXT_44 = "Children(";
- protected final String TEXT_45 = " viewObject) {";
- protected final String TEXT_46 = NL + "\tfor(";
- protected final String TEXT_47 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
- protected final String TEXT_48 = " next = (";
- protected final String TEXT_49 = ") it.next();" + NL + "\t\tint visualID = ";
- protected final String TEXT_50 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
- protected final String TEXT_51 = NL + "\t\tcase ";
- protected final String TEXT_52 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
- protected final String TEXT_53 = "Children(next);" + NL + "\t\t\tbreak;";
- protected final String TEXT_54 = NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_55 = NL + "\t";
- protected final String TEXT_56 = " semanticChildren = get";
- protected final String TEXT_57 = "SemanticChildNodes(viewObject);" + NL + "\tfor(";
- protected final String TEXT_58 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t";
- protected final String TEXT_59 = " nextDescriptor = (";
- protected final String TEXT_60 = ") it.next();" + NL + "\t\t";
- protected final String TEXT_61 = " createCommand = getCreate";
- protected final String TEXT_62 = "NotationalChildNodeCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();";
- protected final String TEXT_63 = NL + "\t\t\t";
- protected final String TEXT_64 = " nextChild = createCommand.getCreatedView();" + NL + "\t\t\tint childVisualID = nextDescriptor.getVisualID();" + NL + "\t\t\tswitch (childVisualID) {";
- protected final String TEXT_65 = NL + "\t\t\tcase ";
- protected final String TEXT_66 = ".VISUAL_ID:" + NL + "\t\t\t\tcreate";
- protected final String TEXT_67 = "Children(nextChild);" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_68 = NL + "\t\t\t}";
- protected final String TEXT_69 = NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_70 = NL + "}" + NL;
- protected final String TEXT_71 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_72 = " get";
- protected final String TEXT_73 = "SemanticChildNodes(";
- protected final String TEXT_74 = " parentView) {";
- protected final String TEXT_75 = NL;
- protected final String TEXT_76 = NL + "\treturn ";
- protected final String TEXT_77 = ".EMPTY_LIST;";
- protected final String TEXT_78 = NL + "\t";
- protected final String TEXT_79 = " result = new ";
- protected final String TEXT_80 = "();";
- protected final String TEXT_81 = NL + "\t";
- protected final String TEXT_82 = " viewObject = ";
- protected final String TEXT_83 = ";" + NL + "\t";
- protected final String TEXT_84 = " modelObject = viewObject.getElement();" + NL + "\t";
- protected final String TEXT_85 = " nextValue;" + NL + "\tint nodeVID;";
- protected final String TEXT_86 = NL + "\tfor(";
- protected final String TEXT_87 = " it = ";
- protected final String TEXT_88 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_89 = ") it.next();";
- protected final String TEXT_90 = NL + "\tnextValue = (";
- protected final String TEXT_91 = ")";
- protected final String TEXT_92 = ";";
- protected final String TEXT_93 = NL + "\tnodeVID = ";
- protected final String TEXT_94 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
- protected final String TEXT_95 = NL + "\tswitch (nodeVID) {";
- protected final String TEXT_96 = NL + "\tcase ";
- protected final String TEXT_97 = ".VISUAL_ID: {";
- protected final String TEXT_98 = NL + "\tif (";
- protected final String TEXT_99 = ".VISUAL_ID == nodeVID) {";
- protected final String TEXT_100 = NL + "\t\tresult.add(new ";
- protected final String TEXT_101 = "(nextValue, nodeVID));";
- protected final String TEXT_102 = NL + "\t\tbreak;" + NL + "\t\t}";
- protected final String TEXT_103 = NL + "\t\t}";
- protected final String TEXT_104 = NL + "\t}";
- protected final String TEXT_105 = NL + "\t}";
- protected final String TEXT_106 = NL + "\treturn result;";
- protected final String TEXT_107 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
- protected final String TEXT_108 = " getCreate";
- protected final String TEXT_109 = "NotationalChildNodeCommand(";
- protected final String TEXT_110 = " parentView, ";
- protected final String TEXT_111 = " descriptor) {";
- protected final String TEXT_112 = NL;
- protected final String TEXT_113 = "\t\t\t";
- protected final String TEXT_114 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
- protected final String TEXT_115 = NL + "\t\t\tcase ";
- protected final String TEXT_116 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
- protected final String TEXT_117 = ") {" + NL + "\t\t\t\t\treturn new ";
- protected final String TEXT_118 = "(";
- protected final String TEXT_119 = ", domainElement, ";
- protected final String TEXT_120 = "new ";
- protected final String TEXT_121 = "(0, 0, ";
- protected final String TEXT_122 = ", ";
- protected final String TEXT_123 = ")";
- protected final String TEXT_124 = NL + "null";
- protected final String TEXT_125 = ", ";
- protected final String TEXT_126 = ".INSTANCE, false);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
- protected final String TEXT_127 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
- protected final String TEXT_128 = NL + "}";
- protected final String TEXT_129 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
- protected final String TEXT_130 = "ChildLinks(";
- protected final String TEXT_131 = " viewObject) {";
- protected final String TEXT_132 = NL + "\t";
- protected final String TEXT_133 = " semanticChildLinks = get";
- protected final String TEXT_134 = "SemanticChildLinks(viewObject);" + NL + "\tfor(";
- protected final String TEXT_135 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t";
- protected final String TEXT_136 = " nextDescriptor = (";
- protected final String TEXT_137 = ") it.next();" + NL + "\t\t";
- protected final String TEXT_138 = " createCommand = getCreate";
- protected final String TEXT_139 = "NotationalChildLinkCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_140 = NL + "\tfor(";
- protected final String TEXT_141 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
- protected final String TEXT_142 = " next = (";
- protected final String TEXT_143 = ") it.next();" + NL + "\t\tint visualID = ";
- protected final String TEXT_144 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
- protected final String TEXT_145 = NL + "\t\tcase ";
- protected final String TEXT_146 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
- protected final String TEXT_147 = "ChildLinks(next);" + NL + "\t\t\tbreak;";
- protected final String TEXT_148 = NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_149 = NL + "}" + NL;
- protected final String TEXT_150 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_151 = " get";
- protected final String TEXT_152 = "SemanticChildLinks(";
- protected final String TEXT_153 = " parentView) {";
- protected final String TEXT_154 = NL;
- protected final String TEXT_155 = "\t";
- protected final String TEXT_156 = " result = new ";
- protected final String TEXT_157 = "();";
- protected final String TEXT_158 = NL + "\t";
- protected final String TEXT_159 = " modelObject = ";
- protected final String TEXT_160 = ".getElement();" + NL + "\t";
- protected final String TEXT_161 = " nextValue;";
- protected final String TEXT_162 = NL + "\tint linkVID;";
- protected final String TEXT_163 = NL + "\tfor(";
- protected final String TEXT_164 = " it = ";
- protected final String TEXT_165 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_166 = ") it.next();";
- protected final String TEXT_167 = NL + "\tnextValue = (";
- protected final String TEXT_168 = ")";
- protected final String TEXT_169 = ";";
- protected final String TEXT_170 = NL + "\tlinkVID = ";
- protected final String TEXT_171 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
- protected final String TEXT_172 = NL + "\tswitch (linkVID) {";
- protected final String TEXT_173 = NL + "\tcase ";
- protected final String TEXT_174 = ".VISUAL_ID: {";
- protected final String TEXT_175 = NL + "\tif (";
- protected final String TEXT_176 = ".VISUAL_ID == linkVID) {";
- protected final String TEXT_177 = NL + "\t\t";
- protected final String TEXT_178 = " source = (";
- protected final String TEXT_179 = ")";
- protected final String TEXT_180 = ";";
- protected final String TEXT_181 = NL + "\t\t";
- protected final String TEXT_182 = " source = ";
- protected final String TEXT_183 = ".getElement();";
- protected final String TEXT_184 = NL + "\t\t";
- protected final String TEXT_185 = " target = (";
- protected final String TEXT_186 = ")";
- protected final String TEXT_187 = ";";
- protected final String TEXT_188 = NL + "\t\t";
- protected final String TEXT_189 = " target = ";
- protected final String TEXT_190 = ".getElement();";
- protected final String TEXT_191 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new ";
- protected final String TEXT_192 = "(source, target, nextValue, linkVID));" + NL + "\t\t}";
- protected final String TEXT_193 = NL + "\t\tbreak;" + NL + "\t}";
- protected final String TEXT_194 = NL + "\t}";
- protected final String TEXT_195 = NL + "\t}";
- protected final String TEXT_196 = NL + "\t}";
- protected final String TEXT_197 = NL + "\tfor(";
- protected final String TEXT_198 = " it = ";
- protected final String TEXT_199 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_200 = ") it.next();";
- protected final String TEXT_201 = NL + "\tnextValue = (";
- protected final String TEXT_202 = ")";
- protected final String TEXT_203 = ";";
- protected final String TEXT_204 = NL + "\tif (nextValue != null) {";
- protected final String TEXT_205 = NL + "\t\tresult.add(new ";
- protected final String TEXT_206 = "(modelObject, nextValue, null, ";
- protected final String TEXT_207 = ".VISUAL_ID));";
- protected final String TEXT_208 = NL + "\t}";
- protected final String TEXT_209 = NL + "\t}";
- protected final String TEXT_210 = NL + "\treturn result;";
- protected final String TEXT_211 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
- protected final String TEXT_212 = " getCreate";
- protected final String TEXT_213 = "NotationalChildLinkCommand(";
- protected final String TEXT_214 = " parentView, ";
- protected final String TEXT_215 = " linkDescriptor) {";
- protected final String TEXT_216 = NL;
- protected final String TEXT_217 = "\t\t\t";
- protected final String TEXT_218 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t";
- protected final String TEXT_219 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t";
- protected final String TEXT_220 = " decorator = null;" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {";
- protected final String TEXT_221 = NL + "\t\t\tcase ";
- protected final String TEXT_222 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof ";
- protected final String TEXT_223 = ") {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_224 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_225 = NL + "\t\t\tcase ";
- protected final String TEXT_226 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_227 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_228 = NL + "\t\t\t}" + NL + "\t\t\tif (decorator == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new ";
- protected final String TEXT_229 = "(";
- protected final String TEXT_230 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);";
- protected final String TEXT_231 = NL + "}";
- protected final String TEXT_232 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_233 = " myViewService;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
- protected final String TEXT_234 = " getViewService() {" + NL + "\treturn myViewService;" + NL + "}";
- protected final String TEXT_235 = NL + "\t}";
- protected final String TEXT_236 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getDiagramFileURI(URI modelFileURI) {" + NL + "\t\tif (modelFileURI == null || !modelFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn modelFileURI.trimFileExtension().appendFileExtension(\"";
- protected final String TEXT_237 = "\");" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getModelFileURI(URI diagramFileURI) {" + NL + "\t\tif (diagramFileURI == null || !diagramFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFileURI.trimFileExtension().appendFileExtension(\"";
- protected final String TEXT_238 = "\");" + NL + "\t}";
- protected final String TEXT_239 = NL + NL + "\t/**" + NL + "\t * Returns whether the given element is read only in its editing domain." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static boolean isReadOnly(";
- protected final String TEXT_240 = " element) {" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_241 = " resource = element.eResource();" + NL + "\t\tif (resource == null) {" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_242 = " editingDomain = ";
- protected final String TEXT_243 = ".getEditingDomain(resource);" + NL + "\t\tif (editingDomain == null) {" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\treturn editingDomain.isReadOnly(resource);" + NL + "\t}" + NL + "}";
- protected final String TEXT_244 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final GenEditorGenerator editorGen = genDiagram.getEditorGen();
-final GenPlugin genPlugin = editorGen.getPlugin();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-final GenModel genModel = genDiagram.getEditorGen().getDomainGenModel();
-final boolean isRichClientPlatform = genDiagram.getEditorGen().getApplication() != null;
-
-importManager.emitPackageStatement(stringBuffer);
- stringBuffer.append(TEXT_1);
- importManager.markImportLocation(stringBuffer);
-importManager.addImport("java.io.File");
-importManager.addImport("org.eclipse.ui.IWorkbench");
-importManager.addImport("org.eclipse.ui.IWorkbenchPage");
-importManager.addImport("org.eclipse.ui.IWorkbenchWindow");
-importManager.addImport("org.eclipse.ui.PlatformUI");
-importManager.addImport("org.eclipse.ui.PartInitException");
-importManager.addImport("org.eclipse.ui.IEditorDescriptor");
-importManager.addImport("org.eclipse.swt.widgets.Shell");
-importManager.addImport("org.eclipse.swt.widgets.FileDialog");
-importManager.addImport("org.eclipse.jface.dialogs.MessageDialog");
-importManager.addImport("org.eclipse.emf.common.util.URI");
-importManager.addImport("org.eclipse.emf.common.ui.URIEditorInput");
-
-importManager.registerInnerClass("DiagramInitializer");
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(TEXT_3);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_4);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_5);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_7);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_8);
-
- }
-
- stringBuffer.append(TEXT_9);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_10);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_11);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_12);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_13);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_14);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_15);
-
- }
-
- stringBuffer.append(TEXT_16);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_17);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_18);
- stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
- stringBuffer.append(TEXT_19);
-
-if (editorGen.getEditor().isEclipseEditor()) {
-
- stringBuffer.append(TEXT_20);
- stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
- stringBuffer.append(TEXT_21);
-
-} else {
-
- stringBuffer.append(TEXT_22);
- stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IViewPart"));
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.parts.DiagramViewPart"));
- stringBuffer.append(TEXT_24);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.parts.DiagramViewPart"));
- stringBuffer.append(TEXT_25);
- stringBuffer.append(importManager.getImportedName(editorGen.getEditor().getQualifiedClassName()));
- stringBuffer.append(TEXT_26);
-
-}
-
- stringBuffer.append(TEXT_27);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_28);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_29);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_30);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_31);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(TEXT_35);
- stringBuffer.append(TEXT_36);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_37);
- stringBuffer.append(genDiagram.getUniqueIdentifier());
- stringBuffer.append(TEXT_38);
-
-if(!genDiagram.getLinks().isEmpty()) {
-
- stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService"));
- stringBuffer.append(TEXT_40);
- stringBuffer.append(genDiagram.getUniqueIdentifier());
- stringBuffer.append(TEXT_41);
-
-}
-
- stringBuffer.append(TEXT_42);
-
-final Comparator<GenContainerBase> comparator = new Comparator<GenContainerBase>() {
- public int compare(GenContainerBase o1, GenContainerBase o2) {
- return o1.getVisualID() - o2.getVisualID();
- }
-};
-TreeSet<GenContainerBase> containers2Generate = new TreeSet<GenContainerBase>(comparator);
-for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
- GenContainerBase nextContainer = (GenContainerBase) containers.next();
- if (!nextContainer.getContainedNodes().isEmpty()) {
- containers2Generate.add(nextContainer);
- continue;
- }
- if (nextContainer instanceof GenDiagram) {
- containers2Generate.add(nextContainer);
- continue;
- }
- if (nextContainer instanceof GenNode) {
- //May need to generate if contains compartments with children
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (!nextCompartment.getContainedNodes().isEmpty()) {
- containers2Generate.add(nextContainer);
- break;
- }
- }
- }
-}
-for (Iterator<GenContainerBase> containers = containers2Generate.iterator(); containers.hasNext();) {
- GenContainerBase nextContainer = containers.next();
-
- stringBuffer.append(TEXT_43);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_44);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_45);
-
- if (nextContainer instanceof GenNode) {
- boolean shouldIterateOverCompartments = false;
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (!nextCompartment.getContainedNodes().isEmpty()) {
- shouldIterateOverCompartments = true;
- break;
- }
- }
- if (shouldIterateOverCompartments) {
-
- stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_47);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_48);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_50);
-
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (nextCompartment.getContainedNodes().isEmpty()) {
- continue;
- }
-
- stringBuffer.append(TEXT_51);
- stringBuffer.append(importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_52);
- stringBuffer.append(nextCompartment.getUniqueIdentifier());
- stringBuffer.append(TEXT_53);
-
- }
-
- stringBuffer.append(TEXT_54);
-
- }
- }
- if (!nextContainer.getContainedNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_56);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_57);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_58);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_61);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_62);
-
- boolean shouldIterateToGenerate = false;
- for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
- GenNode nextNode = (GenNode) containedNodes.next();
- if (containers2Generate.contains(nextNode)) {
- shouldIterateToGenerate = true;
- break;
- }
- }
- if (shouldIterateToGenerate) {
-
- stringBuffer.append(TEXT_63);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_64);
-
- for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
- GenNode nextNode = (GenNode) containedNodes.next();
- if (containers2Generate.contains(nextNode)) {
-
- stringBuffer.append(TEXT_65);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_66);
- stringBuffer.append(nextNode.getUniqueIdentifier());
- stringBuffer.append(TEXT_67);
-
- }
- } //iterate over contained nodes
-
- stringBuffer.append(TEXT_68);
-
- } //if (shouldIterateToGenerate)
-
- stringBuffer.append(TEXT_69);
-
- } //if (!nextContainer.getContainedNodes().isEmpty())
-
- stringBuffer.append(TEXT_70);
-
- if (!nextContainer.getContainedNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_72);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_74);
-
- {
- String _getViewCode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
-
- stringBuffer.append(TEXT_75);
-
-if (childNodes.size() == 0) {
-
- stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_77);
-
-} else {
-
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_80);
-
- Map genFeature2genNodeMap = new LinkedHashMap();
- for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
- GenNode nextNode = (GenNode) childNodes.get(nodeIndex);
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (!genFeature2genNodeMap.containsKey(childMetaFeature)) {
- genFeature2genNodeMap.put(childMetaFeature, new ArrayList());
- }
- ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode);
- }
- Set entrySet = genFeature2genNodeMap.entrySet();
- if (entrySet.size() > 0) {
-
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_82);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_85);
-
- }
- for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature childMetaFeature = (GenFeature) nextEntry.getKey();
- Collection genNodesCollection = (Collection) nextEntry.getValue();
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_87);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_89);
-
- } else {
-
- stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_91);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
- stringBuffer.append(TEXT_92);
-
- }
-
- stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_94);
-
- boolean generateSwitch = genNodesCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_95);
-
- }
- for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
- GenNode nextNode = (GenNode) genNodesIterator.next();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_97);
-
- } else {
-
- stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_99);
-
- }
-
- stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_101);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_102);
-
- } else {
-
- stringBuffer.append(TEXT_103);
-
- }
- }
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_104);
-
- }
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_105);
-
- }
-}
-
- stringBuffer.append(TEXT_106);
-
-}
-
-
- }
-
- stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_108);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_110);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_111);
-
- {
- String _parentNode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
- boolean isListLayout;
- if (nextContainer instanceof GenNode) {
- isListLayout = !org.eclipse.gmf.codegen.gmfgen.util.ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions((GenNode) nextContainer);
- } else if (nextContainer instanceof GenCompartment) {
- isListLayout = ((GenCompartment) nextContainer).isListLayout();
- } else if (nextContainer instanceof GenDiagram) {
- isListLayout = false;
- } else {
- throw new RuntimeException("Unexpected container");
- }
-
- stringBuffer.append(TEXT_112);
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_114);
-
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
-
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(childNodeInterfaceName);
- stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
- stringBuffer.append(TEXT_118);
- stringBuffer.append(_parentNode);
- stringBuffer.append(TEXT_119);
-
- if (!isListLayout) {
- int defaultWidth = 40;
- int defaultHeight = 40;
- DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class);
- if (defSizeAttrs != null) {
- defaultWidth = defSizeAttrs.getWidth();
- defaultHeight = defSizeAttrs.getHeight();
- }
-
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_121);
- stringBuffer.append(defaultWidth);
- stringBuffer.append(TEXT_122);
- stringBuffer.append(defaultHeight);
- stringBuffer.append(TEXT_123);
-
- } else {
-
- stringBuffer.append(TEXT_124);
-
- }
-
- stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_126);
-
-}
-
- stringBuffer.append(TEXT_127);
-
- } //local declarations
-
- stringBuffer.append(TEXT_128);
-
- } //if (!nextContainer.getContainedNodes().isEmpty())
-}
-class LinksCollection {
- private Collection<GenLink> myTypeModelFacetLinks = new LinkedList<GenLink>();
- private Collection<GenLink> myFeatureModelFacetLinks = new LinkedList<GenLink>();
- public void add(GenLink link) {
- if (link.getModelFacet() instanceof TypeLinkModelFacet) {
- myTypeModelFacetLinks.add(link);
- } else if (link.getModelFacet() instanceof FeatureLinkModelFacet) {
- myFeatureModelFacetLinks.add(link);
- }
- }
- public Iterator<GenLink> getContainedTypeModelFacetLinks() {
- return myTypeModelFacetLinks.iterator();
- }
- public Iterator<GenLink> getContainedFeatureModelFacetLinks() {
- return myFeatureModelFacetLinks.iterator();
- }
-}
-class CreateChildLinkElements {
- private TreeMap<GenContainerBase, LinksCollection> myElements;
- public CreateChildLinkElements() {
- myElements = new TreeMap<GenContainerBase, LinksCollection>(comparator);
- }
- public void add(GenContainerBase o, GenLink link) {
- buildAncestors(o);
- myElements.get(o).add(link);
- }
- private void buildAncestors(GenContainerBase o) {
- if (!myElements.containsKey(o)) {
- LinksCollection elements = new LinksCollection();
- myElements.put(o, elements);
- addAncestors(o);
- }
- }
- private void addAncestors(GenContainerBase o) {
- if (o instanceof GenCompartment) {
- GenCompartment compartment = (GenCompartment) o;
- buildAncestors(compartment.getNode());
- } else if (o instanceof GenTopLevelNode) {
- GenTopLevelNode node = (GenTopLevelNode) o;
- buildAncestors(node.getDiagram());
- } else if (o instanceof GenChildNode) {
- GenChildNode node = (GenChildNode) o;
- for(Iterator it = node.getContainers().iterator(); it.hasNext(); ) {
- GenContainerBase next = (GenContainerBase) it.next();
- buildAncestors(next);
- }
- }
- }
- public boolean contains(GenContainerBase o) {
- return myElements.containsKey(o);
- }
- public Iterator<Map.Entry<GenContainerBase, LinksCollection>> iterator() {
- return myElements.entrySet().iterator();
- }
-}
-if (!genDiagram.getLinks().isEmpty()) {
- CreateChildLinkElements linkContainers2Generate = new CreateChildLinkElements();
- //No need to explicitly add diagram, since we build the whole hierarchy up.
- for(Iterator links = genDiagram.getLinks().iterator(); links.hasNext(); ) {
- GenLink next = (GenLink) links.next();
- GenClass containerClass;
- LinkModelFacet nextModelFacet = next.getModelFacet();
- if (nextModelFacet instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) next.getModelFacet();
- if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
- //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
- containerClass = null;
- } else {
- containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
- }
- } else if (nextModelFacet instanceof FeatureLinkModelFacet) {
- GenFeature metaFeature = ((FeatureLinkModelFacet) next.getModelFacet()).getMetaFeature();
- containerClass = metaFeature.getGenClass();
- } else {
- continue;
- }
- for (Iterator nodes = genDiagram.getAllNodes().iterator(); nodes.hasNext(); ) {
- GenNode nextNode = (GenNode) nodes.next();
- if (containerClass.getEcoreClass().isSuperTypeOf(nextNode.getDomainMetaClass().getEcoreClass())) {
- linkContainers2Generate.add(nextNode, next);
- }
- }
- }
- for(Iterator<Map.Entry<GenContainerBase, LinksCollection>> entryIt = linkContainers2Generate.iterator(); entryIt.hasNext(); ) {
- Map.Entry<GenContainerBase, LinksCollection> next = entryIt.next();
- GenContainerBase nextContainer = next.getKey();
- LinksCollection linksCollection = next.getValue();
- Iterator<GenLink> typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();
- Iterator<GenLink> featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_131);
-
- if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
-
- stringBuffer.append(TEXT_132);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_133);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_134);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_135);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_136);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_138);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_139);
-
- }
- boolean shouldIterateToGenerate = false;
- Collection childElements = new ArrayList(nextContainer.getContainedNodes());
- if (nextContainer instanceof GenNode) {
- childElements.addAll(((GenNode) nextContainer).getCompartments());
- }
- for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
- GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
- if (linkContainers2Generate.contains(nextChild)) {
- shouldIterateToGenerate = true;
- break;
- }
- }
- if (shouldIterateToGenerate) {
-
- stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_142);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_143);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_144);
-
- for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
- GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
- if (!linkContainers2Generate.contains(nextChild)) {
- continue;
- }
-
- stringBuffer.append(TEXT_145);
- stringBuffer.append(importManager.getImportedName(nextChild.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_146);
- stringBuffer.append(nextChild.getUniqueIdentifier());
- stringBuffer.append(TEXT_147);
-
- }
-
- stringBuffer.append(TEXT_148);
-
- }
-
- stringBuffer.append(TEXT_149);
-
- if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
-
- stringBuffer.append(TEXT_150);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_151);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_152);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_153);
-
- {
- String _getViewCode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
- Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
- Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
-
- stringBuffer.append(TEXT_154);
- stringBuffer.append(TEXT_155);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_156);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_157);
-
-Map genFeature2genLinkMap = new LinkedHashMap();
-for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- GenFeature metaFeature = modelFacet.getChildMetaFeature();
- if (!genFeature2genLinkMap.containsKey(metaFeature)) {
- genFeature2genLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
-}
-Map genFeature2featureGenLinkMap = new LinkedHashMap();
-for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
- genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
-}
-if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_158);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_159);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_160);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_161);
-
-}
-if (!genFeature2genLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_162);
-
-}
-for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_164);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_166);
-
- } else {
-
- stringBuffer.append(TEXT_167);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_168);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_169);
-
- }
-
- stringBuffer.append(TEXT_170);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_171);
-
- boolean generateSwitch = genLinksCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_172);
-
- }
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_174);
-
- } else {
-
- stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_176);
-
- }
- if (modelFacet.getSourceMetaFeature() != null) {
-
- stringBuffer.append(TEXT_177);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_179);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);
- stringBuffer.append(TEXT_180);
-
- } else {
-
- stringBuffer.append(TEXT_181);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_182);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_183);
-
- }
- if (modelFacet.getTargetMetaFeature() != null) {
-
- stringBuffer.append(TEXT_184);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_185);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_186);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);
- stringBuffer.append(TEXT_187);
-
- } else {
-
- stringBuffer.append(TEXT_188);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_189);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_190);
-
- }
-
- stringBuffer.append(TEXT_191);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_192);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_193);
-
- } else {
-
- stringBuffer.append(TEXT_194);
-
- }
-
-
- } //iterate over genLinksCollection
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_195);
-
- }
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_196);
-
- }
-}
-for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_198);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_199);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_200);
-
- } else {
-
- stringBuffer.append(TEXT_201);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_202);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_203);
-
- }
-
- stringBuffer.append(TEXT_204);
-
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
-
- stringBuffer.append(TEXT_205);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_206);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_207);
-
- }
-
- stringBuffer.append(TEXT_208);
-
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_209);
-
- }
-}
-
- stringBuffer.append(TEXT_210);
-
- }
-
- stringBuffer.append(TEXT_211);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_212);
- stringBuffer.append(nextContainer.getUniqueIdentifier());
- stringBuffer.append(TEXT_213);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_214);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_215);
-
- {
- String _diagramCode = "parentView.getDiagram()";
- Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
- Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
-
- stringBuffer.append(TEXT_216);
- stringBuffer.append(TEXT_217);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_218);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_219);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator"));
- stringBuffer.append(TEXT_220);
-
- for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
-
- stringBuffer.append(TEXT_221);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_222);
- stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_223);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_224);
-
- }
- for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_225);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_226);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_227);
-
- }
-
- stringBuffer.append(TEXT_228);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand"));
- stringBuffer.append(TEXT_229);
- stringBuffer.append(_diagramCode);
- stringBuffer.append(TEXT_230);
-
- }
-
- stringBuffer.append(TEXT_231);
-
- }
- }
-}
-if(!genDiagram.getLinks().isEmpty()) {
-
- stringBuffer.append(TEXT_232);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_233);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_234);
-
-}
-
- stringBuffer.append(TEXT_235);
-
-if (!genDiagram.getEditorGen().isSameFileForDiagramAndModel()) {
-
- stringBuffer.append(TEXT_236);
- stringBuffer.append(editorGen.getDiagramFileExtension());
- stringBuffer.append(TEXT_237);
- stringBuffer.append(editorGen.getDomainFileExtension());
- stringBuffer.append(TEXT_238);
-
-}
-
- stringBuffer.append(TEXT_239);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_240);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
- stringBuffer.append(TEXT_241);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_242);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_243);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_244);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java
deleted file mode 100644
index 6ab42cde7..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/ChildNodeEditPartGenerator.java
+++ /dev/null
@@ -1,943 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import java.util.*;
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.emf.ecore.*;
-
-public class ChildNodeEditPartGenerator
-{
- protected static String nl;
- public static synchronized ChildNodeEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- ChildNodeEditPartGenerator result = new ChildNodeEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL;
- protected final String TEXT_5 = NL;
- protected final String TEXT_6 = "((";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = "((";
- protected final String TEXT_9 = ")";
- protected final String TEXT_10 = ")";
- protected final String TEXT_11 = ".eGet(";
- protected final String TEXT_12 = ".eINSTANCE.get";
- protected final String TEXT_13 = "())";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = "((";
- protected final String TEXT_16 = ")";
- protected final String TEXT_17 = ")";
- protected final String TEXT_18 = ".";
- protected final String TEXT_19 = "()";
- protected final String TEXT_20 = NL;
- protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_22 = " extends ";
- protected final String TEXT_23 = " implements ";
- protected final String TEXT_24 = ", ";
- protected final String TEXT_25 = ", ";
- protected final String TEXT_26 = " {";
- protected final String TEXT_27 = NL;
- protected final String TEXT_28 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_29 = ";";
- protected final String TEXT_30 = NL;
- protected final String TEXT_31 = NL;
- protected final String TEXT_32 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_33 = " manager;" + NL;
- protected final String TEXT_34 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
- protected final String TEXT_35 = " LABEL_DISPLAYER = createLabelTextDisplayer();" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_36 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_37 = " getDiagramNode() {" + NL + "\t\treturn (";
- protected final String TEXT_38 = ") getModel();" + NL + "\t}" + NL;
- protected final String TEXT_39 = NL;
- protected final String TEXT_40 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
- protected final String TEXT_41 = " view = (";
- protected final String TEXT_42 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
- protected final String TEXT_43 = " view = (";
- protected final String TEXT_44 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_45 = NL;
- protected final String TEXT_46 = "\t\tinstallEditPolicy(";
- protected final String TEXT_47 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_48 = "());";
- protected final String TEXT_49 = NL;
- protected final String TEXT_50 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_51 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_52 = "());";
- protected final String TEXT_53 = NL;
- protected final String TEXT_54 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_55 = "\", new ";
- protected final String TEXT_56 = "()); //$NON-NLS-1$";
- protected final String TEXT_57 = NL;
- protected final String TEXT_58 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_59 = ".OPEN_ROLE";
- protected final String TEXT_60 = " + \"";
- protected final String TEXT_61 = "\" ";
- protected final String TEXT_62 = ", new ";
- protected final String TEXT_63 = "());";
- protected final String TEXT_64 = NL + "\t}" + NL;
- protected final String TEXT_65 = NL;
- protected final String TEXT_66 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
- protected final String TEXT_67 = " req) {";
- protected final String TEXT_68 = NL + "\t\tif (";
- protected final String TEXT_69 = ".REQ_DIRECT_EDIT.equals(req.getType()) && understandsRequest(req)) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_70 = NL;
- protected final String TEXT_71 = "if (";
- protected final String TEXT_72 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_73 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}";
- protected final String TEXT_74 = NL;
- protected final String TEXT_75 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_76 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
- protected final String TEXT_77 = "(this, ";
- protected final String TEXT_78 = ".class, new ";
- protected final String TEXT_79 = "(getViewer(), getLabel())) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelTextDisplayer().getEditText(";
- protected final String TEXT_80 = ".getElement()));" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tif (";
- protected final String TEXT_81 = ".isReadOnly(";
- protected final String TEXT_82 = ".getElement()) || ";
- protected final String TEXT_83 = ".isReadOnly(";
- protected final String TEXT_84 = ")) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL;
- protected final String TEXT_85 = NL;
- protected final String TEXT_86 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_87 = " externalRefreshers = new ";
- protected final String TEXT_88 = "();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_89 = " getExternalRefreshers() {" + NL + "\t\treturn externalRefreshers;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addExternalRefresher(";
- protected final String TEXT_90 = ".ExternalRefresher externalRefresher) {" + NL + "\t\tif (externalRefresher != null && !externalRefreshers.contains(externalRefresher)) {" + NL + "\t\t\texternalRefreshers.add(externalRefresher);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeExternalRefresher(";
- protected final String TEXT_91 = ".ExternalRefresher externalRefresher) {" + NL + "\t\texternalRefreshers.remove(externalRefresher);" + NL + "\t}" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((View)getModel()).getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelSourceConnections() {" + NL + "\t\treturn ((View)getModel()).getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelTargetConnections() {" + NL + "\t\treturn ((View)getModel()).getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}";
- protected final String TEXT_92 = NL;
- protected final String TEXT_93 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static ";
- protected final String TEXT_94 = " createLabelTextDisplayer() {";
- protected final String TEXT_95 = NL + "\t\treturn new ";
- protected final String TEXT_96 = "(\"";
- protected final String TEXT_97 = "\"";
- protected final String TEXT_98 = ", \"";
- protected final String TEXT_99 = "\"";
- protected final String TEXT_100 = ", " + NL + "\t\t\tnew ";
- protected final String TEXT_101 = "[] {";
- protected final String TEXT_102 = NL + "\t\t";
- protected final String TEXT_103 = ".eINSTANCE.get";
- protected final String TEXT_104 = "()";
- protected final String TEXT_105 = ",";
- protected final String TEXT_106 = "});";
- protected final String TEXT_107 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\treturn null;";
- protected final String TEXT_108 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_109 = " getLabelTextDisplayer() {" + NL + "\t\treturn LABEL_DISPLAYER;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabelText(String text) {" + NL + "\t\tgetLabel().setText(text);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
- protected final String TEXT_110 = " element = ";
- protected final String TEXT_111 = ".getElement();" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\tString result = getLabelTextDisplayer().getDisplayText(element);" + NL + "\t\tif (result == null || result.length() == 0) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}";
- protected final String TEXT_112 = NL;
- protected final String TEXT_113 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
- protected final String TEXT_114 = NL + "\t\t";
- protected final String TEXT_115 = " style =" + NL + "\t\t\t(";
- protected final String TEXT_116 = ") ";
- protected final String TEXT_117 = ".getStyle(" + NL + "\t\t\t\t";
- protected final String TEXT_118 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_119 = " 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_120 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_121 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_122 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
- protected final String TEXT_123 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
- protected final String TEXT_124 = " 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_125 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
- protected final String TEXT_126 = "\t" + NL + "\t}";
- protected final String TEXT_127 = 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_128 = " createdFont;";
- protected final String TEXT_129 = "\t";
- protected final String TEXT_130 = NL;
- protected final String TEXT_131 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
- protected final String TEXT_132 = " style = (";
- protected final String TEXT_133 = ") ";
- protected final String TEXT_134 = ".getStyle(";
- protected final String TEXT_135 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_136 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
- protected final String TEXT_137 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new ";
- protected final String TEXT_138 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_139 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_140 = " getLabelIcon() {";
- protected final String TEXT_141 = NL + "\t\treturn ";
- protected final String TEXT_142 = ".getImage(getDiagramNode().getElement().eClass());";
- protected final String TEXT_143 = NL + "\t\treturn null;";
- protected final String TEXT_144 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = getDiagramNode().isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
- protected final String TEXT_145 = ".class == key) {" + NL + "\t\t\treturn getTreeEditPartAdapter();" + NL + "\t\t}";
- protected final String TEXT_146 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter myTreeEditPartAdapter;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter getTreeEditPartAdapter() {" + NL + "\t\tif (myTreeEditPartAdapter == null) {" + NL + "\t\t\tmyTreeEditPartAdapter = new TreeEditPartAdapter();" + NL + "\t\t}" + NL + "\t\treturn myTreeEditPartAdapter;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\taddExternalRefresher(getLabelRefresher());" + 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\tremoveExternalRefresher(getLabelRefresher());" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
- protected final String TEXT_147 = NL;
- protected final String TEXT_148 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_149 = " domainModelRefresher = new ";
- protected final String TEXT_150 = "(this);" + NL;
- protected final String TEXT_151 = NL;
- protected final String TEXT_152 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_153 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
- protected final String TEXT_154 = " feature, ";
- protected final String TEXT_155 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + NL;
- protected final String TEXT_156 = NL;
- protected final String TEXT_157 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_158 = ".ExternalRefresher labelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_159 = ".ExternalRefresher getLabelRefresher() {" + NL + "\t\tif (labelRefresher == null && getDiagramNode() != null) {" + NL + "\t\t\tlabelRefresher = new ";
- protected final String TEXT_160 = ".ExternalRefresherAdapter(this, getDiagramNode().getElement());" + NL + "\t\t}" + NL + "\t\treturn labelRefresher;" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
- protected final String TEXT_161 = NL;
- protected final String TEXT_162 = "\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_163 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_164 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_165 = ".eINSTANCE.getView_Styles(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_166 = ".eINSTANCE.getDrawerStyle_Collapsed(), childrenRefresher);" + NL + "\t\t";
- protected final String TEXT_167 = NL;
- protected final String TEXT_168 = "\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_169 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
- protected final String TEXT_170 = NL;
- protected final String TEXT_171 = "\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_172 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_173 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_174 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_175 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
- protected final String TEXT_176 = NL;
- protected final String TEXT_177 = "\t\tRefresher fontColorRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshFontColor();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_178 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t}" + NL;
- protected final String TEXT_179 = NL;
- protected final String TEXT_180 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_181 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
- protected final String TEXT_182 = " method" + NL + "\t\treturn null;" + NL + "\t}";
- protected final String TEXT_183 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_184 = " createLabel() {";
- protected final String TEXT_185 = NL + "\t\treturn new ";
- protected final String TEXT_186 = "();";
- protected final String TEXT_187 = NL + "\t\treturn ";
- protected final String TEXT_188 = ";";
- protected final String TEXT_189 = NL + "\t\treturn new ";
- protected final String TEXT_190 = "();";
- protected final String TEXT_191 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_192 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_193 = " label = createLabel();";
- protected final String TEXT_194 = NL + "\t\tdefaultText = label.getText();";
- protected final String TEXT_195 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_196 = NL + "\t\treturn label;" + NL + "\t}";
- protected final String TEXT_197 = NL + NL + "\t/**";
- protected final String TEXT_198 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
- protected final String TEXT_199 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_200 = " getLabel() {" + NL + "\t\treturn (";
- protected final String TEXT_201 = ") getFigure();" + NL + "\t}" + NL;
- protected final String TEXT_202 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
- protected final String TEXT_203 = "(";
- protected final String TEXT_204 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
- protected final String TEXT_205 = NL + "\t\tdefaultText = figure.getText();";
- protected final String TEXT_206 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_207 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
- protected final String TEXT_208 = NL;
- protected final String TEXT_209 = NL;
- protected final String TEXT_210 = 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_211 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class TreeEditPartAdapter extends ";
- protected final String TEXT_212 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic TreeEditPartAdapter() {" + NL + "\t\t\tsuper(getDiagramNode(), ";
- protected final String TEXT_213 = ".getInstance().getItemProvidersAdapterFactory());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void createEditPolicies() {";
- protected final String TEXT_214 = NL;
- protected final String TEXT_215 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_216 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_217 = "()";
- protected final String TEXT_218 = " {" + NL + "\t\t\tprotected ";
- protected final String TEXT_219 = " getGraphicalEditPart() {" + NL + "\t\t\t\treturn ";
- protected final String TEXT_220 = ".this;" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_221 = ");";
- protected final String TEXT_222 = NL;
- protected final String TEXT_223 = "\t\tinstallEditPolicy(";
- protected final String TEXT_224 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_225 = "());";
- protected final String TEXT_226 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_227 = " createLabelTextDisplayer() {" + NL + "\t\t\treturn ";
- protected final String TEXT_228 = ".this.getLabelTextDisplayer();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_229 = " getImage() {" + NL + "\t\t\treturn getLabelIcon();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_230 = " getModelChildren() {" + NL + "\t\t\treturn ";
- protected final String TEXT_231 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
- protected final String TEXT_232 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];
-final GenChildLabelNode genChildNode = (GenChildLabelNode)genElement;
-GenNode genHost = genChildNode;
-GenNode genNode = genChildNode; /*var used by componentEditPolicy.javajetinc*/
-GenClass underlyingMetaClass = genHost.getDomainMetaClass();
-GenDiagram genDiagram = genChildNode.getDiagram();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
-final boolean isReadOnly = genChildNode.isLabelReadOnly();
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
- stringBuffer.append(TEXT_4);
- stringBuffer.append(TEXT_5);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_7);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_9);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_10);
-
- }
-
- stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_13);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_14);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_16);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_17);
-
- }
-
- stringBuffer.append(TEXT_18);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_19);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_20);
- importManager.emitPackageStatement(stringBuffer);
-importManager.registerInnerClass("TreeEditPartAdapter");
-
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.gef.Request");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("org.eclipse.gmf.runtime.notation.NotationPackage");
-importManager.addImport("java.util.List");
-
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_21);
- stringBuffer.append(genChildNode.getEditPartClassName());
- stringBuffer.append(TEXT_22);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart"));
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_24);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_25);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_26);
- {
-GenCommonBase genCommonBase = genChildNode;
- stringBuffer.append(TEXT_27);
- stringBuffer.append(TEXT_28);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_29);
- }
- stringBuffer.append(TEXT_30);
- stringBuffer.append(TEXT_31);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_33);
-
-}
-
- stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_35);
- stringBuffer.append(genChildNode.getEditPartClassName());
- stringBuffer.append(TEXT_36);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_37);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_38);
- stringBuffer.append(TEXT_39);
- stringBuffer.append(TEXT_40);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_41);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_42);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_43);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_44);
-
- String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
- final String primaryView = "getDiagramNode()";
-
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_45);
- stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_47);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_48);
-
-}
-
- stringBuffer.append(TEXT_49);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_51);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_52);
-
-}
-
- {
-GenCommonBase genCommonBase = genChildNode;
- stringBuffer.append(TEXT_53);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_54);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_56);
- }
- stringBuffer.append(TEXT_57);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_58);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_59);
- if (i > 0) {
- stringBuffer.append(TEXT_60);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_61);
- }
- stringBuffer.append(TEXT_62);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_63);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_64);
- stringBuffer.append(TEXT_65);
- stringBuffer.append(TEXT_66);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_67);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_68);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_69);
-
-}
-
- stringBuffer.append(TEXT_70);
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_73);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_74);
- stringBuffer.append(TEXT_75);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_77);
- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.LabelCellEditorLocator"));
- stringBuffer.append(TEXT_79);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_81);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_83);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_84);
-
-}
-
- stringBuffer.append(TEXT_85);
- stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_89);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_91);
- stringBuffer.append(TEXT_92);
- stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_94);
-
-if (labelModelFacet instanceof FeatureLabelModelFacet) {
- FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
- String viewPattern = featureLabelModelFacet.getViewPattern();
- if (viewPattern == null || viewPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- viewPattern = patternBuffer.toString().trim();
- }
- String editPattern = null;
- if (!isReadOnly) {
- editPattern = featureLabelModelFacet.getEditPattern();
- if (editPattern == null || editPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- editPattern = patternBuffer.toString().trim();
- }
- }
-
- stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.SimpleLabelTextDisplayer"));
- stringBuffer.append(TEXT_96);
- stringBuffer.append(viewPattern);
- stringBuffer.append(TEXT_97);
- if (!isReadOnly) {
- stringBuffer.append(TEXT_98);
- stringBuffer.append(editPattern);
- stringBuffer.append(TEXT_99);
- }
- stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_101);
-
- for(Iterator it = featureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
- GenFeature next = (GenFeature) it.next();
-
- stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_103);
- stringBuffer.append(next.getFeatureAccessorName());
- stringBuffer.append(TEXT_104);
- if (it.hasNext()) {
- stringBuffer.append(TEXT_105);
- }
-
-
- }
-
- stringBuffer.append(TEXT_106);
-
-} else {
-
- stringBuffer.append(TEXT_107);
-
-}
-
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_110);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_111);
- stringBuffer.append(TEXT_112);
-
-boolean isFixedFontSetInFigure;
-{
- StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
- isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
-}
-
- stringBuffer.append(TEXT_113);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
- stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_125);
-
-}
-
- stringBuffer.append(TEXT_126);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_128);
-
-}
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(TEXT_130);
- stringBuffer.append(TEXT_131);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_132);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_133);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_134);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_135);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_136);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_138);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_140);
-
-if (genChildNode.isLabelElementIcon()) {
-
- stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
- stringBuffer.append(TEXT_142);
-
-} else {
-
- stringBuffer.append(TEXT_143);
-
-}
-
- stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.TreeEditPart"));
- stringBuffer.append(TEXT_145);
- /*@ include file="adapters/propertySource.javajetinc"*/
- stringBuffer.append(TEXT_146);
- stringBuffer.append(TEXT_147);
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_150);
- stringBuffer.append(TEXT_151);
- stringBuffer.append(TEXT_152);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_153);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_154);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_155);
- stringBuffer.append(TEXT_156);
- stringBuffer.append(TEXT_157);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_158);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_160);
- stringBuffer.append(TEXT_161);
- stringBuffer.append(TEXT_162);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_166);
- stringBuffer.append(TEXT_167);
- stringBuffer.append(TEXT_168);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_169);
- stringBuffer.append(TEXT_170);
- stringBuffer.append(TEXT_171);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_172);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_175);
- stringBuffer.append(TEXT_176);
- stringBuffer.append(TEXT_177);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_178);
-
-final Viewmap viewmap = genChildNode.getViewmap();
-
- stringBuffer.append(TEXT_179);
-
-final String figureQualifiedClassName;
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- figureQualifiedClassName = parentAssignedViewmap.getFigureQualifiedClassName() == null ? "org.eclipse.draw2d.IFigure" : parentAssignedViewmap.getFigureQualifiedClassName();
-} else if (viewmap instanceof FigureViewmap) {
- String figureQualifiedClassNameCandidate = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassNameCandidate == null || figureQualifiedClassNameCandidate.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.draw2d.Label";
- } else {
- figureQualifiedClassName = figureQualifiedClassNameCandidate;
- }
-} else if (viewmap instanceof SnippetViewmap) {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-} else if (viewmap instanceof InnerClassViewmap) {
- figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
-} else {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-}
-final String figureImportedName;
-if (viewmap instanceof InnerClassViewmap) {
- figureImportedName = figureQualifiedClassName; //do not import inner class
-} else {
- figureImportedName = importManager.getImportedName(figureQualifiedClassName);
-}
-if (viewmap instanceof ParentAssignedViewmap) {
- final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
-
- stringBuffer.append(TEXT_180);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_181);
- stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
- stringBuffer.append(TEXT_182);
- } else {
- stringBuffer.append(TEXT_183);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_184);
-
-if (viewmap instanceof FigureViewmap) {
-
- stringBuffer.append(TEXT_185);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_186);
- } // instanceof FigureViewmap
- else if (viewmap instanceof SnippetViewmap) {
- stringBuffer.append(TEXT_187);
- stringBuffer.append(((SnippetViewmap) viewmap).getBody());
- stringBuffer.append(TEXT_188);
- } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
- else if (viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_189);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_190);
- }
- stringBuffer.append(TEXT_191);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_192);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_193);
-
-if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_194);
-
-} else {
-
- stringBuffer.append(TEXT_195);
-
-}
-
- stringBuffer.append(TEXT_196);
- } /*not parent-assigned*/
- stringBuffer.append(TEXT_197);
-
-if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
-
- stringBuffer.append(TEXT_198);
-
-}
-
- stringBuffer.append(TEXT_199);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_200);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_201);
-
-String labelSetterName = "setLabel"; // same assumption in NodeEditPart
-String labelFigureClassName = "org.eclipse.draw2d.IFigure";
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- if (parentAssignedViewmap.getSetterName() != null) {
- labelSetterName = parentAssignedViewmap.getSetterName();
- }
- if (parentAssignedViewmap.getFigureQualifiedClassName() != null) {
- labelFigureClassName = parentAssignedViewmap.getFigureQualifiedClassName();
- }
-} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
-
- stringBuffer.append(TEXT_202);
- stringBuffer.append(labelSetterName);
- stringBuffer.append(TEXT_203);
- stringBuffer.append(importManager.getImportedName(labelFigureClassName));
- stringBuffer.append(TEXT_204);
-
-if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
-
- stringBuffer.append(TEXT_205);
-
-} else {
-
- stringBuffer.append(TEXT_206);
-
-}
-
- stringBuffer.append(TEXT_207);
-
-if (viewmap instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) viewmap).getClassBody();
-
- stringBuffer.append(TEXT_208);
- stringBuffer.append(classBody);
- stringBuffer.append(TEXT_209);
-
-if (classBody.indexOf("DPtoLP") != -1) {
-
- stringBuffer.append(TEXT_210);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_211);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart"));
- stringBuffer.append(TEXT_212);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
- stringBuffer.append(TEXT_213);
- stringBuffer.append(TEXT_214);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_215);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_216);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_217);
-
- if (genElement instanceof GenNode) {
- stringBuffer.append(TEXT_218);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_219);
- stringBuffer.append(genElement.getEditPartClassName());
- stringBuffer.append(TEXT_220);
- }
- stringBuffer.append(TEXT_221);
-
-}
-
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_222);
- stringBuffer.append(TEXT_223);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_224);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_225);
-
-}
-
- stringBuffer.append(TEXT_226);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_227);
- stringBuffer.append(genChildNode.getEditPartClassName());
- stringBuffer.append(TEXT_228);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_229);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_230);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_231);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_232);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java
deleted file mode 100644
index f92bd6ad2..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/CompartmentEditPartGenerator.java
+++ /dev/null
@@ -1,888 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import java.util.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-
-public class CompartmentEditPartGenerator
-{
- protected static String nl;
- public static synchronized CompartmentEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- CompartmentEditPartGenerator result = new CompartmentEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL;
- protected final String TEXT_5 = NL;
- protected final String TEXT_6 = "((";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = "((";
- protected final String TEXT_9 = ")";
- protected final String TEXT_10 = ")";
- protected final String TEXT_11 = ".eGet(";
- protected final String TEXT_12 = ".eINSTANCE.get";
- protected final String TEXT_13 = "())";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = "((";
- protected final String TEXT_16 = ")";
- protected final String TEXT_17 = ")";
- protected final String TEXT_18 = ".";
- protected final String TEXT_19 = "()";
- protected final String TEXT_20 = NL;
- protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_22 = " extends ";
- protected final String TEXT_23 = " implements ";
- protected final String TEXT_24 = " {";
- protected final String TEXT_25 = NL;
- protected final String TEXT_26 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_27 = ";";
- protected final String TEXT_28 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_29 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSelectable() {" + NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_30 = " getModelChildren() {" + NL + "\t\t";
- protected final String TEXT_31 = " style = (";
- protected final String TEXT_32 = ") getDiagramNode().getStyle(";
- protected final String TEXT_33 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\tif (style != null && style.isCollapsed()) {" + NL + "\t\t\treturn ";
- protected final String TEXT_34 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "\t\treturn getDiagramNode().getChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_35 = " getDiagramNode() {" + NL + "\t\treturn (";
- protected final String TEXT_36 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_37 = NL;
- protected final String TEXT_38 = NL + "installEditPolicy(";
- protected final String TEXT_39 = ".LAYOUT_ROLE, new ";
- protected final String TEXT_40 = "());";
- protected final String TEXT_41 = NL;
- protected final String TEXT_42 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_43 = "\", new ";
- protected final String TEXT_44 = "()); //$NON-NLS-1$";
- protected final String TEXT_45 = NL;
- protected final String TEXT_46 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_47 = ".OPEN_ROLE";
- protected final String TEXT_48 = " + \"";
- protected final String TEXT_49 = "\" ";
- protected final String TEXT_50 = ", new ";
- protected final String TEXT_51 = "());";
- protected final String TEXT_52 = NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns the selection handles that should be contributed to the parent when it becomes selected." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_53 = " createSelectionHandles() {";
- protected final String TEXT_54 = NL + "\t\treturn ";
- protected final String TEXT_55 = ".singletonList(new ";
- protected final String TEXT_56 = "(this, getTitleName()));";
- protected final String TEXT_57 = NL + "\t\treturn ";
- protected final String TEXT_58 = ".singletonList(new ";
- protected final String TEXT_59 = "(this, getTitleName()));";
- protected final String TEXT_60 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
- protected final String TEXT_61 = " req) {";
- protected final String TEXT_62 = NL;
- protected final String TEXT_63 = "if (";
- protected final String TEXT_64 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_65 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getTitleName() {";
- protected final String TEXT_66 = NL + "\t\treturn \"";
- protected final String TEXT_67 = "\";";
- protected final String TEXT_68 = NL + "\t\treturn \"\";\t//$NON-NLS-1$";
- protected final String TEXT_69 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_70 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_71 = " result = new ";
- protected final String TEXT_72 = "();" + NL + "\t\tresult.setLayoutManager(new ";
- protected final String TEXT_73 = "());" + NL + "\t\t";
- protected final String TEXT_74 = " scrollPane = new ";
- protected final String TEXT_75 = "();" + NL + "\t\tresult.add(scrollPane);";
- protected final String TEXT_76 = NL + "\t\t";
- protected final String TEXT_77 = " viewport = new ";
- protected final String TEXT_78 = "();" + NL + "\t\tcontentPane = new ";
- protected final String TEXT_79 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
- protected final String TEXT_80 = "());";
- protected final String TEXT_81 = NL + "\t\t";
- protected final String TEXT_82 = " viewport = new ";
- protected final String TEXT_83 = "();" + NL + "\t\tcontentPane = new ";
- protected final String TEXT_84 = "();" + NL + "\t\tcontentPane.setLayoutManager(new ";
- protected final String TEXT_85 = "());";
- protected final String TEXT_86 = NL + "\t\tviewport.setContents(contentPane);" + NL + "\t\tscrollPane.setViewport(viewport);" + NL + "\t\treturn result;" + NL + "\t}" + NL;
- protected final String TEXT_87 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
- protected final String TEXT_88 = ".class == key) {" + NL + "\t\t\treturn new ";
- protected final String TEXT_89 = "(this);" + NL + "\t\t}" + NL + "\t\treturn super.getAdapter(key);" + NL + "\t}";
- protected final String TEXT_90 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IFigure getContentPane() {" + NL + "\t\treturn contentPane;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate IFigure contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tinstallNotationModelRefresher();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
- protected final String TEXT_91 = NL;
- protected final String TEXT_92 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\t";
- protected final String TEXT_93 = " refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_94 = " domainModelEditDomain = ";
- protected final String TEXT_95 = ".getEditingDomain(";
- protected final String TEXT_96 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_97 = " notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_98 = " getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
- protected final String TEXT_99 = " {";
- protected final String TEXT_100 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
- protected final String TEXT_101 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_102 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_103 = ".NOT_TOUCH;" + NL + "\t\t}";
- protected final String TEXT_104 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_105 = " createFilter() {";
- protected final String TEXT_106 = NL + "\t\t\t";
- protected final String TEXT_107 = " filter = ";
- protected final String TEXT_108 = ".createFeatureFilter(";
- protected final String TEXT_109 = ".eINSTANCE.get";
- protected final String TEXT_110 = "());";
- protected final String TEXT_111 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_112 = ".createFeatureFilter(";
- protected final String TEXT_113 = ".eINSTANCE.get";
- protected final String TEXT_114 = "()));";
- protected final String TEXT_115 = NL + "\t\t\tfilter = filter.and(";
- protected final String TEXT_116 = ".createNotifierFilter(";
- protected final String TEXT_117 = ".getElement()));";
- protected final String TEXT_118 = NL + "\t\t\t";
- protected final String TEXT_119 = " filter = ";
- protected final String TEXT_120 = ".createNotifierFilter(";
- protected final String TEXT_121 = ".getElement());";
- protected final String TEXT_122 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
- protected final String TEXT_123 = NL + "\t\t\t";
- protected final String TEXT_124 = " filter = getConstrainedChildrenFilter();";
- protected final String TEXT_125 = NL + "\t\t\t";
- protected final String TEXT_126 = " filter = ";
- protected final String TEXT_127 = ".NOT_TOUCH;";
- protected final String TEXT_128 = NL + "\t\t\treturn filter;";
- protected final String TEXT_129 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_130 = " getCreateNotationalElementCommand(";
- protected final String TEXT_131 = " descriptor) {";
- protected final String TEXT_132 = NL;
- protected final String TEXT_133 = "\t\t\t";
- protected final String TEXT_134 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
- protected final String TEXT_135 = NL + "\t\t\tcase ";
- protected final String TEXT_136 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
- protected final String TEXT_137 = ") {" + NL + "\t\t\t\t\treturn new ";
- protected final String TEXT_138 = "(";
- protected final String TEXT_139 = ", domainElement, ";
- protected final String TEXT_140 = "new ";
- protected final String TEXT_141 = "(0, 0, ";
- protected final String TEXT_142 = ", ";
- protected final String TEXT_143 = ")";
- protected final String TEXT_144 = NL + "null";
- protected final String TEXT_145 = ", ";
- protected final String TEXT_146 = ".INSTANCE, false);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
- protected final String TEXT_147 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
- protected final String TEXT_148 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_149 = " getSemanticChildNodes() {";
- protected final String TEXT_150 = NL;
- protected final String TEXT_151 = NL + "\treturn ";
- protected final String TEXT_152 = ".EMPTY_LIST;";
- protected final String TEXT_153 = NL + "\t";
- protected final String TEXT_154 = " result = new ";
- protected final String TEXT_155 = "();";
- protected final String TEXT_156 = NL + "\t";
- protected final String TEXT_157 = " viewObject = ";
- protected final String TEXT_158 = ";" + NL + "\t";
- protected final String TEXT_159 = " modelObject = viewObject.getElement();" + NL + "\t";
- protected final String TEXT_160 = " nextValue;" + NL + "\tint nodeVID;";
- protected final String TEXT_161 = NL + "\tfor(";
- protected final String TEXT_162 = " it = ";
- protected final String TEXT_163 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_164 = ") it.next();";
- protected final String TEXT_165 = NL + "\tnextValue = (";
- protected final String TEXT_166 = ")";
- protected final String TEXT_167 = ";";
- protected final String TEXT_168 = NL + "\tnodeVID = ";
- protected final String TEXT_169 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
- protected final String TEXT_170 = NL + "\tswitch (nodeVID) {";
- protected final String TEXT_171 = NL + "\tcase ";
- protected final String TEXT_172 = ".VISUAL_ID: {";
- protected final String TEXT_173 = NL + "\tif (";
- protected final String TEXT_174 = ".VISUAL_ID == nodeVID) {";
- protected final String TEXT_175 = NL + "\t\tresult.add(new ";
- protected final String TEXT_176 = "(nextValue, nodeVID));";
- protected final String TEXT_177 = NL + "\t\tbreak;" + NL + "\t\t}";
- protected final String TEXT_178 = NL + "\t\t}";
- protected final String TEXT_179 = NL + "\t}";
- protected final String TEXT_180 = NL + "\t}";
- protected final String TEXT_181 = NL + "\treturn result;";
- protected final String TEXT_182 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t\t * The generated code always returns ";
- protected final String TEXT_183 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView(";
- protected final String TEXT_184 = " descriptor) {" + NL + "\t\t\treturn ";
- protected final String TEXT_185 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_186 = " getHost() {" + NL + "\t\t\treturn ";
- protected final String TEXT_187 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
- protected final String TEXT_188 = " childRefresher = getNotationModelRefresher();" + NL + "\t\tif (!childRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_189 = " command = childRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_190 = " domainModelEditDomain = ";
- protected final String TEXT_191 = ".getEditingDomain(";
- protected final String TEXT_192 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_193 = "(domainModelEditDomain, command));" + NL + "\t}" + NL;
- protected final String TEXT_194 = NL;
- protected final String TEXT_195 = NL;
- protected final String TEXT_196 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_197 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
- protected final String TEXT_198 = " feature, ";
- protected final String TEXT_199 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
- protected final String TEXT_200 = NL;
- protected final String TEXT_201 = "\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_202 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_203 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_204 = ".eINSTANCE.getView_Styles(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_205 = ".eINSTANCE.getDrawerStyle_Collapsed(), childrenRefresher);" + NL + "\t\t";
- protected final String TEXT_206 = NL;
- protected final String TEXT_207 = "\t\tRefresher visibilityRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshVisibility();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_208 = ".eINSTANCE.getView_Visible(), visibilityRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "}" + NL;
- protected final String TEXT_209 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-GenCompartment genCompartment = (GenCompartment) ((Object[]) argument)[0];
-GenNode genHost = genCompartment.getNode();
-GenDiagram genDiagram = genCompartment.getDiagram();
-List childNodes = genCompartment.getChildNodes();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
- stringBuffer.append(TEXT_4);
- stringBuffer.append(TEXT_5);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_7);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_9);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_10);
-
- }
-
- stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_13);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_14);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_16);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_17);
-
- }
-
- stringBuffer.append(TEXT_18);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_19);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_20);
- importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.requests.CreateRequest");
-
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_21);
- stringBuffer.append(genCompartment.getEditPartClassName());
- stringBuffer.append(TEXT_22);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart"));
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_24);
- {
-GenCommonBase genCommonBase = genCompartment;
- stringBuffer.append(TEXT_25);
- stringBuffer.append(TEXT_26);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_27);
- }
- stringBuffer.append(TEXT_28);
- stringBuffer.append(genCompartment.getEditPartClassName());
- stringBuffer.append(TEXT_29);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_30);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle"));
- stringBuffer.append(TEXT_31);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle"));
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_35);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_36);
- {
-GenCommonBase genCommonBase = genCompartment;
- stringBuffer.append(TEXT_37);
-
-String layoutEditPolicyClassName = genCommonBase.getEditPartClassName();
-if (layoutEditPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- layoutEditPolicyClassName = layoutEditPolicyClassName.substring(0, layoutEditPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
-}
-layoutEditPolicyClassName = genDiagram.getEditPoliciesPackageName() + "." + layoutEditPolicyClassName + "LayoutEditPolicy";
-
- stringBuffer.append(TEXT_38);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName(layoutEditPolicyClassName));
- stringBuffer.append(TEXT_40);
- stringBuffer.append(TEXT_41);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_42);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_43);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_44);
- }
- stringBuffer.append(TEXT_45);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_47);
- if (i > 0) {
- stringBuffer.append(TEXT_48);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_49);
- }
- stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_51);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_53);
-
-if (!genCompartment.isCanCollapse()) {
-
- stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.handles.CompartmentNameHandle"));
- stringBuffer.append(TEXT_56);
-
-} else {
-
- stringBuffer.append(TEXT_57);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_58);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.handles.CompartmentCollapseHandle"));
- stringBuffer.append(TEXT_59);
-
-}
-
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_61);
- stringBuffer.append(TEXT_62);
- stringBuffer.append(TEXT_63);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_64);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_65);
-
-if (genCompartment.isNeedsTitle()) {
-
- stringBuffer.append(TEXT_66);
- stringBuffer.append(genCompartment.getTitle());
- stringBuffer.append(TEXT_67);
-
-} else {
-
- stringBuffer.append(TEXT_68);
-
-}
-
- stringBuffer.append(TEXT_69);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.figures.CompartmentFigure"));
- stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
- stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
- stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ScrollPane"));
- stringBuffer.append(TEXT_75);
- if (genCompartment.isListLayout()) {
- stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
- stringBuffer.append(TEXT_77);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
- stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout"));
- stringBuffer.append(TEXT_80);
- } else {
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Viewport"));
- stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformViewport"));
- stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
- stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
- stringBuffer.append(TEXT_85);
- }
- stringBuffer.append(TEXT_86);
-
-if (!genCompartment.isListLayout()) {
-
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
- stringBuffer.append(TEXT_89);
-
-}
-
- stringBuffer.append(TEXT_90);
-
-{
-String _getViewCode = "getDiagramNode()";
-String _getDiagramCode = _getViewCode + ".getDiagram()";
-boolean isListLayout = genCompartment.isListLayout();
-
- stringBuffer.append(TEXT_91);
- stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_95);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_97);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_99);
-
-boolean hasConstraintsInChildren = false;
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
- hasConstraintsInChildren = true;
- break;
- }
-}
-
-
-if (hasConstraintsInChildren) {
-
- stringBuffer.append(TEXT_100);
- stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
- stringBuffer.append(TEXT_101);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_103);
-
-}
-
- stringBuffer.append(TEXT_104);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_105);
-
-{
- boolean hasDeclaredFilter = false;
- Set genChildFeatures = new LinkedHashSet();
- for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (genChildFeatures.contains(childMetaFeature)) {
- continue;
- }
- genChildFeatures.add(childMetaFeature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_110);
-
- } else {
-
- stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_113);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_114);
-
- }
- } //for
-
-
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_117);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_121);
-
- }
-
-
- if (hasConstraintsInChildren) {
- if (hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_122);
-
- } else {
-
- stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_124);
-
- }
- }
- if (!hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_127);
-
- }
-
- stringBuffer.append(TEXT_128);
-
-} //local declaration of hasDeclaredFilter
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_131);
-
-{
- String _parentNode = "getHost()";
-
- stringBuffer.append(TEXT_132);
- stringBuffer.append(TEXT_133);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_134);
-
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
-
- stringBuffer.append(TEXT_135);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_136);
- stringBuffer.append(childNodeInterfaceName);
- stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
- stringBuffer.append(TEXT_138);
- stringBuffer.append(_parentNode);
- stringBuffer.append(TEXT_139);
-
- if (!isListLayout) {
- int defaultWidth = 40;
- int defaultHeight = 40;
- DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class);
- if (defSizeAttrs != null) {
- defaultWidth = defSizeAttrs.getWidth();
- defaultHeight = defSizeAttrs.getHeight();
- }
-
- stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_141);
- stringBuffer.append(defaultWidth);
- stringBuffer.append(TEXT_142);
- stringBuffer.append(defaultHeight);
- stringBuffer.append(TEXT_143);
-
- } else {
-
- stringBuffer.append(TEXT_144);
-
- }
-
- stringBuffer.append(TEXT_145);
- stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_146);
-
-}
-
- stringBuffer.append(TEXT_147);
-
-}
-
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_149);
- stringBuffer.append(TEXT_150);
-
-if (childNodes.size() == 0) {
-
- stringBuffer.append(TEXT_151);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_152);
-
-} else {
-
- stringBuffer.append(TEXT_153);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_154);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_155);
-
- Map genFeature2genNodeMap = new LinkedHashMap();
- for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
- GenNode nextNode = (GenNode) childNodes.get(nodeIndex);
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (!genFeature2genNodeMap.containsKey(childMetaFeature)) {
- genFeature2genNodeMap.put(childMetaFeature, new ArrayList());
- }
- ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode);
- }
- Set entrySet = genFeature2genNodeMap.entrySet();
- if (entrySet.size() > 0) {
-
- stringBuffer.append(TEXT_156);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_157);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_158);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_160);
-
- }
- for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature childMetaFeature = (GenFeature) nextEntry.getKey();
- Collection genNodesCollection = (Collection) nextEntry.getValue();
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_161);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_162);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_164);
-
- } else {
-
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_166);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
- stringBuffer.append(TEXT_167);
-
- }
-
- stringBuffer.append(TEXT_168);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_169);
-
- boolean generateSwitch = genNodesCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_170);
-
- }
- for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
- GenNode nextNode = (GenNode) genNodesIterator.next();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_171);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_172);
-
- } else {
-
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_174);
-
- }
-
- stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_176);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_177);
-
- } else {
-
- stringBuffer.append(TEXT_178);
-
- }
- }
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_179);
-
- }
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_180);
-
- }
-}
-
- stringBuffer.append(TEXT_181);
-
-}
-
- stringBuffer.append(TEXT_182);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_183);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_184);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_185);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_186);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_187);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher"));
- stringBuffer.append(TEXT_188);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_189);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_190);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_191);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_192);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_193);
-
-}
-
- stringBuffer.append(TEXT_194);
- stringBuffer.append(TEXT_195);
- stringBuffer.append(TEXT_196);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_198);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_199);
- stringBuffer.append(TEXT_200);
- stringBuffer.append(TEXT_201);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_202);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_203);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_204);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_205);
- stringBuffer.append(TEXT_206);
- stringBuffer.append(TEXT_207);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_208);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_209);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java
deleted file mode 100644
index 9408830ea..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramEditPartGenerator.java
+++ /dev/null
@@ -1,1726 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import java.util.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-
-public class DiagramEditPartGenerator
-{
- protected static String nl;
- public static synchronized DiagramEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- DiagramEditPartGenerator result = new DiagramEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL;
- protected final String TEXT_3 = "((";
- protected final String TEXT_4 = ")";
- protected final String TEXT_5 = "((";
- protected final String TEXT_6 = ")";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = ".eGet(";
- protected final String TEXT_9 = ".eINSTANCE.get";
- protected final String TEXT_10 = "())";
- protected final String TEXT_11 = ")";
- protected final String TEXT_12 = "((";
- protected final String TEXT_13 = ")";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = ".";
- protected final String TEXT_16 = "()";
- protected final String TEXT_17 = NL;
- protected final String TEXT_18 = NL;
- protected final String TEXT_19 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_20 = " extends AbstractGraphicalEditPart implements ";
- protected final String TEXT_21 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String MODEL_ID = \"";
- protected final String TEXT_22 = "\";" + NL;
- protected final String TEXT_23 = NL;
- protected final String TEXT_24 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_25 = ";";
- protected final String TEXT_26 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_27 = "(";
- protected final String TEXT_28 = " model) {" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_29 = " getDiagram() {" + NL + "\t\treturn (";
- protected final String TEXT_30 = ") getModel();" + NL + "\t}" + NL;
- protected final String TEXT_31 = NL;
- protected final String TEXT_32 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
- protected final String TEXT_33 = " view = (";
- protected final String TEXT_34 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
- protected final String TEXT_35 = " view = (";
- protected final String TEXT_36 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetDiagram().eAdapters().add(getUpdateManager());" + NL + "\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {" + NL + "\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());";
- protected final String TEXT_37 = NL;
- protected final String TEXT_38 = NL + "installEditPolicy(";
- protected final String TEXT_39 = ".LAYOUT_ROLE, new ";
- protected final String TEXT_40 = "());";
- protected final String TEXT_41 = NL;
- protected final String TEXT_42 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_43 = "\", new ";
- protected final String TEXT_44 = "()); //$NON-NLS-1$";
- protected final String TEXT_45 = NL + "\t\tinstallNotationModelRefresher();";
- protected final String TEXT_46 = NL + "\t\tinstallLinkNotationModelRefresher();";
- protected final String TEXT_47 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected IFigure createFigure() {" + NL + "\t\tIFigure f = new FreeformLayer();" + NL + "\t\tf.setBorder(new MarginBorder(5));" + NL + "\t\tf.setLayoutManager(new FreeformLayout());" + NL + "\t\treturn f;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
- protected final String TEXT_48 = ".class == key) {" + NL + "\t\t\treturn new ";
- protected final String TEXT_49 = "(this);" + NL + "\t\t}" + NL + "\t\tif (";
- protected final String TEXT_50 = ".class == key) {" + NL + "\t\t\treturn getTreeEditPartAdapter();" + NL + "\t\t}";
- protected final String TEXT_51 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter myTreeEditPartAdapter;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter getTreeEditPartAdapter() {" + NL + "\t\tif (myTreeEditPartAdapter == null) {" + NL + "\t\t\tmyTreeEditPartAdapter = new TreeEditPartAdapter();" + NL + "\t\t}" + NL + "\t\treturn myTreeEditPartAdapter;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn getDiagram().getVisibleChildren();" + NL + "\t}" + NL;
- protected final String TEXT_52 = NL;
- protected final String TEXT_53 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_54 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
- protected final String TEXT_55 = " feature, ";
- protected final String TEXT_56 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
- protected final String TEXT_57 = NL;
- protected final String TEXT_58 = "\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_59 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_60 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_61 = ".eINSTANCE.getView_Styles(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_62 = ".eINSTANCE.getDrawerStyle_Collapsed(), childrenRefresher);" + NL + "\t\t" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tif (!getDiagram().eAdapters().contains(getUpdateManager())) {" + NL + "\t\t\tgetDiagram().eAdapters().add(getUpdateManager());" + NL + "\t\t}" + NL + "\t\tif (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {" + NL + "\t\t\tgetDiagram().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t\t}" + NL + "\t\tinstallNotationModelRefresher();";
- protected final String TEXT_63 = NL + "\t\tinstallLinkNotationModelRefresher();";
- protected final String TEXT_64 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {";
- protected final String TEXT_65 = NL + "\t\tuninstallLinkNotationModelRefresher();";
- protected final String TEXT_66 = NL + "\t\tuninstallNotationModelRefresher();" + NL + "\t\tgetDiagram().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tgetDiagram().eAdapters().remove(getUpdateManager());" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
- protected final String TEXT_67 = NL;
- protected final String TEXT_68 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\t";
- protected final String TEXT_69 = " refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_70 = " domainModelEditDomain = ";
- protected final String TEXT_71 = ".getEditingDomain(";
- protected final String TEXT_72 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_73 = " notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_74 = " getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
- protected final String TEXT_75 = " {";
- protected final String TEXT_76 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
- protected final String TEXT_77 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_78 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_79 = ".NOT_TOUCH;" + NL + "\t\t}";
- protected final String TEXT_80 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_81 = " createFilter() {";
- protected final String TEXT_82 = NL + "\t\t\t";
- protected final String TEXT_83 = " filter = ";
- protected final String TEXT_84 = ".createFeatureFilter(";
- protected final String TEXT_85 = ".eINSTANCE.get";
- protected final String TEXT_86 = "());";
- protected final String TEXT_87 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_88 = ".createFeatureFilter(";
- protected final String TEXT_89 = ".eINSTANCE.get";
- protected final String TEXT_90 = "()));";
- protected final String TEXT_91 = NL + "\t\t\tfilter = filter.and(";
- protected final String TEXT_92 = ".createNotifierFilter(";
- protected final String TEXT_93 = ".getElement()));";
- protected final String TEXT_94 = NL + "\t\t\t";
- protected final String TEXT_95 = " filter = ";
- protected final String TEXT_96 = ".createNotifierFilter(";
- protected final String TEXT_97 = ".getElement());";
- protected final String TEXT_98 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
- protected final String TEXT_99 = NL + "\t\t\t";
- protected final String TEXT_100 = " filter = getConstrainedChildrenFilter();";
- protected final String TEXT_101 = NL + "\t\t\t";
- protected final String TEXT_102 = " filter = ";
- protected final String TEXT_103 = ".NOT_TOUCH;";
- protected final String TEXT_104 = NL + "\t\t\treturn filter;";
- protected final String TEXT_105 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_106 = " getCreateNotationalElementCommand(";
- protected final String TEXT_107 = " descriptor) {";
- protected final String TEXT_108 = NL;
- protected final String TEXT_109 = "\t\t\t";
- protected final String TEXT_110 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
- protected final String TEXT_111 = NL + "\t\t\tcase ";
- protected final String TEXT_112 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
- protected final String TEXT_113 = ") {" + NL + "\t\t\t\t\treturn new ";
- protected final String TEXT_114 = "(";
- protected final String TEXT_115 = ", domainElement, ";
- protected final String TEXT_116 = "new ";
- protected final String TEXT_117 = "(0, 0, ";
- protected final String TEXT_118 = ", ";
- protected final String TEXT_119 = ")";
- protected final String TEXT_120 = NL + "null";
- protected final String TEXT_121 = ", ";
- protected final String TEXT_122 = ".INSTANCE, false);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
- protected final String TEXT_123 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
- protected final String TEXT_124 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_125 = " getSemanticChildNodes() {";
- protected final String TEXT_126 = NL;
- protected final String TEXT_127 = NL + "\treturn ";
- protected final String TEXT_128 = ".EMPTY_LIST;";
- protected final String TEXT_129 = NL + "\t";
- protected final String TEXT_130 = " result = new ";
- protected final String TEXT_131 = "();";
- protected final String TEXT_132 = NL + "\t";
- protected final String TEXT_133 = " viewObject = ";
- protected final String TEXT_134 = ";" + NL + "\t";
- protected final String TEXT_135 = " modelObject = viewObject.getElement();" + NL + "\t";
- protected final String TEXT_136 = " nextValue;" + NL + "\tint nodeVID;";
- protected final String TEXT_137 = NL + "\tfor(";
- protected final String TEXT_138 = " it = ";
- protected final String TEXT_139 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_140 = ") it.next();";
- protected final String TEXT_141 = NL + "\tnextValue = (";
- protected final String TEXT_142 = ")";
- protected final String TEXT_143 = ";";
- protected final String TEXT_144 = NL + "\tnodeVID = ";
- protected final String TEXT_145 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
- protected final String TEXT_146 = NL + "\tswitch (nodeVID) {";
- protected final String TEXT_147 = NL + "\tcase ";
- protected final String TEXT_148 = ".VISUAL_ID: {";
- protected final String TEXT_149 = NL + "\tif (";
- protected final String TEXT_150 = ".VISUAL_ID == nodeVID) {";
- protected final String TEXT_151 = NL + "\t\tresult.add(new ";
- protected final String TEXT_152 = "(nextValue, nodeVID));";
- protected final String TEXT_153 = NL + "\t\tbreak;" + NL + "\t\t}";
- protected final String TEXT_154 = NL + "\t\t}";
- protected final String TEXT_155 = NL + "\t}";
- protected final String TEXT_156 = NL + "\t}";
- protected final String TEXT_157 = NL + "\treturn result;";
- protected final String TEXT_158 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t\t * The generated code always returns ";
- protected final String TEXT_159 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView(";
- protected final String TEXT_160 = " descriptor) {" + NL + "\t\t\treturn ";
- protected final String TEXT_161 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_162 = " getHost() {" + NL + "\t\t\treturn ";
- protected final String TEXT_163 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
- protected final String TEXT_164 = " childRefresher = getNotationModelRefresher();" + NL + "\t\tif (!childRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_165 = " command = childRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_166 = " domainModelEditDomain = ";
- protected final String TEXT_167 = ".getEditingDomain(";
- protected final String TEXT_168 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_169 = "(domainModelEditDomain, command));" + NL + "\t}" + NL + NL;
- protected final String TEXT_170 = NL;
- protected final String TEXT_171 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_172 = " domainModelEditDomain = ";
- protected final String TEXT_173 = ".getEditingDomain(";
- protected final String TEXT_174 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * Service to find a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_175 = " viewService;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_176 = " getViewService() {" + NL + "\t\tif (viewService == null) {" + NL + "\t\t\tviewService = new ";
- protected final String TEXT_177 = "(getViewer());" + NL + "\t\t}" + NL + "\t\treturn viewService;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher(getViewService());" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends ";
- protected final String TEXT_178 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher(";
- protected final String TEXT_179 = " viewService) {" + NL + "\t\t\tsuper(viewService);" + NL + "\t\t}";
- protected final String TEXT_180 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in ";
- protected final String TEXT_181 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_182 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_183 = ".NOT_TOUCH;" + NL + "\t\t}";
- protected final String TEXT_184 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_185 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_186 = ".createEventTypeFilter(";
- protected final String TEXT_187 = ".SET).or(" + NL + "\t\t\t\t";
- protected final String TEXT_188 = ".createEventTypeFilter(";
- protected final String TEXT_189 = ".UNSET).or(" + NL + "\t\t\t\t";
- protected final String TEXT_190 = ".createEventTypeFilter(";
- protected final String TEXT_191 = ".REMOVE).or(" + NL + "\t\t\t\t";
- protected final String TEXT_192 = ".createEventTypeFilter(";
- protected final String TEXT_193 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}";
- protected final String TEXT_194 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_195 = " createFilter() {";
- protected final String TEXT_196 = NL;
- protected final String TEXT_197 = NL + "\t\t\t";
- protected final String TEXT_198 = " filter = ";
- protected final String TEXT_199 = ".createFeatureFilter(";
- protected final String TEXT_200 = ".eINSTANCE.get";
- protected final String TEXT_201 = "());";
- protected final String TEXT_202 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_203 = ".createFeatureFilter(";
- protected final String TEXT_204 = ".eINSTANCE.get";
- protected final String TEXT_205 = "()));";
- protected final String TEXT_206 = NL;
- protected final String TEXT_207 = NL + "\t\t\t";
- protected final String TEXT_208 = " filter = ";
- protected final String TEXT_209 = ".createFeatureFilter(";
- protected final String TEXT_210 = ".eINSTANCE.get";
- protected final String TEXT_211 = "());";
- protected final String TEXT_212 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_213 = ".createFeatureFilter(";
- protected final String TEXT_214 = ".eINSTANCE.get";
- protected final String TEXT_215 = "()));";
- protected final String TEXT_216 = NL;
- protected final String TEXT_217 = NL + "\t\t\t";
- protected final String TEXT_218 = " filter = ";
- protected final String TEXT_219 = ".createFeatureFilter(";
- protected final String TEXT_220 = ".eINSTANCE.get";
- protected final String TEXT_221 = "());";
- protected final String TEXT_222 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_223 = ".createFeatureFilter(";
- protected final String TEXT_224 = ".eINSTANCE.get";
- protected final String TEXT_225 = "()));";
- protected final String TEXT_226 = NL;
- protected final String TEXT_227 = NL + "\t\t\t";
- protected final String TEXT_228 = " filter = ";
- protected final String TEXT_229 = ".createFeatureFilter(";
- protected final String TEXT_230 = ".eINSTANCE.get";
- protected final String TEXT_231 = "());";
- protected final String TEXT_232 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_233 = ".createFeatureFilter(";
- protected final String TEXT_234 = ".eINSTANCE.get";
- protected final String TEXT_235 = "()));";
- protected final String TEXT_236 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);";
- protected final String TEXT_237 = NL + "\t\t\t";
- protected final String TEXT_238 = " filter = getConstrainedChildLinksFilter();";
- protected final String TEXT_239 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());";
- protected final String TEXT_240 = NL + "\t\t\t";
- protected final String TEXT_241 = " filter = createUncontainedLinksFilter();";
- protected final String TEXT_242 = NL + "\t\t\t";
- protected final String TEXT_243 = " filter = ";
- protected final String TEXT_244 = ".NOT_TOUCH;";
- protected final String TEXT_245 = NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t \t * @generated" + NL + "\t \t */" + NL + "\t\tprotected ";
- protected final String TEXT_246 = " getCreateNotationalElementCommand(";
- protected final String TEXT_247 = " descriptor) {" + NL + "\t\t\t";
- protected final String TEXT_248 = " linkDescriptor = (";
- protected final String TEXT_249 = ") descriptor;";
- protected final String TEXT_250 = NL;
- protected final String TEXT_251 = "\t\t\t";
- protected final String TEXT_252 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t";
- protected final String TEXT_253 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t";
- protected final String TEXT_254 = " decorator = null;" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {";
- protected final String TEXT_255 = NL + "\t\t\tcase ";
- protected final String TEXT_256 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof ";
- protected final String TEXT_257 = ") {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_258 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_259 = NL + "\t\t\tcase ";
- protected final String TEXT_260 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_261 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_262 = NL + "\t\t\t}" + NL + "\t\t\tif (decorator == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new ";
- protected final String TEXT_263 = "(";
- protected final String TEXT_264 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);";
- protected final String TEXT_265 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_266 = " getSemanticChildLinks() {";
- protected final String TEXT_267 = NL;
- protected final String TEXT_268 = "\t";
- protected final String TEXT_269 = " result = new ";
- protected final String TEXT_270 = "();";
- protected final String TEXT_271 = NL + "\t";
- protected final String TEXT_272 = " modelObject = ";
- protected final String TEXT_273 = ".getElement();" + NL + "\t";
- protected final String TEXT_274 = " nextValue;";
- protected final String TEXT_275 = NL + "\tint linkVID;";
- protected final String TEXT_276 = NL + "\tfor(";
- protected final String TEXT_277 = " it = ";
- protected final String TEXT_278 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_279 = ") it.next();";
- protected final String TEXT_280 = NL + "\tnextValue = (";
- protected final String TEXT_281 = ")";
- protected final String TEXT_282 = ";";
- protected final String TEXT_283 = NL + "\tlinkVID = ";
- protected final String TEXT_284 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
- protected final String TEXT_285 = NL + "\tswitch (linkVID) {";
- protected final String TEXT_286 = NL + "\tcase ";
- protected final String TEXT_287 = ".VISUAL_ID: {";
- protected final String TEXT_288 = NL + "\tif (";
- protected final String TEXT_289 = ".VISUAL_ID == linkVID) {";
- protected final String TEXT_290 = NL + "\t\t";
- protected final String TEXT_291 = " source = (";
- protected final String TEXT_292 = ")";
- protected final String TEXT_293 = ";";
- protected final String TEXT_294 = NL + "\t\t";
- protected final String TEXT_295 = " source = ";
- protected final String TEXT_296 = ".getElement();";
- protected final String TEXT_297 = NL + "\t\t";
- protected final String TEXT_298 = " target = (";
- protected final String TEXT_299 = ")";
- protected final String TEXT_300 = ";";
- protected final String TEXT_301 = NL + "\t\t";
- protected final String TEXT_302 = " target = ";
- protected final String TEXT_303 = ".getElement();";
- protected final String TEXT_304 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new ";
- protected final String TEXT_305 = "(source, target, nextValue, linkVID));" + NL + "\t\t}";
- protected final String TEXT_306 = NL + "\t\tbreak;" + NL + "\t}";
- protected final String TEXT_307 = NL + "\t}";
- protected final String TEXT_308 = NL + "\t}";
- protected final String TEXT_309 = NL + "\t}";
- protected final String TEXT_310 = NL + "\tfor(";
- protected final String TEXT_311 = " it = ";
- protected final String TEXT_312 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_313 = ") it.next();";
- protected final String TEXT_314 = NL + "\tnextValue = (";
- protected final String TEXT_315 = ")";
- protected final String TEXT_316 = ";";
- protected final String TEXT_317 = NL + "\tif (nextValue != null) {";
- protected final String TEXT_318 = NL + "\t\tresult.add(new ";
- protected final String TEXT_319 = "(modelObject, nextValue, null, ";
- protected final String TEXT_320 = ".VISUAL_ID));";
- protected final String TEXT_321 = NL + "\t}";
- protected final String TEXT_322 = NL + "\t}";
- protected final String TEXT_323 = NL + "\treturn result;";
- protected final String TEXT_324 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_325 = " getNotationalChildLinks() {" + NL + "\t\t\t";
- protected final String TEXT_326 = " result = new ";
- protected final String TEXT_327 = "();" + NL + "\t\t\t";
- protected final String TEXT_328 = " allLinks = ";
- protected final String TEXT_329 = ".getEdges();" + NL + "\t\t\tfor(";
- protected final String TEXT_330 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t";
- protected final String TEXT_331 = " next = (";
- protected final String TEXT_332 = ") it.next();";
- protected final String TEXT_333 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
- protected final String TEXT_334 = " source = next.getSource();" + NL + "\t\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
- protected final String TEXT_335 = " target = next.getTarget();" + NL + "\t\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}";
- protected final String TEXT_336 = NL + "\t\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\t\tif (next.getSource() == ";
- protected final String TEXT_337 = ") {" + NL + "\t\t\t\t\t\tint linkVID = ";
- protected final String TEXT_338 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {";
- protected final String TEXT_339 = NL + "\t\t\t\t\t\tcase ";
- protected final String TEXT_340 = ".VISUAL_ID:";
- protected final String TEXT_341 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}";
- protected final String TEXT_342 = NL + "\t\t\t\t} else {";
- protected final String TEXT_343 = NL + "\t\t\t\t}";
- protected final String TEXT_344 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null) {";
- protected final String TEXT_345 = NL + "\t\t\t\t\tif (next.getElement().eContainer() == ";
- protected final String TEXT_346 = ".getElement()) {" + NL + "\t\t\t\t\t\tint linkVID = ";
- protected final String TEXT_347 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {";
- protected final String TEXT_348 = NL + "\t\t\t\t\t\tcase ";
- protected final String TEXT_349 = ".VISUAL_ID:";
- protected final String TEXT_350 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}";
- protected final String TEXT_351 = NL + "\t\t\t}" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t\t * The generated code always returns ";
- protected final String TEXT_352 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView(";
- protected final String TEXT_353 = " descriptor) {" + NL + "\t\t\treturn ";
- protected final String TEXT_354 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_355 = " getHost() {" + NL + "\t\t\treturn ";
- protected final String TEXT_356 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t";
- protected final String TEXT_357 = " linkRefresher = getLinkNotationModelRefresher();" + NL + "\t\tif (!linkRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_358 = " command = linkRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_359 = " domainModelEditDomain = ";
- protected final String TEXT_360 = ".getEditingDomain(";
- protected final String TEXT_361 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_362 = "(domainModelEditDomain, command));" + NL + "\t}";
- protected final String TEXT_363 = NL;
- protected final String TEXT_364 = NL;
- protected final String TEXT_365 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_366 = " domainModelRefresher = new ";
- protected final String TEXT_367 = "(this);" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_368 = " updateManager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_369 = " getUpdateManager() {" + NL + "\t\tif (updateManager == null) {" + NL + "\t\t\tupdateManager = new ";
- protected final String TEXT_370 = "(getViewer());" + NL + "\t\t}" + NL + "\t\treturn updateManager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class TreeEditPartAdapter extends ";
- protected final String TEXT_371 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic TreeEditPartAdapter() {" + NL + "\t\t\tsuper(getDiagram(), ";
- protected final String TEXT_372 = ".getInstance().getItemProvidersAdapterFactory());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void createEditPolicies() {" + NL + "\t\t\tinstallEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void activate() {" + NL + "\t\t\tsuper.activate();" + NL + "\t\t\tif (!getDiagram().eAdapters().contains(getTreeUpdateManager())) {" + NL + "\t\t\t\tgetDiagram().eAdapters().add(getTreeUpdateManager());" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void deactivate() {" + NL + "\t\t\tgetDiagram().eAdapters().remove(getTreeUpdateManager());" + NL + "\t\t\tsuper.deactivate();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_373 = " treeUpdateManager;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_374 = " getTreeUpdateManager() {" + NL + "\t\t\tif (treeUpdateManager == null) {" + NL + "\t\t\t\ttreeUpdateManager = new ";
- protected final String TEXT_375 = "(getViewer());" + NL + "\t\t\t}" + NL + "\t\t\treturn treeUpdateManager;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
- protected final String TEXT_376 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc
-importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc
-importManager.registerInnerClass("TreeEditPartAdapter");
-List childNodes = genDiagram.getTopLevelNodes();
-
- stringBuffer.append(TEXT_1);
- stringBuffer.append(TEXT_2);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_3);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_4);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_5);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_6);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_7);
-
- }
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_9);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_10);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_11);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_12);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_13);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_14);
-
- }
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_16);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_17);
-
-class DiagramEditPartHelper {
- private final List myContainedFeatureModelFacetLinks = new LinkedList();
- private final List myContainedTypeModelFacetLinks = new LinkedList();
- public DiagramEditPartHelper(GenDiagram diagram) {
- for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) {
- continue;
- }
- GenClass containerClass;
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
- //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
- containerClass = null;
- } else {
- containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
- }
- } else if (genLink.getModelFacet() instanceof FeatureLinkModelFacet) {
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- containerClass = metaFeature.getGenClass();
- } else {
- continue;
- }
- if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) {
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- myContainedTypeModelFacetLinks.add(genLink);
- } else {
- myContainedFeatureModelFacetLinks.add(genLink);
- }
- }
- }
- }
-
- public boolean containsLinks() {
- return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
- }
-
- public boolean containsFeatureModelFacetLinks() {
- return !myContainedFeatureModelFacetLinks.isEmpty();
- }
-
- public boolean containsTypeModelFacetLinks() {
- return !myContainedTypeModelFacetLinks.isEmpty();
- }
-
- public Iterator getContainedFeatureModelFacetLinks() {
- return myContainedFeatureModelFacetLinks.iterator();
- }
-
- public Iterator getContainedTypeModelFacetLinks() {
- return myContainedTypeModelFacetLinks.iterator();
- }
-}
-final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram);
-
- stringBuffer.append(TEXT_18);
-
-importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("org.eclipse.gef.editparts.AbstractGraphicalEditPart");
-importManager.addImport("org.eclipse.draw2d.IFigure");
-importManager.addImport("org.eclipse.draw2d.FreeformLayer");
-importManager.addImport("org.eclipse.draw2d.FreeformLayout");
-importManager.addImport("org.eclipse.draw2d.MarginBorder");
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.draw2d.geometry.Dimension");
-importManager.addImport("org.eclipse.draw2d.geometry.Point");
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.SnapToGrid");
-importManager.addImport("org.eclipse.gef.SnapToHelper");
-importManager.addImport("org.eclipse.gef.editpolicies.RootComponentEditPolicy");
-importManager.addImport("org.eclipse.gef.requests.ChangeBoundsRequest");
-importManager.addImport("org.eclipse.gef.requests.CreateRequest");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Bounds");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Diagram");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Node");
-importManager.addImport("org.eclipse.gmf.runtime.notation.NotationPackage");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("java.util.List");
-
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_19);
- stringBuffer.append(genDiagram.getEditPartClassName());
- stringBuffer.append(TEXT_20);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_21);
- stringBuffer.append(genDiagram.getEditorGen().getModelID());
- stringBuffer.append(TEXT_22);
- {
-GenCommonBase genCommonBase = genDiagram;
- stringBuffer.append(TEXT_23);
- stringBuffer.append(TEXT_24);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_25);
- }
- stringBuffer.append(TEXT_26);
- stringBuffer.append(genDiagram.getEditPartClassName());
- stringBuffer.append(TEXT_27);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_28);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_29);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_30);
- stringBuffer.append(TEXT_31);
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_35);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_36);
- {
-GenCommonBase genCommonBase = genDiagram;
- stringBuffer.append(TEXT_37);
-
-String layoutEditPolicyClassName = genCommonBase.getEditPartClassName();
-if (layoutEditPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- layoutEditPolicyClassName = layoutEditPolicyClassName.substring(0, layoutEditPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
-}
-layoutEditPolicyClassName = genDiagram.getEditPoliciesPackageName() + "." + layoutEditPolicyClassName + "LayoutEditPolicy";
-
- stringBuffer.append(TEXT_38);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName(layoutEditPolicyClassName));
- stringBuffer.append(TEXT_40);
- stringBuffer.append(TEXT_41);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_42);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_43);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_44);
- }
- }
- stringBuffer.append(TEXT_45);
-
-//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_46);
-
-//}
-
- stringBuffer.append(TEXT_47);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
- stringBuffer.append(TEXT_48);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
- stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.TreeEditPart"));
- stringBuffer.append(TEXT_50);
- /*@ include file="adapters/propertySource.javajetinc"*/
- stringBuffer.append(TEXT_51);
- stringBuffer.append(TEXT_52);
- stringBuffer.append(TEXT_53);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_56);
- stringBuffer.append(TEXT_57);
- stringBuffer.append(TEXT_58);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_61);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_62);
-
-//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_63);
-
-//}
-
- stringBuffer.append(TEXT_64);
-
-//link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_65);
-
-//}
-
- stringBuffer.append(TEXT_66);
-
-{
-String _getDiagramCode = "getDiagram()";
-String _getViewCode = "getDiagram()";
-boolean isListLayout = false;
-final boolean _includeUncontainedLinks = true;
-
- stringBuffer.append(TEXT_67);
- stringBuffer.append(TEXT_68);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_69);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_75);
-
-boolean hasConstraintsInChildren = false;
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
- hasConstraintsInChildren = true;
- break;
- }
-}
-
-
-if (hasConstraintsInChildren) {
-
- stringBuffer.append(TEXT_76);
- stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
- stringBuffer.append(TEXT_77);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_79);
-
-}
-
- stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_81);
-
-{
- boolean hasDeclaredFilter = false;
- Set genChildFeatures = new LinkedHashSet();
- for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (genChildFeatures.contains(childMetaFeature)) {
- continue;
- }
- genChildFeatures.add(childMetaFeature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_85);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_86);
-
- } else {
-
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_89);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_90);
-
- }
- } //for
-
-
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_92);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_93);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_96);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_97);
-
- }
-
-
- if (hasConstraintsInChildren) {
- if (hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_98);
-
- } else {
-
- stringBuffer.append(TEXT_99);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_100);
-
- }
- }
- if (!hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_101);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_103);
-
- }
-
- stringBuffer.append(TEXT_104);
-
-} //local declaration of hasDeclaredFilter
-
- stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_107);
-
-{
- String _parentNode = "getHost()";
-
- stringBuffer.append(TEXT_108);
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_110);
-
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
-
- stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_112);
- stringBuffer.append(childNodeInterfaceName);
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
- stringBuffer.append(TEXT_114);
- stringBuffer.append(_parentNode);
- stringBuffer.append(TEXT_115);
-
- if (!isListLayout) {
- int defaultWidth = 40;
- int defaultHeight = 40;
- DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class);
- if (defSizeAttrs != null) {
- defaultWidth = defSizeAttrs.getWidth();
- defaultHeight = defSizeAttrs.getHeight();
- }
-
- stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_117);
- stringBuffer.append(defaultWidth);
- stringBuffer.append(TEXT_118);
- stringBuffer.append(defaultHeight);
- stringBuffer.append(TEXT_119);
-
- } else {
-
- stringBuffer.append(TEXT_120);
-
- }
-
- stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_122);
-
-}
-
- stringBuffer.append(TEXT_123);
-
-}
-
- stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_125);
- stringBuffer.append(TEXT_126);
-
-if (childNodes.size() == 0) {
-
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_128);
-
-} else {
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_131);
-
- Map genFeature2genNodeMap = new LinkedHashMap();
- for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
- GenNode nextNode = (GenNode) childNodes.get(nodeIndex);
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (!genFeature2genNodeMap.containsKey(childMetaFeature)) {
- genFeature2genNodeMap.put(childMetaFeature, new ArrayList());
- }
- ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode);
- }
- Set entrySet = genFeature2genNodeMap.entrySet();
- if (entrySet.size() > 0) {
-
- stringBuffer.append(TEXT_132);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_133);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_134);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_135);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_136);
-
- }
- for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature childMetaFeature = (GenFeature) nextEntry.getKey();
- Collection genNodesCollection = (Collection) nextEntry.getValue();
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_138);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
- stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_140);
-
- } else {
-
- stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_142);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
- stringBuffer.append(TEXT_143);
-
- }
-
- stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_145);
-
- boolean generateSwitch = genNodesCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_146);
-
- }
- for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
- GenNode nextNode = (GenNode) genNodesIterator.next();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_147);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_148);
-
- } else {
-
- stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_150);
-
- }
-
- stringBuffer.append(TEXT_151);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_152);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_153);
-
- } else {
-
- stringBuffer.append(TEXT_154);
-
- }
- }
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_155);
-
- }
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_156);
-
- }
-}
-
- stringBuffer.append(TEXT_157);
-
-}
-
- stringBuffer.append(TEXT_158);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_160);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_161);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_162);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher"));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_166);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_167);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_168);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_169);
- stringBuffer.append(TEXT_170);
-
-if (myHelper.containsLinks() || _includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_171);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_172);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_173);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_176);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.EditPartRegistryBasedViewService"));
- stringBuffer.append(TEXT_177);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.OwnedLinksNotationModelRefresher"));
- stringBuffer.append(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_179);
-
- boolean hasConstraintsInContainedLinks = false;
- for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
- hasConstraintsInContainedLinks = true;
- break;
- }
- }
- if (hasConstraintsInContainedLinks) {
-
- stringBuffer.append(TEXT_180);
- stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
- stringBuffer.append(TEXT_181);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_182);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_183);
-
- }
- if (_includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_184);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_185);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_186);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_187);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_188);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_189);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_190);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_191);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_192);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_193);
-
- }
-
- stringBuffer.append(TEXT_194);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_195);
-
- {
- boolean hasDeclaredFilter = false;
- Set genAffectingFeatures = new LinkedHashSet();
- for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
- GenFeature _feature = modelFacet.getChildMetaFeature();
-
- stringBuffer.append(TEXT_196);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_198);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_199);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_200);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_201);
-
- } else {
-
- stringBuffer.append(TEXT_202);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_203);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_204);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_205);
-
- }
-
-
- _feature = modelFacet.getSourceMetaFeature();
-
- stringBuffer.append(TEXT_206);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_207);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_208);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_209);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_210);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_211);
-
- } else {
-
- stringBuffer.append(TEXT_212);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_213);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_214);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_215);
-
- }
-
-
- _feature = modelFacet.getTargetMetaFeature();
-
- stringBuffer.append(TEXT_216);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_217);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_218);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_219);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_220);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_221);
-
- } else {
-
- stringBuffer.append(TEXT_222);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_223);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_224);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_225);
-
- }
-
-
- }
- for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- GenFeature _feature = ((FeatureLinkModelFacet) nextLink.getModelFacet()).getMetaFeature();
-
- stringBuffer.append(TEXT_226);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_227);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_228);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_229);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_230);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_231);
-
- } else {
-
- stringBuffer.append(TEXT_232);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_233);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_234);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_235);
-
- }
-
-
- }
- if (hasConstraintsInContainedLinks) {
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_236);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_237);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_238);
-
- }
- }
- if (_includeUncontainedLinks) {
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_239);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_240);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_241);
-
- }
- }
- if (!hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_242);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_243);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_244);
-
- }
- } //local declaration of hasDeclaredFilter
-
- stringBuffer.append(TEXT_245);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_246);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_247);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_248);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_249);
-
-{
- Iterator _containedTypeModelFacetLinks = myHelper.getContainedTypeModelFacetLinks();
- Iterator _containedFeatureModelFacetLinks = myHelper.getContainedFeatureModelFacetLinks();
- String _diagramCode = "getHost().getDiagram()";
-
- stringBuffer.append(TEXT_250);
- stringBuffer.append(TEXT_251);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_252);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_253);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator"));
- stringBuffer.append(TEXT_254);
-
- for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
-
- stringBuffer.append(TEXT_255);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_256);
- stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_257);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_258);
-
- }
- for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_259);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_260);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_261);
-
- }
-
- stringBuffer.append(TEXT_262);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand"));
- stringBuffer.append(TEXT_263);
- stringBuffer.append(_diagramCode);
- stringBuffer.append(TEXT_264);
-
-}
-
- stringBuffer.append(TEXT_265);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_266);
-
-{
- Iterator _containedTypeModelFacetLinks = myHelper.getContainedTypeModelFacetLinks();
- Iterator _containedFeatureModelFacetLinks = myHelper.getContainedFeatureModelFacetLinks();
-
- stringBuffer.append(TEXT_267);
- stringBuffer.append(TEXT_268);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_269);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_270);
-
-Map genFeature2genLinkMap = new LinkedHashMap();
-for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- GenFeature metaFeature = modelFacet.getChildMetaFeature();
- if (!genFeature2genLinkMap.containsKey(metaFeature)) {
- genFeature2genLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
-}
-Map genFeature2featureGenLinkMap = new LinkedHashMap();
-for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
- genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
-}
-if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_271);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_272);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_273);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_274);
-
-}
-if (!genFeature2genLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_275);
-
-}
-for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_276);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_277);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_278);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_279);
-
- } else {
-
- stringBuffer.append(TEXT_280);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_281);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_282);
-
- }
-
- stringBuffer.append(TEXT_283);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_284);
-
- boolean generateSwitch = genLinksCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_285);
-
- }
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_286);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_287);
-
- } else {
-
- stringBuffer.append(TEXT_288);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_289);
-
- }
- if (modelFacet.getSourceMetaFeature() != null) {
-
- stringBuffer.append(TEXT_290);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_291);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_292);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);
- stringBuffer.append(TEXT_293);
-
- } else {
-
- stringBuffer.append(TEXT_294);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_295);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_296);
-
- }
- if (modelFacet.getTargetMetaFeature() != null) {
-
- stringBuffer.append(TEXT_297);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_298);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_299);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);
- stringBuffer.append(TEXT_300);
-
- } else {
-
- stringBuffer.append(TEXT_301);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_302);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_303);
-
- }
-
- stringBuffer.append(TEXT_304);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_305);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_306);
-
- } else {
-
- stringBuffer.append(TEXT_307);
-
- }
-
-
- } //iterate over genLinksCollection
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_308);
-
- }
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_309);
-
- }
-}
-for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_310);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_311);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_312);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_313);
-
- } else {
-
- stringBuffer.append(TEXT_314);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_315);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_316);
-
- }
-
- stringBuffer.append(TEXT_317);
-
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
-
- stringBuffer.append(TEXT_318);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_319);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_320);
-
- }
-
- stringBuffer.append(TEXT_321);
-
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_322);
-
- }
-}
-
- stringBuffer.append(TEXT_323);
-
-}
-
- stringBuffer.append(TEXT_324);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_325);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_326);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_327);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_328);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_329);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_330);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_331);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_332);
-
- if (_includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_333);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_334);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_335);
-
- }
- if (myHelper.containsFeatureModelFacetLinks()) {
-
- stringBuffer.append(TEXT_336);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_337);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_338);
-
- for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_339);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_340);
-
- }
-
- stringBuffer.append(TEXT_341);
-
- if (myHelper.containsTypeModelFacetLinks()) {
-
- stringBuffer.append(TEXT_342);
-
- } else {
-
- stringBuffer.append(TEXT_343);
-
- }
- }
- if (myHelper.containsTypeModelFacetLinks()) {
- if (!myHelper.containsFeatureModelFacetLinks()) {
-
- stringBuffer.append(TEXT_344);
-
- }
-
- stringBuffer.append(TEXT_345);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_346);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_347);
-
- for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_348);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_349);
-
- }
-
- stringBuffer.append(TEXT_350);
-
- }
-
- stringBuffer.append(TEXT_351);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_352);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_353);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_354);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_355);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_356);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher"));
- stringBuffer.append(TEXT_357);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_358);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_359);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_360);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_361);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_362);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_363);
- stringBuffer.append(TEXT_364);
- stringBuffer.append(TEXT_365);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_366);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_367);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_368);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_369);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_370);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart"));
- stringBuffer.append(TEXT_371);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
- stringBuffer.append(TEXT_372);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_373);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_374);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager"));
- stringBuffer.append(TEXT_375);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_376);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramExternalNodeLabelEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramExternalNodeLabelEditPartGenerator.java
deleted file mode 100644
index a4fc8b802..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/DiagramExternalNodeLabelEditPartGenerator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-
-public class DiagramExternalNodeLabelEditPartGenerator
-{
- protected static String nl;
- public static synchronized DiagramExternalNodeLabelEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- DiagramExternalNodeLabelEditPartGenerator result = new DiagramExternalNodeLabelEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL + NL + "import org.eclipse.draw2d.IFigure;" + NL + "import org.eclipse.draw2d.geometry.Point;" + NL + "import org.eclipse.gef.GraphicalEditPart;" + NL + "import org.eclipse.gmf.runtime.notation.View;";
- protected final String TEXT_5 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public abstract class ";
- protected final String TEXT_6 = " extends ";
- protected final String TEXT_7 = " {" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_8 = "(View view) {" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void refreshBounds() {" + NL + "\t\t";
- protected final String TEXT_9 = " node = (";
- protected final String TEXT_10 = ") getModel();" + NL + "\t\tif (node.getLayoutConstraint() == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
- protected final String TEXT_11 = ";" + NL + "\t\tfinal ";
- protected final String TEXT_12 = " location = (";
- protected final String TEXT_13 = ") node.getLayoutConstraint();" + NL + "\t\tgetFigure().getParent().setConstraint(getFigure(), new ";
- protected final String TEXT_14 = "() {" + NL + "\t\t\tprotected Point getReferencePoint() {" + NL + "\t\t\t\treturn getLabelLocation(((GraphicalEditPart) getParent()).getFigure()).translate(location.getX(), location.getY());" + NL + "\t\t\t}" + NL + "\t\t\tpublic int getRelativePosition() {" + NL + "\t\t\t\treturn ";
- protected final String TEXT_15 = ".SOUTH;" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_16 = ".Refresher boundsRefresher = new ";
- protected final String TEXT_17 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshBounds();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Point getReferencePoint() {" + NL + "\t\treturn getLabelLocation(((GraphicalEditPart) getParent()).getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected Point getLabelLocation(IFigure parent) {" + NL + "\t\tPoint result = parent.getBounds().getBottom();" + NL + "\t\tparent.translateToAbsolute(result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "}";
- protected final String TEXT_18 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
- importManager.emitPackageStatement(stringBuffer);
- stringBuffer.append(TEXT_4);
- importManager.markImportLocation(stringBuffer);
- stringBuffer.append(TEXT_5);
- stringBuffer.append(genDiagram.getBaseExternalNodeLabelEditPartClassName());
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart"));
- stringBuffer.append(TEXT_7);
- stringBuffer.append(genDiagram.getBaseExternalNodeLabelEditPartClassName());
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_9);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_10);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location"));
- stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location"));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location"));
- stringBuffer.append(TEXT_13);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.AbstractLocator"));
- stringBuffer.append(TEXT_14);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_16);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_17);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_18);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java
deleted file mode 100644
index 15008b751..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkEditPartGenerator.java
+++ /dev/null
@@ -1,640 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.emf.ecore.*;
-import java.util.*;
-
-public class LinkEditPartGenerator
-{
- protected static String nl;
- public static synchronized LinkEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- LinkEditPartGenerator result = new LinkEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_5 = " extends ";
- protected final String TEXT_6 = " implements ";
- protected final String TEXT_7 = ", ";
- protected final String TEXT_8 = ", ";
- protected final String TEXT_9 = " {";
- protected final String TEXT_10 = NL;
- protected final String TEXT_11 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_12 = ";";
- protected final String TEXT_13 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_14 = " myDecorationManager;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_15 = "(";
- protected final String TEXT_16 = " view) {" + NL + "\t\tassert view instanceof ";
- protected final String TEXT_17 = ";" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_18 = " getDiagramEdge() {" + NL + "\t\treturn (";
- protected final String TEXT_19 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_20 = " getDecorationManager() {" + NL + "\t\treturn myDecorationManager;" + NL + "\t}" + NL;
- protected final String TEXT_21 = NL;
- protected final String TEXT_22 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
- protected final String TEXT_23 = " view = (";
- protected final String TEXT_24 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
- protected final String TEXT_25 = " view = (";
- protected final String TEXT_26 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}";
- protected final String TEXT_27 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_28 = NL;
- protected final String TEXT_29 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_30 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_31 = "());";
- protected final String TEXT_32 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_33 = ".CONNECTION_ENDPOINTS_ROLE, new ";
- protected final String TEXT_34 = "());" + NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_35 = ".CONNECTION_BENDPOINTS_ROLE, new ";
- protected final String TEXT_36 = "());";
- protected final String TEXT_37 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_38 = ".DIRECT_EDIT_ROLE, new ";
- protected final String TEXT_39 = "());";
- protected final String TEXT_40 = NL;
- protected final String TEXT_41 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_42 = "\", new ";
- protected final String TEXT_43 = "()); //$NON-NLS-1$";
- protected final String TEXT_44 = NL;
- protected final String TEXT_45 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_46 = ".OPEN_ROLE";
- protected final String TEXT_47 = " + \"";
- protected final String TEXT_48 = "\" ";
- protected final String TEXT_49 = ", new ";
- protected final String TEXT_50 = "());";
- protected final String TEXT_51 = NL + "\t}" + NL;
- protected final String TEXT_52 = 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_53 = " getPrimaryLabelEditPart() {" + NL + "\t\tfor(";
- protected final String TEXT_54 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t";
- protected final String TEXT_55 = " nextChild = (";
- protected final String TEXT_56 = ")it.next();" + NL + "\t\t\tif (";
- protected final String TEXT_57 = ".getVisualID(nextChild) == ";
- protected final String TEXT_58 = ".VISUAL_ID) {" + NL + "\t\t\t\treturn (EditPart) getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
- protected final String TEXT_59 = " req) {" + NL + "\t\tif (";
- protected final String TEXT_60 = ".REQ_DIRECT_EDIT.equals(req.getType())) {" + NL + "\t\t\t";
- protected final String TEXT_61 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
- protected final String TEXT_62 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
- protected final String TEXT_63 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_64 = NL;
- protected final String TEXT_65 = "if (";
- protected final String TEXT_66 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_67 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_68 = " getLabelEditPart(";
- protected final String TEXT_69 = " req) {" + NL + "\t\t";
- protected final String TEXT_70 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
- protected final String TEXT_71 = " view = (";
- protected final String TEXT_72 = ") result.getModel();" + NL + "\t\t\tif (getDiagramEdge().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
- protected final String TEXT_73 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
- protected final String TEXT_74 = NL + "\t\t\t\tcase ";
- protected final String TEXT_75 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
- protected final String TEXT_76 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
- protected final String TEXT_77 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected List getModelChildren() {" + NL + "\t\treturn ((Edge)getModel()).getChildren();" + NL + "\t}" + NL;
- protected final String TEXT_78 = NL;
- protected final String TEXT_79 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_80 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
- protected final String TEXT_81 = " feature, ";
- protected final String TEXT_82 = " msg) {" + NL + "\t\tif (structuralFeatures2Refresher == null) {" + NL + "\t\t\tcreateRefreshers();" + NL + "\t\t}" + NL + "\t\treturn (Refresher) structuralFeatures2Refresher.get(feature);" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {" + NL + "\t\tif (";
- protected final String TEXT_83 = ".class == key) {" + NL + "\t\t\treturn getTreeEditPartAdapter();" + NL + "\t\t}" + NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter myTreeEditPartAdapter;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter getTreeEditPartAdapter() {" + NL + "\t\tif (myTreeEditPartAdapter == null) {" + NL + "\t\t\tmyTreeEditPartAdapter = new TreeEditPartAdapter();" + NL + "\t\t}" + NL + "\t\treturn myTreeEditPartAdapter;" + NL + "\t}" + NL;
- protected final String TEXT_84 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().add(domainModelRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tgetDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}" + NL;
- protected final String TEXT_85 = NL;
- protected final String TEXT_86 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_87 = " domainModelRefresher = new ";
- protected final String TEXT_88 = "(this);" + NL;
- protected final String TEXT_89 = NL;
- protected final String TEXT_90 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
- protected final String TEXT_91 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
- protected final String TEXT_92 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
- protected final String TEXT_93 = " 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}";
- protected final String TEXT_94 = NL;
- protected final String TEXT_95 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_96 = " externalRefreshers = new ";
- protected final String TEXT_97 = "();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_98 = " getExternalRefreshers() {" + NL + "\t\treturn externalRefreshers;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addExternalRefresher(";
- protected final String TEXT_99 = ".ExternalRefresher externalRefresher) {" + NL + "\t\tif (externalRefresher != null && !externalRefreshers.contains(externalRefresher)) {" + NL + "\t\t\texternalRefreshers.add(externalRefresher);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeExternalRefresher(";
- protected final String TEXT_100 = ".ExternalRefresher externalRefresher) {" + NL + "\t\texternalRefreshers.remove(externalRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void createRefreshers() {" + NL + "\t\tstructuralFeatures2Refresher = new HashMap();";
- protected final String TEXT_101 = NL;
- protected final String TEXT_102 = "\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_103 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_104 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_105 = ".eINSTANCE.getView_Styles(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_106 = ".eINSTANCE.getDrawerStyle_Collapsed(), childrenRefresher);" + NL + "\t\t";
- protected final String TEXT_107 = NL;
- protected final String TEXT_108 = "\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_109 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
- protected final String TEXT_110 = NL;
- protected final String TEXT_111 = "\t\tRefresher bendpointsRefresher = new Refresher() {" + NL + "\t\t\tpublic void refresh() {" + NL + "\t\t\t\trefreshBendpoints();" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_112 = ".eINSTANCE.getEdge_Bendpoints(), bendpointsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_113 = ".eINSTANCE.getRelativeBendpoints_Points(), bendpointsRefresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "//XXX:\t\trefreshBackgroundColor();" + NL + "//XXX:\t\trefreshForegroundColor();" + NL + "//XXX:\t\trefreshFont();" + NL + "\t\trefreshVisibility();" + NL + "\t\trefreshBendpoints();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBendpoints() {" + NL + "\t\t";
- protected final String TEXT_114 = " bendpoints = (";
- protected final String TEXT_115 = ") getDiagramEdge().getBendpoints();" + NL + "\t\tif (bendpoints == null) {" + NL + "\t\t\tgetConnectionFigure().setRoutingConstraint(";
- protected final String TEXT_116 = ".EMPTY_LIST);" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_117 = " modelConstraint = bendpoints.getPoints();" + NL + "\t\t";
- protected final String TEXT_118 = " figureConstraint = new ";
- protected final String TEXT_119 = "();" + NL + "\t\tfor (int i = 0; i < modelConstraint.size(); i++) {" + NL + "\t\t\t";
- protected final String TEXT_120 = " wbp = (";
- protected final String TEXT_121 = ") modelConstraint.get(i);" + NL + "\t\t\t";
- protected final String TEXT_122 = " rbp = new ";
- protected final String TEXT_123 = "(getConnectionFigure());" + NL + "\t\t\trbp.setRelativeDimensions(new ";
- protected final String TEXT_124 = "(wbp.getSourceX(), wbp.getSourceY()), new ";
- protected final String TEXT_125 = "(wbp.getTargetX(), wbp.getTargetY()));" + NL + "\t\t\trbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));" + NL + "\t\t\tfigureConstraint.add(rbp);" + NL + "\t\t}" + NL + "\t\tgetConnectionFigure().setRoutingConstraint(figureConstraint);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisibility() {" + NL + "\t\tboolean isVisible = ((View)getModel()).isVisible();" + NL + "\t\tboolean wasVisible = getFigure().isVisible();" + NL + "\t\tif (isVisible == wasVisible) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tif (!isVisible && (getSelected() != SELECTED_NONE)) {" + NL + "\t\t\tgetViewer().deselect(this);" + NL + "\t\t}" + NL + "" + NL + "\t\tgetFigure().setVisible(isVisible);" + NL + "\t\tgetFigure().revalidate();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addNotify() {" + NL + "\t\tsuper.addNotify();" + NL + "\t\tgetConnectionFigure().setConnectionRouter(new ";
- protected final String TEXT_126 = "());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_127 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_128 = " result = primCreateFigure();" + NL + "\t\tmyDecorationManager = createDecorationManager(result);" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_129 = " createDecorationManager(";
- protected final String TEXT_130 = " connection) {" + NL + "\t\treturn new ";
- protected final String TEXT_131 = "(connection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Creates figure for this edit part." + NL + "\t * " + NL + "\t * Body of this method does not depend on settings in generation model" + NL + "\t * so you may safely remove <i>generated</i> tag and modify it." + NL + "\t * " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_132 = " primCreateFigure() {";
- protected final String TEXT_133 = NL + "\t\treturn new ";
- protected final String TEXT_134 = "();";
- protected final String TEXT_135 = NL + "\t\treturn ";
- protected final String TEXT_136 = ";";
- protected final String TEXT_137 = NL + " \t\treturn new ";
- protected final String TEXT_138 = "();";
- protected final String TEXT_139 = NL + "\t}" + NL;
- protected final String TEXT_140 = NL;
- protected final String TEXT_141 = NL;
- protected final String TEXT_142 = 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_143 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class TreeEditPartAdapter extends ";
- protected final String TEXT_144 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic TreeEditPartAdapter() {" + NL + "\t\t\tsuper(getDiagramEdge(), ";
- protected final String TEXT_145 = ".getInstance().getItemProvidersAdapterFactory());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void createEditPolicies() {";
- protected final String TEXT_146 = NL;
- protected final String TEXT_147 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_148 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_149 = "()";
- protected final String TEXT_150 = " {" + NL + "\t\t\tprotected ";
- protected final String TEXT_151 = " getGraphicalEditPart() {" + NL + "\t\t\t\treturn ";
- protected final String TEXT_152 = ".this;" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_153 = ");";
- protected final String TEXT_154 = NL;
- protected final String TEXT_155 = "\t\tinstallEditPolicy(";
- protected final String TEXT_156 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_157 = "());";
- protected final String TEXT_158 = NL + "\t\t}" + NL;
- protected final String TEXT_159 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_160 = " createLabelTextDisplayer() {" + NL + "\t\t\t";
- protected final String TEXT_161 = " primaryLabelEditPart = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabelEditPart != null) {" + NL + "\t\t\t\treturn primaryLabelEditPart.getLabelTextDisplayer();" + NL + "\t\t\t}" + NL + "\t\t\treturn super.createLabelTextDisplayer();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_162 = " getImage() {" + NL + "\t\t\t";
- protected final String TEXT_163 = " primaryLabelEditPart = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabelEditPart != null) {" + NL + "\t\t\t\treturn primaryLabelEditPart.getLabelIcon();" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_164 = " getPrimaryLabelEditPart() {" + NL + "\t\t\tfor(";
- protected final String TEXT_165 = " it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t";
- protected final String TEXT_166 = " nextChild = (";
- protected final String TEXT_167 = ")it.next();" + NL + "\t\t\t\tif (";
- protected final String TEXT_168 = ".getVisualID(nextChild) == ";
- protected final String TEXT_169 = ".VISUAL_ID) {" + NL + "\t\t\t\t\treturn (";
- protected final String TEXT_170 = ") ";
- protected final String TEXT_171 = ".this.getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
- protected final String TEXT_172 = NL + NL + "\t\t/**" + NL + "\t\t * Since labels are not selectable edit parts, they are filtered from the overview as well." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_173 = " getModelChildren() {" + NL + "\t\t\treturn ";
- protected final String TEXT_174 = ".EMPTY_LIST;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
- protected final String TEXT_175 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-GenLink genLink = (GenLink) ((Object[]) argument)[0];
-final GenCommonBase genElement = genLink;
-GenDiagram genDiagram = genLink.getDiagram();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("TreeEditPartAdapter");
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
-
-importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("java.util.List");
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_4);
- stringBuffer.append(genLink.getEditPartClassName());
- stringBuffer.append(TEXT_5);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractConnectionEditPart"));
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_7);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecoratableEditPart"));
- stringBuffer.append(TEXT_9);
- {
-GenCommonBase genCommonBase = genLink;
- stringBuffer.append(TEXT_10);
- stringBuffer.append(TEXT_11);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_12);
- }
- stringBuffer.append(TEXT_13);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_14);
- stringBuffer.append(genLink.getEditPartClassName());
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_16);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_17);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_18);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_19);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_20);
- stringBuffer.append(TEXT_21);
- stringBuffer.append(TEXT_22);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_24);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_25);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_26);
-
-GenLinkLabel primaryLabel = null;
-for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
- GenLinkLabel next = (GenLinkLabel)it.next();
- if (!next.isReadOnly()) {
- primaryLabel = next;
- break;
- }
-}
-
- stringBuffer.append(TEXT_27);
- stringBuffer.append(TEXT_28);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_29);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_30);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_31);
-
-}
-
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_35);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.BendpointEditPolicy"));
- stringBuffer.append(TEXT_36);
-
-if (primaryLabel != null) {
-
- stringBuffer.append(TEXT_37);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_38);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.DelegatingDirectEditPolicy"));
- stringBuffer.append(TEXT_39);
-
-}
-
- {
-GenCommonBase genCommonBase = genLink;
- stringBuffer.append(TEXT_40);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_41);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_42);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_43);
- }
- stringBuffer.append(TEXT_44);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_45);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_46);
- if (i > 0) {
- stringBuffer.append(TEXT_47);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_48);
- }
- stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_50);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_51);
-
-if (primaryLabel != null) {
-
- stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_53);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_57);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_58);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_61);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_62);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_63);
- stringBuffer.append(TEXT_64);
- stringBuffer.append(TEXT_65);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_66);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_67);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_68);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_69);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_73);
-
- for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
- GenLinkLabel genLabel = (GenLinkLabel) it.next();
- if (genLabel.isReadOnly()) {
- continue;
- }
-
- stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_75);
-
- }
-
- stringBuffer.append(TEXT_76);
-
-} //if (primaryLabel != null, i.e., there are editable labels)
-
- stringBuffer.append(TEXT_77);
- stringBuffer.append(TEXT_78);
- stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_82);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.TreeEditPart"));
- stringBuffer.append(TEXT_83);
-
-if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- //Otherwise, there's no element associated with the element
-
- stringBuffer.append(TEXT_84);
- stringBuffer.append(TEXT_85);
- stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_88);
-
-}
-
- stringBuffer.append(TEXT_89);
- stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_93);
- stringBuffer.append(TEXT_94);
- stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
- stringBuffer.append(TEXT_97);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_99);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_100);
- stringBuffer.append(TEXT_101);
- stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_103);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_104);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_106);
- stringBuffer.append(TEXT_107);
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(TEXT_110);
- stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint"));
- stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint"));
- stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
- stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension"));
- stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter"));
- stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
- stringBuffer.append(TEXT_128);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
- stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.ConnectionDecorationManager"));
- stringBuffer.append(TEXT_131);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
- stringBuffer.append(TEXT_132);
-
-Viewmap viewmap = genLink.getViewmap();
-if (viewmap instanceof FigureViewmap) {
- String figureQualifiedClassName = null;
- figureQualifiedClassName = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassName == null || figureQualifiedClassName.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
- }
-
- stringBuffer.append(TEXT_133);
- stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
- stringBuffer.append(TEXT_134);
- } // instanceof FigureViewmap
- else if (viewmap instanceof SnippetViewmap) {
- stringBuffer.append(TEXT_135);
- stringBuffer.append(((SnippetViewmap) viewmap).getBody());
- stringBuffer.append(TEXT_136);
- } // instanceof SnippetViewmap
- else if (viewmap instanceof InnerClassViewmap) {
- stringBuffer.append(TEXT_137);
- stringBuffer.append(((InnerClassViewmap) viewmap).getClassName());
- stringBuffer.append(TEXT_138);
- }
- stringBuffer.append(TEXT_139);
-
-if (genLink.getViewmap() instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
-
- stringBuffer.append(TEXT_140);
- stringBuffer.append(classBody);
- stringBuffer.append(TEXT_141);
-
-if (classBody.indexOf("DPtoLP") != -1) {
-
- stringBuffer.append(TEXT_142);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_143);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart"));
- stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
- stringBuffer.append(TEXT_145);
- stringBuffer.append(TEXT_146);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_147);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_149);
-
- if (genElement instanceof GenNode) {
- stringBuffer.append(TEXT_150);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_151);
- stringBuffer.append(genElement.getEditPartClassName());
- stringBuffer.append(TEXT_152);
- }
- stringBuffer.append(TEXT_153);
-
-}
-
-
-if (primaryLabel != null && genLink.getModelFacet() instanceof TypeLinkModelFacet) {
-
- stringBuffer.append(TEXT_154);
- stringBuffer.append(TEXT_155);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_156);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_157);
-
-}
-
- stringBuffer.append(TEXT_158);
-
-if (primaryLabel != null) {
-
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_160);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_161);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_162);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_166);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_167);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_168);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_169);
- stringBuffer.append(importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_170);
- stringBuffer.append(genLink.getEditPartClassName());
- stringBuffer.append(TEXT_171);
-
-}
-
- stringBuffer.append(TEXT_172);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_174);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_175);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java
deleted file mode 100644
index 4acc64ef6..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/LinkLabelEditPartGenerator.java
+++ /dev/null
@@ -1,901 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import java.util.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.emf.ecore.*;
-
-public class LinkLabelEditPartGenerator
-{
- protected static String nl;
- public static synchronized LinkLabelEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- LinkLabelEditPartGenerator result = new LinkLabelEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL;
- protected final String TEXT_5 = NL;
- protected final String TEXT_6 = "((";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = "((";
- protected final String TEXT_9 = ")";
- protected final String TEXT_10 = ")";
- protected final String TEXT_11 = ".eGet(";
- protected final String TEXT_12 = ".eINSTANCE.get";
- protected final String TEXT_13 = "())";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = "((";
- protected final String TEXT_16 = ")";
- protected final String TEXT_17 = ")";
- protected final String TEXT_18 = ".";
- protected final String TEXT_19 = "()";
- protected final String TEXT_20 = NL;
- protected final String TEXT_21 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_22 = " extends ";
- protected final String TEXT_23 = " implements ";
- protected final String TEXT_24 = " {";
- protected final String TEXT_25 = NL;
- protected final String TEXT_26 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_27 = ";";
- protected final String TEXT_28 = NL;
- protected final String TEXT_29 = NL;
- protected final String TEXT_30 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_31 = " manager;" + NL;
- protected final String TEXT_32 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
- protected final String TEXT_33 = " LABEL_DISPLAYER = createLabelTextDisplayer();" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_34 = "(View view) {" + NL + "\t\tassert view instanceof Node;" + NL + "\t\tsetModel(view);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Node getDiagramNode() {" + NL + "\t\treturn (Node)getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_35 = NL + "\t\tinstallEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE, new ";
- protected final String TEXT_36 = "() {" + NL + "\t\t\tpublic EditPart getHost() {" + NL + "\t\t\t\treturn getUpdatableParent();" + NL + "\t\t\t}" + NL + "\t\t});";
- protected final String TEXT_37 = NL;
- protected final String TEXT_38 = "\t\tinstallEditPolicy(";
- protected final String TEXT_39 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_40 = "());";
- protected final String TEXT_41 = NL;
- protected final String TEXT_42 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_43 = "\", new ";
- protected final String TEXT_44 = "()); //$NON-NLS-1$";
- protected final String TEXT_45 = NL;
- protected final String TEXT_46 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_47 = ".OPEN_ROLE";
- protected final String TEXT_48 = " + \"";
- protected final String TEXT_49 = "\" ";
- protected final String TEXT_50 = ", new ";
- protected final String TEXT_51 = "());";
- protected final String TEXT_52 = NL + "\t}" + NL;
- protected final String TEXT_53 = NL;
- protected final String TEXT_54 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
- protected final String TEXT_55 = " req) {";
- protected final String TEXT_56 = NL + "\t\tif (";
- protected final String TEXT_57 = ".REQ_DIRECT_EDIT.equals(req.getType()) && understandsRequest(req)) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_58 = NL;
- protected final String TEXT_59 = "if (";
- protected final String TEXT_60 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_61 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}";
- protected final String TEXT_62 = NL;
- protected final String TEXT_63 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_64 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
- protected final String TEXT_65 = "(this, ";
- protected final String TEXT_66 = ".class, new ";
- protected final String TEXT_67 = "(getViewer(), getLabel())) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelTextDisplayer().getEditText(";
- protected final String TEXT_68 = ".getElement()));" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tif (";
- protected final String TEXT_69 = ".isReadOnly(";
- protected final String TEXT_70 = ".getElement()) || ";
- protected final String TEXT_71 = ".isReadOnly(";
- protected final String TEXT_72 = ")) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL;
- protected final String TEXT_73 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t\trefreshBounds();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBounds() {" + NL + "\t\tNode node = getDiagramNode();" + NL + "\t\tassert node.getLayoutConstraint() instanceof Location;" + NL + "\t\tfinal Location location = (Location) node.getLayoutConstraint();" + NL + "\t\t";
- protected final String TEXT_74 = " parent = getUpdatableParent();" + NL + "\t\t";
- protected final String TEXT_75 = " connection = (";
- protected final String TEXT_76 = ") parent.getFigure();";
- protected final String TEXT_77 = NL + "\t\t((";
- protected final String TEXT_78 = ") getParent()).setLayoutConstraint(this," + NL + "\t\t\t\tgetFigure(), new ";
- protected final String TEXT_79 = "(connection, ";
- protected final String TEXT_80 = ".";
- protected final String TEXT_81 = ") {" + NL + "\t\t\t\t\tprotected ";
- protected final String TEXT_82 = " getReferencePoint() {" + NL + "\t\t\t\t\t\treturn super.getReferencePoint().translate(location.getX(), location.getY());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t});" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL;
- protected final String TEXT_83 = NL;
- protected final String TEXT_84 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static ";
- protected final String TEXT_85 = " createLabelTextDisplayer() {";
- protected final String TEXT_86 = NL + "\t\treturn new ";
- protected final String TEXT_87 = "(\"";
- protected final String TEXT_88 = "\"";
- protected final String TEXT_89 = ", \"";
- protected final String TEXT_90 = "\"";
- protected final String TEXT_91 = ", " + NL + "\t\t\tnew ";
- protected final String TEXT_92 = "[] {";
- protected final String TEXT_93 = NL + "\t\t";
- protected final String TEXT_94 = ".eINSTANCE.get";
- protected final String TEXT_95 = "()";
- protected final String TEXT_96 = ",";
- protected final String TEXT_97 = "});";
- protected final String TEXT_98 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\treturn null;";
- protected final String TEXT_99 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_100 = " getLabelTextDisplayer() {" + NL + "\t\treturn LABEL_DISPLAYER;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabelText(String text) {" + NL + "\t\tgetLabel().setText(text);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
- protected final String TEXT_101 = " element = ";
- protected final String TEXT_102 = ".getElement();" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\tString result = getLabelTextDisplayer().getDisplayText(element);" + NL + "\t\tif (result == null || result.length() == 0) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}";
- protected final String TEXT_103 = NL;
- protected final String TEXT_104 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
- protected final String TEXT_105 = NL + "\t\t";
- protected final String TEXT_106 = " style =" + NL + "\t\t\t(";
- protected final String TEXT_107 = ") ";
- protected final String TEXT_108 = ".getStyle(" + NL + "\t\t\t\t";
- protected final String TEXT_109 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_110 = " 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_111 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_112 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_113 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
- protected final String TEXT_114 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
- protected final String TEXT_115 = " 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_116 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
- protected final String TEXT_117 = "\t" + NL + "\t}";
- protected final String TEXT_118 = 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_119 = " createdFont;";
- protected final String TEXT_120 = "\t";
- protected final String TEXT_121 = NL;
- protected final String TEXT_122 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
- protected final String TEXT_123 = " style = (";
- protected final String TEXT_124 = ") ";
- protected final String TEXT_125 = ".getStyle(";
- protected final String TEXT_126 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_127 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
- protected final String TEXT_128 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new ";
- protected final String TEXT_129 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_130 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_131 = " getLabelIcon() {";
- protected final String TEXT_132 = NL + "\t\t";
- protected final String TEXT_133 = " semanticElement = ";
- protected final String TEXT_134 = "(";
- protected final String TEXT_135 = ") ";
- protected final String TEXT_136 = "resolveSemanticElement();" + NL + "\t\tif (semanticElement != null) {" + NL + "\t\t\treturn ";
- protected final String TEXT_137 = ".getImage(semanticElement.eClass());" + NL + "\t\t}";
- protected final String TEXT_138 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_139 = " resolveSemanticElement() {" + NL + "\t\t";
- protected final String TEXT_140 = " parent = getUpdatableParent();" + NL + "\t\tif (parent == null || parent.getModel() instanceof ";
- protected final String TEXT_141 = " == false) {" + NL + "\t\t\treturn null;" + NL + "\t\t}";
- protected final String TEXT_142 = NL + "\t\t";
- protected final String TEXT_143 = " view = (";
- protected final String TEXT_144 = ") parent.getModel();" + NL + "\t\treturn (";
- protected final String TEXT_145 = ") view.getElement();";
- protected final String TEXT_146 = NL + "\t\t";
- protected final String TEXT_147 = " target = ((";
- protected final String TEXT_148 = ") parent.getModel()).getTarget();" + NL + "\t\treturn (target != null && target.getElement() instanceof ";
- protected final String TEXT_149 = ") ? (";
- protected final String TEXT_150 = ") target.getElement() : null;";
- protected final String TEXT_151 = NL + "\t\treturn null;";
- protected final String TEXT_152 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_153 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
- protected final String TEXT_154 = ") {" + NL + "\t\t\t\treturn (";
- protected final String TEXT_155 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
- protected final String TEXT_156 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_157 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_158 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_159 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_160 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_161 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t\tupdatableParent.addExternalRefresher(getLabelRefresher());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
- protected final String TEXT_162 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_163 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_164 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_165 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_166 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_167 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeExternalRefresher(getLabelRefresher());" + NL + "\t\t}" + NL + "\t}" + NL;
- protected final String TEXT_168 = NL;
- protected final String TEXT_169 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_170 = ".ExternalRefresher labelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_171 = ".ExternalRefresher getLabelRefresher() {" + NL + "\t\tif (labelRefresher == null && getDiagramNode() != null) {" + NL + "\t\t\tlabelRefresher = new ";
- protected final String TEXT_172 = ".ExternalRefresherAdapter(this, getDiagramNode().getElement());" + NL + "\t\t}" + NL + "\t\treturn labelRefresher;" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_173 = ".Refresher fontColorRefresher = new ";
- protected final String TEXT_174 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_175 = ".Refresher fontRefresher = new ";
- protected final String TEXT_176 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};" + NL;
- protected final String TEXT_177 = NL;
- protected final String TEXT_178 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_179 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
- protected final String TEXT_180 = " method" + NL + "\t\treturn null;" + NL + "\t}";
- protected final String TEXT_181 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_182 = " createLabel() {";
- protected final String TEXT_183 = NL + "\t\treturn new ";
- protected final String TEXT_184 = "();";
- protected final String TEXT_185 = NL + "\t\treturn ";
- protected final String TEXT_186 = ";";
- protected final String TEXT_187 = NL + "\t\treturn new ";
- protected final String TEXT_188 = "();";
- protected final String TEXT_189 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_190 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_191 = " label = createLabel();";
- protected final String TEXT_192 = NL + "\t\tdefaultText = label.getText();";
- protected final String TEXT_193 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_194 = NL + "\t\treturn label;" + NL + "\t}";
- protected final String TEXT_195 = NL + NL + "\t/**";
- protected final String TEXT_196 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
- protected final String TEXT_197 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_198 = " getLabel() {" + NL + "\t\treturn (";
- protected final String TEXT_199 = ") getFigure();" + NL + "\t}" + NL;
- protected final String TEXT_200 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
- protected final String TEXT_201 = "(";
- protected final String TEXT_202 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
- protected final String TEXT_203 = NL + "\t\tdefaultText = figure.getText();";
- protected final String TEXT_204 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_205 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
- protected final String TEXT_206 = NL;
- protected final String TEXT_207 = NL;
- protected final String TEXT_208 = 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_209 = NL + "}";
- protected final String TEXT_210 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];
-final GenLinkLabel genLabel = (GenLinkLabel)genElement;
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-GenLink genHost = genLabel.getLink();
-GenDiagram genDiagram = genLabel.getDiagram();
-LabelModelFacet labelModelFacet = genLabel.getModelFacet();
-GenClass underlyingMetaClass;
-if (genHost.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet typeLinkModelFacet = (TypeLinkModelFacet) genHost.getModelFacet();
- underlyingMetaClass = typeLinkModelFacet.getMetaClass();
-} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) {
- FeatureLinkModelFacet featureLinkModelFacet = (FeatureLinkModelFacet) genHost.getModelFacet();
- underlyingMetaClass = featureLinkModelFacet.getMetaFeature().getTypeGenClass();
-} else {
- underlyingMetaClass = null;
-}
-final boolean isReadOnly = genLabel.isReadOnly();
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
- stringBuffer.append(TEXT_4);
- stringBuffer.append(TEXT_5);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_7);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_9);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_10);
-
- }
-
- stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_13);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_14);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_16);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_17);
-
- }
-
- stringBuffer.append(TEXT_18);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_19);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_20);
- importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("org.eclipse.draw2d.geometry.Point");
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Location");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Node");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_21);
- stringBuffer.append(genLabel.getEditPartClassName());
- stringBuffer.append(TEXT_22);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart"));
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_24);
- {
-GenCommonBase genCommonBase = genLabel;
- stringBuffer.append(TEXT_25);
- stringBuffer.append(TEXT_26);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_27);
- }
- stringBuffer.append(TEXT_28);
- stringBuffer.append(TEXT_29);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_30);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_31);
-
-}
-
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(genLabel.getEditPartClassName());
- stringBuffer.append(TEXT_34);
-
-final String primaryView = "getUpdatableParent().getDiagramEdge()";
-final String resolvedSemanticElement = "resolveSemanticElement()";
-
- stringBuffer.append(TEXT_35);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy"));
- stringBuffer.append(TEXT_36);
-
-if (labelModelFacet instanceof FeatureLabelModelFacet && !isReadOnly) {
-
- stringBuffer.append(TEXT_37);
- stringBuffer.append(TEXT_38);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_40);
-
-}
-
- {
-GenCommonBase genCommonBase = genLabel;
- stringBuffer.append(TEXT_41);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_42);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_43);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_44);
- }
- stringBuffer.append(TEXT_45);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_47);
- if (i > 0) {
- stringBuffer.append(TEXT_48);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_49);
- }
- stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_51);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_52);
- stringBuffer.append(TEXT_53);
- stringBuffer.append(TEXT_54);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_55);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_57);
-
-}
-
- stringBuffer.append(TEXT_58);
- stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_61);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_62);
- stringBuffer.append(TEXT_63);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_64);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_65);
- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
- stringBuffer.append(TEXT_66);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.LabelCellEditorLocator"));
- stringBuffer.append(TEXT_67);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_68);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_69);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_72);
-
-}
-
- stringBuffer.append(TEXT_73);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
- stringBuffer.append(TEXT_75);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Connection"));
- stringBuffer.append(TEXT_76);
-
- final String alignment;
- LinkLabelAlignment genAlignment = genLabel.getAlignment();
- if (genAlignment == null) {
- alignment = "MIDDLE";
- } else {
- switch (genAlignment.getValue()) {
- case LinkLabelAlignment.MIDDLE:
- alignment = "MIDDLE";
- break;
- case LinkLabelAlignment.TARGET:
- alignment = "TARGET";
- break;
- case LinkLabelAlignment.SOURCE:
- alignment = "SOURCE";
- break;
- default:
- alignment = "MIDDLE";
- break;
- }
- }
-
- stringBuffer.append(TEXT_77);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator"));
- stringBuffer.append(TEXT_79);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionLocator"));
- stringBuffer.append(TEXT_80);
- stringBuffer.append(alignment);
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Point"));
- stringBuffer.append(TEXT_82);
- stringBuffer.append(TEXT_83);
- stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_85);
-
-if (labelModelFacet instanceof FeatureLabelModelFacet) {
- FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
- String viewPattern = featureLabelModelFacet.getViewPattern();
- if (viewPattern == null || viewPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- viewPattern = patternBuffer.toString().trim();
- }
- String editPattern = null;
- if (!isReadOnly) {
- editPattern = featureLabelModelFacet.getEditPattern();
- if (editPattern == null || editPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- editPattern = patternBuffer.toString().trim();
- }
- }
-
- stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.SimpleLabelTextDisplayer"));
- stringBuffer.append(TEXT_87);
- stringBuffer.append(viewPattern);
- stringBuffer.append(TEXT_88);
- if (!isReadOnly) {
- stringBuffer.append(TEXT_89);
- stringBuffer.append(editPattern);
- stringBuffer.append(TEXT_90);
- }
- stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_92);
-
- for(Iterator it = featureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
- GenFeature next = (GenFeature) it.next();
-
- stringBuffer.append(TEXT_93);
- stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_94);
- stringBuffer.append(next.getFeatureAccessorName());
- stringBuffer.append(TEXT_95);
- if (it.hasNext()) {
- stringBuffer.append(TEXT_96);
- }
-
-
- }
-
- stringBuffer.append(TEXT_97);
-
-} else {
-
- stringBuffer.append(TEXT_98);
-
-}
-
- stringBuffer.append(TEXT_99);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_101);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_102);
- stringBuffer.append(TEXT_103);
-
-boolean isFixedFontSetInFigure;
-{
- StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
- isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
-}
-
- stringBuffer.append(TEXT_104);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_107);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_110);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_116);
-
-}
-
- stringBuffer.append(TEXT_117);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_119);
-
-}
-
- stringBuffer.append(TEXT_120);
- stringBuffer.append(TEXT_121);
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_124);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_128);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_131);
-
-if (genLabel.isElementIcon()) {
-
- stringBuffer.append(TEXT_132);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_133);
- if (underlyingMetaClass.isExternalInterface()) {
- stringBuffer.append(TEXT_134);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_135);
- }
- stringBuffer.append(TEXT_136);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
- stringBuffer.append(TEXT_137);
-
-}
-
- stringBuffer.append(TEXT_138);
- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_141);
-
-if (genHost.getModelFacet() instanceof TypeLinkModelFacet) {
-
- stringBuffer.append(TEXT_142);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_143);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_145);
-
-} else if (genHost.getModelFacet() instanceof FeatureLinkModelFacet) {
-
- stringBuffer.append(TEXT_146);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_147);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName(underlyingMetaClass.getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_150);
-
-} else {
-
- stringBuffer.append(TEXT_151);
-
-}
-
- stringBuffer.append(TEXT_152);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_153);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_154);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_155);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_156);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_157);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_158);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_160);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_161);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_162);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_166);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_167);
- stringBuffer.append(TEXT_168);
- stringBuffer.append(TEXT_169);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_170);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_171);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_172);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_176);
-
-final Viewmap viewmap = genLabel.getViewmap();
-
- stringBuffer.append(TEXT_177);
-
-final String figureQualifiedClassName;
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- figureQualifiedClassName = parentAssignedViewmap.getFigureQualifiedClassName() == null ? "org.eclipse.draw2d.IFigure" : parentAssignedViewmap.getFigureQualifiedClassName();
-} else if (viewmap instanceof FigureViewmap) {
- String figureQualifiedClassNameCandidate = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassNameCandidate == null || figureQualifiedClassNameCandidate.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.draw2d.Label";
- } else {
- figureQualifiedClassName = figureQualifiedClassNameCandidate;
- }
-} else if (viewmap instanceof SnippetViewmap) {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-} else if (viewmap instanceof InnerClassViewmap) {
- figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
-} else {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-}
-final String figureImportedName;
-if (viewmap instanceof InnerClassViewmap) {
- figureImportedName = figureQualifiedClassName; //do not import inner class
-} else {
- figureImportedName = importManager.getImportedName(figureQualifiedClassName);
-}
-if (viewmap instanceof ParentAssignedViewmap) {
- final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
-
- stringBuffer.append(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_179);
- stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
- stringBuffer.append(TEXT_180);
- } else {
- stringBuffer.append(TEXT_181);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_182);
-
-if (viewmap instanceof FigureViewmap) {
-
- stringBuffer.append(TEXT_183);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_184);
- } // instanceof FigureViewmap
- else if (viewmap instanceof SnippetViewmap) {
- stringBuffer.append(TEXT_185);
- stringBuffer.append(((SnippetViewmap) viewmap).getBody());
- stringBuffer.append(TEXT_186);
- } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
- else if (viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_187);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_188);
- }
- stringBuffer.append(TEXT_189);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_190);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_191);
-
-if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_192);
-
-} else {
-
- stringBuffer.append(TEXT_193);
-
-}
-
- stringBuffer.append(TEXT_194);
- } /*not parent-assigned*/
- stringBuffer.append(TEXT_195);
-
-if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
-
- stringBuffer.append(TEXT_196);
-
-}
-
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_198);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_199);
-
-String labelSetterName = "setLabel"; // same assumption in NodeEditPart
-String labelFigureClassName = "org.eclipse.draw2d.IFigure";
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- if (parentAssignedViewmap.getSetterName() != null) {
- labelSetterName = parentAssignedViewmap.getSetterName();
- }
- if (parentAssignedViewmap.getFigureQualifiedClassName() != null) {
- labelFigureClassName = parentAssignedViewmap.getFigureQualifiedClassName();
- }
-} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
-
- stringBuffer.append(TEXT_200);
- stringBuffer.append(labelSetterName);
- stringBuffer.append(TEXT_201);
- stringBuffer.append(importManager.getImportedName(labelFigureClassName));
- stringBuffer.append(TEXT_202);
-
-if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
-
- stringBuffer.append(TEXT_203);
-
-} else {
-
- stringBuffer.append(TEXT_204);
-
-}
-
- stringBuffer.append(TEXT_205);
-
-if (viewmap instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) viewmap).getClassBody();
-
- stringBuffer.append(TEXT_206);
- stringBuffer.append(classBody);
- stringBuffer.append(TEXT_207);
-
-if (classBody.indexOf("DPtoLP") != -1) {
-
- stringBuffer.append(TEXT_208);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_209);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_210);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java
deleted file mode 100644
index f0f30559b..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeEditPartGenerator.java
+++ /dev/null
@@ -1,3006 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import java.util.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.codegen.gmfgen.util.*;
-import org.eclipse.gmf.common.codegen.*;
-import org.eclipse.emf.ecore.*;
-
-public class NodeEditPartGenerator
-{
- protected static String nl;
- public static synchronized NodeEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- NodeEditPartGenerator result = new NodeEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL;
- protected final String TEXT_3 = "((";
- protected final String TEXT_4 = ")";
- protected final String TEXT_5 = "((";
- protected final String TEXT_6 = ")";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = ".eGet(";
- protected final String TEXT_9 = ".eINSTANCE.get";
- protected final String TEXT_10 = "())";
- protected final String TEXT_11 = ")";
- protected final String TEXT_12 = "((";
- protected final String TEXT_13 = ")";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = ".";
- protected final String TEXT_16 = "()";
- protected final String TEXT_17 = NL;
- protected final String TEXT_18 = NL;
- protected final String TEXT_19 = NL + "/*" + NL + " * ";
- protected final String TEXT_20 = NL + " */";
- protected final String TEXT_21 = NL;
- protected final String TEXT_22 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
- protected final String TEXT_23 = " extends ";
- protected final String TEXT_24 = " implements ";
- protected final String TEXT_25 = ", ";
- protected final String TEXT_26 = ", ";
- protected final String TEXT_27 = ", ";
- protected final String TEXT_28 = " {";
- protected final String TEXT_29 = NL;
- protected final String TEXT_30 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_31 = ";";
- protected final String TEXT_32 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_33 = " contentPane;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_34 = " primaryShape;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_35 = " myDecorationManager;" + NL;
- protected final String TEXT_36 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_37 = " childNodesPane;";
- protected final String TEXT_38 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_39 = "(";
- protected final String TEXT_40 = " model) {" + NL + "\t\tassert model instanceof ";
- protected final String TEXT_41 = ";" + NL + "\t\tsetModel(model);" + NL + "\t}" + NL;
- protected final String TEXT_42 = NL;
- protected final String TEXT_43 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void registerModel() {" + NL + "\t\tsuper.registerModel();" + NL + "\t\t";
- protected final String TEXT_44 = " view = (";
- protected final String TEXT_45 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().put(view.getElement(), this);\t" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void unregisterModel() {" + NL + "\t\tsuper.unregisterModel();" + NL + "\t\t";
- protected final String TEXT_46 = " view = (";
- protected final String TEXT_47 = ") getModel();" + NL + "\t\tif (view != null && view.isSetElement() && view.getElement() != null && getViewer().getEditPartRegistry().get(view.getElement()) == this) {" + NL + "\t\t\tgetViewer().getEditPartRegistry().remove(view.getElement());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_48 = NL;
- protected final String TEXT_49 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_50 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_51 = "());";
- protected final String TEXT_52 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_53 = ".GRAPHICAL_NODE_ROLE, new ";
- protected final String TEXT_54 = "());";
- protected final String TEXT_55 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_56 = ".DIRECT_EDIT_ROLE, new ";
- protected final String TEXT_57 = "());";
- protected final String TEXT_58 = NL;
- protected final String TEXT_59 = NL + "installEditPolicy(";
- protected final String TEXT_60 = ".LAYOUT_ROLE, new ";
- protected final String TEXT_61 = "());";
- protected final String TEXT_62 = NL;
- protected final String TEXT_63 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_64 = "\", new ";
- protected final String TEXT_65 = "()); //$NON-NLS-1$";
- protected final String TEXT_66 = NL;
- protected final String TEXT_67 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_68 = ".OPEN_ROLE";
- protected final String TEXT_69 = " + \"";
- protected final String TEXT_70 = "\" ";
- protected final String TEXT_71 = ", new ";
- protected final String TEXT_72 = "());";
- protected final String TEXT_73 = NL + "\t\tinstallEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE, getPrimaryDragEditPolicy());";
- protected final String TEXT_74 = NL + "\t\tinstallNotationModelRefresher();";
- protected final String TEXT_75 = NL + "\t\tinstallLinkNotationModelRefresher();";
- protected final String TEXT_76 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_77 = " getPrimaryDragEditPolicy() {";
- protected final String TEXT_78 = NL + "\t\treturn new ";
- protected final String TEXT_79 = "();";
- protected final String TEXT_80 = NL + "\t\t";
- protected final String TEXT_81 = " result = new ";
- protected final String TEXT_82 = "();";
- protected final String TEXT_83 = NL + "\t\t";
- protected final String TEXT_84 = " result = new ";
- protected final String TEXT_85 = "() {" + NL + "\t\t\tprotected ";
- protected final String TEXT_86 = " createSelectionHandles() {" + NL + "\t\t\t\t";
- protected final String TEXT_87 = " result = super.createSelectionHandles();" + NL + "\t\t\t\tfor(";
- protected final String TEXT_88 = " it = getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\t";
- protected final String TEXT_89 = " next = (";
- protected final String TEXT_90 = ") it.next();" + NL + "\t\t\t\t\t";
- protected final String TEXT_91 = " nextView = (";
- protected final String TEXT_92 = ") next.getModel();" + NL + "\t\t\t\t\tswitch (";
- protected final String TEXT_93 = ".getVisualID(nextView)) {";
- protected final String TEXT_94 = NL + "\t\t\t\t\tcase ";
- protected final String TEXT_95 = ".VISUAL_ID:" + NL + "\t\t\t\t\t\tresult.addAll(((";
- protected final String TEXT_96 = ") next).createSelectionHandles());" + NL + "\t\t\t\t\t\tbreak;";
- protected final String TEXT_97 = NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn result;" + NL + "\t\t\t}" + NL + "\t\t};";
- protected final String TEXT_98 = NL + "\t\tresult.setResizeDirections(";
- protected final String TEXT_99 = ".NONE);";
- protected final String TEXT_100 = NL + "\t\tresult.setResizeDirections(";
- protected final String TEXT_101 = ".";
- protected final String TEXT_102 = " | ";
- protected final String TEXT_103 = ");";
- protected final String TEXT_104 = NL + "\t\treturn result;";
- protected final String TEXT_105 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_106 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_107 = " invisibleRectangle = new ";
- protected final String TEXT_108 = "();" + NL + "\t\tinvisibleRectangle.setLayoutManager(new ";
- protected final String TEXT_109 = "());" + NL + "\t\t";
- protected final String TEXT_110 = " shape = createNodeShape();" + NL + "\t\tinvisibleRectangle.add(shape);" + NL + "\t\tcontentPane = setupContentPane(shape);";
- protected final String TEXT_111 = NL + "\t\tchildNodesPane = createChildNodesPane();" + NL + "\t\tshape.add(childNodesPane);";
- protected final String TEXT_112 = NL + NL + "\t\t";
- protected final String TEXT_113 = " decorationShape = createDecorationPane();" + NL + "\t\tif (decorationShape != null) {" + NL + "\t\t\tmyDecorationManager = createDecorationManager(decorationShape);" + NL + "\t\t\tinvisibleRectangle.add(decorationShape, 0);" + NL + "\t\t}" + NL + "" + NL + "\t\treturn invisibleRectangle;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_114 = " createDecorationManager(";
- protected final String TEXT_115 = " decorationShape) {" + NL + "\t\treturn new ";
- protected final String TEXT_116 = "(decorationShape);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_117 = " getDecorationManager() {" + NL + "\t\treturn myDecorationManager;" + NL + "\t}" + NL;
- protected final String TEXT_118 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_119 = " createChildNodesPane() {" + NL + "\t\t";
- protected final String TEXT_120 = " result = new ";
- protected final String TEXT_121 = "();" + NL + "\t\tsetupContentPane(result);" + NL + "\t\treturn result;" + NL + "\t}";
- protected final String TEXT_122 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_123 = " createNodeShape() {";
- protected final String TEXT_124 = NL + "\t\tprimaryShape = new ";
- protected final String TEXT_125 = "()";
- protected final String TEXT_126 = " {" + NL + "\t\t\tprotected boolean useLocalCoordinates() {" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_127 = ";";
- protected final String TEXT_128 = NL + "\t\tprimaryShape = ";
- protected final String TEXT_129 = ";";
- protected final String TEXT_130 = NL + "\t\t";
- protected final String TEXT_131 = " figure = new ";
- protected final String TEXT_132 = "();";
- protected final String TEXT_133 = NL + " \t\tfigure.setUseLocalCoordinates(true);";
- protected final String TEXT_134 = NL + " \t\tprimaryShape = figure;";
- protected final String TEXT_135 = NL + "\t\treturn primaryShape;" + NL + "\t}";
- protected final String TEXT_136 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_137 = " getPrimaryShape() {" + NL + "\t\treturn (";
- protected final String TEXT_138 = ") primaryShape;" + NL + "\t}";
- protected final String TEXT_139 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_140 = " createDecorationPane() {" + NL + "\t\treturn new ";
- protected final String TEXT_141 = "();" + 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_142 = " setupContentPane(";
- protected final String TEXT_143 = " nodeShape) {" + NL + "\t\tif (nodeShape.getLayoutManager() == null) {";
- protected final String TEXT_144 = NL + "\t\t\t";
- protected final String TEXT_145 = " layout = new ";
- protected final String TEXT_146 = "();" + NL + "\t\t\tlayout.setSpacing(5);" + NL + "\t\t\tnodeShape.setLayoutManager(layout);";
- protected final String TEXT_147 = NL + "\t\tnodeShape.setLayoutManager(new ";
- protected final String TEXT_148 = "() {" + NL + "" + NL + "\t\t\tpublic Object getConstraint(";
- protected final String TEXT_149 = " 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_150 = "(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_151 = 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_152 = " 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_153 = " getDiagramNode() {" + NL + "\t\treturn (";
- protected final String TEXT_154 = ") getModel();" + NL + "\t}" + NL;
- protected final String TEXT_155 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean addFixedChild(";
- protected final String TEXT_156 = " childEditPart) {";
- protected final String TEXT_157 = NL + "\t\tif (childEditPart instanceof ";
- protected final String TEXT_158 = ") {" + NL + "\t\t\t((";
- protected final String TEXT_159 = ") childEditPart).";
- protected final String TEXT_160 = "(getPrimaryShape().";
- protected final String TEXT_161 = "());" + NL + "\t\t\treturn true;" + NL + "\t\t}";
- protected final String TEXT_162 = NL + "\t\tif (childEditPart instanceof ";
- protected final String TEXT_163 = ") {" + NL + "\t\t\t";
- protected final String TEXT_164 = " pane = getPrimaryShape().";
- protected final String TEXT_165 = "();" + NL + "\t\t\tsetupContentPane(pane); // FIXME each comparment should handle his content pane in his own way " + NL + "\t\t\tpane.add(((";
- protected final String TEXT_166 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
- protected final String TEXT_167 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean removeFixedChild(EditPart childEditPart) {";
- protected final String TEXT_168 = "\t\t" + NL + "\t\tif (childEditPart instanceof ";
- protected final String TEXT_169 = ") {" + NL + "\t\t\t";
- protected final String TEXT_170 = " pane = getPrimaryShape().";
- protected final String TEXT_171 = "();" + NL + "\t\t\tpane.remove(((";
- protected final String TEXT_172 = ")childEditPart).getFigure());" + NL + "\t\t\treturn true;" + NL + "\t\t}\t";
- protected final String TEXT_173 = NL + "\t\treturn false;" + NL + "\t}";
- protected final String TEXT_174 = 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.equals(req.getType())) {" + NL + "\t\t\t";
- protected final String TEXT_186 = " labelToEdit;" + NL + "\t\t\tif (req instanceof ";
- protected final String TEXT_187 = ") {" + NL + "\t\t\t\tlabelToEdit = getLabelEditPart((";
- protected final String TEXT_188 = ")req);" + NL + "\t\t\t} else {" + NL + "\t\t\t\tlabelToEdit = getPrimaryLabelEditPart();" + NL + "\t\t\t}" + NL + "\t\t\tif (labelToEdit != null) {" + NL + "\t\t\t\tlabelToEdit.performRequest(req);" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_189 = NL;
- protected final String TEXT_190 = "if (";
- protected final String TEXT_191 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_192 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_193 = " getLabelEditPart(";
- protected final String TEXT_194 = " req) {" + NL + "\t\t";
- protected final String TEXT_195 = " result = getViewer().findObjectAt(req.getLocation());" + NL + "\t\tif (result != null) {" + NL + "\t\t\t";
- protected final String TEXT_196 = " view = (";
- protected final String TEXT_197 = ") result.getModel();" + NL + "\t\t\tif (getDiagramNode().getChildren().contains(view)) {" + NL + "\t\t\t\tint visualId = ";
- protected final String TEXT_198 = ".getVisualID(view);" + NL + "\t\t\t\tswitch (visualId) {";
- protected final String TEXT_199 = NL + "\t\t\t\tcase ";
- protected final String TEXT_200 = ".VISUAL_ID:" + NL + "\t\t\t\t\treturn result;";
- protected final String TEXT_201 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn getPrimaryLabelEditPart();" + NL + "\t}" + NL;
- protected final String TEXT_202 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isExternalLabel(";
- protected final String TEXT_203 = " childEditPart) {";
- protected final String TEXT_204 = NL + "\t\tif (childEditPart instanceof ";
- protected final String TEXT_205 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
- protected final String TEXT_206 = NL + "\t\treturn false;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_207 = " getExternalLabelsContainer() {" + NL + "\t\t";
- protected final String TEXT_208 = " root = (";
- protected final String TEXT_209 = ") getRoot();" + NL + "\t\treturn root.getLayer(";
- protected final String TEXT_210 = ".EXTERNAL_NODE_LABELS_LAYER);" + NL + "\t}" + NL;
- protected final String TEXT_211 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isDirectChild(";
- protected final String TEXT_212 = " childEditPart) {";
- protected final String TEXT_213 = NL + "\t\tif (childEditPart instanceof ";
- protected final String TEXT_214 = ") {" + NL + "\t\t\treturn true;" + NL + "\t\t}";
- protected final String TEXT_215 = NL + "\t\treturn false;" + NL + "\t}";
- 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) {";
- protected final String TEXT_218 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
- protected final String TEXT_219 = " labelFigure = ((";
- protected final String TEXT_220 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().add(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_221 = NL + "\t\tif (addFixedChild(childEditPart)) {" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_222 = NL + "\t\tif (isDirectChild(childEditPart)) {" + NL + "\t\t\t";
- protected final String TEXT_223 = " childFigure = ((";
- protected final String TEXT_224 = ") childEditPart).getFigure();" + NL + "\t\t\tchildNodesPane.add(childFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_225 = NL + "\t\tsuper.addChildVisual(childEditPart, -1);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void removeChildVisual(";
- protected final String TEXT_226 = " childEditPart) {";
- protected final String TEXT_227 = NL + "\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t";
- protected final String TEXT_228 = " labelFigure = ((";
- protected final String TEXT_229 = ") childEditPart).getFigure();" + NL + "\t\t\tgetExternalLabelsContainer().remove(labelFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_230 = NL + "\t\tif (removeFixedChild(childEditPart)){" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_231 = NL + "\t\tif (isDirectChild(childEditPart)) {" + NL + "\t\t\t";
- protected final String TEXT_232 = " childFigure = ((";
- protected final String TEXT_233 = ") childEditPart).getFigure();" + NL + "\t\t\tchildNodesPane.remove(childFigure);" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_234 = NL + "\t\tsuper.removeChildVisual(childEditPart);" + NL + "\t}";
- protected final String TEXT_235 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeNotify() {" + NL + "\t\tfor (";
- protected final String TEXT_236 = " it = getChildren().iterator(); it.hasNext();) {" + NL + "\t\t\t";
- protected final String TEXT_237 = " childEditPart = (";
- protected final String TEXT_238 = ") it.next();" + NL + "\t\t\tif (isExternalLabel(childEditPart)) {" + NL + "\t\t\t\tIFigure labelFigure = ((";
- protected final String TEXT_239 = ") 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_240 = 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_241 = " node = getDiagramNode();" + NL + "\t\tif (node.getLayoutConstraint() == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tassert node.getLayoutConstraint() instanceof ";
- protected final String TEXT_242 = ";" + NL + "\t\t";
- protected final String TEXT_243 = " bounds = (";
- protected final String TEXT_244 = ") node.getLayoutConstraint();" + NL + "\t\tint x = bounds.getX();" + NL + "\t\tint y = bounds.getY();" + NL + "\t\tint width = bounds.getWidth();" + NL + "\t\tint height = bounds.getHeight();" + NL + "\t\tif (width < 0) {" + NL + "\t\t\tx -= width;" + NL + "\t\t\twidth = -width;" + NL + "\t\t}" + NL + "\t\tif (height < 0) {" + NL + "\t\t\ty -= height;" + NL + "\t\t\theight = -height;" + NL + "\t\t}" + NL + "\t\t((";
- protected final String TEXT_245 = ") getParent()).setLayoutConstraint(this, getFigure(), " + NL + "\t\t\tnew ";
- protected final String TEXT_246 = "(x, y, width, height));" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_247 = " getModelChildren() {" + NL + "\t\treturn getDiagramNode().getVisibleChildren();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_248 = " getModelSourceConnections() {" + NL + "\t\treturn getDiagramNode().getSourceEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_249 = " getModelTargetConnections() {" + NL + "\t\treturn getDiagramNode().getTargetEdges();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_250 = " getSourceConnectionAnchor(";
- protected final String TEXT_251 = " connection) {" + NL + "\t\treturn new ";
- protected final String TEXT_252 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_253 = " getSourceConnectionAnchor(";
- protected final String TEXT_254 = " request) {" + NL + "\t\treturn new ";
- protected final String TEXT_255 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_256 = " getTargetConnectionAnchor(";
- protected final String TEXT_257 = " connection) {" + NL + "\t\treturn new ";
- protected final String TEXT_258 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_259 = " getTargetConnectionAnchor(";
- protected final String TEXT_260 = " request) {" + NL + "\t\treturn new ";
- protected final String TEXT_261 = "(getFigure());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Object getAdapter(Class key) {";
- protected final String TEXT_262 = NL + "\t\tif (";
- protected final String TEXT_263 = ".class == key) {" + NL + "\t\t\treturn new ";
- protected final String TEXT_264 = "(this);" + NL + "\t\t}";
- protected final String TEXT_265 = NL + "\t\tif (";
- protected final String TEXT_266 = ".class == key) {" + NL + "\t\t\treturn getTreeEditPartAdapter();" + NL + "\t\t}";
- protected final String TEXT_267 = NL + "\t\treturn super.getAdapter(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter myTreeEditPartAdapter;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate TreeEditPartAdapter getTreeEditPartAdapter() {" + NL + "\t\tif (myTreeEditPartAdapter == null) {" + NL + "\t\t\tmyTreeEditPartAdapter = new TreeEditPartAdapter();" + NL + "\t\t}" + NL + "\t\treturn myTreeEditPartAdapter;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\tgetDiagramNode().getElement().eAdapters().add(domainModelRefresher);";
- protected final String TEXT_268 = NL + "\t\tinstallNotationModelRefresher();";
- protected final String TEXT_269 = NL + "\t\tinstallLinkNotationModelRefresher();";
- protected final String TEXT_270 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {";
- protected final String TEXT_271 = NL + "\t\tuninstallLinkNotationModelRefresher();";
- protected final String TEXT_272 = NL + "\t\tuninstallNotationModelRefresher();";
- protected final String TEXT_273 = NL + "\t\tgetDiagramNode().getElement().eAdapters().remove(domainModelRefresher);" + NL + "\t\tsuper.deactivate();" + NL + "\t}";
- protected final String TEXT_274 = NL;
- protected final String TEXT_275 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installNotationModelRefresher() {" + NL + "\t\t";
- protected final String TEXT_276 = " refresher = getNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_277 = " domainModelEditDomain = ";
- protected final String TEXT_278 = ".getEditingDomain(";
- protected final String TEXT_279 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallNotationModelRefresher() {" + NL + "\t\tgetNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_280 = " notationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_281 = " getNotationModelRefresher() {" + NL + "\t\tif (notationModelRefresher == null) {" + NL + "\t\t\tnotationModelRefresher = new NotationModelRefresher();" + NL + "\t\t}" + NL + "\t\treturn notationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class NotationModelRefresher extends ";
- protected final String TEXT_282 = " {";
- protected final String TEXT_283 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Children of this element are selected based on constraint declared in ";
- protected final String TEXT_284 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_285 = " getConstrainedChildrenFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_286 = ".NOT_TOUCH;" + NL + "\t\t}";
- protected final String TEXT_287 = NL + NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_288 = " createFilter() {";
- protected final String TEXT_289 = NL + "\t\t\t";
- protected final String TEXT_290 = " filter = ";
- protected final String TEXT_291 = ".createFeatureFilter(";
- protected final String TEXT_292 = ".eINSTANCE.get";
- protected final String TEXT_293 = "());";
- protected final String TEXT_294 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_295 = ".createFeatureFilter(";
- protected final String TEXT_296 = ".eINSTANCE.get";
- protected final String TEXT_297 = "()));";
- protected final String TEXT_298 = NL + "\t\t\tfilter = filter.and(";
- protected final String TEXT_299 = ".createNotifierFilter(";
- protected final String TEXT_300 = ".getElement()));";
- protected final String TEXT_301 = NL + "\t\t\t";
- protected final String TEXT_302 = " filter = ";
- protected final String TEXT_303 = ".createNotifierFilter(";
- protected final String TEXT_304 = ".getElement());";
- protected final String TEXT_305 = NL + "\t\t\tfilter = getConstrainedChildrenFilter().or(filter);";
- protected final String TEXT_306 = NL + "\t\t\t";
- protected final String TEXT_307 = " filter = getConstrainedChildrenFilter();";
- protected final String TEXT_308 = NL + "\t\t\t";
- protected final String TEXT_309 = " filter = ";
- protected final String TEXT_310 = ".NOT_TOUCH;";
- protected final String TEXT_311 = NL + "\t\t\treturn filter;";
- protected final String TEXT_312 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_313 = " getCreateNotationalElementCommand(";
- protected final String TEXT_314 = " descriptor) {";
- protected final String TEXT_315 = NL;
- protected final String TEXT_316 = "\t\t\t";
- protected final String TEXT_317 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
- protected final String TEXT_318 = NL + "\t\t\tcase ";
- protected final String TEXT_319 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
- protected final String TEXT_320 = ") {" + NL + "\t\t\t\t\treturn new ";
- protected final String TEXT_321 = "(";
- protected final String TEXT_322 = ", domainElement, ";
- protected final String TEXT_323 = "new ";
- protected final String TEXT_324 = "(0, 0, ";
- protected final String TEXT_325 = ", ";
- protected final String TEXT_326 = ")";
- protected final String TEXT_327 = NL + "null";
- protected final String TEXT_328 = ", ";
- protected final String TEXT_329 = ".INSTANCE, false);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
- protected final String TEXT_330 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
- protected final String TEXT_331 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_332 = " getSemanticChildNodes() {";
- protected final String TEXT_333 = NL;
- protected final String TEXT_334 = NL + "\treturn ";
- protected final String TEXT_335 = ".EMPTY_LIST;";
- protected final String TEXT_336 = NL + "\t";
- protected final String TEXT_337 = " result = new ";
- protected final String TEXT_338 = "();";
- protected final String TEXT_339 = NL + "\t";
- protected final String TEXT_340 = " viewObject = ";
- protected final String TEXT_341 = ";" + NL + "\t";
- protected final String TEXT_342 = " modelObject = viewObject.getElement();" + NL + "\t";
- protected final String TEXT_343 = " nextValue;" + NL + "\tint nodeVID;";
- protected final String TEXT_344 = NL + "\tfor(";
- protected final String TEXT_345 = " it = ";
- protected final String TEXT_346 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_347 = ") it.next();";
- protected final String TEXT_348 = NL + "\tnextValue = (";
- protected final String TEXT_349 = ")";
- protected final String TEXT_350 = ";";
- protected final String TEXT_351 = NL + "\tnodeVID = ";
- protected final String TEXT_352 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
- protected final String TEXT_353 = NL + "\tswitch (nodeVID) {";
- protected final String TEXT_354 = NL + "\tcase ";
- protected final String TEXT_355 = ".VISUAL_ID: {";
- protected final String TEXT_356 = NL + "\tif (";
- protected final String TEXT_357 = ".VISUAL_ID == nodeVID) {";
- protected final String TEXT_358 = NL + "\t\tresult.add(new ";
- protected final String TEXT_359 = "(nextValue, nodeVID));";
- protected final String TEXT_360 = NL + "\t\tbreak;" + NL + "\t\t}";
- protected final String TEXT_361 = NL + "\t\t}";
- protected final String TEXT_362 = NL + "\t}";
- protected final String TEXT_363 = NL + "\t}";
- protected final String TEXT_364 = NL + "\treturn result;";
- protected final String TEXT_365 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational element should be created for the given domain element. " + NL + "\t\t * The generated code always returns ";
- protected final String TEXT_366 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView(";
- protected final String TEXT_367 = " descriptor) {" + NL + "\t\t\treturn ";
- protected final String TEXT_368 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_369 = " getHost() {" + NL + "\t\t\treturn ";
- protected final String TEXT_370 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshNotationModel() {" + NL + "\t\t";
- protected final String TEXT_371 = " childRefresher = getNotationModelRefresher();" + NL + "\t\tif (!childRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_372 = " command = childRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_373 = " domainModelEditDomain = ";
- protected final String TEXT_374 = ".getEditingDomain(";
- protected final String TEXT_375 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_376 = "(domainModelEditDomain, command));" + NL + "\t}" + NL;
- protected final String TEXT_377 = NL;
- protected final String TEXT_378 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void installLinkNotationModelRefresher() {" + NL + "\t\tLinkNotationModelRefresher refresher = getLinkNotationModelRefresher();" + NL + "\t\tif (refresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_379 = " domainModelEditDomain = ";
- protected final String TEXT_380 = ".getEditingDomain(";
- protected final String TEXT_381 = ".getElement());" + NL + "\t\trefresher.install(domainModelEditDomain);" + NL + "\t\trefreshLinkNotationModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void uninstallLinkNotationModelRefresher() {" + NL + "\t\tgetLinkNotationModelRefresher().uninstall();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher linkNotationModelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * Service to find a notational element that corresponds to the given underlying domain element. " + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_382 = " viewService;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_383 = " getViewService() {" + NL + "\t\tif (viewService == null) {" + NL + "\t\t\tviewService = new ";
- protected final String TEXT_384 = "(getViewer());" + NL + "\t\t}" + NL + "\t\treturn viewService;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate LinkNotationModelRefresher getLinkNotationModelRefresher() {" + NL + "\t\tif (linkNotationModelRefresher == null) {" + NL + "\t\t\tlinkNotationModelRefresher = new LinkNotationModelRefresher(getViewService());" + NL + "\t\t}" + NL + "\t\treturn linkNotationModelRefresher;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class LinkNotationModelRefresher extends ";
- protected final String TEXT_385 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic LinkNotationModelRefresher(";
- protected final String TEXT_386 = " viewService) {" + NL + "\t\t\tsuper(viewService);" + NL + "\t\t}";
- protected final String TEXT_387 = NL + NL + "\t\t/**" + NL + "\t\t * NB: Child links of this element are selected based on constraint declared in ";
- protected final String TEXT_388 = ". " + NL + "\t\t * Since no assumptions may be made concerning the runtime behavior of the constraint, <b>any</b> non-touch notification may result in " + NL + "\t\t * notational model having to be updated." + NL + "\t\t * <p/>User is encouraged to change implementation of this method to provide an optimization if it is safe to assume that not all notifications" + NL + "\t\t * result in such an update." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_389 = " getConstrainedChildLinksFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_390 = ".NOT_TOUCH;" + NL + "\t\t}";
- protected final String TEXT_391 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly result in uncontained links. " + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_392 = " createUncontainedLinksFilter() {" + NL + "\t\t\treturn ";
- protected final String TEXT_393 = ".createEventTypeFilter(";
- protected final String TEXT_394 = ".SET).or(" + NL + "\t\t\t\t";
- protected final String TEXT_395 = ".createEventTypeFilter(";
- protected final String TEXT_396 = ".UNSET).or(" + NL + "\t\t\t\t";
- protected final String TEXT_397 = ".createEventTypeFilter(";
- protected final String TEXT_398 = ".REMOVE).or(" + NL + "\t\t\t\t";
- protected final String TEXT_399 = ".createEventTypeFilter(";
- protected final String TEXT_400 = ".REMOVE_MANY)" + NL + "\t\t\t)));" + NL + "\t\t}";
- protected final String TEXT_401 = NL + "\t\t/**" + NL + "\t\t * Creates a notification filter which filters notifications that may possibly affect the notational model" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_402 = " createFilter() {";
- protected final String TEXT_403 = NL;
- protected final String TEXT_404 = NL + "\t\t\t";
- protected final String TEXT_405 = " filter = ";
- protected final String TEXT_406 = ".createFeatureFilter(";
- protected final String TEXT_407 = ".eINSTANCE.get";
- protected final String TEXT_408 = "());";
- protected final String TEXT_409 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_410 = ".createFeatureFilter(";
- protected final String TEXT_411 = ".eINSTANCE.get";
- protected final String TEXT_412 = "()));";
- protected final String TEXT_413 = NL;
- protected final String TEXT_414 = NL + "\t\t\t";
- protected final String TEXT_415 = " filter = ";
- protected final String TEXT_416 = ".createFeatureFilter(";
- protected final String TEXT_417 = ".eINSTANCE.get";
- protected final String TEXT_418 = "());";
- protected final String TEXT_419 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_420 = ".createFeatureFilter(";
- protected final String TEXT_421 = ".eINSTANCE.get";
- protected final String TEXT_422 = "()));";
- protected final String TEXT_423 = NL;
- protected final String TEXT_424 = NL + "\t\t\t";
- protected final String TEXT_425 = " filter = ";
- protected final String TEXT_426 = ".createFeatureFilter(";
- protected final String TEXT_427 = ".eINSTANCE.get";
- protected final String TEXT_428 = "());";
- protected final String TEXT_429 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_430 = ".createFeatureFilter(";
- protected final String TEXT_431 = ".eINSTANCE.get";
- protected final String TEXT_432 = "()));";
- protected final String TEXT_433 = NL;
- protected final String TEXT_434 = NL + "\t\t\t";
- protected final String TEXT_435 = " filter = ";
- protected final String TEXT_436 = ".createFeatureFilter(";
- protected final String TEXT_437 = ".eINSTANCE.get";
- protected final String TEXT_438 = "());";
- protected final String TEXT_439 = NL + "\t\t\tfilter = filter.or(";
- protected final String TEXT_440 = ".createFeatureFilter(";
- protected final String TEXT_441 = ".eINSTANCE.get";
- protected final String TEXT_442 = "()));";
- protected final String TEXT_443 = NL + "\t\t\tfilter = getConstrainedChildLinksFilter().or(filter);";
- protected final String TEXT_444 = NL + "\t\t\t";
- protected final String TEXT_445 = " filter = getConstrainedChildLinksFilter();";
- protected final String TEXT_446 = NL + "\t\t\tfilter = filter.or(createUncontainedLinksFilter());";
- protected final String TEXT_447 = NL + "\t\t\t";
- protected final String TEXT_448 = " filter = createUncontainedLinksFilter();";
- protected final String TEXT_449 = NL + "\t\t\t";
- protected final String TEXT_450 = " filter = ";
- protected final String TEXT_451 = ".NOT_TOUCH;";
- protected final String TEXT_452 = NL + "\t\t\treturn filter;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t \t * @generated" + NL + "\t \t */" + NL + "\t\tprotected ";
- protected final String TEXT_453 = " getCreateNotationalElementCommand(";
- protected final String TEXT_454 = " descriptor) {" + NL + "\t\t\t";
- protected final String TEXT_455 = " linkDescriptor = (";
- protected final String TEXT_456 = ") descriptor;";
- protected final String TEXT_457 = NL;
- protected final String TEXT_458 = "\t\t\t";
- protected final String TEXT_459 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t";
- protected final String TEXT_460 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t";
- protected final String TEXT_461 = " decorator = null;" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {";
- protected final String TEXT_462 = NL + "\t\t\tcase ";
- protected final String TEXT_463 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof ";
- protected final String TEXT_464 = ") {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_465 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_466 = NL + "\t\t\tcase ";
- protected final String TEXT_467 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = ";
- protected final String TEXT_468 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
- protected final String TEXT_469 = NL + "\t\t\t}" + NL + "\t\t\tif (decorator == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new ";
- protected final String TEXT_470 = "(";
- protected final String TEXT_471 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);";
- protected final String TEXT_472 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_473 = " getSemanticChildLinks() {";
- protected final String TEXT_474 = NL;
- protected final String TEXT_475 = "\t";
- protected final String TEXT_476 = " result = new ";
- protected final String TEXT_477 = "();";
- protected final String TEXT_478 = NL + "\t";
- protected final String TEXT_479 = " modelObject = ";
- protected final String TEXT_480 = ".getElement();" + NL + "\t";
- protected final String TEXT_481 = " nextValue;";
- protected final String TEXT_482 = NL + "\tint linkVID;";
- protected final String TEXT_483 = NL + "\tfor(";
- protected final String TEXT_484 = " it = ";
- protected final String TEXT_485 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_486 = ") it.next();";
- protected final String TEXT_487 = NL + "\tnextValue = (";
- protected final String TEXT_488 = ")";
- protected final String TEXT_489 = ";";
- protected final String TEXT_490 = NL + "\tlinkVID = ";
- protected final String TEXT_491 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
- protected final String TEXT_492 = NL + "\tswitch (linkVID) {";
- protected final String TEXT_493 = NL + "\tcase ";
- protected final String TEXT_494 = ".VISUAL_ID: {";
- protected final String TEXT_495 = NL + "\tif (";
- protected final String TEXT_496 = ".VISUAL_ID == linkVID) {";
- protected final String TEXT_497 = NL + "\t\t";
- protected final String TEXT_498 = " source = (";
- protected final String TEXT_499 = ")";
- protected final String TEXT_500 = ";";
- protected final String TEXT_501 = NL + "\t\t";
- protected final String TEXT_502 = " source = ";
- protected final String TEXT_503 = ".getElement();";
- protected final String TEXT_504 = NL + "\t\t";
- protected final String TEXT_505 = " target = (";
- protected final String TEXT_506 = ")";
- protected final String TEXT_507 = ";";
- protected final String TEXT_508 = NL + "\t\t";
- protected final String TEXT_509 = " target = ";
- protected final String TEXT_510 = ".getElement();";
- protected final String TEXT_511 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new ";
- protected final String TEXT_512 = "(source, target, nextValue, linkVID));" + NL + "\t\t}";
- protected final String TEXT_513 = NL + "\t\tbreak;" + NL + "\t}";
- protected final String TEXT_514 = NL + "\t}";
- protected final String TEXT_515 = NL + "\t}";
- protected final String TEXT_516 = NL + "\t}";
- protected final String TEXT_517 = NL + "\tfor(";
- protected final String TEXT_518 = " it = ";
- protected final String TEXT_519 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
- protected final String TEXT_520 = ") it.next();";
- protected final String TEXT_521 = NL + "\tnextValue = (";
- protected final String TEXT_522 = ")";
- protected final String TEXT_523 = ";";
- protected final String TEXT_524 = NL + "\tif (nextValue != null) {";
- protected final String TEXT_525 = NL + "\t\tresult.add(new ";
- protected final String TEXT_526 = "(modelObject, nextValue, null, ";
- protected final String TEXT_527 = ".VISUAL_ID));";
- protected final String TEXT_528 = NL + "\t}";
- protected final String TEXT_529 = NL + "\t}";
- protected final String TEXT_530 = NL + "\treturn result;";
- protected final String TEXT_531 = NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_532 = " getNotationalChildLinks() {" + NL + "\t\t\t";
- protected final String TEXT_533 = " result = new ";
- protected final String TEXT_534 = "();" + NL + "\t\t\t";
- protected final String TEXT_535 = " allLinks = ";
- protected final String TEXT_536 = ".getEdges();" + NL + "\t\t\tfor(";
- protected final String TEXT_537 = " it = allLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t";
- protected final String TEXT_538 = " next = (";
- protected final String TEXT_539 = ") it.next();";
- protected final String TEXT_540 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null && next.getElement().eResource() == null) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
- protected final String TEXT_541 = " source = next.getSource();" + NL + "\t\t\t\tif (source == null || (source.isSetElement() && source.getElement() != null && source.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\t";
- protected final String TEXT_542 = " target = next.getTarget();" + NL + "\t\t\t\tif (target == null || (target.isSetElement() && target.getElement() != null && target.getElement().eResource() == null)) {" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}";
- protected final String TEXT_543 = NL + "\t\t\t\tif (!next.isSetElement() || next.getElement() == null) {" + NL + "\t\t\t\t\tif (next.getSource() == ";
- protected final String TEXT_544 = ") {" + NL + "\t\t\t\t\t\tint linkVID = ";
- protected final String TEXT_545 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {";
- protected final String TEXT_546 = NL + "\t\t\t\t\t\tcase ";
- protected final String TEXT_547 = ".VISUAL_ID:";
- protected final String TEXT_548 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}";
- protected final String TEXT_549 = NL + "\t\t\t\t} else {";
- protected final String TEXT_550 = NL + "\t\t\t\t}";
- protected final String TEXT_551 = NL + "\t\t\t\tif (next.isSetElement() && next.getElement() != null) {";
- protected final String TEXT_552 = NL + "\t\t\t\t\tif (next.getElement().eContainer() == ";
- protected final String TEXT_553 = ".getElement()) {" + NL + "\t\t\t\t\t\tint linkVID = ";
- protected final String TEXT_554 = ".getVisualID(next);" + NL + "\t\t\t\t\t\tswitch (linkVID) {";
- protected final String TEXT_555 = NL + "\t\t\t\t\t\tcase ";
- protected final String TEXT_556 = ".VISUAL_ID:";
- protected final String TEXT_557 = NL + "\t\t\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}";
- protected final String TEXT_558 = NL + "\t\t\t}" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns whether a notational edge should be created for the given domain element. " + NL + "\t\t * The generated code always returns ";
- protected final String TEXT_559 = ". " + NL + "\t\t * User can change implementation of this method to handle a more sophisticated logic." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean shouldCreateView(";
- protected final String TEXT_560 = " descriptor) {" + NL + "\t\t\treturn ";
- protected final String TEXT_561 = ";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_562 = " getHost() {" + NL + "\t\t\treturn ";
- protected final String TEXT_563 = ";" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLinkNotationModel() {" + NL + "\t\t";
- protected final String TEXT_564 = " linkRefresher = getLinkNotationModelRefresher();" + NL + "\t\tif (!linkRefresher.isInstalled()) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_565 = " command = linkRefresher.buildRefreshNotationModelCommand();" + NL + "\t\tif (command == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_566 = " domainModelEditDomain = ";
- protected final String TEXT_567 = ".getEditingDomain(";
- protected final String TEXT_568 = ".getElement());" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_569 = "(domainModelEditDomain, command));" + NL + "\t}";
- protected final String TEXT_570 = NL;
- protected final String TEXT_571 = NL;
- protected final String TEXT_572 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_573 = " domainModelRefresher = new ";
- protected final String TEXT_574 = "(this);" + NL;
- protected final String TEXT_575 = NL;
- protected final String TEXT_576 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addRefresher(";
- protected final String TEXT_577 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.addRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeRefresher(";
- protected final String TEXT_578 = " feature, Refresher refresher) {" + NL + "\t\tCompositeRefresher compositeRefresher = getCompositeRefresher(feature);" + NL + "\t\tcompositeRefresher.removeRefresher(refresher);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate CompositeRefresher getCompositeRefresher(";
- protected final String TEXT_579 = " 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}";
- protected final String TEXT_580 = NL;
- protected final String TEXT_581 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_582 = " externalRefreshers = new ";
- protected final String TEXT_583 = "();" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_584 = " getExternalRefreshers() {" + NL + "\t\treturn externalRefreshers;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addExternalRefresher(";
- protected final String TEXT_585 = ".ExternalRefresher externalRefresher) {" + NL + "\t\tif (externalRefresher != null && !externalRefreshers.contains(externalRefresher)) {" + NL + "\t\t\texternalRefreshers.add(externalRefresher);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeExternalRefresher(";
- protected final String TEXT_586 = ".ExternalRefresher externalRefresher) {" + NL + "\t\texternalRefreshers.remove(externalRefresher);" + NL + "\t}" + NL;
- protected final String TEXT_587 = NL;
- protected final String TEXT_588 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
- protected final String TEXT_589 = NL + "\t\t";
- protected final String TEXT_590 = " style =" + NL + "\t\t\t(";
- protected final String TEXT_591 = ") ";
- protected final String TEXT_592 = ".getStyle(" + NL + "\t\t\t\t";
- protected final String TEXT_593 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_594 = " 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_595 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_596 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_597 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
- protected final String TEXT_598 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
- protected final String TEXT_599 = " 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_600 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
- protected final String TEXT_601 = "\t" + NL + "\t}";
- protected final String TEXT_602 = 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_603 = " createdFont;";
- protected final String TEXT_604 = "\t" + NL;
- protected final String TEXT_605 = NL;
- protected final String TEXT_606 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshForegroundColor() {" + NL + "\t\t";
- protected final String TEXT_607 = " style = (";
- protected final String TEXT_608 = ") ";
- protected final String TEXT_609 = ".getStyle(";
- protected final String TEXT_610 = ".eINSTANCE.getLineStyle());" + NL + "\t\t";
- protected final String TEXT_611 = " 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_612 = " 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_613 = "(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_614 = " createdForegroundColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshBackgroundColor() {" + NL + "\t\t";
- protected final String TEXT_615 = " style = (";
- protected final String TEXT_616 = ") ";
- protected final String TEXT_617 = ".getStyle(";
- protected final String TEXT_618 = ".eINSTANCE.getFillStyle());" + NL + "\t\t";
- protected final String TEXT_619 = " 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_620 = " 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_621 = "(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_622 = " createdBackgroundColor;" + NL;
- protected final String TEXT_623 = NL;
- protected final String TEXT_624 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_625 = " structuralFeatures2Refresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic Refresher getRefresher(";
- protected final String TEXT_626 = " feature, ";
- protected final String TEXT_627 = " 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_628 = "();";
- protected final String TEXT_629 = NL;
- protected final String TEXT_630 = "\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_631 = ".eINSTANCE.getView_PersistedChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_632 = ".eINSTANCE.getView_TransientChildren(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_633 = ".eINSTANCE.getView_Styles(), childrenRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_634 = ".eINSTANCE.getDrawerStyle_Collapsed(), childrenRefresher);" + NL + "\t\t";
- protected final String TEXT_635 = NL;
- protected final String TEXT_636 = "\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_637 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_638 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_639 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_640 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_641 = ".eINSTANCE.getLocation_Y(), boundsRefresher);";
- protected final String TEXT_642 = NL;
- protected final String TEXT_643 = "\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_644 = ".eINSTANCE.getView_Visible(), visibilityRefresher);";
- protected final String TEXT_645 = NL;
- protected final String TEXT_646 = "\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_647 = ".eINSTANCE.getView_SourceEdges(), sourceEdgesRefresher);";
- protected final String TEXT_648 = NL;
- protected final String TEXT_649 = "\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_650 = ".eINSTANCE.getView_TargetEdges(), targetEdgesRefresher);";
- protected final String TEXT_651 = NL;
- protected final String TEXT_652 = "\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_653 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_654 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_655 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\tstructuralFeatures2Refresher.put(";
- protected final String TEXT_656 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);" + NL + "\t\t";
- protected final String TEXT_657 = NL;
- protected final String TEXT_658 = "\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_659 = ".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_660 = ".eINSTANCE.getLineStyle_LineColor(), foregroundColorRefresher);" + NL + "\t}" + NL;
- protected final String TEXT_661 = NL;
- protected final String TEXT_662 = NL;
- protected final String TEXT_663 = 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_664 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class TreeEditPartAdapter extends ";
- protected final String TEXT_665 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic TreeEditPartAdapter() {" + NL + "\t\t\tsuper(getDiagramNode(), ";
- protected final String TEXT_666 = ".getInstance().getItemProvidersAdapterFactory());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void createEditPolicies() {";
- protected final String TEXT_667 = NL;
- protected final String TEXT_668 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_669 = ".COMPONENT_ROLE, new ";
- protected final String TEXT_670 = "()";
- protected final String TEXT_671 = " {" + NL + "\t\t\tprotected ";
- protected final String TEXT_672 = " getGraphicalEditPart() {" + NL + "\t\t\t\treturn ";
- protected final String TEXT_673 = ".this;" + NL + "\t\t\t}" + NL + "\t\t}";
- protected final String TEXT_674 = ");";
- protected final String TEXT_675 = NL;
- protected final String TEXT_676 = "\t\tinstallEditPolicy(";
- protected final String TEXT_677 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_678 = "());";
- protected final String TEXT_679 = NL + "\t\t}" + NL;
- protected final String TEXT_680 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_681 = " createLabelTextDisplayer() {" + NL + "\t\t\t";
- protected final String TEXT_682 = " primaryLabelEditPart = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabelEditPart != null) {" + NL + "\t\t\t\treturn primaryLabelEditPart.getLabelTextDisplayer();" + NL + "\t\t\t}" + NL + "\t\t\treturn super.createLabelTextDisplayer();" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_683 = " getImage() {" + NL + "\t\t\t";
- protected final String TEXT_684 = " primaryLabelEditPart = getPrimaryLabelEditPart();" + NL + "\t\t\tif (primaryLabelEditPart != null) {" + NL + "\t\t\t\treturn primaryLabelEditPart.getLabelIcon();" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_685 = " getPrimaryLabelEditPart() {" + NL + "\t\t\tfor(";
- protected final String TEXT_686 = " it = getDiagramNode().getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t";
- protected final String TEXT_687 = " nextChild = (";
- protected final String TEXT_688 = ")it.next();" + NL + "\t\t\t\tif (";
- protected final String TEXT_689 = ".getVisualID(nextChild) == ";
- protected final String TEXT_690 = ".VISUAL_ID) {" + NL + "\t\t\t\t\treturn (";
- protected final String TEXT_691 = ") ";
- protected final String TEXT_692 = ".this.getViewer().getEditPartRegistry().get(nextChild);" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}";
- protected final String TEXT_693 = NL + NL + "\t\t/**" + NL + "\t\t * Since compartments and labels are not selectable edit parts, they are filtered from the overview as well." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
- protected final String TEXT_694 = " getModelChildren() {" + NL + "\t\t\t";
- protected final String TEXT_695 = " result = new ";
- protected final String TEXT_696 = "();" + NL + "\t\t\tfor(";
- protected final String TEXT_697 = " it = getDiagramNode().getVisibleChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t";
- protected final String TEXT_698 = " next = (";
- protected final String TEXT_699 = ") it.next();" + NL + "\t\t\t\t";
- protected final String TEXT_700 = " style = (";
- protected final String TEXT_701 = ") next.getStyle(";
- protected final String TEXT_702 = ".eINSTANCE.getDrawerStyle());" + NL + "\t\t\t\tif (style != null && style.isCollapsed()) {" + NL + "\t\t\t\t\tcontinue;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tswitch (";
- protected final String TEXT_703 = ".getVisualID(next)) {";
- protected final String TEXT_704 = NL + "\t\t\t\tcase ";
- protected final String TEXT_705 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult.add(next);" + NL + "\t\t\t\t\tbreak;";
- protected final String TEXT_706 = NL + "\t\t\t\tcase ";
- protected final String TEXT_707 = ".VISUAL_ID:" + NL + "\t\t\t\t\tresult.addAll(next.getChildren());" + NL + "\t\t\t\t\tbreak;";
- protected final String TEXT_708 = NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tresult.addAll(getDiagramNode().getSourceEdges());" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
- protected final String TEXT_709 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];
-final GenNode genNode = (GenNode) genElement;
-final GenDiagram genDiagram = genNode.getDiagram();
-boolean isXYLayout = ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions(genNode);
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc
-importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc
-importManager.registerInnerClass("TreeEditPartAdapter");
-
- stringBuffer.append(TEXT_1);
- stringBuffer.append(TEXT_2);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_3);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_4);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_5);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_6);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_7);
-
- }
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_9);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_10);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_11);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_12);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_13);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_14);
-
- }
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_16);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_17);
-
-@SuppressWarnings("unchecked")
-class NodeEditPartHelper {
- private final List myInnerLabels = new LinkedList();
- private final List myAllLabels = new LinkedList();
- private final List myExternalLabels = new LinkedList();
- private final List myPinnedCompartments = new LinkedList();
- private final List myFloatingCompartments = new LinkedList();
- private final List myContainedFeatureModelFacetLinks = new LinkedList();
- private final List myContainedTypeModelFacetLinks = new LinkedList();
- private GenNodeLabel myPrimaryLabel;
-
- public NodeEditPartHelper(GenNode genNode){
- myPrimaryLabel = null;
-
- for (Iterator labels = genNode.getLabels().iterator(); labels.hasNext();) {
- GenNodeLabel next = (GenNodeLabel) labels.next();
- if (myPrimaryLabel == null && !next.isReadOnly()){
- myPrimaryLabel = next;
- }
- myAllLabels.add(next);
- if (next instanceof GenExternalNodeLabel) {
- myExternalLabels.add(next);
- } else {
- if (next.getViewmap() instanceof ParentAssignedViewmap) {
- myInnerLabels.add(next);
- }
- }
- }
-
- for (Iterator compartments = genNode.getCompartments().iterator(); compartments.hasNext();){
- GenCompartment next = (GenCompartment) compartments.next();
- if (next.getViewmap() instanceof ParentAssignedViewmap){
- myPinnedCompartments.add(next);
- } else {
- myFloatingCompartments.add(next);
- }
- }
-
- for(Iterator it = genDiagram.getLinks().iterator(); it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) {
- continue;
- }
- GenClass containerClass;
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
- //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
- containerClass = null;
- } else {
- containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
- }
- } else if (genLink.getModelFacet() instanceof FeatureLinkModelFacet) {
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- containerClass = metaFeature.getGenClass();
- } else {
- continue;
- }
- if (containerClass != null && containerClass.getEcoreClass().isSuperTypeOf(genNode.getModelFacet().getMetaClass().getEcoreClass())) {
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- myContainedTypeModelFacetLinks.add(genLink);
- } else {
- myContainedFeatureModelFacetLinks.add(genLink);
- }
- }
- }
- }
-
- public boolean hasBothChildrenAndCompartments() {
- return !genNode.getCompartments().isEmpty() && !genNode.getChildNodes().isEmpty();
- }
-
- public boolean containsLinks() {
- return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
- }
-
- public boolean containsFeatureModelFacetLinks() {
- return !myContainedFeatureModelFacetLinks.isEmpty();
- }
-
- public boolean containsTypeModelFacetLinks() {
- return !myContainedTypeModelFacetLinks.isEmpty();
- }
-
- public boolean hasInnerFixedLabels(){
- return !myInnerLabels.isEmpty();
- }
-
- public boolean hasPinnedCompartments(){
- return !myPinnedCompartments.isEmpty();
- }
-
- public boolean hasFixedChildren(){
- return hasInnerFixedLabels() || hasPinnedCompartments();
- }
-
- public boolean hasExternalLabels(){
- return !myExternalLabels.isEmpty();
- }
-
- public GenNodeLabel getPrimaryLabel(){
- return myPrimaryLabel;
- }
-
- public Iterator getInnerFixedLabels(){
- return myInnerLabels.iterator();
- }
-
- public Iterator getExternalLabels(){
- return myExternalLabels.iterator();
- }
-
- public Iterator getPinnedCompartments(){
- return myPinnedCompartments.iterator();
- }
-
- public Iterator getAllLabels() {
- return myAllLabels.iterator();
- }
-
- public Iterator getContainedFeatureModelFacetLinks() {
- return myContainedFeatureModelFacetLinks.iterator();
- }
-
- public Iterator getContainedTypeModelFacetLinks() {
- return myContainedTypeModelFacetLinks.iterator();
- }
-}
-final NodeEditPartHelper myHelper = new NodeEditPartHelper(genNode);
-
- stringBuffer.append(TEXT_18);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_19);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_20);
- }
- stringBuffer.append(TEXT_21);
- importManager.emitPackageStatement(stringBuffer);
-
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_22);
- stringBuffer.append(genNode.getEditPartClassName());
- stringBuffer.append(TEXT_23);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart"));
- stringBuffer.append(TEXT_24);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.NodeEditPart"));
- stringBuffer.append(TEXT_25);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_26);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_27);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecoratableEditPart"));
- stringBuffer.append(TEXT_28);
- {
-GenCommonBase genCommonBase = genNode;
- stringBuffer.append(TEXT_29);
- stringBuffer.append(TEXT_30);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_31);
- }
- stringBuffer.append(TEXT_32);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_35);
-
- if (myHelper.hasBothChildrenAndCompartments()) {
-
- stringBuffer.append(TEXT_36);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_37);
-
- }
-
- stringBuffer.append(TEXT_38);
- stringBuffer.append(genNode.getEditPartClassName());
- stringBuffer.append(TEXT_39);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_40);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_41);
- stringBuffer.append(TEXT_42);
- stringBuffer.append(TEXT_43);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_44);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_45);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_46);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_47);
- stringBuffer.append(TEXT_48);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_50);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_51);
-
-}
-
- stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_53);
- stringBuffer.append(importManager.getImportedName(genNode.getGraphicalNodeEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_54);
-
-if (myHelper.getPrimaryLabel() != null) {
-
- stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.DelegatingDirectEditPolicy"));
- stringBuffer.append(TEXT_57);
-
-}
-
- {
-GenCommonBase genCommonBase = genNode;
- stringBuffer.append(TEXT_58);
-
-String layoutEditPolicyClassName = genCommonBase.getEditPartClassName();
-if (layoutEditPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- layoutEditPolicyClassName = layoutEditPolicyClassName.substring(0, layoutEditPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
-}
-layoutEditPolicyClassName = genDiagram.getEditPoliciesPackageName() + "." + layoutEditPolicyClassName + "LayoutEditPolicy";
-
- stringBuffer.append(TEXT_59);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName(layoutEditPolicyClassName));
- stringBuffer.append(TEXT_61);
- stringBuffer.append(TEXT_62);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_63);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_64);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_65);
- }
- stringBuffer.append(TEXT_66);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_67);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_68);
- if (i > 0) {
- stringBuffer.append(TEXT_69);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_70);
- }
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_72);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_73);
-
-if (!genNode.getChildNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_74);
-
-}
-
-
-if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_75);
-
-}
-
- stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_77);
-
-if (genNode.getPrimaryDragEditPolicyQualifiedClassName() != null) {
-
- stringBuffer.append(TEXT_78);
- stringBuffer.append(importManager.getImportedName(genNode.getPrimaryDragEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_79);
-
-} else {
- if (genNode.getCompartments().isEmpty()) {
-
- stringBuffer.append(TEXT_80);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
- stringBuffer.append(TEXT_82);
-
- } else {
-
- stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
- stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editpolicies.ResizableEditPolicy"));
- stringBuffer.append(TEXT_85);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_89);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_91);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_93);
-
- for (Iterator compartments = genNode.getCompartments().iterator(); compartments.hasNext();){
- GenCompartment next = (GenCompartment) compartments.next();
-
- stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_95);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_96);
-
- }
-
- stringBuffer.append(TEXT_97);
-
- }
- ResizeConstraints rc = (ResizeConstraints) genNode.getViewmap().find(ResizeConstraints.class);
- if (rc != null) {
- if (rc.getResizeHandles() == 0) {
-
- stringBuffer.append(TEXT_98);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
- stringBuffer.append(TEXT_99);
-
- } else {
-
- stringBuffer.append(TEXT_100);
-
- for (Iterator it = rc.getResizeHandleNames().iterator(); it.hasNext(); ) {
- String next = (String) it.next();
-
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.PositionConstants"));
- stringBuffer.append(TEXT_101);
- stringBuffer.append(next);
-
- if (it.hasNext()) {
- stringBuffer.append(TEXT_102);
-
- }
- }
-
- stringBuffer.append(TEXT_103);
-
- }
- }
-
- stringBuffer.append(TEXT_104);
-
-}
-
- stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.StackLayout"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_110);
-
- if (myHelper.hasBothChildrenAndCompartments()) {
-
- stringBuffer.append(TEXT_111);
-
- }
-
- stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_113);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.PaneDecorationManager"));
- stringBuffer.append(TEXT_116);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager"));
- stringBuffer.append(TEXT_117);
-
- if (!genNode.getCompartments().isEmpty() && !genNode.getChildNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.RectangleFigure"));
- stringBuffer.append(TEXT_121);
-
- }
-
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_123);
-
-String figureQualifiedClassName = null;
-Viewmap viewmap = genNode.getViewmap();
-if (viewmap instanceof FigureViewmap) {
- figureQualifiedClassName = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassName == null || figureQualifiedClassName.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.draw2d.RectangleFigure";
- }
-
- stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName(figureQualifiedClassName));
- stringBuffer.append(TEXT_125);
- if (isXYLayout) {
- stringBuffer.append(TEXT_126);
- } /* use flow layout*/
- stringBuffer.append(TEXT_127);
- } else if (viewmap instanceof SnippetViewmap) {
- stringBuffer.append(TEXT_128);
- stringBuffer.append(((SnippetViewmap) viewmap).getBody());
- stringBuffer.append(TEXT_129);
- } else if (viewmap instanceof InnerClassViewmap) {
- figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
-
- stringBuffer.append(TEXT_130);
- stringBuffer.append(figureQualifiedClassName);
- stringBuffer.append(TEXT_131);
- stringBuffer.append(figureQualifiedClassName);
- stringBuffer.append(TEXT_132);
- if (!genNode.getChildNodes().isEmpty() && isXYLayout) { /*otherwise, leave to figure's default value*/
- stringBuffer.append(TEXT_133);
- }
- stringBuffer.append(TEXT_134);
- }
- stringBuffer.append(TEXT_135);
- if (figureQualifiedClassName != null) {
- stringBuffer.append(TEXT_136);
- stringBuffer.append(figureQualifiedClassName);
- stringBuffer.append(TEXT_137);
- stringBuffer.append(figureQualifiedClassName);
- stringBuffer.append(TEXT_138);
- }
- stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Figure"));
- stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_142);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_143);
-
-if (!isXYLayout) {
- String layoutClassName = importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout");
-
- stringBuffer.append(TEXT_144);
- stringBuffer.append(layoutClassName);
- stringBuffer.append(TEXT_145);
- stringBuffer.append(layoutClassName);
- stringBuffer.append(TEXT_146);
- } else {
- stringBuffer.append(TEXT_147);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayout"));
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_150);
- }
- stringBuffer.append(TEXT_151);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_152);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_153);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_154);
-
- if (myHelper.hasFixedChildren()) {
-
- stringBuffer.append(TEXT_155);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_156);
-
-for (Iterator it = myHelper.getInnerFixedLabels(); it.hasNext(); ) {
- GenNodeLabel genLabel = (GenNodeLabel) it.next();
- final String labelEditPart = importManager.getImportedName(genLabel.getEditPartQualifiedClassName());
- final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) genLabel.getViewmap();
- final String childSetterName = childViewmap.getSetterName() == null ? "setLabel" : childViewmap.getSetterName();
-
- stringBuffer.append(TEXT_157);
- stringBuffer.append(labelEditPart);
- stringBuffer.append(TEXT_158);
- stringBuffer.append(labelEditPart);
- stringBuffer.append(TEXT_159);
- stringBuffer.append(childSetterName);
- stringBuffer.append(TEXT_160);
- stringBuffer.append(childViewmap.getGetterName());
- stringBuffer.append(TEXT_161);
-
-}
-
-for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) {
- GenCompartment next = (GenCompartment) it.next();
- final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
- String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
-
- stringBuffer.append(TEXT_162);
- stringBuffer.append(compartmentEditPartFQN);
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(childViewmap.getGetterName());
- stringBuffer.append(TEXT_165);
- stringBuffer.append(compartmentEditPartFQN);
- stringBuffer.append(TEXT_166);
-
-} // for pinned compartments
-
- stringBuffer.append(TEXT_167);
-
-//XXX: ignore labels assuming that they never may be removed
-for (Iterator it = myHelper.getPinnedCompartments(); it.hasNext(); ) {
- GenCompartment next = (GenCompartment) it.next();
- final ParentAssignedViewmap childViewmap = (ParentAssignedViewmap) next.getViewmap();
- String compartmentEditPartFQN = importManager.getImportedName(next.getEditPartQualifiedClassName());
-
- stringBuffer.append(TEXT_168);
- stringBuffer.append(compartmentEditPartFQN);
- stringBuffer.append(TEXT_169);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_170);
- stringBuffer.append(childViewmap.getGetterName());
- stringBuffer.append(TEXT_171);
- stringBuffer.append(compartmentEditPartFQN);
- stringBuffer.append(TEXT_172);
-
-} // for pinned compartments
-
- stringBuffer.append(TEXT_173);
-
-} // if myHelper.hasFixedChildren()
-
- stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_175);
-
- if (myHelper.getPrimaryLabel() != 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(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_179);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_180);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_181);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_182);
-
- }
-
- 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(TEXT_185);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_186);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_187);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_188);
- stringBuffer.append(TEXT_189);
- stringBuffer.append(TEXT_190);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_191);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_192);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_193);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest"));
- stringBuffer.append(TEXT_194);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_195);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_196);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_198);
-
- for (Iterator it = myHelper.getAllLabels(); it.hasNext(); ) {
- GenNodeLabel genLabel = (GenNodeLabel) it.next();
- if (genLabel.isReadOnly()) {
- continue;
- }
-
- stringBuffer.append(TEXT_199);
- stringBuffer.append(importManager.getImportedName(genLabel.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_200);
-
- }
-
- stringBuffer.append(TEXT_201);
-
-if (myHelper.hasExternalLabels()) {
-
- stringBuffer.append(TEXT_202);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_203);
-
- for (Iterator externalLabels = myHelper.getExternalLabels(); externalLabels.hasNext();) {
- GenNodeLabel next = (GenNodeLabel) externalLabels.next();
-
- stringBuffer.append(TEXT_204);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_205);
-
- }
-
- stringBuffer.append(TEXT_206);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_207);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
- stringBuffer.append(TEXT_208);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.LayerManager"));
- stringBuffer.append(TEXT_209);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_210);
-
-}
-if (!genNode.getChildNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_211);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_212);
-
- for(Iterator directChildren = genNode.getChildNodes().iterator(); directChildren.hasNext(); ) {
- GenChildNode next = (GenChildNode) directChildren.next();
-
- stringBuffer.append(TEXT_213);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_214);
-
- }
-
- stringBuffer.append(TEXT_215);
-
-}
-if (myHelper.hasExternalLabels() || myHelper.hasFixedChildren() || myHelper.hasBothChildrenAndCompartments()) {
-
- stringBuffer.append(TEXT_216);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_217);
-
- if (myHelper.hasExternalLabels()) {
-
- stringBuffer.append(TEXT_218);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_219);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_220);
-
- }
- if (myHelper.hasFixedChildren()) {
-
- stringBuffer.append(TEXT_221);
-
- }
- if (myHelper.hasBothChildrenAndCompartments()) {
-
- stringBuffer.append(TEXT_222);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_223);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_224);
-
- }
-
- stringBuffer.append(TEXT_225);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_226);
-
- if (myHelper.hasExternalLabels()) {
-
- stringBuffer.append(TEXT_227);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_228);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_229);
-
- }
- if (myHelper.hasFixedChildren()){
-
- stringBuffer.append(TEXT_230);
-
- }
- if (myHelper.hasBothChildrenAndCompartments()) {
-
- stringBuffer.append(TEXT_231);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_232);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_233);
-
- }
-
- stringBuffer.append(TEXT_234);
-
-}
-
-
-if (myHelper.hasExternalLabels()) {
-
- stringBuffer.append(TEXT_235);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_236);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_237);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPart"));
- stringBuffer.append(TEXT_238);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_239);
-
-}
-
- stringBuffer.append(TEXT_240);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_241);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
- stringBuffer.append(TEXT_242);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
- stringBuffer.append(TEXT_243);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Bounds"));
- stringBuffer.append(TEXT_244);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_245);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_246);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_247);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_248);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_249);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
- stringBuffer.append(TEXT_250);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
- stringBuffer.append(TEXT_251);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
- stringBuffer.append(TEXT_252);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
- stringBuffer.append(TEXT_253);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_254);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
- stringBuffer.append(TEXT_255);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
- stringBuffer.append(TEXT_256);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ConnectionEditPart"));
- stringBuffer.append(TEXT_257);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
- stringBuffer.append(TEXT_258);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ConnectionAnchor"));
- stringBuffer.append(TEXT_259);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_260);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.ChopboxAnchor"));
- stringBuffer.append(TEXT_261);
-
-if (!genNode.getChildNodes().isEmpty() && isXYLayout) {
-
- stringBuffer.append(TEXT_262);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToHelper"));
- stringBuffer.append(TEXT_263);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.SnapToGrid"));
- stringBuffer.append(TEXT_264);
-
-}
-
- stringBuffer.append(TEXT_265);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.TreeEditPart"));
- stringBuffer.append(TEXT_266);
- /*@ include file="adapters/propertySource.javajetinc"*/
- stringBuffer.append(TEXT_267);
-
-if (!genNode.getChildNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_268);
-
-}
-
-
-if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_269);
-
-}
-
- stringBuffer.append(TEXT_270);
-
-if (myHelper.containsLinks()) {
-
- stringBuffer.append(TEXT_271);
-
-}
-
-
-if (!genNode.getChildNodes().isEmpty()) {
-
- stringBuffer.append(TEXT_272);
-
-}
-
- stringBuffer.append(TEXT_273);
-
-{
- final String _getViewCode = "getDiagramNode()";
- final String _getDiagramCode = "getDiagramNode().getDiagram()";
- final boolean _includeUncontainedLinks = false;
- if (!genNode.getChildNodes().isEmpty()) {
- final boolean isListLayout = !isXYLayout;
- final List childNodes = genNode.getChildNodes();
-
- stringBuffer.append(TEXT_274);
- stringBuffer.append(TEXT_275);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_276);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_277);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_278);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_279);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_280);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_281);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ChildNotationModelRefresher"));
- stringBuffer.append(TEXT_282);
-
-boolean hasConstraintsInChildren = false;
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
- hasConstraintsInChildren = true;
- break;
- }
-}
-
-
-if (hasConstraintsInChildren) {
-
- stringBuffer.append(TEXT_283);
- stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
- stringBuffer.append(TEXT_284);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_285);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_286);
-
-}
-
- stringBuffer.append(TEXT_287);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_288);
-
-{
- boolean hasDeclaredFilter = false;
- Set genChildFeatures = new LinkedHashSet();
- for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (genChildFeatures.contains(childMetaFeature)) {
- continue;
- }
- genChildFeatures.add(childMetaFeature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_289);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_290);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_291);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_292);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_293);
-
- } else {
-
- stringBuffer.append(TEXT_294);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_295);
- stringBuffer.append(importManager.getImportedName(childMetaFeature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_296);
- stringBuffer.append(childMetaFeature.getFeatureAccessorName());
- stringBuffer.append(TEXT_297);
-
- }
- } //for
-
-
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_298);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_299);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_300);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_301);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_302);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_303);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_304);
-
- }
-
-
- if (hasConstraintsInChildren) {
- if (hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_305);
-
- } else {
-
- stringBuffer.append(TEXT_306);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_307);
-
- }
- }
- if (!hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_308);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_309);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_310);
-
- }
-
- stringBuffer.append(TEXT_311);
-
-} //local declaration of hasDeclaredFilter
-
- stringBuffer.append(TEXT_312);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_313);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_314);
-
-{
- String _parentNode = "getHost()";
-
- stringBuffer.append(TEXT_315);
- stringBuffer.append(TEXT_316);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_317);
-
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
-
- stringBuffer.append(TEXT_318);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_319);
- stringBuffer.append(childNodeInterfaceName);
- stringBuffer.append(TEXT_320);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
- stringBuffer.append(TEXT_321);
- stringBuffer.append(_parentNode);
- stringBuffer.append(TEXT_322);
-
- if (!isListLayout) {
- int defaultWidth = 40;
- int defaultHeight = 40;
- DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class);
- if (defSizeAttrs != null) {
- defaultWidth = defSizeAttrs.getWidth();
- defaultHeight = defSizeAttrs.getHeight();
- }
-
- stringBuffer.append(TEXT_323);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
- stringBuffer.append(TEXT_324);
- stringBuffer.append(defaultWidth);
- stringBuffer.append(TEXT_325);
- stringBuffer.append(defaultHeight);
- stringBuffer.append(TEXT_326);
-
- } else {
-
- stringBuffer.append(TEXT_327);
-
- }
-
- stringBuffer.append(TEXT_328);
- stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_329);
-
-}
-
- stringBuffer.append(TEXT_330);
-
-}
-
- stringBuffer.append(TEXT_331);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_332);
- stringBuffer.append(TEXT_333);
-
-if (childNodes.size() == 0) {
-
- stringBuffer.append(TEXT_334);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_335);
-
-} else {
-
- stringBuffer.append(TEXT_336);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_337);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_338);
-
- Map genFeature2genNodeMap = new LinkedHashMap();
- for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
- GenNode nextNode = (GenNode) childNodes.get(nodeIndex);
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (!genFeature2genNodeMap.containsKey(childMetaFeature)) {
- genFeature2genNodeMap.put(childMetaFeature, new ArrayList());
- }
- ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode);
- }
- Set entrySet = genFeature2genNodeMap.entrySet();
- if (entrySet.size() > 0) {
-
- stringBuffer.append(TEXT_339);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_340);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_341);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_342);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_343);
-
- }
- for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature childMetaFeature = (GenFeature) nextEntry.getKey();
- Collection genNodesCollection = (Collection) nextEntry.getValue();
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_344);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_345);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
- stringBuffer.append(TEXT_346);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_347);
-
- } else {
-
- stringBuffer.append(TEXT_348);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_349);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
- stringBuffer.append(TEXT_350);
-
- }
-
- stringBuffer.append(TEXT_351);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_352);
-
- boolean generateSwitch = genNodesCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_353);
-
- }
- for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
- GenNode nextNode = (GenNode) genNodesIterator.next();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_354);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_355);
-
- } else {
-
- stringBuffer.append(TEXT_356);
- stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_357);
-
- }
-
- stringBuffer.append(TEXT_358);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_359);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_360);
-
- } else {
-
- stringBuffer.append(TEXT_361);
-
- }
- }
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_362);
-
- }
- if (childMetaFeature.isListType()) {
-
- stringBuffer.append(TEXT_363);
-
- }
-}
-
- stringBuffer.append(TEXT_364);
-
-}
-
- stringBuffer.append(TEXT_365);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_366);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_367);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_368);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_369);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_370);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher"));
- stringBuffer.append(TEXT_371);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_372);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_373);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_374);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_375);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_376);
-
- }
-
- stringBuffer.append(TEXT_377);
-
-if (myHelper.containsLinks() || _includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_378);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_379);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_380);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_381);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_382);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_383);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.EditPartRegistryBasedViewService"));
- stringBuffer.append(TEXT_384);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.OwnedLinksNotationModelRefresher"));
- stringBuffer.append(TEXT_385);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
- stringBuffer.append(TEXT_386);
-
- boolean hasConstraintsInContainedLinks = false;
- for (Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeModelFacet typeModelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (typeModelFacet != null && typeModelFacet.getMetaClass() != null && typeModelFacet.getModelElementSelector() != null) {
- hasConstraintsInContainedLinks = true;
- break;
- }
- }
- if (hasConstraintsInContainedLinks) {
-
- stringBuffer.append(TEXT_387);
- stringBuffer.append(genDiagram.getVisualIDRegistryQualifiedClassName());
- stringBuffer.append(TEXT_388);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_389);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_390);
-
- }
- if (_includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_391);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_392);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_393);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_394);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_395);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_396);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_397);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_398);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_399);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_400);
-
- }
-
- stringBuffer.append(TEXT_401);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_402);
-
- {
- boolean hasDeclaredFilter = false;
- Set genAffectingFeatures = new LinkedHashSet();
- for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
- GenFeature _feature = modelFacet.getChildMetaFeature();
-
- stringBuffer.append(TEXT_403);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_404);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_405);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_406);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_407);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_408);
-
- } else {
-
- stringBuffer.append(TEXT_409);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_410);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_411);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_412);
-
- }
-
-
- _feature = modelFacet.getSourceMetaFeature();
-
- stringBuffer.append(TEXT_413);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_414);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_415);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_416);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_417);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_418);
-
- } else {
-
- stringBuffer.append(TEXT_419);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_420);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_421);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_422);
-
- }
-
-
- _feature = modelFacet.getTargetMetaFeature();
-
- stringBuffer.append(TEXT_423);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_424);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_425);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_426);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_427);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_428);
-
- } else {
-
- stringBuffer.append(TEXT_429);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_430);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_431);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_432);
-
- }
-
-
- }
- for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- GenFeature _feature = ((FeatureLinkModelFacet) nextLink.getModelFacet()).getMetaFeature();
-
- stringBuffer.append(TEXT_433);
-
- /*
- * input:
- * _feature: GenFeature
- * genAffectingFeatures : Set
- */
- if (_feature == null || genAffectingFeatures.contains(_feature)) {
- continue;
- }
- genAffectingFeatures.add(_feature);
- if (!hasDeclaredFilter) {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_434);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_435);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_436);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_437);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_438);
-
- } else {
-
- stringBuffer.append(TEXT_439);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_440);
- stringBuffer.append(importManager.getImportedName(_feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_441);
- stringBuffer.append(_feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_442);
-
- }
-
-
- }
- if (hasConstraintsInContainedLinks) {
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_443);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_444);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_445);
-
- }
- }
- if (_includeUncontainedLinks) {
- if (hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_446);
-
- } else {
- hasDeclaredFilter = true;
-
- stringBuffer.append(TEXT_447);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_448);
-
- }
- }
- if (!hasDeclaredFilter) {
-
- stringBuffer.append(TEXT_449);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_450);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.NotificationFilter"));
- stringBuffer.append(TEXT_451);
-
- }
- } //local declaration of hasDeclaredFilter
-
- stringBuffer.append(TEXT_452);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
- stringBuffer.append(TEXT_453);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_454);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_455);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_456);
-
-{
- Iterator _containedTypeModelFacetLinks = myHelper.getContainedTypeModelFacetLinks();
- Iterator _containedFeatureModelFacetLinks = myHelper.getContainedFeatureModelFacetLinks();
- String _diagramCode = "getHost().getDiagram()";
-
- stringBuffer.append(TEXT_457);
- stringBuffer.append(TEXT_458);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_459);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_460);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator"));
- stringBuffer.append(TEXT_461);
-
- for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
-
- stringBuffer.append(TEXT_462);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_463);
- stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_464);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_465);
-
- }
- for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_466);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_467);
- stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
- stringBuffer.append(TEXT_468);
-
- }
-
- stringBuffer.append(TEXT_469);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand"));
- stringBuffer.append(TEXT_470);
- stringBuffer.append(_diagramCode);
- stringBuffer.append(TEXT_471);
-
-}
-
- stringBuffer.append(TEXT_472);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_473);
-
-{
- Iterator _containedTypeModelFacetLinks = myHelper.getContainedTypeModelFacetLinks();
- Iterator _containedFeatureModelFacetLinks = myHelper.getContainedFeatureModelFacetLinks();
-
- stringBuffer.append(TEXT_474);
- stringBuffer.append(TEXT_475);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_476);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_477);
-
-Map genFeature2genLinkMap = new LinkedHashMap();
-for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- GenFeature metaFeature = modelFacet.getChildMetaFeature();
- if (!genFeature2genLinkMap.containsKey(metaFeature)) {
- genFeature2genLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
-}
-Map genFeature2featureGenLinkMap = new LinkedHashMap();
-for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
- genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
-}
-if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_478);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_479);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_480);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_481);
-
-}
-if (!genFeature2genLinkMap.isEmpty()) {
-
- stringBuffer.append(TEXT_482);
-
-}
-for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_483);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_484);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_485);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_486);
-
- } else {
-
- stringBuffer.append(TEXT_487);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_488);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_489);
-
- }
-
- stringBuffer.append(TEXT_490);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_491);
-
- boolean generateSwitch = genLinksCollection.size() != 1;
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_492);
-
- }
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_493);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_494);
-
- } else {
-
- stringBuffer.append(TEXT_495);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_496);
-
- }
- if (modelFacet.getSourceMetaFeature() != null) {
-
- stringBuffer.append(TEXT_497);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_498);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_499);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);
- stringBuffer.append(TEXT_500);
-
- } else {
-
- stringBuffer.append(TEXT_501);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_502);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_503);
-
- }
- if (modelFacet.getTargetMetaFeature() != null) {
-
- stringBuffer.append(TEXT_504);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_505);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_506);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);
- stringBuffer.append(TEXT_507);
-
- } else {
-
- stringBuffer.append(TEXT_508);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_509);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_510);
-
- }
-
- stringBuffer.append(TEXT_511);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_512);
-
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_513);
-
- } else {
-
- stringBuffer.append(TEXT_514);
-
- }
-
-
- } //iterate over genLinksCollection
- if (generateSwitch) {
-
- stringBuffer.append(TEXT_515);
-
- }
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_516);
-
- }
-}
-for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_517);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_518);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
- stringBuffer.append(TEXT_519);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_520);
-
- } else {
-
- stringBuffer.append(TEXT_521);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_522);
- myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
- stringBuffer.append(TEXT_523);
-
- }
-
- stringBuffer.append(TEXT_524);
-
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
-
- stringBuffer.append(TEXT_525);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
- stringBuffer.append(TEXT_526);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_527);
-
- }
-
- stringBuffer.append(TEXT_528);
-
- if (metaFeature.isListType()) {
-
- stringBuffer.append(TEXT_529);
-
- }
-}
-
- stringBuffer.append(TEXT_530);
-
-}
-
- stringBuffer.append(TEXT_531);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_532);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_533);
- stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
- stringBuffer.append(TEXT_534);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_535);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_536);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_537);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_538);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge"));
- stringBuffer.append(TEXT_539);
-
- if (_includeUncontainedLinks) {
-
- stringBuffer.append(TEXT_540);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_541);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_542);
-
- }
- if (myHelper.containsFeatureModelFacetLinks()) {
-
- stringBuffer.append(TEXT_543);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_544);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_545);
-
- for(Iterator it = myHelper.getContainedFeatureModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_546);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_547);
-
- }
-
- stringBuffer.append(TEXT_548);
-
- if (myHelper.containsTypeModelFacetLinks()) {
-
- stringBuffer.append(TEXT_549);
-
- } else {
-
- stringBuffer.append(TEXT_550);
-
- }
- }
- if (myHelper.containsTypeModelFacetLinks()) {
- if (!myHelper.containsFeatureModelFacetLinks()) {
-
- stringBuffer.append(TEXT_551);
-
- }
-
- stringBuffer.append(TEXT_552);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_553);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_554);
-
- for(Iterator it = myHelper.getContainedTypeModelFacetLinks(); it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-
- stringBuffer.append(TEXT_555);
- stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_556);
-
- }
-
- stringBuffer.append(TEXT_557);
-
- }
-
- stringBuffer.append(TEXT_558);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_559);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
- stringBuffer.append(TEXT_560);
- stringBuffer.append(genDiagram.isSynchronized());
- stringBuffer.append(TEXT_561);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_562);
- stringBuffer.append(_getViewCode);
- stringBuffer.append(TEXT_563);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.AbstractNotationModelRefresher"));
- stringBuffer.append(TEXT_564);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_565);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
- stringBuffer.append(TEXT_566);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil"));
- stringBuffer.append(TEXT_567);
- stringBuffer.append(_getDiagramCode);
- stringBuffer.append(TEXT_568);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_569);
-
-}
-
-
-} //end of local declarations
-
- stringBuffer.append(TEXT_570);
- stringBuffer.append(TEXT_571);
- stringBuffer.append(TEXT_572);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_573);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.RefreshAdapter"));
- stringBuffer.append(TEXT_574);
- stringBuffer.append(TEXT_575);
- stringBuffer.append(TEXT_576);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_577);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_578);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_579);
- stringBuffer.append(TEXT_580);
- stringBuffer.append(TEXT_581);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_582);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
- stringBuffer.append(TEXT_583);
- stringBuffer.append(importManager.getImportedName("java.util.Collection"));
- stringBuffer.append(TEXT_584);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_585);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_586);
-
- final String primaryView = "getDiagramNode()";
-
- stringBuffer.append(TEXT_587);
-
-boolean isFixedFontSetInFigure;
-{
- StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
- isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
-}
-
- stringBuffer.append(TEXT_588);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_589);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_590);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_591);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_592);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_593);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_594);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_595);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_596);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_597);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_598);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
- stringBuffer.append(TEXT_599);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_600);
-
-}
-
- stringBuffer.append(TEXT_601);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_602);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_603);
-
-}
-
- stringBuffer.append(TEXT_604);
- stringBuffer.append(TEXT_605);
- stringBuffer.append(TEXT_606);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
- stringBuffer.append(TEXT_607);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.LineStyle"));
- stringBuffer.append(TEXT_608);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_609);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_610);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_611);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_612);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_613);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_614);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
- stringBuffer.append(TEXT_615);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FillStyle"));
- stringBuffer.append(TEXT_616);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_617);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_618);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_619);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_620);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_621);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_622);
- stringBuffer.append(TEXT_623);
- stringBuffer.append(TEXT_624);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_625);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_626);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.Notification"));
- stringBuffer.append(TEXT_627);
- stringBuffer.append(importManager.getImportedName("java.util.HashMap"));
- stringBuffer.append(TEXT_628);
- stringBuffer.append(TEXT_629);
- stringBuffer.append(TEXT_630);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_631);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_632);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_633);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_634);
- stringBuffer.append(TEXT_635);
- stringBuffer.append(TEXT_636);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_637);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_638);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_639);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_640);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_641);
- stringBuffer.append(TEXT_642);
- stringBuffer.append(TEXT_643);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_644);
- stringBuffer.append(TEXT_645);
- stringBuffer.append(TEXT_646);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_647);
- stringBuffer.append(TEXT_648);
- stringBuffer.append(TEXT_649);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_650);
- stringBuffer.append(TEXT_651);
- stringBuffer.append(TEXT_652);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_653);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_654);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_655);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_656);
- stringBuffer.append(TEXT_657);
- stringBuffer.append(TEXT_658);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_659);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_660);
-
-if (genNode.getViewmap() instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) genNode.getViewmap()).getClassBody();
-
- stringBuffer.append(TEXT_661);
- stringBuffer.append(classBody);
- stringBuffer.append(TEXT_662);
-
-if (classBody.indexOf("DPtoLP") != -1) {
-
- stringBuffer.append(TEXT_663);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_664);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart"));
- stringBuffer.append(TEXT_665);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
- stringBuffer.append(TEXT_666);
- stringBuffer.append(TEXT_667);
-
-{
- /*See xpt::diagram::policies::ClassNames.ext#getComponentEditPolicyClassName(GenCommonBase)*/
- String editPolicyClassName = genElement.getEditPartClassName();
- if (editPolicyClassName.endsWith(GenCommonBase.EDIT_PART_SUFFIX)) {
- editPolicyClassName = editPolicyClassName.substring(0, editPolicyClassName.length() - GenCommonBase.EDIT_PART_SUFFIX.length());
- }
- editPolicyClassName += "ComponentEditPolicy";
-
- stringBuffer.append(TEXT_668);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_669);
- stringBuffer.append(importManager.getImportedName(genDiagram.getEditPoliciesPackageName() + "." + editPolicyClassName));
- stringBuffer.append(TEXT_670);
-
- if (genElement instanceof GenNode) {
- stringBuffer.append(TEXT_671);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_672);
- stringBuffer.append(genElement.getEditPartClassName());
- stringBuffer.append(TEXT_673);
- }
- stringBuffer.append(TEXT_674);
-
-}
-
-
-if (myHelper.getPrimaryLabel() != null) {
-
- stringBuffer.append(TEXT_675);
- stringBuffer.append(TEXT_676);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_677);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_678);
-
-}
-
- stringBuffer.append(TEXT_679);
-
-if (myHelper.getPrimaryLabel() != null) {
-
- stringBuffer.append(TEXT_680);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_681);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_682);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_683);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_684);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_685);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_686);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_687);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_688);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_689);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_690);
- stringBuffer.append(importManager.getImportedName(myHelper.getPrimaryLabel().getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_691);
- stringBuffer.append(genNode.getEditPartClassName());
- stringBuffer.append(TEXT_692);
-
-}
-
- stringBuffer.append(TEXT_693);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_694);
- stringBuffer.append(importManager.getImportedName("java.util.List"));
- stringBuffer.append(TEXT_695);
- stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
- stringBuffer.append(TEXT_696);
- stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
- stringBuffer.append(TEXT_697);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_698);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
- stringBuffer.append(TEXT_699);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle"));
- stringBuffer.append(TEXT_700);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle"));
- stringBuffer.append(TEXT_701);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_702);
- stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_703);
-
- for(Iterator it = genNode.getChildNodes().iterator(); it.hasNext(); ) {
- GenChildNode next = (GenChildNode)it.next();
-
- stringBuffer.append(TEXT_704);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_705);
-
-}
-
-
- for (Iterator compartments = genNode.getCompartments().iterator(); compartments.hasNext();){
- GenCompartment next = (GenCompartment) compartments.next();
-
- stringBuffer.append(TEXT_706);
- stringBuffer.append(importManager.getImportedName(next.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_707);
-
-}
-
- stringBuffer.append(TEXT_708);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_709);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java
deleted file mode 100644
index cf1bcf574..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/parts/NodeLabelEditPartGenerator.java
+++ /dev/null
@@ -1,887 +0,0 @@
-package org.eclipse.gmf.codegen.templates.lite.parts;
-
-import java.util.*;
-import org.eclipse.gmf.codegen.gmfgen.*;
-import org.eclipse.gmf.common.codegen.*;
-import org.eclipse.emf.codegen.ecore.genmodel.*;
-import org.eclipse.emf.ecore.*;
-
-public class NodeLabelEditPartGenerator
-{
- protected static String nl;
- public static synchronized NodeLabelEditPartGenerator create(String lineSeparator)
- {
- nl = lineSeparator;
- NodeLabelEditPartGenerator result = new NodeLabelEditPartGenerator();
- nl = null;
- return result;
- }
-
- protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "";
- protected final String TEXT_2 = NL + "/*" + NL + " * ";
- protected final String TEXT_3 = NL + " */";
- protected final String TEXT_4 = NL;
- protected final String TEXT_5 = NL;
- protected final String TEXT_6 = "((";
- protected final String TEXT_7 = ")";
- protected final String TEXT_8 = "((";
- protected final String TEXT_9 = ")";
- protected final String TEXT_10 = ")";
- protected final String TEXT_11 = ".eGet(";
- protected final String TEXT_12 = ".eINSTANCE.get";
- protected final String TEXT_13 = "())";
- protected final String TEXT_14 = ")";
- protected final String TEXT_15 = "((";
- protected final String TEXT_16 = ")";
- protected final String TEXT_17 = ")";
- protected final String TEXT_18 = ".";
- protected final String TEXT_19 = "()";
- protected final String TEXT_20 = NL;
- protected final String TEXT_21 = NL;
- protected final String TEXT_22 = NL + NL + "/**" + NL + " * @generated" + NL + " */";
- protected final String TEXT_23 = NL + "public class ";
- protected final String TEXT_24 = " extends ";
- protected final String TEXT_25 = " implements ";
- protected final String TEXT_26 = " {";
- protected final String TEXT_27 = NL;
- protected final String TEXT_28 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final int VISUAL_ID = ";
- protected final String TEXT_29 = ";";
- protected final String TEXT_30 = NL;
- protected final String TEXT_31 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_32 = " manager;" + NL;
- protected final String TEXT_33 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate String defaultText;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static final ";
- protected final String TEXT_34 = " LABEL_DISPLAYER = createLabelTextDisplayer();" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_35 = "(View view) {";
- protected final String TEXT_36 = NL + "\t\tsuper(view);";
- protected final String TEXT_37 = NL + "\t\tsetModel(view);";
- protected final String TEXT_38 = NL + "\t}" + NL;
- protected final String TEXT_39 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic boolean isSelectable() {" + NL + "\t\treturn false;" + NL + "\t}";
- protected final String TEXT_40 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_41 = " getDiagramNode() {" + NL + "\t\treturn (";
- protected final String TEXT_42 = ") getModel();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createEditPolicies() {";
- protected final String TEXT_43 = NL;
- protected final String TEXT_44 = "\t\tinstallEditPolicy(";
- protected final String TEXT_45 = ".DIRECT_EDIT_ROLE," + NL + "\t\t\t\tnew ";
- protected final String TEXT_46 = "());";
- protected final String TEXT_47 = NL;
- protected final String TEXT_48 = NL + "\t\tinstallEditPolicy(\"";
- protected final String TEXT_49 = "\", new ";
- protected final String TEXT_50 = "()); //$NON-NLS-1$";
- protected final String TEXT_51 = NL;
- protected final String TEXT_52 = NL + "\t\tinstallEditPolicy(";
- protected final String TEXT_53 = ".OPEN_ROLE";
- protected final String TEXT_54 = " + \"";
- protected final String TEXT_55 = "\" ";
- protected final String TEXT_56 = ", new ";
- protected final String TEXT_57 = "());";
- protected final String TEXT_58 = NL + "\t}" + NL;
- protected final String TEXT_59 = NL;
- protected final String TEXT_60 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void performRequest(";
- protected final String TEXT_61 = " req) {";
- protected final String TEXT_62 = NL + "\t\tif (";
- protected final String TEXT_63 = ".REQ_DIRECT_EDIT.equals(req.getType()) && understandsRequest(req)) {" + NL + "\t\t\tperformDirectEdit();" + NL + "\t\t\treturn;" + NL + "\t\t}";
- protected final String TEXT_64 = NL;
- protected final String TEXT_65 = "if (";
- protected final String TEXT_66 = ".REQ_OPEN.equals(req.getType())) {" + NL + "\t";
- protected final String TEXT_67 = " command = getCommand(req);" + NL + "\tif (command != null && command.canExecute()) {" + NL + "\t\tgetViewer().getEditDomain().getCommandStack().execute(command);" + NL + "\t}" + NL + "\treturn;" + NL + "}" + NL + "\t\tsuper.performRequest(req);" + NL + "\t}";
- protected final String TEXT_68 = NL;
- protected final String TEXT_69 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_70 = " getManager() {" + NL + "\t\tif (manager == null) {" + NL + "\t\t\tmanager = new ";
- protected final String TEXT_71 = "(this, ";
- protected final String TEXT_72 = ".class, new ";
- protected final String TEXT_73 = "(getViewer(), getLabel())) {" + NL + "\t\t\t\tprotected void initCellEditor() {" + NL + "\t\t\t\t\tgetCellEditor().setValue(getLabelTextDisplayer().getEditText(";
- protected final String TEXT_74 = ".getElement()));" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t}" + NL + "\t\treturn manager;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void performDirectEdit() {" + NL + "\t\tif (";
- protected final String TEXT_75 = ".isReadOnly(";
- protected final String TEXT_76 = ".getElement()) || ";
- protected final String TEXT_77 = ".isReadOnly(";
- protected final String TEXT_78 = ")) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\tgetManager().show();" + NL + "\t}" + NL;
- protected final String TEXT_79 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshVisuals() {" + NL + "\t\tsuper.refreshVisuals();" + NL + "\t\trefreshLabel();" + NL + "\t\trefreshFont();" + NL + "\t\trefreshFontColor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshLabel() {" + NL + "\t\tgetLabel().setText(getLabelText());" + NL + "\t\tgetLabel().setIcon(getLabelIcon());" + NL + "\t}" + NL;
- protected final String TEXT_80 = NL;
- protected final String TEXT_81 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static ";
- protected final String TEXT_82 = " createLabelTextDisplayer() {";
- protected final String TEXT_83 = NL + "\t\treturn new ";
- protected final String TEXT_84 = "(\"";
- protected final String TEXT_85 = "\"";
- protected final String TEXT_86 = ", \"";
- protected final String TEXT_87 = "\"";
- protected final String TEXT_88 = ", " + NL + "\t\t\tnew ";
- protected final String TEXT_89 = "[] {";
- protected final String TEXT_90 = NL + "\t\t";
- protected final String TEXT_91 = ".eINSTANCE.get";
- protected final String TEXT_92 = "()";
- protected final String TEXT_93 = ",";
- protected final String TEXT_94 = "});";
- protected final String TEXT_95 = NL + "\t\t// TODO: implement this method" + NL + "\t\t// Ensure that you remove @generated or mark it @generated NOT" + NL + "\t\treturn null;";
- protected final String TEXT_96 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_97 = " getLabelTextDisplayer() {" + NL + "\t\treturn LABEL_DISPLAYER;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setLabelText(String text) {" + NL + "\t\tgetLabel().setText(text);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected String getLabelText() {" + NL + "\t\t";
- protected final String TEXT_98 = " element = ";
- protected final String TEXT_99 = ".getElement();" + NL + "\t\tif (element == null) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\tString result = getLabelTextDisplayer().getDisplayText(element);" + NL + "\t\tif (result == null || result.length() == 0) {" + NL + "\t\t\treturn defaultText;" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}";
- protected final String TEXT_100 = NL;
- protected final String TEXT_101 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFont() {";
- protected final String TEXT_102 = NL + "\t\t";
- protected final String TEXT_103 = " style =" + NL + "\t\t\t(";
- protected final String TEXT_104 = ") ";
- protected final String TEXT_105 = ".getStyle(" + NL + "\t\t\t\t";
- protected final String TEXT_106 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_107 = " 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_108 = ".NORMAL;" + NL + "\t\t\tif (style.isBold()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_109 = ".BOLD;" + NL + "\t\t\t}" + NL + "\t\t\tif (style.isItalic()) {" + NL + "\t\t\t\tfontStyle |= ";
- protected final String TEXT_110 = ".ITALIC;" + NL + "\t\t\t}" + NL + "\t\t\t";
- protected final String TEXT_111 = " currentFont = getFigure().getFont();" + NL + "\t\t\tif (currentFont != null) {" + NL + "\t\t\t\t";
- protected final String TEXT_112 = " 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_113 = "(null, fontName, fontHeight, fontStyle);" + NL + "\t\t\tgetFigure().setFont(createdFont);" + NL + "\t\t} else {" + NL + "\t\t\t//revert to the default font" + NL + "\t\t\tgetFigure().setFont(getViewer().getControl().getFont());" + NL + "\t\t\tcreatedFont = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}";
- protected final String TEXT_114 = "\t" + NL + "\t}";
- protected final String TEXT_115 = 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_116 = " createdFont;";
- protected final String TEXT_117 = "\t";
- protected final String TEXT_118 = NL;
- protected final String TEXT_119 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void refreshFontColor() {" + NL + "\t\t";
- protected final String TEXT_120 = " style = (";
- protected final String TEXT_121 = ") ";
- protected final String TEXT_122 = ".getStyle(";
- protected final String TEXT_123 = ".eINSTANCE.getFontStyle());" + NL + "\t\t";
- protected final String TEXT_124 = " toDispose = createdFontColor;" + NL + "\t\tif (style != null) {" + NL + "\t\t\tint fontColor = style.getFontColor();" + NL + "\t\t\tint red = fontColor & 0x000000FF;" + NL + "\t\t\tint green = (fontColor & 0x0000FF00) >> 8;" + NL + "\t\t\tint blue = (fontColor & 0x00FF0000) >> 16;" + NL + "\t\t\t";
- protected final String TEXT_125 = " currentColor = getLabel().getForegroundColor();" + NL + "\t\t\tif (currentColor != null && currentColor.getRed() == red && currentColor.getGreen() == green && currentColor.getBlue() == blue) {" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t\tcreatedFontColor = new ";
- protected final String TEXT_126 = "(null, red, green, blue);" + NL + "\t\t\tgetFigure().setForegroundColor(createdFontColor);" + NL + "\t\t} else {" + NL + "\t\t\tgetFigure().setForegroundColor(getViewer().getControl().getForeground());" + NL + "\t\t\tcreatedFontColor = null;" + NL + "\t\t}" + NL + "\t\tif (toDispose != null) {" + NL + "\t\t\ttoDispose.dispose();" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * The color (created by {@link #refreshFontColor()}) currently assigned to the label." + NL + "\t * Whenever another color is assigned to it, it is safe to dispose the previous one." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_127 = " createdFontColor;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_128 = " getLabelIcon() {";
- protected final String TEXT_129 = NL + "\t\t";
- protected final String TEXT_130 = " semanticElement = ";
- protected final String TEXT_131 = "(";
- protected final String TEXT_132 = ") ";
- protected final String TEXT_133 = "resolveSemanticElement();" + NL + "\t\tif (semanticElement != null) {" + NL + "\t\t\treturn ";
- protected final String TEXT_134 = ".getImage(semanticElement.eClass());" + NL + "\t\t}";
- protected final String TEXT_135 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_136 = " resolveSemanticElement() {" + NL + "\t\tView view = (View) getModel();" + NL + "\t\treturn (view.getElement() instanceof ";
- protected final String TEXT_137 = ") ? (";
- protected final String TEXT_138 = ") view.getElement() : null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_139 = " getUpdatableParent() {" + NL + "\t\tfor(EditPart editPart = getParent(); editPart != null; editPart = editPart.getParent()) {" + NL + "\t\t\tif (editPart instanceof ";
- protected final String TEXT_140 = ") {" + NL + "\t\t\t\treturn (";
- protected final String TEXT_141 = ") editPart;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void activate() {" + NL + "\t\tsuper.activate();" + NL + "\t\t";
- protected final String TEXT_142 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_143 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_144 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_145 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_146 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_147 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
- protected final String TEXT_148 = NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_149 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_150 = ".eINSTANCE.getLocation_Y(), boundsRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_151 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_152 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\t\tupdatableParent.addRefresher(";
- protected final String TEXT_153 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);";
- protected final String TEXT_154 = NL + "\t\t\tupdatableParent.addExternalRefresher(getLabelRefresher());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void deactivate() {" + NL + "\t\tsuper.deactivate();" + NL + "\t\t";
- protected final String TEXT_155 = " updatableParent = getUpdatableParent();" + NL + "\t\tif (updatableParent != null) {" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_156 = ".eINSTANCE.getFontStyle_FontColor(), fontColorRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_157 = ".eINSTANCE.getFontStyle_FontHeight(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_158 = ".eINSTANCE.getFontStyle_FontName(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_159 = ".eINSTANCE.getFontStyle_Bold(), fontRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_160 = ".eINSTANCE.getFontStyle_Italic(), fontRefresher);";
- protected final String TEXT_161 = NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_162 = ".eINSTANCE.getLocation_X(), boundsRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_163 = ".eINSTANCE.getLocation_Y(), boundsRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_164 = ".eINSTANCE.getSize_Width(), boundsRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_165 = ".eINSTANCE.getSize_Height(), boundsRefresher);" + NL + "\t\t\tupdatableParent.removeRefresher(";
- protected final String TEXT_166 = ".eINSTANCE.getNode_LayoutConstraint(), boundsRefresher);";
- protected final String TEXT_167 = NL + "\t\t\tupdatableParent.removeExternalRefresher(getLabelRefresher());" + NL + "\t\t}" + NL + "\t}" + NL;
- protected final String TEXT_168 = NL;
- protected final String TEXT_169 = "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_170 = ".ExternalRefresher labelRefresher;" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_171 = ".ExternalRefresher getLabelRefresher() {" + NL + "\t\tif (labelRefresher == null && getDiagramNode() != null) {" + NL + "\t\t\tlabelRefresher = new ";
- protected final String TEXT_172 = ".ExternalRefresherAdapter(this, getDiagramNode().getElement());" + NL + "\t\t}" + NL + "\t\treturn labelRefresher;" + NL + "\t}" + NL + "" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_173 = ".Refresher fontColorRefresher = new ";
- protected final String TEXT_174 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFontColor();" + NL + "\t\t}" + NL + "\t};" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
- protected final String TEXT_175 = ".Refresher fontRefresher = new ";
- protected final String TEXT_176 = ".Refresher() {" + NL + "\t\tpublic void refresh() {" + NL + "\t\t\trefreshFont();" + NL + "\t\t}" + NL + "\t};";
- protected final String TEXT_177 = NL;
- protected final String TEXT_178 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_179 = " createFigure() {" + NL + "\t\t// Parent should assign one using ";
- protected final String TEXT_180 = " method" + NL + "\t\treturn null;" + NL + "\t}";
- protected final String TEXT_181 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_182 = " createLabel() {";
- protected final String TEXT_183 = NL + "\t\treturn new ";
- protected final String TEXT_184 = "();";
- protected final String TEXT_185 = NL + "\t\treturn ";
- protected final String TEXT_186 = ";";
- protected final String TEXT_187 = NL + "\t\treturn new ";
- protected final String TEXT_188 = "();";
- protected final String TEXT_189 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
- protected final String TEXT_190 = " createFigure() {" + NL + "\t\t";
- protected final String TEXT_191 = " label = createLabel();";
- protected final String TEXT_192 = NL + "\t\tdefaultText = label.getText();";
- protected final String TEXT_193 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_194 = NL + "\t\treturn label;" + NL + "\t}";
- protected final String TEXT_195 = NL + NL + "\t/**";
- protected final String TEXT_196 = NL + "\t * TODO: reimplement, since the figure used by this editpart is not a Label.";
- protected final String TEXT_197 = NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
- protected final String TEXT_198 = " getLabel() {" + NL + "\t\treturn (";
- protected final String TEXT_199 = ") getFigure();" + NL + "\t}" + NL;
- protected final String TEXT_200 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void ";
- protected final String TEXT_201 = "(";
- protected final String TEXT_202 = " figure) {" + NL + "\t\tunregisterVisuals();" + NL + "\t\tsetFigure(figure);";
- protected final String TEXT_203 = NL + "\t\tdefaultText = figure.getText();";
- protected final String TEXT_204 = NL + "\t\tdefaultText = \"\";\t//$NON-NLS-1$";
- protected final String TEXT_205 = NL + "\t\tregisterVisuals();" + NL + "\t\trefreshVisuals();" + NL + "\t}" + NL;
- protected final String TEXT_206 = NL;
- protected final String TEXT_207 = NL;
- protected final String TEXT_208 = 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_209 = NL + "}";
- protected final String TEXT_210 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
-
-final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];
-final GenNodeLabel genLabel = (GenNodeLabel) genElement;
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-GenNode genHost = genLabel.getNode();
-GenClass underlyingMetaClass = genHost.getDomainMetaClass();
-GenDiagram genDiagram = genLabel.getDiagram();
-LabelModelFacet labelModelFacet = genLabel.getModelFacet();
-final boolean isReadOnly = genLabel.isReadOnly();
-
- stringBuffer.append(TEXT_1);
-
-String copyrightText = genDiagram.getEditorGen().getCopyrightText();
-if (copyrightText != null && copyrightText.trim().length() > 0) {
-
- stringBuffer.append(TEXT_2);
- stringBuffer.append(copyrightText.replaceAll("\n", "\n * "));
- stringBuffer.append(TEXT_3);
- }
- stringBuffer.append(TEXT_4);
- stringBuffer.append(TEXT_5);
-
-class FeatureGetAccessorHelper {
- /**
- * @param containerName the name of the container
- * @param feature the feature whose value is in interest
- * @param containerMetaClass the <code>GenClass</code> of the container, or <code>null</code>, if the container is declared as an <code>EObject</code>.
- * @param needsCastToResultType whether the cast to the result type is required (this parameter is only used if the <code>EClass</code> this feature belongs to is an external interface).
- */
- public void appendFeatureValueGetter(String containerName, GenFeature feature, GenClass containerMetaClass, boolean needsCastToResultType) {
- if (feature.getGenClass().isExternalInterface()) {
- boolean needsCastToEObject = containerMetaClass != null && containerMetaClass.isExternalInterface();
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_6);
- stringBuffer.append(importManager.getImportedName(feature.isListType() ? "java.util.Collection" : feature.getTypeGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_7);
-
- }
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_8);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_9);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToEObject) {
-
- stringBuffer.append(TEXT_10);
-
- }
-
- stringBuffer.append(TEXT_11);
- stringBuffer.append(importManager.getImportedName(feature.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_12);
- stringBuffer.append(feature.getFeatureAccessorName());
- stringBuffer.append(TEXT_13);
-
- if (needsCastToResultType) {
-
- stringBuffer.append(TEXT_14);
-
- }
- } else {
- boolean needsCastToFeatureGenType = containerMetaClass == null || containerMetaClass.isExternalInterface();
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_15);
- stringBuffer.append(importManager.getImportedName(feature.getGenClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_16);
-
- }
-
- stringBuffer.append(containerName);
-
- if (needsCastToFeatureGenType) {
-
- stringBuffer.append(TEXT_17);
-
- }
-
- stringBuffer.append(TEXT_18);
- stringBuffer.append(feature.getGetAccessor());
- stringBuffer.append(TEXT_19);
-
- }
- }
-}
-final FeatureGetAccessorHelper myFeatureGetAccessorHelper = new FeatureGetAccessorHelper();
-
- stringBuffer.append(TEXT_20);
- importManager.emitPackageStatement(stringBuffer);
- stringBuffer.append(TEXT_21);
-
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.markImportLocation(stringBuffer);
-
- stringBuffer.append(TEXT_22);
-
- boolean isExternal;
- String baseClass;
- if (genLabel instanceof GenExternalNodeLabel) {
- isExternal = true;
- baseClass = genDiagram.getBaseExternalNodeLabelEditPartQualifiedClassName();
- } else {
- isExternal = false;
- baseClass = "org.eclipse.gef.editparts.AbstractGraphicalEditPart";
- }
-
- stringBuffer.append(TEXT_23);
- stringBuffer.append(genLabel.getEditPartClassName());
- stringBuffer.append(TEXT_24);
- stringBuffer.append(importManager.getImportedName(baseClass));
- stringBuffer.append(TEXT_25);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_26);
- {
-GenCommonBase genCommonBase = genLabel;
- stringBuffer.append(TEXT_27);
- stringBuffer.append(TEXT_28);
- stringBuffer.append(genCommonBase.getVisualID());
- stringBuffer.append(TEXT_29);
- }
- stringBuffer.append(TEXT_30);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_31);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_32);
-
-}
-
- stringBuffer.append(TEXT_33);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_34);
- stringBuffer.append(genLabel.getEditPartClassName());
- stringBuffer.append(TEXT_35);
-
-if (isExternal) {
-
- stringBuffer.append(TEXT_36);
-
-} else {
-
- stringBuffer.append(TEXT_37);
-
-}
-
- stringBuffer.append(TEXT_38);
-
-if (!isExternal) {
-
- stringBuffer.append(TEXT_39);
-
-}
-
- stringBuffer.append(TEXT_40);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_41);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node"));
- stringBuffer.append(TEXT_42);
-
- final String primaryView = "getUpdatableParent().getDiagramNode()";
- final String resolvedSemanticElement = "resolveSemanticElement()";
- if (!isReadOnly) {
-
- stringBuffer.append(TEXT_43);
- stringBuffer.append(TEXT_44);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPolicy"));
- stringBuffer.append(TEXT_45);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.LabelDirectEditPolicy"));
- stringBuffer.append(TEXT_46);
-
- }
-
- {
-GenCommonBase genCommonBase = genLabel;
- stringBuffer.append(TEXT_47);
-
-for (CustomBehaviour behaviour : genCommonBase.getBehaviour(CustomBehaviour.class)) {
-
- stringBuffer.append(TEXT_48);
- stringBuffer.append(behaviour.getKey());
- stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName(behaviour.getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_50);
- }
- stringBuffer.append(TEXT_51);
-
-{
- List<OpenDiagramBehaviour> behaviours = genCommonBase.getBehaviour(OpenDiagramBehaviour.class);
- for(int i = 0, iMax = behaviours.size(); i < iMax; i++) {
- /*doesn't make sense to install more than one policy for the same role*/
- OpenDiagramBehaviour next = behaviours.get(i);
-
- stringBuffer.append(TEXT_52);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.EditPolicyRoles"));
- stringBuffer.append(TEXT_53);
- if (i > 0) {
- stringBuffer.append(TEXT_54);
- stringBuffer.append(i+1);
- stringBuffer.append(TEXT_55);
- }
- stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName(genCommonBase.getBehaviour(OpenDiagramBehaviour.class).get(0).getEditPolicyQualifiedClassName()));
- stringBuffer.append(TEXT_57);
-
- }
-}
-
- }
- stringBuffer.append(TEXT_58);
- stringBuffer.append(TEXT_59);
- stringBuffer.append(TEXT_60);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.Request"));
- stringBuffer.append(TEXT_61);
-
-if (!isReadOnly) {
-
- stringBuffer.append(TEXT_62);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_63);
-
-}
-
- stringBuffer.append(TEXT_64);
- stringBuffer.append(TEXT_65);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.RequestConstants"));
- stringBuffer.append(TEXT_66);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.commands.Command"));
- stringBuffer.append(TEXT_67);
-
- if (!isReadOnly) {
-
- stringBuffer.append(TEXT_68);
- stringBuffer.append(TEXT_69);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_70);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.tools.DirectEditManager"));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TextCellEditor"));
- stringBuffer.append(TEXT_72);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.LabelCellEditorLocator"));
- stringBuffer.append(TEXT_73);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_74);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_75);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_76);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_77);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_78);
-
- }
-
- stringBuffer.append(TEXT_79);
- stringBuffer.append(TEXT_80);
- stringBuffer.append(TEXT_81);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_82);
-
-if (labelModelFacet instanceof FeatureLabelModelFacet) {
- FeatureLabelModelFacet featureLabelModelFacet = (FeatureLabelModelFacet) labelModelFacet;
- String viewPattern = featureLabelModelFacet.getViewPattern();
- if (viewPattern == null || viewPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- viewPattern = patternBuffer.toString().trim();
- }
- String editPattern = null;
- if (!isReadOnly) {
- editPattern = featureLabelModelFacet.getEditPattern();
- if (editPattern == null || editPattern.length() == 0) {
- StringBuffer patternBuffer = new StringBuffer();
- for(int i = 0; i < featureLabelModelFacet.getMetaFeatures().size(); i++) {
- patternBuffer.append("{").append(i).append("} ");
- }
- editPattern = patternBuffer.toString().trim();
- }
- }
-
- stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.SimpleLabelTextDisplayer"));
- stringBuffer.append(TEXT_84);
- stringBuffer.append(viewPattern);
- stringBuffer.append(TEXT_85);
- if (!isReadOnly) {
- stringBuffer.append(TEXT_86);
- stringBuffer.append(editPattern);
- stringBuffer.append(TEXT_87);
- }
- stringBuffer.append(TEXT_88);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EStructuralFeature"));
- stringBuffer.append(TEXT_89);
-
- for(Iterator it = featureLabelModelFacet.getMetaFeatures().iterator(); it.hasNext(); ) {
- GenFeature next = (GenFeature) it.next();
-
- stringBuffer.append(TEXT_90);
- stringBuffer.append(importManager.getImportedName(next.getGenPackage().getQualifiedPackageInterfaceName()));
- stringBuffer.append(TEXT_91);
- stringBuffer.append(next.getFeatureAccessorName());
- stringBuffer.append(TEXT_92);
- if (it.hasNext()) {
- stringBuffer.append(TEXT_93);
- }
-
-
- }
-
- stringBuffer.append(TEXT_94);
-
-} else {
-
- stringBuffer.append(TEXT_95);
-
-}
-
- stringBuffer.append(TEXT_96);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer"));
- stringBuffer.append(TEXT_97);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_98);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_99);
- stringBuffer.append(TEXT_100);
-
-boolean isFixedFontSetInFigure;
-{
- StyleAttributes styleAttributes = (genElement.getViewmap() == null) ? null : (StyleAttributes)genElement.getViewmap().find(StyleAttributes.class);
- isFixedFontSetInFigure = styleAttributes != null && styleAttributes.isFixedFont();
-}
-
- stringBuffer.append(TEXT_101);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_102);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_103);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_104);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_110);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.FontData"));
- stringBuffer.append(TEXT_112);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_113);
-
-}
-
- stringBuffer.append(TEXT_114);
-
-if (!isFixedFontSetInFigure) {
-
- stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Font"));
- stringBuffer.append(TEXT_116);
-
-}
-
- stringBuffer.append(TEXT_117);
- stringBuffer.append(TEXT_118);
- stringBuffer.append(TEXT_119);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.FontStyle"));
- stringBuffer.append(TEXT_121);
- stringBuffer.append(primaryView);
- stringBuffer.append(TEXT_122);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_125);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Color"));
- stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Image"));
- stringBuffer.append(TEXT_128);
-
-if (genLabel.isElementIcon()) {
-
- stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_130);
- if (genHost.getDomainMetaClass().isExternalInterface()) {
- stringBuffer.append(TEXT_131);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_132);
- }
- stringBuffer.append(TEXT_133);
- stringBuffer.append(importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName()));
- stringBuffer.append(TEXT_134);
-
-}
-
- stringBuffer.append(TEXT_135);
- stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_136);
- stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_138);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_142);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_143);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_145);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_146);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_147);
-
-if (isExternal) {
-
- stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_150);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_151);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_152);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_153);
-
-}
-
- stringBuffer.append(TEXT_154);
- stringBuffer.append(importManager.getImportedName(genHost.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_155);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_156);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_157);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_158);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_159);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_160);
-
-if (isExternal) {
-
- stringBuffer.append(TEXT_161);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_162);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_163);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage"));
- stringBuffer.append(TEXT_166);
-
-}
-
- stringBuffer.append(TEXT_167);
- stringBuffer.append(TEXT_168);
- stringBuffer.append(TEXT_169);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_170);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart"));
- stringBuffer.append(TEXT_171);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController"));
- stringBuffer.append(TEXT_172);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart"));
- stringBuffer.append(TEXT_176);
-
-final Viewmap viewmap = genLabel.getViewmap();
-
- stringBuffer.append(TEXT_177);
-
-final String figureQualifiedClassName;
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- figureQualifiedClassName = parentAssignedViewmap.getFigureQualifiedClassName() == null ? "org.eclipse.draw2d.IFigure" : parentAssignedViewmap.getFigureQualifiedClassName();
-} else if (viewmap instanceof FigureViewmap) {
- String figureQualifiedClassNameCandidate = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassNameCandidate == null || figureQualifiedClassNameCandidate.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.draw2d.Label";
- } else {
- figureQualifiedClassName = figureQualifiedClassNameCandidate;
- }
-} else if (viewmap instanceof SnippetViewmap) {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-} else if (viewmap instanceof InnerClassViewmap) {
- figureQualifiedClassName = ((InnerClassViewmap) viewmap).getClassName();
-} else {
- figureQualifiedClassName = "org.eclipse.draw2d.IFigure";
-}
-final String figureImportedName;
-if (viewmap instanceof InnerClassViewmap) {
- figureImportedName = figureQualifiedClassName; //do not import inner class
-} else {
- figureImportedName = importManager.getImportedName(figureQualifiedClassName);
-}
-if (viewmap instanceof ParentAssignedViewmap) {
- final ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
-
- stringBuffer.append(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_179);
- stringBuffer.append((parentAssignedViewmap.getSetterName() == null ? "setLabel" : parentAssignedViewmap.getSetterName()));
- stringBuffer.append(TEXT_180);
- } else {
- stringBuffer.append(TEXT_181);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_182);
-
-if (viewmap instanceof FigureViewmap) {
-
- stringBuffer.append(TEXT_183);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_184);
- } // instanceof FigureViewmap
- else if (viewmap instanceof SnippetViewmap) {
- stringBuffer.append(TEXT_185);
- stringBuffer.append(((SnippetViewmap) viewmap).getBody());
- stringBuffer.append(TEXT_186);
- } // instanceof SnippetViewmap; FIXME : obtain figure class name to generate getter
- else if (viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_187);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_188);
- }
- stringBuffer.append(TEXT_189);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.IFigure"));
- stringBuffer.append(TEXT_190);
- stringBuffer.append(figureImportedName);
- stringBuffer.append(TEXT_191);
-
-if ("org.eclipse.draw2d.Label".equals(figureQualifiedClassName) || viewmap instanceof InnerClassViewmap) {
-
- stringBuffer.append(TEXT_192);
-
-} else {
-
- stringBuffer.append(TEXT_193);
-
-}
-
- stringBuffer.append(TEXT_194);
- } /*not parent-assigned*/
- stringBuffer.append(TEXT_195);
-
-if (!"org.eclipse.draw2d.Label".equals(figureQualifiedClassName) && viewmap instanceof InnerClassViewmap==false) {
-
- stringBuffer.append(TEXT_196);
-
-}
-
- stringBuffer.append(TEXT_197);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_198);
- stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.Label"));
- stringBuffer.append(TEXT_199);
-
-String labelSetterName = "setLabel"; // same assumption in NodeEditPart
-String labelFigureClassName = "org.eclipse.draw2d.IFigure";
-if (viewmap instanceof ParentAssignedViewmap) {
- ParentAssignedViewmap parentAssignedViewmap = (ParentAssignedViewmap) viewmap;
- if (parentAssignedViewmap.getSetterName() != null) {
- labelSetterName = parentAssignedViewmap.getSetterName();
- }
- if (parentAssignedViewmap.getFigureQualifiedClassName() != null) {
- labelFigureClassName = parentAssignedViewmap.getFigureQualifiedClassName();
- }
-} // FIXME perhaps, there's no sense to have setLabel for any other viewmap than ParentAssigned?
-
- stringBuffer.append(TEXT_200);
- stringBuffer.append(labelSetterName);
- stringBuffer.append(TEXT_201);
- stringBuffer.append(importManager.getImportedName(labelFigureClassName));
- stringBuffer.append(TEXT_202);
-
-if ("org.eclipse.draw2d.Label".equals(labelFigureClassName)) {
-
- stringBuffer.append(TEXT_203);
-
-} else {
-
- stringBuffer.append(TEXT_204);
-
-}
-
- stringBuffer.append(TEXT_205);
-
-if (viewmap instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) viewmap).getClassBody();
-
- stringBuffer.append(TEXT_206);
- stringBuffer.append(classBody);
- stringBuffer.append(TEXT_207);
-
-if (classBody.indexOf("DPtoLP") != -1) {
-
- stringBuffer.append(TEXT_208);
-
-}
-
-
-}
-
- stringBuffer.append(TEXT_209);
- importManager.emitSortedImports();
- stringBuffer.append(TEXT_210);
- return stringBuffer.toString();
- }
-}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java
index cad33b0aa..dfd88b8bb 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/CodegenEmitters.java
@@ -25,7 +25,6 @@ import org.eclipse.gmf.codegen.templates.lite.editor.ActionBarContributorGenerat
import org.eclipse.gmf.codegen.templates.lite.editor.BuildPropertiesGenerator;
import org.eclipse.gmf.codegen.templates.lite.editor.CreationWizardGenerator;
import org.eclipse.gmf.codegen.templates.lite.editor.CreationWizardPageGenerator;
-import org.eclipse.gmf.codegen.templates.lite.editor.DiagramEditorUtilGenerator;
import org.eclipse.gmf.codegen.templates.lite.editor.InitDiagramFileActionGenerator;
import org.eclipse.gmf.codegen.templates.lite.editor.ManifestGenerator;
import org.eclipse.gmf.codegen.templates.lite.editor.NewDiagramFileWizardGenerator;
@@ -37,15 +36,7 @@ import org.eclipse.gmf.codegen.templates.lite.expressions.OCLExpressionFactoryGe
import org.eclipse.gmf.codegen.templates.lite.expressions.RegexpExpressionFactoryGenerator;
import org.eclipse.gmf.codegen.templates.lite.navigator.NavigatorActionProviderGenerator;
import org.eclipse.gmf.codegen.templates.lite.navigator.NavigatorLabelProviderGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.ChildNodeEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.CompartmentEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.DiagramEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.DiagramExternalNodeLabelEditPartGenerator;
import org.eclipse.gmf.codegen.templates.lite.parts.EditPartFactoryGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.LinkEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.LinkLabelEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.NodeEditPartGenerator;
-import org.eclipse.gmf.codegen.templates.lite.parts.NodeLabelEditPartGenerator;
import org.eclipse.gmf.codegen.templates.lite.policies.OpenDiagramPolicyGenerator;
import org.eclipse.gmf.codegen.templates.lite.providers.DomainElementInitializerGenerator;
import org.eclipse.gmf.codegen.templates.lite.providers.MetricProviderGenerator;
@@ -117,26 +108,16 @@ public class CodegenEmitters {
put(tr, "/providers/ValidationProvider.javajet", ValidationProviderGenerator.class);
put(tr, "/providers/MetricProvider.javajet", MetricProviderGenerator.class); //$NON-NLS-1$
- put(tr, "/parts/DiagramExternalNodeLabelEditPart.javajet", DiagramExternalNodeLabelEditPartGenerator.class);
- put(tr, "/parts/CompartmentEditPart.javajet", CompartmentEditPartGenerator.class);
put(tr, "/editor/CreationWizard.javajet", CreationWizardGenerator.class);
put(tr, "/editor/CreationWizardPage.javajet", CreationWizardPageGenerator.class);
- put(tr, "/editor/DiagramEditorUtil.javajet", DiagramEditorUtilGenerator.class);
// put(tr, "/editor/MatchingStrategy.javajet",
// MatchingStrategyGenerator.class);
put(tr, "/editor/PaletteFactory.javajet", PaletteFactoryGenerator.class);
put(tr, "/editor/VisualIDRegistry.javajet", VisualIDRegistryGenerator.class);
- put(tr, "/parts/DiagramEditPart.javajet", DiagramEditPartGenerator.class);
put(tr, "/parts/EditPartFactory.javajet", EditPartFactoryGenerator.class);
put(tr, "/providers/DomainElementInitializer.javajet", DomainElementInitializerGenerator.class);
put(tr, "/editor/ActionBarContributor.javajet", ActionBarContributorGenerator.class);
put(tr, "/editor/OpenDiagramInViewAction.javajet", OpenDiagramFileInViewGenerator.class);
- put(tr, "/parts/LinkEditPart.javajet", LinkEditPartGenerator.class);
- put(tr, "/parts/LinkLabelEditPart.javajet", LinkLabelEditPartGenerator.class);
- put(tr, "/parts/ChildNodeEditPart.javajet", ChildNodeEditPartGenerator.class);
- put(tr, "/parts/NodeEditPart.javajet", NodeEditPartGenerator.class);
- put(tr, "/parts/NodeLabelEditPart.javajet", NodeLabelEditPartGenerator.class);
- // put(tr, "/editor/ModelCreationFactory.javajet", ModelCreationFactoryGenerator.class);
put(tr, "/editor/manifest.mfjet", ManifestGenerator.class);
put(tr, "/editor/build.propertiesjet", BuildPropertiesGenerator.class);
put(tr, "/editor/InitDiagramFileAction.javajet", InitDiagramFileActionGenerator.class);
@@ -210,15 +191,11 @@ public class CodegenEmitters {
}
public TextEmitter getCompartmentEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(CompartmentEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::CompartmentEditPart::CompartmentEditPart"); //$NON-NLS-1$
}
public TextEmitter getDiagramEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(DiagramEditPartGenerator.class);
- }
-
- public TextEmitter getDiagramExternalNodeLabelEditPartEmitter() throws UnexpectedBehaviourException {
- return retrieve(DiagramExternalNodeLabelEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::DiagramEditPart::DiagramEditPart"); //$NON-NLS-1$
}
public TextEmitter getEditPartFactoryGenerator() throws UnexpectedBehaviourException {
@@ -226,23 +203,23 @@ public class CodegenEmitters {
}
public TextEmitter getLinkEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(LinkEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::LinkEditPart::LinkEditPart"); //$NON-NLS-1$
}
public TextEmitter getLinkLabelEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(LinkLabelEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::LinkLabelEditPart::LinkLabelEditPart"); //$NON-NLS-1$
}
public TextEmitter getChildNodeEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(ChildNodeEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::ChildNodeEditPart::ChildNodeEditPart"); //$NON-NLS-1$
}
public TextEmitter getNodeEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(NodeEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::NodeEditPart::NodeEditPart"); //$NON-NLS-1$
}
public TextEmitter getNodeLabelEditPartGenerator() throws UnexpectedBehaviourException {
- return retrieve(NodeLabelEditPartGenerator.class);
+ return retrieveXpand("xpt::diagram::parts::NodeLabelEditPart::NodeLabelEditPart"); //$NON-NLS-1$
}
public TextEmitter getPluginGenerator() throws UnexpectedBehaviourException {
@@ -270,7 +247,7 @@ public class CodegenEmitters {
}
public TextEmitter getDiagramEditorUtilGenerator() throws UnexpectedBehaviourException {
- return retrieve(DiagramEditorUtilGenerator.class);
+ return retrieveXpand("xpt::editor::DiagramEditorUtil::DiagramEditorUtil"); //$NON-NLS-1$
}
public TextEmitter getPaletteFactoryGenerator() throws UnexpectedBehaviourException {
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
index fdc8b2cb0..0c9857571 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
@@ -32,7 +32,6 @@ import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
-import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
@@ -125,14 +124,12 @@ public class Generator extends GeneratorBase implements Runnable {
generateMetricProvider();
}
- boolean hasExternalLabels = false;
for (GenNode next : (List<? extends GenNode>) myDiagram.getAllNodes()) {
if (!(next instanceof GenChildLabelNode)) {
internalGenerateJavaClass(myEmitters.getNodeEditPartGenerator(), next.getEditPartQualifiedClassName(), next);
generateGraphicalEditPolicy(next);
for (Iterator it2 = next.getLabels().iterator(); it2.hasNext();) {
final GenNodeLabel label = (GenNodeLabel) it2.next();
- hasExternalLabels |= label instanceof GenExternalNodeLabel;
internalGenerateJavaClass(myEmitters.getNodeLabelEditPartGenerator(), label.getEditPartQualifiedClassName(), label);
internalGenerateJavaClass(myEmitters.getViewFactoryGenerator(), label.getNotationViewFactoryQualifiedClassName(), label);
}
@@ -145,9 +142,6 @@ public class Generator extends GeneratorBase implements Runnable {
generateComponentEditPolicy(next);
generateLayoutEditPolicy(next);
}
- if (hasExternalLabels) {
- internalGenerateJavaClass(myEmitters.getDiagramExternalNodeLabelEditPartEmitter(), myDiagram.getEditPartsPackageName(), myDiagram.getBaseExternalNodeLabelEditPartClassName(), myDiagram);
- }
for (GenLink next : (List<? extends GenLink>) myDiagram.getLinks()) {
internalGenerateJavaClass(myEmitters.getLinkEditPartGenerator(), next.getEditPartQualifiedClassName(), next);
for (GenLinkLabel label : (List<? extends GenLinkLabel>) next.getLabels()) {
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/utils/SemanticSyncUtils.java b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/utils/SemanticSyncUtils.java
new file mode 100644
index 000000000..bb2dedc54
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/utils/SemanticSyncUtils.java
@@ -0,0 +1,183 @@
+/**
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * bblajer - initial API and implementation
+ */
+package org.eclipse.gmf.internal.codegen.lite.utils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.codegen.gmfgen.FeatureLinkModelFacet;
+import org.eclipse.gmf.codegen.gmfgen.GenChildContainer;
+import org.eclipse.gmf.codegen.gmfgen.GenChildNode;
+import org.eclipse.gmf.codegen.gmfgen.GenCompartment;
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
+import org.eclipse.gmf.codegen.gmfgen.GenLink;
+import org.eclipse.gmf.codegen.gmfgen.GenNode;
+import org.eclipse.gmf.codegen.gmfgen.GenTopLevelNode;
+import org.eclipse.gmf.codegen.gmfgen.TypeLinkModelFacet;
+import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
+import org.eclipse.gmf.codegen.gmfgen.util.GMFGenSwitch;
+
+/**
+ * This class provides static utility methods for use with Xpand templates.
+ * Although it is possible to implement these methods in Xtend, doing so would severely impact performance,
+ * since they would have to be called several times without the possibility to cache their results.
+ */
+public class SemanticSyncUtils {
+ public static Collection<GenNode> getGenNodes(GenContainerBase genContainerBase, GenFeature genFeature) {
+ Collection<GenNode> result = getGenChildFeature2genNodeMap(genContainerBase).get(genFeature);
+ if (result == null) {
+ return Collections.emptyList();
+ }
+ return result;
+ }
+
+ private static Map<GenFeature, Collection<GenNode>> getGenChildFeature2genNodeMap(GenContainerBase genContainerBase) {
+ Map<GenFeature, Collection<GenNode>> result = myFeature2NodesCache.get(genContainerBase);
+ if (result == null) {
+ result = buildGenChildFeature2genNodeMap(genContainerBase);
+ myFeature2NodesCache.put(genContainerBase, result);
+ }
+ return result;
+ }
+
+ private static Map<GenFeature, Collection<GenNode>> buildGenChildFeature2genNodeMap(GenContainerBase genContainerBase) {
+ Map<GenFeature, Collection<GenNode>> result = new LinkedHashMap<GenFeature, Collection<GenNode>>();
+ Collection<? extends GenNode> childNodes = new GMFGenSwitch<Collection<? extends GenNode>>() {
+ @Override
+ public Collection<? extends GenNode> caseGenDiagram(GenDiagram object) {
+ return object.getTopLevelNodes();
+ }
+ @Override
+ public Collection<? extends GenNode> caseGenChildContainer(GenChildContainer object) {
+ return object.getChildNodes();
+ }
+ }.doSwitch(genContainerBase);
+ for (GenNode nextNode : childNodes) {
+ TypeModelFacet typeModelFacet = nextNode.getModelFacet();
+ if (typeModelFacet == null) {
+ continue;
+ }
+ GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
+ if (!result.containsKey(childMetaFeature)) {
+ result.put(childMetaFeature, new ArrayList<GenNode>());
+ }
+ result.get(childMetaFeature).add(nextNode);
+ }
+ return result;
+ }
+
+ public static Collection<GenLink> getTypeGenLinks(GenContainerBase container, GenFeature feature, Collection<GenLink> containedLinks) {
+ Collection<GenLink> result = getGenChildFeature2TypeGenLinkMap(container, containedLinks).get(feature);
+ if (result == null) {
+ return Collections.emptyList();
+ }
+ return result;
+ }
+
+ public static Collection<GenLink> getFeatureGenLinks(GenContainerBase container, GenFeature feature, Collection<GenLink> containedLinks) {
+ Collection<GenLink> result = getGenChildFeature2FeatureGenLinkMap(container, containedLinks).get(feature);
+ if (result == null) {
+ return Collections.emptyList();
+ }
+ return result;
+ }
+
+ private static Map<GenFeature, Collection<GenLink>> getGenChildFeature2TypeGenLinkMap(GenContainerBase container, Collection<GenLink> containedLinks) {
+ if (!myFeature2TypeLinksCache.containsKey(container)) {
+ buildGenChildFeature2LinkMaps(container, containedLinks);
+ }
+ return myFeature2TypeLinksCache.get(container);
+ }
+
+ private static Map<GenFeature, Collection<GenLink>> getGenChildFeature2FeatureGenLinkMap(GenContainerBase container, Collection<GenLink> containedLinks) {
+ if (!myFeature2FeatureLinksCache.containsKey(container)) {
+ buildGenChildFeature2LinkMaps(container, containedLinks);
+ }
+ return myFeature2FeatureLinksCache.get(container);
+ }
+
+ private static void buildGenChildFeature2LinkMaps(GenContainerBase container, Collection<GenLink> containedLinks) {
+ final Map<GenFeature, Collection<GenLink>> genFeature2TypeGenLinkMap = new LinkedHashMap<GenFeature, Collection<GenLink>>();
+ final Map<GenFeature, Collection<GenLink>> genFeature2FeatureGenLinkMap = new LinkedHashMap<GenFeature, Collection<GenLink>>();
+ for(final GenLink genLink : containedLinks) {
+ new GMFGenSwitch<Object>() {
+ @Override
+ public Object caseTypeLinkModelFacet(TypeLinkModelFacet modelFacet) {
+ GenFeature metaFeature = modelFacet.getChildMetaFeature();
+ if (!genFeature2TypeGenLinkMap.containsKey(metaFeature)) {
+ genFeature2TypeGenLinkMap.put(metaFeature, new ArrayList<GenLink>());
+ }
+ genFeature2TypeGenLinkMap.get(metaFeature).add(genLink);
+ return null;
+ }
+ @Override
+ public Object caseFeatureLinkModelFacet(FeatureLinkModelFacet modelFacet) {
+ GenFeature metaFeature = modelFacet.getMetaFeature();
+ if (!genFeature2FeatureGenLinkMap.containsKey(metaFeature)) {
+ genFeature2FeatureGenLinkMap.put(metaFeature, new ArrayList<GenLink>());
+ }
+ genFeature2FeatureGenLinkMap.get(metaFeature).add(genLink);
+ return null;
+ }
+ }.doSwitch(genLink.getModelFacet());
+ }
+ myFeature2TypeLinksCache.put(container, genFeature2TypeGenLinkMap);
+ myFeature2FeatureLinksCache.put(container, genFeature2FeatureGenLinkMap);
+ }
+
+ public static Collection<GenContainerBase> buildAncestorClosure(Collection<GenContainerBase> elements) {
+ Collection<GenContainerBase> result = new LinkedHashSet<GenContainerBase>(elements);
+ for(GenContainerBase next : elements) {
+ addAncestors(result, next);
+ }
+ return result;
+ }
+
+ private static void addAncestors(Collection<GenContainerBase> result, GenContainerBase next) {
+ Collection<? extends GenContainerBase> ancestors = new GMFGenSwitch<Collection<? extends GenContainerBase>>() {
+ @Override
+ public Collection<? extends GenContainerBase> caseGenTopLevelNode(GenTopLevelNode object) {
+ return Collections.singleton(object.getDiagram());
+ }
+ @Override
+ public Collection<? extends GenContainerBase> caseGenCompartment(GenCompartment object) {
+ return Collections.singleton(object.getNode());
+ }
+ @Override
+ public Collection<? extends GenContainerBase> caseGenChildNode(GenChildNode object) {
+ return object.getContainers();
+ }
+ @Override
+ public Collection<? extends GenContainerBase> defaultCase(EObject object) {
+ return Collections.emptyList();
+ }
+ }.doSwitch(next);
+ for(GenContainerBase nextAncestor : ancestors) {
+ if (!result.contains(nextAncestor)) {
+ result.add(nextAncestor);
+ addAncestors(result, nextAncestor);
+ }
+ }
+ }
+
+ private static WeakHashMap<GenContainerBase, Map<GenFeature, Collection<GenNode>>> myFeature2NodesCache = new WeakHashMap<GenContainerBase, Map<GenFeature,Collection<GenNode>>>();
+ private static WeakHashMap<GenContainerBase, Map<GenFeature, Collection<GenLink>>> myFeature2TypeLinksCache = new WeakHashMap<GenContainerBase, Map<GenFeature,Collection<GenLink>>>();
+ private static WeakHashMap<GenContainerBase, Map<GenFeature, Collection<GenLink>>> myFeature2FeatureLinksCache = new WeakHashMap<GenContainerBase, Map<GenFeature,Collection<GenLink>>>();
+}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalEdgeCommand.jetinc b/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalEdgeCommand.jetinc
deleted file mode 100644
index 9a8cb829b..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalEdgeCommand.jetinc
+++ /dev/null
@@ -1,38 +0,0 @@
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> sourceView = getViewService().findView(linkDescriptor.getSource());
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> targetView = getViewService().findView(linkDescriptor.getDestination());
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator")%> decorator = null;
- if (sourceView == null || targetView == null) {
- return null;
- }
- switch (linkDescriptor.getVisualID()) {
-<%
- for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (modelFacet == null) {
- continue;
- }
-%>
- case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
- if (linkDescriptor.getElement() instanceof <%=importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())%>) {
- decorator = <%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.INSTANCE;
- }
- break;
-<%
- }
- for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink nextLink = (GenLink) it.next();
-%>
- case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID:
- if (linkDescriptor.getElement() == null) {
- decorator = <%=importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())%>.INSTANCE;
- }
- break;
-<%
- }
-%>
- }
- if (decorator == null) {
- return null;
- }
- return new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand")%>(<%=_diagramCode%>, linkDescriptor.getElement(), sourceView, targetView, decorator);
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalNodeCommand.jetinc b/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalNodeCommand.jetinc
deleted file mode 100644
index 1c8a81b1a..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/common/createNotationalNodeCommand.jetinc
+++ /dev/null
@@ -1,38 +0,0 @@
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> domainElement = descriptor.getElement();
- int nodeVisualID = descriptor.getVisualID();
- switch (nodeVisualID) {
-<%
-for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
- GenNode nextNode = (GenNode) it.next();
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
-%>
- case <%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID:
- if (domainElement instanceof <%=childNodeInterfaceName%>) {
- return new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand")%>(<%=_parentNode%>, domainElement,
-<%
- if (!isListLayout) {
- int defaultWidth = 40;
- int defaultHeight = 40;
- DefaultSizeAttributes defSizeAttrs = (DefaultSizeAttributes) nextNode.getViewmap().find(DefaultSizeAttributes.class);
- if (defSizeAttrs != null) {
- defaultWidth = defSizeAttrs.getWidth();
- defaultHeight = defSizeAttrs.getHeight();
- }
-%>new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")%>(0, 0, <%=defaultWidth%>, <%=defaultHeight%>)<%
- } else {
-%>
-null<%
- }
-%>, <%=importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName())%>.INSTANCE, false);
- }
- return null;
-<%
-}
-%>
- default:
- return null;
- }
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/common/initDiagramContents.jetinc b/plugins/org.eclipse.gmf.codegen.lite/templates/common/initDiagramContents.jetinc
deleted file mode 100644
index 3c37ea530..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/common/initDiagramContents.jetinc
+++ /dev/null
@@ -1,375 +0,0 @@
-/**
- * @generated
- */
-private void initDiagramContents(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> diagram) {
- create<%=genDiagram.getUniqueIdentifier()%>Children(diagram);
-<%
-if(!genDiagram.getLinks().isEmpty()) {
-%>
- myViewService = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService")%>(diagram);
- create<%=genDiagram.getUniqueIdentifier()%>ChildLinks(diagram);
-<%
-}
-%>
-}
-
-<%
-final Comparator<GenContainerBase> comparator = new Comparator<GenContainerBase>() {
- public int compare(GenContainerBase o1, GenContainerBase o2) {
- return o1.getVisualID() - o2.getVisualID();
- }
-};
-TreeSet<GenContainerBase> containers2Generate = new TreeSet<GenContainerBase>(comparator);
-for (Iterator containers = genDiagram.getAllContainers().iterator(); containers.hasNext();) {
- GenContainerBase nextContainer = (GenContainerBase) containers.next();
- if (!nextContainer.getContainedNodes().isEmpty()) {
- containers2Generate.add(nextContainer);
- continue;
- }
- if (nextContainer instanceof GenDiagram) {
- containers2Generate.add(nextContainer);
- continue;
- }
- if (nextContainer instanceof GenNode) {
- //May need to generate if contains compartments with children
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (!nextCompartment.getContainedNodes().isEmpty()) {
- containers2Generate.add(nextContainer);
- break;
- }
- }
- }
-}
-for (Iterator<GenContainerBase> containers = containers2Generate.iterator(); containers.hasNext();) {
- GenContainerBase nextContainer = containers.next();
-%>
-/**
- * @generated
- */
-private void create<%=nextContainer.getUniqueIdentifier()%>Children(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> viewObject) {
-<%
- if (nextContainer instanceof GenNode) {
- boolean shouldIterateOverCompartments = false;
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (!nextCompartment.getContainedNodes().isEmpty()) {
- shouldIterateOverCompartments = true;
- break;
- }
- }
- if (shouldIterateOverCompartments) {
-%>
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = viewObject.getChildren().iterator(); it.hasNext(); ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next();
- int visualID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next);
- switch (visualID) {
-<%
- for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
- GenCompartment nextCompartment = (GenCompartment) compartments.next();
- if (nextCompartment.getContainedNodes().isEmpty()) {
- continue;
- }
-%>
- case <%=importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName())%>.VISUAL_ID:
- create<%=nextCompartment.getUniqueIdentifier()%>Children(next);
- break;
-<%
- }
-%>
- }
- }
-<%
- }
- }
- if (!nextContainer.getContainedNodes().isEmpty()) {
-%>
- <%=importManager.getImportedName("java.util.List")%> semanticChildren = get<%=nextContainer.getUniqueIdentifier()%>SemanticChildNodes(viewObject);
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticChildren.iterator(); it.hasNext(); ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")%> nextDescriptor = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")%>) it.next();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")%> createCommand = getCreate<%=nextContainer.getUniqueIdentifier()%>NotationalChildNodeCommand(viewObject, nextDescriptor);
- if (createCommand != null && createCommand.canExecute()) {
- createCommand.execute();
-<%
- boolean shouldIterateToGenerate = false;
- for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
- GenNode nextNode = (GenNode) containedNodes.next();
- if (containers2Generate.contains(nextNode)) {
- shouldIterateToGenerate = true;
- break;
- }
- }
- if (shouldIterateToGenerate) {
-%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> nextChild = createCommand.getCreatedView();
- int childVisualID = nextDescriptor.getVisualID();
- switch (childVisualID) {
-<%
- for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
- GenNode nextNode = (GenNode) containedNodes.next();
- if (containers2Generate.contains(nextNode)) {
-%>
- case <%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID:
- create<%=nextNode.getUniqueIdentifier()%>Children(nextChild);
- break;
-<%
- }
- } //iterate over contained nodes
-%>
- }
-<%
- } //if (shouldIterateToGenerate)
-%>
- }
- }
-<%
- } //if (!nextContainer.getContainedNodes().isEmpty())
-%>
-}
-
-<%
- if (!nextContainer.getContainedNodes().isEmpty()) {
-%>
-/**
- * @generated
- */
-private <%=importManager.getImportedName("java.util.List")%> get<%=nextContainer.getUniqueIdentifier()%>SemanticChildNodes(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView) {
-<%
- {
- String _getViewCode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
-%>
-<%@ include file="semanticChildren.jetinc" %>
-<%
- }
-%>
-}
-
-/**
- * @generated
- */
-protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")%> getCreate<%=nextContainer.getUniqueIdentifier()%>NotationalChildNodeCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")%> descriptor) {
-<%
- {
- String _parentNode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
- boolean isListLayout;
- if (nextContainer instanceof GenNode) {
- isListLayout = !org.eclipse.gmf.codegen.gmfgen.util.ViewmapLayoutTypeHelper.getSharedInstance().isStoringChildPositions((GenNode) nextContainer);
- } else if (nextContainer instanceof GenCompartment) {
- isListLayout = ((GenCompartment) nextContainer).isListLayout();
- } else if (nextContainer instanceof GenDiagram) {
- isListLayout = false;
- } else {
- throw new RuntimeException("Unexpected container");
- }
-%>
-<%@ include file="createNotationalNodeCommand.jetinc"%>
-<%
- } //local declarations
-%>
-}
-<%
- } //if (!nextContainer.getContainedNodes().isEmpty())
-}
-class LinksCollection {
- private Collection<GenLink> myTypeModelFacetLinks = new LinkedList<GenLink>();
- private Collection<GenLink> myFeatureModelFacetLinks = new LinkedList<GenLink>();
- public void add(GenLink link) {
- if (link.getModelFacet() instanceof TypeLinkModelFacet) {
- myTypeModelFacetLinks.add(link);
- } else if (link.getModelFacet() instanceof FeatureLinkModelFacet) {
- myFeatureModelFacetLinks.add(link);
- }
- }
- public Iterator<GenLink> getContainedTypeModelFacetLinks() {
- return myTypeModelFacetLinks.iterator();
- }
- public Iterator<GenLink> getContainedFeatureModelFacetLinks() {
- return myFeatureModelFacetLinks.iterator();
- }
-}
-class CreateChildLinkElements {
- private TreeMap<GenContainerBase, LinksCollection> myElements;
- public CreateChildLinkElements() {
- myElements = new TreeMap<GenContainerBase, LinksCollection>(comparator);
- }
- public void add(GenContainerBase o, GenLink link) {
- buildAncestors(o);
- myElements.get(o).add(link);
- }
- private void buildAncestors(GenContainerBase o) {
- if (!myElements.containsKey(o)) {
- LinksCollection elements = new LinksCollection();
- myElements.put(o, elements);
- addAncestors(o);
- }
- }
- private void addAncestors(GenContainerBase o) {
- if (o instanceof GenCompartment) {
- GenCompartment compartment = (GenCompartment) o;
- buildAncestors(compartment.getNode());
- } else if (o instanceof GenTopLevelNode) {
- GenTopLevelNode node = (GenTopLevelNode) o;
- buildAncestors(node.getDiagram());
- } else if (o instanceof GenChildNode) {
- GenChildNode node = (GenChildNode) o;
- for(Iterator it = node.getContainers().iterator(); it.hasNext(); ) {
- GenContainerBase next = (GenContainerBase) it.next();
- buildAncestors(next);
- }
- }
- }
- public boolean contains(GenContainerBase o) {
- return myElements.containsKey(o);
- }
- public Iterator<Map.Entry<GenContainerBase, LinksCollection>> iterator() {
- return myElements.entrySet().iterator();
- }
-}
-if (!genDiagram.getLinks().isEmpty()) {
- CreateChildLinkElements linkContainers2Generate = new CreateChildLinkElements();
- //No need to explicitly add diagram, since we build the whole hierarchy up.
- for(Iterator links = genDiagram.getLinks().iterator(); links.hasNext(); ) {
- GenLink next = (GenLink) links.next();
- GenClass containerClass;
- LinkModelFacet nextModelFacet = next.getModelFacet();
- if (nextModelFacet instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) next.getModelFacet();
- if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
- //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
- containerClass = null;
- } else {
- containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
- }
- } else if (nextModelFacet instanceof FeatureLinkModelFacet) {
- GenFeature metaFeature = ((FeatureLinkModelFacet) next.getModelFacet()).getMetaFeature();
- containerClass = metaFeature.getGenClass();
- } else {
- continue;
- }
- for (Iterator nodes = genDiagram.getAllNodes().iterator(); nodes.hasNext(); ) {
- GenNode nextNode = (GenNode) nodes.next();
- if (containerClass.getEcoreClass().isSuperTypeOf(nextNode.getDomainMetaClass().getEcoreClass())) {
- linkContainers2Generate.add(nextNode, next);
- }
- }
- }
- for(Iterator<Map.Entry<GenContainerBase, LinksCollection>> entryIt = linkContainers2Generate.iterator(); entryIt.hasNext(); ) {
- Map.Entry<GenContainerBase, LinksCollection> next = entryIt.next();
- GenContainerBase nextContainer = next.getKey();
- LinksCollection linksCollection = next.getValue();
- Iterator<GenLink> typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();
- Iterator<GenLink> featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();
-%>
-/**
- * @generated
- */
-private void create<%=nextContainer.getUniqueIdentifier()%>ChildLinks(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> viewObject) {
-<%
- if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
-%>
- <%=importManager.getImportedName("java.util.List")%> semanticChildLinks = get<%=nextContainer.getUniqueIdentifier()%>SemanticChildLinks(viewObject);
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = semanticChildLinks.iterator(); it.hasNext(); ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")%> nextDescriptor = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")%>) it.next();
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")%> createCommand = getCreate<%=nextContainer.getUniqueIdentifier()%>NotationalChildLinkCommand(viewObject, nextDescriptor);
- if (createCommand != null && createCommand.canExecute()) {
- createCommand.execute();
- }
- }
-<%
- }
- boolean shouldIterateToGenerate = false;
- Collection childElements = new ArrayList(nextContainer.getContainedNodes());
- if (nextContainer instanceof GenNode) {
- childElements.addAll(((GenNode) nextContainer).getCompartments());
- }
- for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
- GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
- if (linkContainers2Generate.contains(nextChild)) {
- shouldIterateToGenerate = true;
- break;
- }
- }
- if (shouldIterateToGenerate) {
-%>
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = viewObject.getChildren().iterator(); it.hasNext(); ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> next = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) it.next();
- int visualID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(next);
- switch (visualID) {
-<%
- for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
- GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
- if (!linkContainers2Generate.contains(nextChild)) {
- continue;
- }
-%>
- case <%=importManager.getImportedName(nextChild.getEditPartQualifiedClassName())%>.VISUAL_ID:
- create<%=nextChild.getUniqueIdentifier()%>ChildLinks(next);
- break;
-<%
- }
-%>
- }
- }
-<%
- }
-%>
-}
-
-<%
- if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
-%>
-/**
- * @generated
- */
-private <%=importManager.getImportedName("java.util.List")%> get<%=nextContainer.getUniqueIdentifier()%>SemanticChildLinks(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView) {
-<%
- {
- String _getViewCode = "parentView";
- List childNodes = nextContainer.getContainedNodes();
- Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
- Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
-%>
-<%@ include file="semanticChildLinks.jetinc" %>
-<%
- }
-%>
-}
-
-/**
- * @generated
- */
-protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")%> getCreate<%=nextContainer.getUniqueIdentifier()%>NotationalChildLinkCommand(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> parentView, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")%> linkDescriptor) {
-<%
- {
- String _diagramCode = "parentView.getDiagram()";
- Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
- Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
-%>
-<%@ include file="createNotationalEdgeCommand.jetinc"%>
-<%
- }
-%>
-}
-<%
- }
- }
-}
-if(!genDiagram.getLinks().isEmpty()) {
-%>
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")%> myViewService;
-
-/**
- * @generated
- */
-private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")%> getViewService() {
- return myViewService;
-}
-<%
-}
-%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildLinks.jetinc b/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildLinks.jetinc
deleted file mode 100644
index 076e62aaf..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildLinks.jetinc
+++ /dev/null
@@ -1,148 +0,0 @@
- <%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>();
-<%
-Map genFeature2genLinkMap = new LinkedHashMap();
-for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- GenFeature metaFeature = modelFacet.getChildMetaFeature();
- if (!genFeature2genLinkMap.containsKey(metaFeature)) {
- genFeature2genLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2genLinkMap.get(metaFeature)).add(genLink);
-}
-Map genFeature2featureGenLinkMap = new LinkedHashMap();
-for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- if (!genFeature2featureGenLinkMap.containsKey(metaFeature)) {
- genFeature2featureGenLinkMap.put(metaFeature, new ArrayList());
- }
- ((Collection) genFeature2featureGenLinkMap.get(metaFeature)).add(genLink);
-}
-if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
-%>
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = <%=_getViewCode%>.getElement();
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue;
-<%
-}
-if (!genFeature2genLinkMap.isEmpty()) {
-%>
- int linkVID;
-<%
-}
-for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-%>
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);%>.iterator(); it.hasNext(); ) {
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
-<%
- } else {
-%>
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);%>;
-<%
- }
-%>
- linkVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getLinkWithClassVisualID(nextValue);
-<%
- boolean generateSwitch = genLinksCollection.size() != 1;
- if (generateSwitch) {
-%>
- switch (linkVID) {
-<%
- }
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
- if (generateSwitch) {
-%>
- case <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID: {
-<%
- } else {
-%>
- if (<%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID == linkVID) {
-<%
- }
- if (modelFacet.getSourceMetaFeature() != null) {
-%>
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);%>;
-<%
- } else {
-%>
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> source = <%=_getViewCode%>.getElement();
-<%
- }
- if (modelFacet.getTargetMetaFeature() != null) {
-%>
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);%>;
-<%
- } else {
-%>
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> target = <%=_getViewCode%>.getElement();
-<%
- }
-%>
- if (source != null && target != null) {
- result.add(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")%>(source, target, nextValue, linkVID));
- }
-<%
- if (generateSwitch) {
-%>
- break;
- }
-<%
- } else {
-%>
- }
-<%
- }
-%>
-<%
- } //iterate over genLinksCollection
- if (generateSwitch) {
-%>
- }
-<%
- }
- if (metaFeature.isListType()) {
-%>
- }
-<%
- }
-}
-for (Iterator entries = genFeature2featureGenLinkMap.entrySet().iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature metaFeature = (GenFeature) nextEntry.getKey();
- Collection genLinksCollection = (Collection) nextEntry.getValue();
- if (metaFeature.isListType()) {
-%>
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);%>.iterator(); it.hasNext(); ) {
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
-<%
- } else {
-%>
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);%>;
-<%
- }
-%>
- if (nextValue != null) {
-<%
- for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
- GenLink nextLink = (GenLink) genLinksIterator.next();
-%>
- result.add(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")%>(modelObject, nextValue, null, <%=importManager.getImportedName(nextLink.getEditPartQualifiedClassName())%>.VISUAL_ID));
-<%
- }
-%>
- }
-<%
- if (metaFeature.isListType()) {
-%>
- }
-<%
- }
-}
-%>
- return result;
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildren.jetinc b/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildren.jetinc
deleted file mode 100644
index 9d7b94f7a..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/common/semanticChildren.jetinc
+++ /dev/null
@@ -1,95 +0,0 @@
-<%
-if (childNodes.size() == 0) {
-%>
- return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
-<%
-} else {
-%>
- <%=importManager.getImportedName("java.util.List")%> result = new <%=importManager.getImportedName("java.util.LinkedList")%>();
-<%
- Map genFeature2genNodeMap = new LinkedHashMap();
- for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
- GenNode nextNode = (GenNode) childNodes.get(nodeIndex);
- TypeModelFacet typeModelFacet = nextNode.getModelFacet();
- if (typeModelFacet == null) {
- continue;
- }
- GenFeature childMetaFeature = typeModelFacet.getChildMetaFeature();
- if (!genFeature2genNodeMap.containsKey(childMetaFeature)) {
- genFeature2genNodeMap.put(childMetaFeature, new ArrayList());
- }
- ((Collection) genFeature2genNodeMap.get(childMetaFeature)).add(nextNode);
- }
- Set entrySet = genFeature2genNodeMap.entrySet();
- if (entrySet.size() > 0) {
-%>
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> viewObject = <%=_getViewCode%>;
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> modelObject = viewObject.getElement();
- <%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> nextValue;
- int nodeVID;
-<%
- }
- for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
- Map.Entry nextEntry = (Map.Entry) entries.next();
- GenFeature childMetaFeature = (GenFeature) nextEntry.getKey();
- Collection genNodesCollection = (Collection) nextEntry.getValue();
- if (childMetaFeature.isListType()) {
-%>
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = <%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);%>.iterator(); it.hasNext(); ) {
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>) it.next();
-<%
- } else {
-%>
- nextValue = (<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%>)<%myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);%>;
-<%
- }
-%>
- nodeVID = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getNodeVisualID(viewObject, nextValue);
-<%
- boolean generateSwitch = genNodesCollection.size() != 1;
- if (generateSwitch) {
-%>
- switch (nodeVID) {
-<%
- }
- for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
- GenNode nextNode = (GenNode) genNodesIterator.next();
- if (generateSwitch) {
-%>
- case <%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID: {
-<%
- } else {
-%>
- if (<%=importManager.getImportedName(nextNode.getEditPartQualifiedClassName())%>.VISUAL_ID == nodeVID) {
-<%
- }
-%>
- result.add(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")%>(nextValue, nodeVID));
-<%
- if (generateSwitch) {
-%>
- break;
- }
-<%
- } else {
-%>
- }
-<%
- }
- }
- if (generateSwitch) {
-%>
- }
-<%
- }
- if (childMetaFeature.isListType()) {
-%>
- }
-<%
- }
-}
-%>
- return result;
-<%
-}
-%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/DiagramEditorUtil.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/DiagramEditorUtil.javajet
deleted file mode 100644
index f886e8336..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/DiagramEditorUtil.javajet
+++ /dev/null
@@ -1,178 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.editor" class="DiagramEditorUtilGenerator"
- imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* org.eclipse.emf.codegen.ecore.genmodel.* java.util.*"%>
-<%
-final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final GenEditorGenerator editorGen = genDiagram.getEditorGen();
-final GenPlugin genPlugin = editorGen.getPlugin();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-final GenModel genModel = genDiagram.getEditorGen().getDomainGenModel();
-final boolean isRichClientPlatform = genDiagram.getEditorGen().getApplication() != null;
-
-importManager.emitPackageStatement(stringBuffer);%>
-
-<%importManager.markImportLocation(stringBuffer);
-importManager.addImport("java.io.File");
-importManager.addImport("org.eclipse.ui.IWorkbench");
-importManager.addImport("org.eclipse.ui.IWorkbenchPage");
-importManager.addImport("org.eclipse.ui.IWorkbenchWindow");
-importManager.addImport("org.eclipse.ui.PlatformUI");
-importManager.addImport("org.eclipse.ui.PartInitException");
-importManager.addImport("org.eclipse.ui.IEditorDescriptor");
-importManager.addImport("org.eclipse.swt.widgets.Shell");
-importManager.addImport("org.eclipse.swt.widgets.FileDialog");
-importManager.addImport("org.eclipse.jface.dialogs.MessageDialog");
-importManager.addImport("org.eclipse.emf.common.util.URI");
-importManager.addImport("org.eclipse.emf.common.ui.URIEditorInput");
-
-importManager.registerInnerClass("DiagramInitializer");
-%>
-
-<%@include file="../common/featureGetAccessor.jetinc"%>
-
-/**
- * @generated
- */
-public class <%=genDiagram.getDiagramEditorUtilClassName()%> {
- /**
- * @generated
- */
- public static String openFilePathDialog(Shell shell, String fileExtensionFilter, int style) {
- FileDialog fileDialog = new FileDialog(shell, style);
- fileDialog.setFilterExtensions(new String[]{fileExtensionFilter});
-
- fileDialog.open();
- if (fileDialog.getFileName() != null && fileDialog.getFileName().length() > 0) {
- return fileDialog.getFilterPath() + File.separator + fileDialog.getFileName();
- }
- else
- {
- return null;
- }
- }
-
-<%
-if (editorGen.getEditor().isEclipseEditor()) {
-%>
- /**
- * @generated
- */
- public static <%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> openEditor(URI fileURI) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
- IEditorDescriptor editorDescriptor = workbench.getEditorRegistry().getDefaultEditor(fileURI.lastSegment());
- if (editorDescriptor == null) {
- MessageDialog.openError(
- workbenchWindow.getShell(),
- "Error",
- "There is no editor registered for the file " + fileURI.toFileString());
- return null;
- } else {
- try {
- return page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());
- } catch (PartInitException exception) {
- MessageDialog.openError(
- workbenchWindow.getShell(),
- "Error Opening Editor",
- exception.getMessage());
- return null;
- }
- }
- }
-<%
-} else {
-%>
- /**
- * @generated
- */
- public static <%=importManager.getImportedName("org.eclipse.ui.IViewPart")%> showView(URI fileURI) {
- IWorkbench workbench = PlatformUI.getWorkbench();
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
-
-
- try {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.parts.DiagramViewPart")%> diagramView = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.parts.DiagramViewPart")%>) page.showView(<%=importManager.getImportedName(editorGen.getEditor().getQualifiedClassName())%>.ID);
- if (!diagramView.showDiagram(null, fileURI)) {
- return null;
- }
- return diagramView;
- } catch (PartInitException exception) {
- MessageDialog.openError(
- workbenchWindow.getShell(),
- "Error Opening View",
- exception.getMessage());
- return null;
- }
- }
-<%
-}
-%>
-
- /**
- * @generated
- */
- public static <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> createDiagramFor(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> diagramRoot) {
- if (<%=importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())%>.VISUAL_ID != <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.INSTANCE.getDiagramVisualID(diagramRoot)) {
- return null;
- }
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> result = <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")%>.eINSTANCE.createDiagram();
- result.setElement(diagramRoot);
- <%=importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())%>.INSTANCE.decorateView(result);
- new DiagramInitializer().initDiagramContents(result);
- return result;
- }
-
- /**
- * @generated
- */
- private static class DiagramInitializer {
-<%@ include file="../common/initDiagramContents.jetinc"%>
- }
-<%
-if (!genDiagram.getEditorGen().isSameFileForDiagramAndModel()) {
-%>
- /**
- * @generated
- */
- public static URI getDiagramFileURI(URI modelFileURI) {
- if (modelFileURI == null || !modelFileURI.isFile()) {
- return null;
- }
- return modelFileURI.trimFileExtension().appendFileExtension("<%=editorGen.getDiagramFileExtension()%>");
- }
-
- /**
- * @generated
- */
- public static URI getModelFileURI(URI diagramFileURI) {
- if (diagramFileURI == null || !diagramFileURI.isFile()) {
- return null;
- }
- return diagramFileURI.trimFileExtension().appendFileExtension("<%=editorGen.getDomainFileExtension()%>");
- }
-<%
-}
-%>
-
- /**
- * Returns whether the given element is read only in its editing domain.
- * @generated
- */
- public static boolean isReadOnly(<%=importManager.getImportedName("org.eclipse.emf.ecore.EObject")%> element) {
- if (element == null) {
- return true;
- }
- <%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%> resource = element.eResource();
- if (resource == null) {
- return false;
- }
- <%=importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")%> editingDomain = <%=importManager.getImportedName("org.eclipse.emf.transaction.util.TransactionUtil")%>.getEditingDomain(resource);
- if (editingDomain == null) {
- return false;
- }
- return editingDomain.isReadOnly(resource);
- }
-}
-<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet
deleted file mode 100644
index 27a3789ec..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/ChildNodeEditPart.javajet
+++ /dev/null
@@ -1,279 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="ChildNodeEditPartGenerator"
- imports="java.util.* org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.*"%>
-<%
-final GenCommonBase genElement = (GenCommonBase) ((Object[]) argument)[0];
-final GenChildLabelNode genChildNode = (GenChildLabelNode)genElement;
-GenNode genHost = genChildNode;
-GenNode genNode = genChildNode; /*var used by componentEditPolicy.javajetinc*/
-GenClass underlyingMetaClass = genHost.getDomainMetaClass();
-GenDiagram genDiagram = genChildNode.getDiagram();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-LabelModelFacet labelModelFacet = genChildNode.getLabelModelFacet();
-final boolean isReadOnly = genChildNode.isLabelReadOnly();
-%>
-<%@ include file="../copyright4java.jetinc"%>
-
-<%@ include file="../common/featureGetAccessor.jetinc"%>
-
-<%importManager.emitPackageStatement(stringBuffer);
-importManager.registerInnerClass("TreeEditPartAdapter");
-
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.gef.Request");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("org.eclipse.gmf.runtime.notation.NotationPackage");
-importManager.addImport("java.util.List");
-
-importManager.markImportLocation(stringBuffer);
-%>
-
-/**
- * @generated
- */
-public class <%=genChildNode.getEditPartClassName()%> extends <%=importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")%> implements <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%>, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart")%>, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelController")%> {
-<%{
-GenCommonBase genCommonBase = genChildNode;%>
-<%@ include file="visualID.jetinc"%>
-<%}%>
-
-<%@ include file="textAwareFields.jetinc"%>
-
- /**
- * @generated
- */
- public <%=genChildNode.getEditPartClassName()%>(View view) {
- setModel(view);
- }
-
- /**
- * @generated
- */
- public <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> getDiagramNode() {
- return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel();
- }
-
-<%@ include file="registerModel.jetinc"%>
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
-<%
- String resolvedSemanticElement = "(" + importManager.getImportedName(genHost.getDomainMetaClass().getQualifiedInterfaceName()) + ") getDiagramNode().getElement()";
- final String primaryView = "getDiagramNode()";
-%>
-<%
-if (!isReadOnly) {
-%>
-<%@ include file="directEditPolicy.javajetinc"%>
-<%
-}
-%>
-<%@ include file="componentEditPolicy.javajetinc"%>
-<%{
-GenCommonBase genCommonBase = genChildNode;%>
-<%@ include file="customBehaviour.jetinc"%>
-<%@include file="openEditPolicy.jetinc"%>
-<%}%>
- }
-
-<%@ include file="labelPerformRequest.jetinc"%>
-<%
-if (!isReadOnly) {
-%>
-<%@ include file="directEdit.javajetinc"%>
-<%
-}
-%>
-<%@ include file="refreshers.javajetinc/external.jetinc"%>
- /**
- * @generated
- */
- protected List getModelChildren() {
- return ((View)getModel()).getVisibleChildren();
- }
-
- /**
- * @generated
- */
- protected List getModelSourceConnections() {
- return ((View)getModel()).getSourceEdges();
- }
-
- /**
- * @generated
- */
- protected List getModelTargetConnections() {
- return ((View)getModel()).getTargetEdges();
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshLabel();
- refreshFont();
- refreshFontColor();
- refreshVisibility();
- }
-
- /**
- * @generated
- */
- protected void refreshLabel() {
- getLabel().setText(getLabelText());
- getLabel().setIcon(getLabelIcon());
- }
-<%@ include file="labelText.javajetinc"%>
-<%@ include file="refreshMethods/font.javajetinc"%>
-<%@ include file="refreshMethods/fontColor.javajetinc"%>
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.swt.graphics.Image")%> getLabelIcon() {
-<%
-if (genChildNode.isLabelElementIcon()) {
-%>
- return <%=importManager.getImportedName(genDiagram.getElementTypesQualifiedClassName())%>.getImage(getDiagramNode().getElement().eClass());
-<%
-} else {
-%>
- return null;
-<%
-}
-%>
- }
-
- /**
- * @generated
- */
- protected void refreshVisibility() {
- boolean isVisible = getDiagramNode().isVisible();
- boolean wasVisible = getFigure().isVisible();
- if (isVisible == wasVisible) {
- return;
- }
- if (!isVisible && (getSelected() != SELECTED_NONE)) {
- getViewer().deselect(this);
- }
-
- getFigure().setVisible(isVisible);
- getFigure().revalidate();
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class key) {
- if (<%=importManager.getImportedName("org.eclipse.gef.TreeEditPart")%>.class == key) {
- return getTreeEditPartAdapter();
- }
-<%/*@ include file="adapters/propertySource.javajetinc"*/%>
- return super.getAdapter(key);
- }
-
- /**
- * @generated
- */
- private TreeEditPartAdapter myTreeEditPartAdapter;
-
- /**
- * @generated
- */
- private TreeEditPartAdapter getTreeEditPartAdapter() {
- if (myTreeEditPartAdapter == null) {
- myTreeEditPartAdapter = new TreeEditPartAdapter();
- }
- return myTreeEditPartAdapter;
- }
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- addExternalRefresher(getLabelRefresher());
- getDiagramNode().getElement().eAdapters().add(domainModelRefresher);
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- getDiagramNode().getElement().eAdapters().remove(domainModelRefresher);
- removeExternalRefresher(getLabelRefresher());
- super.deactivate();
- }
-
-<%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%>
-
-<%@ include file="refresher.javajetinc"%>
-
-<%@ include file="refreshers.javajetinc/labelRefresher.jetinc"%>
-
- /**
- * @generated
- */
- private void createRefreshers() {
- structuralFeatures2Refresher = new HashMap();
-<%@ include file="refreshers.javajetinc/children.javajetinc"%>
-<%@ include file="refreshers.javajetinc/visibility.javajetinc"%>
-<%@ include file="refreshers.javajetinc/font.javajetinc"%>
-<%@ include file="refreshers.javajetinc/fontColor.javajetinc"%>
- }
-
-<%
-final Viewmap viewmap = genChildNode.getViewmap();
-%>
-<%@ include file="labelFigure.jetinc"%>
-
- /**
- * @generated
- */
- private class TreeEditPartAdapter extends <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart")%> {
- /**
- * @generated
- */
- public TreeEditPartAdapter() {
- super(getDiagramNode(), <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().getItemProvidersAdapterFactory());
- }
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
-<%@ include file="treeComponentEditPolicy.javajetinc"%>
-<%
-if (!isReadOnly) {
-%>
-<%@ include file="directEditPolicy.javajetinc"%>
-<%
-}
-%>
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.labels.ILabelTextDisplayer")%> createLabelTextDisplayer() {
- return <%=genChildNode.getEditPartClassName()%>.this.getLabelTextDisplayer();
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.swt.graphics.Image")%> getImage() {
- return getLabelIcon();
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("java.util.List")%> getModelChildren() {
- return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
- }
- }
-}
-<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet
deleted file mode 100644
index 869220d3a..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/CompartmentEditPart.javajet
+++ /dev/null
@@ -1,237 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="CompartmentEditPartGenerator"
- imports="java.util.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.*"%>
-<%
-GenCompartment genCompartment = (GenCompartment) ((Object[]) argument)[0];
-GenNode genHost = genCompartment.getNode();
-GenDiagram genDiagram = genCompartment.getDiagram();
-List childNodes = genCompartment.getChildNodes();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc
-%>
-<%@ include file="../copyright4java.jetinc"%>
-
-<%@ include file="../common/featureGetAccessor.jetinc"%>
-
-<%importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.requests.CreateRequest");
-
-importManager.markImportLocation(stringBuffer);
-%>
-
-/**
- * @generated
- */
-public class <%=genCompartment.getEditPartClassName()%> extends <%=importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")%> implements <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%> {
-<%{
-GenCommonBase genCommonBase = genCompartment;%>
-<%@ include file="visualID.jetinc"%>
-<%}%>
-
- /**
- * @generated
- */
- public <%=genCompartment.getEditPartClassName()%>(View view) {
- setModel(view);
- }
-
- /**
- * @generated
- */
- public boolean isSelectable() {
- return false;
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("java.util.List")%> getModelChildren() {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle")%> style = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.DrawerStyle")%>) getDiagramNode().getStyle(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationPackage")%>.eINSTANCE.getDrawerStyle());
- if (style != null && style.isCollapsed()) {
- return <%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST;
- }
- return getDiagramNode().getChildren();
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> getDiagramNode() {
- return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel();
- }
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
-<%{
-GenCommonBase genCommonBase = genCompartment;%>
-<%@ include file="layoutEditPolicy.jetinc"%>
-<%@ include file="customBehaviour.jetinc"%>
-<%@include file="openEditPolicy.jetinc"%>
-<%}%>
- installNotationModelRefresher();
- }
-
- /**
- * Returns the selection handles that should be contributed to the parent when it becomes selected.
- * @generated
- */
- public <%=importManager.getImportedName("java.util.List")%> createSelectionHandles() {
-<%
-if (!genCompartment.isCanCollapse()) {
-%>
- return <%=importManager.getImportedName("java.util.Collections")%>.singletonList(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.handles.CompartmentNameHandle")%>(this, getTitleName()));
-<%
-} else {
-%>
- return <%=importManager.getImportedName("java.util.Collections")%>.singletonList(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.handles.CompartmentCollapseHandle")%>(this, getTitleName()));
-<%
-}
-%>
- }
-
- /**
- * @generated
- */
- public void performRequest(<%=importManager.getImportedName("org.eclipse.gef.Request")%> req) {
-<%@include file="performOpen.jetinc"%>
- super.performRequest(req);
- }
-
- /**
- * @generated
- */
- protected String getTitleName() {
-<%
-if (genCompartment.isNeedsTitle()) {
-%>
- return "<%=genCompartment.getTitle()%>";
-<%
-} else {
-%>
- return ""; //$NON-NLS-1$
-<%
-}
-%>
- }
-
- /**
- * @generated
- */
- public <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> createFigure() {
- <%=importManager.getImportedName("org.eclipse.draw2d.Figure")%> result = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.figures.CompartmentFigure")%>();
- result.setLayoutManager(new <%=importManager.getImportedName("org.eclipse.draw2d.StackLayout")%>());
- <%=importManager.getImportedName("org.eclipse.draw2d.ScrollPane")%> scrollPane = new <%=importManager.getImportedName("org.eclipse.draw2d.ScrollPane")%>();
- result.add(scrollPane);
-<%if (genCompartment.isListLayout()) {%>
- <%=importManager.getImportedName("org.eclipse.draw2d.Viewport")%> viewport = new <%=importManager.getImportedName("org.eclipse.draw2d.Viewport")%>();
- contentPane = new <%=importManager.getImportedName("org.eclipse.draw2d.Figure")%>();
- contentPane.setLayoutManager(new <%=importManager.getImportedName("org.eclipse.draw2d.ToolbarLayout")%>());
-<%} else {%>
- <%=importManager.getImportedName("org.eclipse.draw2d.Viewport")%> viewport = new <%=importManager.getImportedName("org.eclipse.draw2d.FreeformViewport")%>();
- contentPane = new <%=importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")%>();
- contentPane.setLayoutManager(new <%=importManager.getImportedName("org.eclipse.draw2d.FreeformLayout")%>());
-<%}%>
- viewport.setContents(contentPane);
- scrollPane.setViewport(viewport);
- return result;
- }
-
-<%
-if (!genCompartment.isListLayout()) {
-%>
- /**
- * @generated
- */
- public Object getAdapter(Class key) {
- if (<%=importManager.getImportedName("org.eclipse.gef.SnapToHelper")%>.class == key) {
- return new <%=importManager.getImportedName("org.eclipse.gef.SnapToGrid")%>(this);
- }
- return super.getAdapter(key);
- }
-<%
-}
-%>
-
- /**
- * @generated
- */
- public IFigure getContentPane() {
- return contentPane;
- }
-
- /**
- * @generated
- */
- private IFigure contentPane;
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- installNotationModelRefresher();
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- uninstallNotationModelRefresher();
- super.deactivate();
- }
-
-<%
-{
-String _getViewCode = "getDiagramNode()";
-String _getDiagramCode = _getViewCode + ".getDiagram()";
-boolean isListLayout = genCompartment.isListLayout();
-%>
-<%@ include file="notationModelRefresher.jetinc"%>
-<%
-}
-%>
-
-<%@ include file="refresher.javajetinc"%>
-
- /**
- * @generated
- */
- private void createRefreshers() {
- structuralFeatures2Refresher = new HashMap();
-<%@ include file="refreshers.javajetinc/children.javajetinc"%>
-<%@ include file="refreshers.javajetinc/visibility.javajetinc"%>
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
-//XXX: refreshBackgroundColor();
-//XXX: refreshForegroundColor();
-//XXX: refreshFont();
- refreshVisibility();
- }
-
- /**
- * @generated
- */
- protected void refreshVisibility() {
- boolean isVisible = ((View)getModel()).isVisible();
- boolean wasVisible = getFigure().isVisible();
- if (isVisible == wasVisible) {
- return;
- }
- if (!isVisible && (getSelected() != SELECTED_NONE)) {
- getViewer().deselect(this);
- }
-
- getFigure().setVisible(isVisible);
- getFigure().revalidate();
- }
-}
-
-<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet
deleted file mode 100644
index 0f93a4a25..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramEditPart.javajet
+++ /dev/null
@@ -1,337 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="DiagramEditPartGenerator"
- imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* java.util.* org.eclipse.emf.codegen.ecore.genmodel.*"%>
-<%
-GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("NotationModelRefresher"); //from notationModelRefresher.jetinc
-importManager.registerInnerClass("LinkNotationModelRefresher"); //from linkNotationModelRefresher.jetinc
-importManager.registerInnerClass("TreeEditPartAdapter");
-List childNodes = genDiagram.getTopLevelNodes();
-%>
-
-<%@ include file="../common/featureGetAccessor.jetinc"%>
-
-<%
-class DiagramEditPartHelper {
- private final List myContainedFeatureModelFacetLinks = new LinkedList();
- private final List myContainedTypeModelFacetLinks = new LinkedList();
- public DiagramEditPartHelper(GenDiagram diagram) {
- for(Iterator it = diagram.getLinks().iterator(); it.hasNext(); ) {
- GenLink genLink = (GenLink)it.next();
- if (!genLink.isViewDirectionAlignedWithModel() || genLink.getModelFacet() == null) {
- continue;
- }
- GenClass containerClass;
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) genLink.getModelFacet();
- if (modelFacet.getSourceMetaFeature() == null && modelFacet.getTargetMetaFeature() == null) {
- //if one link feature is null, the element is treated as this end of the link. If both are null, we cannot do anything about such a link.
- containerClass = null;
- } else {
- containerClass = modelFacet.getContainmentMetaFeature().getGenClass();
- }
- } else if (genLink.getModelFacet() instanceof FeatureLinkModelFacet) {
- GenFeature metaFeature = ((FeatureLinkModelFacet) genLink.getModelFacet()).getMetaFeature();
- containerClass = metaFeature.getGenClass();
- } else {
- continue;
- }
- if (containerClass.getEcoreClass().isSuperTypeOf(diagram.getDomainDiagramElement().getEcoreClass())) {
- if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- myContainedTypeModelFacetLinks.add(genLink);
- } else {
- myContainedFeatureModelFacetLinks.add(genLink);
- }
- }
- }
- }
-
- public boolean containsLinks() {
- return containsFeatureModelFacetLinks() || containsTypeModelFacetLinks();
- }
-
- public boolean containsFeatureModelFacetLinks() {
- return !myContainedFeatureModelFacetLinks.isEmpty();
- }
-
- public boolean containsTypeModelFacetLinks() {
- return !myContainedTypeModelFacetLinks.isEmpty();
- }
-
- public Iterator getContainedFeatureModelFacetLinks() {
- return myContainedFeatureModelFacetLinks.iterator();
- }
-
- public Iterator getContainedTypeModelFacetLinks() {
- return myContainedTypeModelFacetLinks.iterator();
- }
-}
-final DiagramEditPartHelper myHelper = new DiagramEditPartHelper(genDiagram);
-%>
-
-<%
-importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("org.eclipse.gef.editparts.AbstractGraphicalEditPart");
-importManager.addImport("org.eclipse.draw2d.IFigure");
-importManager.addImport("org.eclipse.draw2d.FreeformLayer");
-importManager.addImport("org.eclipse.draw2d.FreeformLayout");
-importManager.addImport("org.eclipse.draw2d.MarginBorder");
-importManager.addImport("org.eclipse.gef.EditPolicy");
-importManager.addImport("org.eclipse.draw2d.geometry.Dimension");
-importManager.addImport("org.eclipse.draw2d.geometry.Point");
-importManager.addImport("org.eclipse.gef.EditPart");
-importManager.addImport("org.eclipse.gef.SnapToGrid");
-importManager.addImport("org.eclipse.gef.SnapToHelper");
-importManager.addImport("org.eclipse.gef.editpolicies.RootComponentEditPolicy");
-importManager.addImport("org.eclipse.gef.requests.ChangeBoundsRequest");
-importManager.addImport("org.eclipse.gef.requests.CreateRequest");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Bounds");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Diagram");
-importManager.addImport("org.eclipse.gmf.runtime.notation.Node");
-importManager.addImport("org.eclipse.gmf.runtime.notation.NotationPackage");
-importManager.addImport("org.eclipse.gmf.runtime.notation.View");
-importManager.addImport("java.util.List");
-
-importManager.markImportLocation(stringBuffer);
-%>
-
-/**
- * @generated
- */
-public class <%=genDiagram.getEditPartClassName()%> extends AbstractGraphicalEditPart implements <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%> {
- /**
- * @generated
- */
- public static String MODEL_ID = "<%=genDiagram.getEditorGen().getModelID()%>";
-
-<%{
-GenCommonBase genCommonBase = genDiagram;%>
-<%@ include file="visualID.jetinc"%>
-<%}%>
-
- /**
- * @generated
- */
- public <%=genDiagram.getEditPartClassName()%>(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> model) {
- setModel(model);
- }
-
- /**
- * @generated
- */
- public <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%> getDiagram() {
- return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")%>) getModel();
- }
-
-<%@ include file="registerModel.jetinc"%>
-
- /**
- * @generated
- */
- public void addNotify() {
- super.addNotify();
- getDiagram().eAdapters().add(getUpdateManager());
- getDiagram().getElement().eAdapters().add(domainModelRefresher);
- }
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
-<%{
-GenCommonBase genCommonBase = genDiagram;%>
-<%@ include file="layoutEditPolicy.jetinc"%>
-<%@ include file="customBehaviour.jetinc"%>
-<%}%>
- installNotationModelRefresher();
-<%
-//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-%>
- installLinkNotationModelRefresher();
-<%
-//}
-%>
- }
-
- /**
- * @generated
- */
- protected IFigure createFigure() {
- IFigure f = new FreeformLayer();
- f.setBorder(new MarginBorder(5));
- f.setLayoutManager(new FreeformLayout());
- return f;
- }
-
- /**
- * @generated
- */
- public Object getAdapter(Class key) {
- if (<%=importManager.getImportedName("org.eclipse.gef.SnapToHelper")%>.class == key) {
- return new <%=importManager.getImportedName("org.eclipse.gef.SnapToGrid")%>(this);
- }
- if (<%=importManager.getImportedName("org.eclipse.gef.TreeEditPart")%>.class == key) {
- return getTreeEditPartAdapter();
- }
-<%/*@ include file="adapters/propertySource.javajetinc"*/%>
- return super.getAdapter(key);
- }
-
- /**
- * @generated
- */
- private TreeEditPartAdapter myTreeEditPartAdapter;
-
- /**
- * @generated
- */
- private TreeEditPartAdapter getTreeEditPartAdapter() {
- if (myTreeEditPartAdapter == null) {
- myTreeEditPartAdapter = new TreeEditPartAdapter();
- }
- return myTreeEditPartAdapter;
- }
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return getDiagram().getVisibleChildren();
- }
-
-<%@ include file="refresher.javajetinc"%>
-
- /**
- * @generated
- */
- private void createRefreshers() {
- structuralFeatures2Refresher = new HashMap();
-<%@ include file="refreshers.javajetinc/children.javajetinc"%>
- }
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- if (!getDiagram().eAdapters().contains(getUpdateManager())) {
- getDiagram().eAdapters().add(getUpdateManager());
- }
- if (!getDiagram().getElement().eAdapters().contains(domainModelRefresher)) {
- getDiagram().getElement().eAdapters().add(domainModelRefresher);
- }
- installNotationModelRefresher();
-<%
-//link notation model refresher should always be installed for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-%>
- installLinkNotationModelRefresher();
-<%
-//}
-%>
- }
-
- /**
- * @generated
- */
- public void deactivate() {
-<%
-//link notation model refresher should always be installed/uninstalled for the diagram edit part, because it tracks the uncontained links
-//if (myHelper.containsLinks()) {
-%>
- uninstallLinkNotationModelRefresher();
-<%
-//}
-%>
- uninstallNotationModelRefresher();
- getDiagram().getElement().eAdapters().remove(domainModelRefresher);
- getDiagram().eAdapters().remove(getUpdateManager());
- super.deactivate();
- }
-
-<%
-{
-String _getDiagramCode = "getDiagram()";
-String _getViewCode = "getDiagram()";
-boolean isListLayout = false;
-final boolean _includeUncontainedLinks = true;
-%>
-<%@ include file="notationModelRefresher.jetinc"%>
-
-<%@ include file="linkNotationModelRefresher.jetinc"%>
-<%
-}
-%>
-
-<%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%>
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%> updateManager;
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%> getUpdateManager() {
- if (updateManager == null) {
- updateManager = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%>(getViewer());
- }
- return updateManager;
- }
-
- /**
- * @generated
- */
- private class TreeEditPartAdapter extends <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart")%> {
- /**
- * @generated
- */
- public TreeEditPartAdapter() {
- super(getDiagram(), <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().getItemProvidersAdapterFactory());
- }
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.COMPONENT_ROLE, new RootComponentEditPolicy());
- }
-
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- if (!getDiagram().eAdapters().contains(getTreeUpdateManager())) {
- getDiagram().eAdapters().add(getTreeUpdateManager());
- }
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- getDiagram().eAdapters().remove(getTreeUpdateManager());
- super.deactivate();
- }
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%> treeUpdateManager;
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%> getTreeUpdateManager() {
- if (treeUpdateManager == null) {
- treeUpdateManager = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.UpdateManager")%>(getViewer());
- }
- return treeUpdateManager;
- }
- }
-}
-<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramExternalNodeLabelEditPart.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramExternalNodeLabelEditPart.javajet
deleted file mode 100644
index de7a0adfd..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/DiagramExternalNodeLabelEditPart.javajet
+++ /dev/null
@@ -1,81 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="DiagramExternalNodeLabelEditPartGenerator"
- imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.*"%>
-<%
-final GenDiagram genDiagram = (GenDiagram) ((Object[]) argument)[0];
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-%>
-<%@ include file="../copyright4java.jetinc"%>
-<%importManager.emitPackageStatement(stringBuffer);%>
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gmf.runtime.notation.View;
-<%importManager.markImportLocation(stringBuffer);%>
-
-/**
- * @generated
- */
-public abstract class <%=genDiagram.getBaseExternalNodeLabelEditPartClassName()%> extends <%=importManager.getImportedName("org.eclipse.gef.editparts.AbstractGraphicalEditPart")%> {
-
- /**
- * @generated
- */
- public <%=genDiagram.getBaseExternalNodeLabelEditPartClassName()%>(View view) {
- setModel(view);
- }
-
- /**
- * @generated
- */
- public void refreshBounds() {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%> node = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Node")%>) getModel();
- if (node.getLayoutConstraint() == null) {
- return;
- }
- assert node.getLayoutConstraint() instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location")%>;
- final <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location")%> location = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Location")%>) node.getLayoutConstraint();
- getFigure().getParent().setConstraint(getFigure(), new <%=importManager.getImportedName("org.eclipse.draw2d.AbstractLocator")%>() {
- protected Point getReferencePoint() {
- return getLabelLocation(((GraphicalEditPart) getParent()).getFigure()).translate(location.getX(), location.getY());
- }
- public int getRelativePosition() {
- return <%=importManager.getImportedName("org.eclipse.draw2d.PositionConstants")%>.SOUTH;
- }
- });
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
- refreshBounds();
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%>.Refresher boundsRefresher = new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%>.Refresher() {
- public void refresh() {
- refreshBounds();
- }
- };
-
- /**
- * @generated
- */
- public Point getReferencePoint() {
- return getLabelLocation(((GraphicalEditPart) getParent()).getFigure());
- }
-
- /**
- * @generated
- */
- protected Point getLabelLocation(IFigure parent) {
- Point result = parent.getBounds().getBottom();
- parent.translateToAbsolute(result);
- return result;
- }
-}
-<%importManager.emitSortedImports();%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkEditPart.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkEditPart.javajet
deleted file mode 100644
index 84a146548..000000000
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/parts/LinkEditPart.javajet
+++ /dev/null
@@ -1,413 +0,0 @@
-<%@ jet package="org.eclipse.gmf.codegen.templates.lite.parts" class="LinkEditPartGenerator"
- imports="org.eclipse.gmf.codegen.gmfgen.* org.eclipse.gmf.common.codegen.* org.eclipse.emf.codegen.ecore.genmodel.* org.eclipse.emf.ecore.* java.util.*"%>
-<%
-GenLink genLink = (GenLink) ((Object[]) argument)[0];
-final GenCommonBase genElement = genLink;
-GenDiagram genDiagram = genLink.getDiagram();
-final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1];
-importManager.registerInnerClass("TreeEditPartAdapter");
-%>
-<%@ include file="../copyright4java.jetinc"%>
-<%
-importManager.emitPackageStatement(stringBuffer);
-importManager.addImport("java.util.List");
-importManager.markImportLocation(stringBuffer);
-%>
-
-/**
- * @generated
- */
-public class <%=genLink.getEditPartClassName()%> extends <%=importManager.getImportedName("org.eclipse.gef.editparts.AbstractConnectionEditPart")%> implements <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart")%>, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart")%>, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecoratableEditPart")%> {
-<%{
-GenCommonBase genCommonBase = genLink;%>
-<%@ include file="visualID.jetinc"%>
-<%}%>
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager")%> myDecorationManager;
-
- /**
- * @generated
- */
- public <%=genLink.getEditPartClassName()%>(<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view) {
- assert view instanceof <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>;
- setModel(view);
- }
-
- /**
- * @generated
- */
- public <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%> getDiagramEdge() {
- return (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.Edge")%>) getModel();
- }
-
- /**
- * @generated
- */
- public <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager")%> getDecorationManager() {
- return myDecorationManager;
- }
-
-<%@ include file="registerModel.jetinc"%>
-<%
-GenLinkLabel primaryLabel = null;
-for(Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
- GenLinkLabel next = (GenLinkLabel)it.next();
- if (!next.isReadOnly()) {
- primaryLabel = next;
- break;
- }
-}
-%>
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
-<%@ include file="componentEditPolicy.javajetinc"%>
- installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.CONNECTION_ENDPOINTS_ROLE, new <%=importManager.getImportedName("org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy")%>());
- installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.CONNECTION_BENDPOINTS_ROLE, new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.BendpointEditPolicy")%>());
-<%
-if (primaryLabel != null) {
-%>
- installEditPolicy(<%=importManager.getImportedName("org.eclipse.gef.EditPolicy")%>.DIRECT_EDIT_ROLE, new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.policies.DelegatingDirectEditPolicy")%>());
-<%
-}
-%>
-<%{
-GenCommonBase genCommonBase = genLink;%>
-<%@ include file="customBehaviour.jetinc"%>
-<%@include file="openEditPolicy.jetinc"%>
-<%}%>
- }
-
-<%
-if (primaryLabel != null) {
-%>
-
- /**
- * Returns the label which should be direct-edited by default.
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> getPrimaryLabelEditPart() {
- for(<%=importManager.getImportedName("java.util.Iterator")%> it = getDiagramEdge().getChildren().iterator(); it.hasNext(); ) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> nextChild = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>)it.next();
- if (<%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(nextChild) == <%=importManager.getImportedName(primaryLabel.getEditPartQualifiedClassName())%>.VISUAL_ID) {
- return (EditPart) getViewer().getEditPartRegistry().get(nextChild);
- }
- }
- return null;
- }
-
- /**
- * @generated
- */
- public void performRequest(<%=importManager.getImportedName("org.eclipse.gef.Request")%> req) {
- if (<%=importManager.getImportedName("org.eclipse.gef.RequestConstants")%>.REQ_DIRECT_EDIT.equals(req.getType())) {
- <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> labelToEdit;
- if (req instanceof <%=importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")%>) {
- labelToEdit = getLabelEditPart((<%=importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")%>)req);
- } else {
- labelToEdit = getPrimaryLabelEditPart();
- }
- if (labelToEdit != null) {
- labelToEdit.performRequest(req);
- }
- }
-<%@include file="performOpen.jetinc"%>
- super.performRequest(req);
- }
-
- /**
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> getLabelEditPart(<%=importManager.getImportedName("org.eclipse.gef.requests.DirectEditRequest")%> req) {
- <%=importManager.getImportedName("org.eclipse.gef.EditPart")%> result = getViewer().findObjectAt(req.getLocation());
- if (result != null) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%> view = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")%>) result.getModel();
- if (getDiagramEdge().getChildren().contains(view)) {
- int visualId = <%=importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())%>.getVisualID(view);
- switch (visualId) {
-<%
- for (Iterator it = genLink.getLabels().iterator(); it.hasNext(); ) {
- GenLinkLabel genLabel = (GenLinkLabel) it.next();
- if (genLabel.isReadOnly()) {
- continue;
- }
-%>
- case <%=importManager.getImportedName(genLabel.getEditPartQualifiedClassName())%>.VISUAL_ID:
- return result;
-<%
- }
-%>
- }
- }
- }
- return getPrimaryLabelEditPart();
- }
-
-<%
-} //if (primaryLabel != null, i.e., there are editable labels)
-%>
-
- /**
- * @generated
- */
- protected List getModelChildren() {
- return ((Edge)getModel()).getChildren();
- }
-
-<%@ include file="refresher.javajetinc"%>
-
- /**
- * @generated
- */
- public Object getAdapter(Class key) {
- if (<%=importManager.getImportedName("org.eclipse.gef.TreeEditPart")%>.class == key) {
- return getTreeEditPartAdapter();
- }
- return super.getAdapter(key);
- }
-
- /**
- * @generated
- */
- private TreeEditPartAdapter myTreeEditPartAdapter;
-
- /**
- * @generated
- */
- private TreeEditPartAdapter getTreeEditPartAdapter() {
- if (myTreeEditPartAdapter == null) {
- myTreeEditPartAdapter = new TreeEditPartAdapter();
- }
- return myTreeEditPartAdapter;
- }
-
-<%
-if (genLink.getModelFacet() instanceof TypeLinkModelFacet) {
- //Otherwise, there's no element associated with the element
-%>
- /**
- * @generated
- */
- public void activate() {
- super.activate();
- getDiagramEdge().getElement().eAdapters().add(domainModelRefresher);
- }
-
- /**
- * @generated
- */
- public void deactivate() {
- getDiagramEdge().getElement().eAdapters().remove(domainModelRefresher);
- super.deactivate();
- }
-
-<%@ include file="refreshers.javajetinc/domainModelRefresher.javajetinc"%>
-
-<%
-}
-%>
-<%@ include file="refreshers.javajetinc/externalRefreshers.javajetinc"%>
-<%@ include file="refreshers.javajetinc/external.jetinc"%>
-
- /**
- * @generated
- */
- private void createRefreshers() {
- structuralFeatures2Refresher = new HashMap();
-<%@ include file="refreshers.javajetinc/children.javajetinc"%>
-<%@ include file="refreshers.javajetinc/visibility.javajetinc"%>
-<%@ include file="refreshers.javajetinc/bendpoints.javajetinc"%>
- }
-
- /**
- * @generated
- */
- protected void refreshVisuals() {
- super.refreshVisuals();
-//XXX: refreshBackgroundColor();
-//XXX: refreshForegroundColor();
-//XXX: refreshFont();
- refreshVisibility();
- refreshBendpoints();
- }
-
- /**
- * @generated
- */
- protected void refreshBendpoints() {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")%> bendpoints = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.RelativeBendpoints")%>) getDiagramEdge().getBendpoints();
- if (bendpoints == null) {
- getConnectionFigure().setRoutingConstraint(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_LIST);
- return;
- }
- <%=importManager.getImportedName("java.util.List")%> modelConstraint = bendpoints.getPoints();
- <%=importManager.getImportedName("java.util.List")%> figureConstraint = new <%=importManager.getImportedName("java.util.ArrayList")%>();
- for (int i = 0; i < modelConstraint.size(); i++) {
- <%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")%> wbp = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.notation.datatype.RelativeBendpoint")%>) modelConstraint.get(i);
- <%=importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")%> rbp = new <%=importManager.getImportedName("org.eclipse.draw2d.RelativeBendpoint")%>(getConnectionFigure());
- rbp.setRelativeDimensions(new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(wbp.getSourceX(), wbp.getSourceY()), new <%=importManager.getImportedName("org.eclipse.draw2d.geometry.Dimension")%>(wbp.getTargetX(), wbp.getTargetY()));
- rbp.setWeight((i + 1) / ((float) modelConstraint.size() + 1));
- figureConstraint.add(rbp);
- }
- getConnectionFigure().setRoutingConstraint(figureConstraint);
- }
-
- /**
- * @generated
- */
- protected void refreshVisibility() {
- boolean isVisible = ((View)getModel()).isVisible();
- boolean wasVisible = getFigure().isVisible();
- if (isVisible == wasVisible) {
- return;
- }
- if (!isVisible && (getSelected() != SELECTED_NONE)) {
- getViewer().deselect(this);
- }
-
- getFigure().setVisible(isVisible);
- getFigure().revalidate();
- }
-
- /**
- * @generated
- */
- public void addNotify() {
- super.addNotify();
- getConnectionFigure().setConnectionRouter(new <%=importManager.getImportedName("org.eclipse.draw2d.BendpointConnectionRouter")%>());
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.draw2d.IFigure")%> createFigure() {
- <%=importManager.getImportedName("org.eclipse.draw2d.Connection")%> result = primCreateFigure();
- myDecorationManager = createDecorationManager(result);
- return result;
- }
-
- /**
- * @generated
- */
- protected <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecorationManager")%> createDecorationManager(<%=importManager.getImportedName("org.eclipse.draw2d.Connection")%> connection) {
- return new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.decorations.ConnectionDecorationManager")%>(connection);
- }
-
- /**
- * Creates figure for this edit part.
- *
- * Body of this method does not depend on settings in generation model
- * so you may safely remove <i>generated</i> tag and modify it.
- *
- * @generated
- */
- private <%=importManager.getImportedName("org.eclipse.draw2d.Connection")%> primCreateFigure() {<%
-Viewmap viewmap = genLink.getViewmap();
-if (viewmap instanceof FigureViewmap) {
- String figureQualifiedClassName = null;
- figureQualifiedClassName = ((FigureViewmap) viewmap).getFigureQualifiedClassName();
- if (figureQualifiedClassName == null || figureQualifiedClassName.trim().length() == 0) {
- figureQualifiedClassName = "org.eclipse.gmf.runtime.draw2d.PolylineConnection";
- }
-%>
- return new <%=importManager.getImportedName(figureQualifiedClassName)%>();
-<%} // instanceof FigureViewmap
- else if (viewmap instanceof SnippetViewmap) {%>
- return <%=((SnippetViewmap) viewmap).getBody()%>;
-<%} // instanceof SnippetViewmap
- else if (viewmap instanceof InnerClassViewmap) {%>
- return new <%=((InnerClassViewmap) viewmap).getClassName()%>();
-<%}%>
- }
-
-<%
-if (genLink.getViewmap() instanceof InnerClassViewmap) {
- String classBody = ((InnerClassViewmap) genLink.getViewmap()).getClassBody();
-%>
-<%=classBody%>
-<%@ include file="mapmodeWorkaround.javajetinc"%>
-<%
-}
-%>
-
- /**
- * @generated
- */
- private class TreeEditPartAdapter extends <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.tree.BaseTreeEditPart")%> {
- /**
- * @generated
- */
- public TreeEditPartAdapter() {
- super(getDiagramEdge(), <%=importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())%>.getInstance().getItemProvidersAdapterFactory());
- }
-
- /**
- * @generated
- */
- protected void createEditPolicies() {
-<%@ include file="treeComponentEditPolicy.javajetinc"%>
-<%
-if (primaryLabel != null &&