### Eclipse Workspace Patch 1.0 #P org.eclipse.gmf.codegen.lite Index: templates/editor/Editor.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/Editor.javajet,v retrieving revision 1.9 diff -u -r1.9 Editor.javajet --- templates/editor/Editor.javajet 11 Sep 2006 15:45:01 -0000 1.9 +++ templates/editor/Editor.javajet 29 Sep 2006 14:18:50 -0000 @@ -124,6 +124,7 @@ addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.SaveAction")%>(this)); addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction")%>(this)); + addEditorAction(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.LayoutDiagramAction")%>(this)); <%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomIn = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")%>(getZoomManager()); <%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomOut = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")%>(getZoomManager()); @@ -429,6 +430,8 @@ appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.DELETE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT); appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.DIRECT_EDIT, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT); + appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.ActionIds")%>.LAYOUT_ALL_ACTION, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_REST); + appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.SAVE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_SAVE); appendAlignmentSubmenu(menuManager); Index: templates/editor/NewDiagramFileWizard.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet,v retrieving revision 1.1 diff -u -r1.1 NewDiagramFileWizard.javajet --- templates/editor/NewDiagramFileWizard.javajet 21 Sep 2006 10:12:03 -0000 1.1 +++ templates/editor/NewDiagramFileWizard.javajet 29 Sep 2006 14:18:50 -0000 @@ -215,14 +215,26 @@ <% if (isRichClientPlatform) { %> - <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.openEditor(diagramResource.getURI()); + <%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> editor = <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.openEditor(diagramResource.getURI()); <% } else { %> - <%=importManager.getImportedName("org.eclipse.ui.ide.IDE")%>.openEditor(myWorkbenchPage, diagramFile); + <%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> editor = <%=importManager.getImportedName("org.eclipse.ui.ide.IDE")%>.openEditor(myWorkbenchPage, diagramFile); <% } %> + if (editor != null) { + <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%> layouter = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%>) editor.getAdapter(<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%>.class); + if (layouter != null) { + <%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%> graphicalViewer = (<%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%>) editor.getAdapter(<%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%>.class); + if (graphicalViewer != null) { + <%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> layoutCommand = layouter.layout((<%=importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")%>) graphicalViewer.getContents()); + if (layoutCommand != null && layoutCommand.canExecute()) { + new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")%>(myEditingDomain, layoutCommand).execute(); + } + } + } + } } catch (<%=importManager.getImportedName("java.io.IOException")%> ex) { <% if (isRichClientPlatform) { Index: templates/editor/DiagramEditorUtil.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/DiagramEditorUtil.javajet,v retrieving revision 1.2 diff -u -r1.2 DiagramEditorUtil.javajet --- templates/editor/DiagramEditorUtil.javajet 20 Apr 2006 18:27:23 -0000 1.2 +++ templates/editor/DiagramEditorUtil.javajet 29 Sep 2006 14:18:50 -0000 @@ -49,7 +49,7 @@ /** * @generated */ - public static boolean openEditor(URI fileURI) { + public static <%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> openEditor(URI fileURI) { IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); IWorkbenchPage page = workbenchWindow.getActivePage(); @@ -60,20 +60,18 @@ workbenchWindow.getShell(), "Error", "There is no editor registered for the file " + fileURI.toFileString()); - return false; + return null; } else { try { - page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId()); + return page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId()); } catch (PartInitException exception) { MessageDialog.openError( workbenchWindow.getShell(), "Error Opening Editor", exception.getMessage()); - return false; + return null; } } - - return true; } <% Index: templates/editor/CreationWizardPage.javajet =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet,v retrieving revision 1.5 diff -u -r1.5 CreationWizardPage.javajet --- templates/editor/CreationWizardPage.javajet 22 Sep 2006 16:57:21 -0000 1.5 +++ templates/editor/CreationWizardPage.javajet 29 Sep 2006 14:18:50 -0000 @@ -455,7 +455,7 @@ <% if (isRichClientPlatform) { %> - boolean result = <%=genDiagram.getDiagramEditorUtilClassName()%>.openEditor(getDiagramFileURI()); + boolean result = <%=genDiagram.getDiagramEditorUtilClassName()%>.openEditor(getDiagramFileURI()) != null; if (!result) { return null; } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java,v retrieving revision 1.5 diff -u -r1.5 CreationWizardPageGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java 22 Sep 2006 16:57:21 -0000 1.5 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java 29 Sep 2006 14:18:50 -0000 @@ -122,7 +122,7 @@ protected final String TEXT_103 = " e) {" + NL + "\t\t\t\t"; protected final String TEXT_104 = ".getInstance().logError(\"exception occurred while creating the diagram\", e);" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}"; protected final String TEXT_105 = NL + "\t\tboolean result = "; - protected final String TEXT_106 = ".openEditor(getDiagramFileURI());" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();"; + protected final String TEXT_106 = ".openEditor(getDiagramFileURI()) != null;" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();"; protected final String TEXT_107 = NL + "\t\ttry {" + NL + "\t\t\t"; protected final String TEXT_108 = ".openEditor("; protected final String TEXT_109 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch ("; Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java,v retrieving revision 1.1 diff -u -r1.1 NewDiagramFileWizardGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java 21 Sep 2006 10:12:03 -0000 1.1 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java 29 Sep 2006 14:18:50 -0000 @@ -104,348 +104,359 @@ protected final String TEXT_85 = "(myEditingDomain, command).execute();" + NL + "\t\t\tdiagramResource.save("; protected final String TEXT_86 = ".EMPTY_MAP);"; protected final String TEXT_87 = NL + "\t\t\t"; - protected final String TEXT_88 = ".openEditor(diagramResource.getURI());"; - protected final String TEXT_89 = NL + "\t\t\t"; - protected final String TEXT_90 = ".openEditor(myWorkbenchPage, diagramFile);"; - protected final String TEXT_91 = NL + "\t\t} catch ("; - protected final String TEXT_92 = " ex) {"; - protected final String TEXT_93 = NL + "\t\t\t"; - protected final String TEXT_94 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$"; - protected final String TEXT_95 = NL + "\t\t\t"; - protected final String TEXT_96 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$" + NL + "\t\t} catch ("; - protected final String TEXT_97 = " ex) {" + NL + "\t\t\t"; - protected final String TEXT_98 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$"; - protected final String TEXT_99 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL; - protected final String TEXT_100 = NL; - protected final String TEXT_101 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents("; - protected final String TEXT_102 = " diagram) {" + NL + "\tcreate"; - protected final String TEXT_103 = "Children(diagram);"; - protected final String TEXT_104 = NL + "\tmyViewService = new "; - protected final String TEXT_105 = "(diagram);" + NL + "\tcreate"; - protected final String TEXT_106 = "ChildLinks(diagram);"; - protected final String TEXT_107 = NL + "}" + NL; - protected final String TEXT_108 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create"; - protected final String TEXT_109 = "Children("; - protected final String TEXT_110 = " viewObject) {"; - protected final String TEXT_111 = NL + "\tfor("; - protected final String TEXT_112 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t"; - protected final String TEXT_113 = " next = ("; - protected final String TEXT_114 = ") it.next();" + NL + "\t\tint visualID = "; - protected final String TEXT_115 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {"; - protected final String TEXT_116 = NL + "\t\tcase "; - protected final String TEXT_117 = ".VISUAL_ID:" + NL + "\t\t\tcreate"; - protected final String TEXT_118 = "Children(next);" + NL + "\t\t\tbreak;"; - protected final String TEXT_119 = NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_120 = NL + "\t"; - protected final String TEXT_121 = " semanticChildren = get"; - protected final String TEXT_122 = "SemanticChildNodes(viewObject);" + NL + "\tfor("; - protected final String TEXT_123 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t"; - protected final String TEXT_124 = " nextDescriptor = ("; - protected final String TEXT_125 = ") it.next();" + NL + "\t\t"; - protected final String TEXT_126 = " createCommand = getCreate"; - protected final String TEXT_127 = "NotationalChildNodeCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();"; - protected final String TEXT_128 = NL + "\t\t\t"; - protected final String TEXT_129 = " nextChild = createCommand.getCreatedView();" + NL + "\t\t\tint childVisualID = nextDescriptor.getVisualID();" + NL + "\t\t\tswitch (childVisualID) {"; - protected final String TEXT_130 = NL + "\t\t\tcase "; - protected final String TEXT_131 = ".VISUAL_ID:" + NL + "\t\t\t\tcreate"; - protected final String TEXT_132 = "Children(nextChild);" + NL + "\t\t\t\tbreak;"; - protected final String TEXT_133 = NL + "\t\t\t}"; - protected final String TEXT_134 = NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; - protected final String TEXT_135 = " get"; - protected final String TEXT_136 = "SemanticChildNodes("; - protected final String TEXT_137 = " parentView) {"; - protected final String TEXT_138 = NL; - protected final String TEXT_139 = NL + "\treturn "; - protected final String TEXT_140 = ".EMPTY_LIST;"; - protected final String TEXT_141 = NL + "\t"; - protected final String TEXT_142 = " result = new "; - protected final String TEXT_143 = "();"; - protected final String TEXT_144 = NL + "\t"; - protected final String TEXT_145 = " viewObject = "; - protected final String TEXT_146 = ";" + NL + "\t"; - protected final String TEXT_147 = " modelObject = viewObject.getElement();" + NL + "\t"; - protected final String TEXT_148 = " nextValue;" + NL + "\tint nodeVID;"; - protected final String TEXT_149 = NL + "\tfor("; - protected final String TEXT_150 = " it = "; - protected final String TEXT_151 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_152 = ") it.next();"; - protected final String TEXT_153 = NL + "\tnextValue = ("; - protected final String TEXT_154 = ")"; - protected final String TEXT_155 = ";"; - protected final String TEXT_156 = NL + "\tnodeVID = "; - protected final String TEXT_157 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; - protected final String TEXT_158 = NL + "\tswitch (nodeVID) {"; - protected final String TEXT_159 = NL + "\tcase "; - protected final String TEXT_160 = ".VISUAL_ID: {"; - protected final String TEXT_161 = NL + "\tif ("; - protected final String TEXT_162 = ".VISUAL_ID == nodeVID) {"; - protected final String TEXT_163 = NL + "\t\tresult.add(new "; - protected final String TEXT_164 = "(nextValue, nodeVID));"; - protected final String TEXT_165 = NL + "\t\tbreak;" + NL + "\t\t}"; - protected final String TEXT_166 = NL + "\t\t}"; - protected final String TEXT_167 = NL + "\t}"; - protected final String TEXT_168 = NL + "\t}"; - protected final String TEXT_169 = NL + "\treturn result;"; - protected final String TEXT_170 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected "; - protected final String TEXT_171 = " getCreate"; - protected final String TEXT_172 = "NotationalChildNodeCommand("; - protected final String TEXT_173 = " parentView, "; - protected final String TEXT_174 = " descriptor) {"; - protected final String TEXT_175 = NL; - protected final String TEXT_176 = "\t\t\t"; - protected final String TEXT_177 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {"; - protected final String TEXT_178 = NL + "\t\t\tcase "; - protected final String TEXT_179 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof "; - protected final String TEXT_180 = ") {" + NL + "\t\t\t\t\treturn new "; - protected final String TEXT_181 = "("; - protected final String TEXT_182 = ", domainElement, "; - protected final String TEXT_183 = "new "; - protected final String TEXT_184 = "(0, 0, "; - protected final String TEXT_185 = ", "; - protected final String TEXT_186 = ")"; - protected final String TEXT_187 = NL + "null"; - protected final String TEXT_188 = ", "; - protected final String TEXT_189 = ".INSTANCE);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;"; - protected final String TEXT_190 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}"; - protected final String TEXT_191 = NL + "}"; - protected final String TEXT_192 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create"; - protected final String TEXT_193 = "ChildLinks("; - protected final String TEXT_194 = " viewObject) {"; - protected final String TEXT_195 = NL + "\t"; - protected final String TEXT_196 = " semanticChildLinks = get"; - protected final String TEXT_197 = "SemanticChildLinks(viewObject);" + NL + "\tfor("; - protected final String TEXT_198 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t"; - protected final String TEXT_199 = " nextDescriptor = ("; - protected final String TEXT_200 = ") it.next();" + NL + "\t\t"; - protected final String TEXT_201 = " createCommand = getCreate"; - protected final String TEXT_202 = "NotationalChildLinkCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_203 = NL + "\tfor("; - protected final String TEXT_204 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t"; - protected final String TEXT_205 = " next = ("; - protected final String TEXT_206 = ") it.next();" + NL + "\t\tint visualID = "; - protected final String TEXT_207 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {"; - protected final String TEXT_208 = NL + "\t\tcase "; - protected final String TEXT_209 = ".VISUAL_ID:" + NL + "\t\t\tcreate"; - protected final String TEXT_210 = "ChildLinks(next);" + NL + "\t\t\tbreak;"; - protected final String TEXT_211 = NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_212 = NL + "}" + NL; - protected final String TEXT_213 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; - protected final String TEXT_214 = " get"; - protected final String TEXT_215 = "SemanticChildLinks("; - protected final String TEXT_216 = " parentView) {"; - protected final String TEXT_217 = NL; - protected final String TEXT_218 = "\t"; - protected final String TEXT_219 = " result = new "; - protected final String TEXT_220 = "();"; - protected final String TEXT_221 = NL + "\t"; - protected final String TEXT_222 = " modelObject = "; - protected final String TEXT_223 = ".getElement();" + NL + "\t"; - protected final String TEXT_224 = " nextValue;"; - protected final String TEXT_225 = NL + "\tint linkVID;"; - protected final String TEXT_226 = NL + "\tfor("; - protected final String TEXT_227 = " it = "; - protected final String TEXT_228 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_229 = ") it.next();"; - protected final String TEXT_230 = NL + "\tnextValue = ("; - protected final String TEXT_231 = ")"; - protected final String TEXT_232 = ";"; - protected final String TEXT_233 = NL + "\tlinkVID = "; - protected final String TEXT_234 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; - protected final String TEXT_235 = NL + "\tswitch (linkVID) {"; - protected final String TEXT_236 = NL + "\tcase "; - protected final String TEXT_237 = ".VISUAL_ID: {"; - protected final String TEXT_238 = NL + "\tif ("; - protected final String TEXT_239 = ".VISUAL_ID == linkVID) {"; - protected final String TEXT_240 = NL + "\t\t"; - protected final String TEXT_241 = " source = ("; + protected final String TEXT_88 = " editor = "; + protected final String TEXT_89 = ".openEditor(diagramResource.getURI());"; + protected final String TEXT_90 = NL + "\t\t\t"; + protected final String TEXT_91 = " editor = "; + protected final String TEXT_92 = ".openEditor(myWorkbenchPage, diagramFile);"; + protected final String TEXT_93 = NL + "\t\t\tif (editor != null) {" + NL + "\t\t\t\t"; + protected final String TEXT_94 = " layouter = ("; + protected final String TEXT_95 = ") editor.getAdapter("; + protected final String TEXT_96 = ".class);" + NL + "\t\t\t\tif (layouter != null) {" + NL + "\t\t\t\t\t"; + protected final String TEXT_97 = " graphicalViewer = ("; + protected final String TEXT_98 = ") editor.getAdapter("; + protected final String TEXT_99 = ".class);" + NL + "\t\t\t\t\tif (graphicalViewer != null) {" + NL + "\t\t\t\t\t\t"; + protected final String TEXT_100 = " layoutCommand = layouter.layout(("; + protected final String TEXT_101 = ") graphicalViewer.getContents());" + NL + "\t\t\t\t\t\tif (layoutCommand != null && layoutCommand.canExecute()) {" + NL + "\t\t\t\t\t\t\tnew "; + protected final String TEXT_102 = "(myEditingDomain, layoutCommand).execute();" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t} catch ("; + protected final String TEXT_103 = " ex) {"; + protected final String TEXT_104 = NL + "\t\t\t"; + protected final String TEXT_105 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$"; + protected final String TEXT_106 = NL + "\t\t\t"; + protected final String TEXT_107 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$" + NL + "\t\t} catch ("; + protected final String TEXT_108 = " ex) {" + NL + "\t\t\t"; + protected final String TEXT_109 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$"; + protected final String TEXT_110 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL; + protected final String TEXT_111 = NL; + protected final String TEXT_112 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents("; + protected final String TEXT_113 = " diagram) {" + NL + "\tcreate"; + protected final String TEXT_114 = "Children(diagram);"; + protected final String TEXT_115 = NL + "\tmyViewService = new "; + protected final String TEXT_116 = "(diagram);" + NL + "\tcreate"; + protected final String TEXT_117 = "ChildLinks(diagram);"; + protected final String TEXT_118 = NL + "}" + NL; + protected final String TEXT_119 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create"; + protected final String TEXT_120 = "Children("; + protected final String TEXT_121 = " viewObject) {"; + protected final String TEXT_122 = NL + "\tfor("; + protected final String TEXT_123 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t"; + protected final String TEXT_124 = " next = ("; + protected final String TEXT_125 = ") it.next();" + NL + "\t\tint visualID = "; + protected final String TEXT_126 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {"; + protected final String TEXT_127 = NL + "\t\tcase "; + protected final String TEXT_128 = ".VISUAL_ID:" + NL + "\t\t\tcreate"; + protected final String TEXT_129 = "Children(next);" + NL + "\t\t\tbreak;"; + protected final String TEXT_130 = NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_131 = NL + "\t"; + protected final String TEXT_132 = " semanticChildren = get"; + protected final String TEXT_133 = "SemanticChildNodes(viewObject);" + NL + "\tfor("; + protected final String TEXT_134 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t"; + protected final String TEXT_135 = " nextDescriptor = ("; + protected final String TEXT_136 = ") it.next();" + NL + "\t\t"; + protected final String TEXT_137 = " createCommand = getCreate"; + protected final String TEXT_138 = "NotationalChildNodeCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();"; + protected final String TEXT_139 = NL + "\t\t\t"; + protected final String TEXT_140 = " nextChild = createCommand.getCreatedView();" + NL + "\t\t\tint childVisualID = nextDescriptor.getVisualID();" + NL + "\t\t\tswitch (childVisualID) {"; + protected final String TEXT_141 = NL + "\t\t\tcase "; + protected final String TEXT_142 = ".VISUAL_ID:" + NL + "\t\t\t\tcreate"; + protected final String TEXT_143 = "Children(nextChild);" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_144 = NL + "\t\t\t}"; + protected final String TEXT_145 = NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; + protected final String TEXT_146 = " get"; + protected final String TEXT_147 = "SemanticChildNodes("; + protected final String TEXT_148 = " parentView) {"; + protected final String TEXT_149 = NL; + protected final String TEXT_150 = NL + "\treturn "; + protected final String TEXT_151 = ".EMPTY_LIST;"; + protected final String TEXT_152 = NL + "\t"; + protected final String TEXT_153 = " result = new "; + protected final String TEXT_154 = "();"; + protected final String TEXT_155 = NL + "\t"; + protected final String TEXT_156 = " viewObject = "; + protected final String TEXT_157 = ";" + NL + "\t"; + protected final String TEXT_158 = " modelObject = viewObject.getElement();" + NL + "\t"; + protected final String TEXT_159 = " nextValue;" + NL + "\tint nodeVID;"; + protected final String TEXT_160 = NL + "\tfor("; + protected final String TEXT_161 = " it = "; + protected final String TEXT_162 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_163 = ") it.next();"; + protected final String TEXT_164 = NL + "\tnextValue = ("; + protected final String TEXT_165 = ")"; + protected final String TEXT_166 = ";"; + protected final String TEXT_167 = NL + "\tnodeVID = "; + protected final String TEXT_168 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);"; + protected final String TEXT_169 = NL + "\tswitch (nodeVID) {"; + protected final String TEXT_170 = NL + "\tcase "; + protected final String TEXT_171 = ".VISUAL_ID: {"; + protected final String TEXT_172 = NL + "\tif ("; + protected final String TEXT_173 = ".VISUAL_ID == nodeVID) {"; + protected final String TEXT_174 = NL + "\t\tresult.add(new "; + protected final String TEXT_175 = "(nextValue, nodeVID));"; + protected final String TEXT_176 = NL + "\t\tbreak;" + NL + "\t\t}"; + protected final String TEXT_177 = NL + "\t\t}"; + protected final String TEXT_178 = NL + "\t}"; + protected final String TEXT_179 = NL + "\t}"; + protected final String TEXT_180 = NL + "\treturn result;"; + protected final String TEXT_181 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected "; + protected final String TEXT_182 = " getCreate"; + protected final String TEXT_183 = "NotationalChildNodeCommand("; + protected final String TEXT_184 = " parentView, "; + protected final String TEXT_185 = " descriptor) {"; + protected final String TEXT_186 = NL; + protected final String TEXT_187 = "\t\t\t"; + protected final String TEXT_188 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {"; + protected final String TEXT_189 = NL + "\t\t\tcase "; + protected final String TEXT_190 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof "; + protected final String TEXT_191 = ") {" + NL + "\t\t\t\t\treturn new "; + protected final String TEXT_192 = "("; + protected final String TEXT_193 = ", domainElement, "; + protected final String TEXT_194 = "new "; + protected final String TEXT_195 = "(0, 0, "; + protected final String TEXT_196 = ", "; + protected final String TEXT_197 = ")"; + protected final String TEXT_198 = NL + "null"; + protected final String TEXT_199 = ", "; + protected final String TEXT_200 = ".INSTANCE);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;"; + protected final String TEXT_201 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}"; + protected final String TEXT_202 = NL + "}"; + protected final String TEXT_203 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create"; + protected final String TEXT_204 = "ChildLinks("; + protected final String TEXT_205 = " viewObject) {"; + protected final String TEXT_206 = NL + "\t"; + protected final String TEXT_207 = " semanticChildLinks = get"; + protected final String TEXT_208 = "SemanticChildLinks(viewObject);" + NL + "\tfor("; + protected final String TEXT_209 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t"; + protected final String TEXT_210 = " nextDescriptor = ("; + protected final String TEXT_211 = ") it.next();" + NL + "\t\t"; + protected final String TEXT_212 = " createCommand = getCreate"; + protected final String TEXT_213 = "NotationalChildLinkCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_214 = NL + "\tfor("; + protected final String TEXT_215 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t"; + protected final String TEXT_216 = " next = ("; + protected final String TEXT_217 = ") it.next();" + NL + "\t\tint visualID = "; + protected final String TEXT_218 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {"; + protected final String TEXT_219 = NL + "\t\tcase "; + protected final String TEXT_220 = ".VISUAL_ID:" + NL + "\t\t\tcreate"; + protected final String TEXT_221 = "ChildLinks(next);" + NL + "\t\t\tbreak;"; + protected final String TEXT_222 = NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_223 = NL + "}" + NL; + protected final String TEXT_224 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; + protected final String TEXT_225 = " get"; + protected final String TEXT_226 = "SemanticChildLinks("; + protected final String TEXT_227 = " parentView) {"; + protected final String TEXT_228 = NL; + protected final String TEXT_229 = "\t"; + protected final String TEXT_230 = " result = new "; + protected final String TEXT_231 = "();"; + protected final String TEXT_232 = NL + "\t"; + protected final String TEXT_233 = " modelObject = "; + protected final String TEXT_234 = ".getElement();" + NL + "\t"; + protected final String TEXT_235 = " nextValue;"; + protected final String TEXT_236 = NL + "\tint linkVID;"; + protected final String TEXT_237 = NL + "\tfor("; + protected final String TEXT_238 = " it = "; + protected final String TEXT_239 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_240 = ") it.next();"; + protected final String TEXT_241 = NL + "\tnextValue = ("; protected final String TEXT_242 = ")"; protected final String TEXT_243 = ";"; - protected final String TEXT_244 = NL + "\t\t"; - protected final String TEXT_245 = " source = "; - protected final String TEXT_246 = ".getElement();"; - protected final String TEXT_247 = NL + "\t\t"; - protected final String TEXT_248 = " target = ("; - protected final String TEXT_249 = ")"; - protected final String TEXT_250 = ";"; + protected final String TEXT_244 = NL + "\tlinkVID = "; + protected final String TEXT_245 = ".INSTANCE.getLinkWithClassVisualID(nextValue);"; + protected final String TEXT_246 = NL + "\tswitch (linkVID) {"; + protected final String TEXT_247 = NL + "\tcase "; + protected final String TEXT_248 = ".VISUAL_ID: {"; + protected final String TEXT_249 = NL + "\tif ("; + protected final String TEXT_250 = ".VISUAL_ID == linkVID) {"; protected final String TEXT_251 = NL + "\t\t"; - protected final String TEXT_252 = " target = "; - protected final String TEXT_253 = ".getElement();"; - protected final String TEXT_254 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new "; - protected final String TEXT_255 = "(source, target, nextValue, linkVID));" + NL + "\t\t}"; - protected final String TEXT_256 = NL + "\t\tbreak;" + NL + "\t}"; - protected final String TEXT_257 = NL + "\t}"; - protected final String TEXT_258 = NL + "\t}"; - protected final String TEXT_259 = NL + "\t}"; - protected final String TEXT_260 = NL + "\tfor("; - protected final String TEXT_261 = " it = "; - protected final String TEXT_262 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; - protected final String TEXT_263 = ") it.next();"; - protected final String TEXT_264 = NL + "\tnextValue = ("; - protected final String TEXT_265 = ")"; - protected final String TEXT_266 = ";"; - protected final String TEXT_267 = NL + "\tif (nextValue != null) {"; - protected final String TEXT_268 = NL + "\t\tresult.add(new "; - protected final String TEXT_269 = "(modelObject, nextValue, null, "; - protected final String TEXT_270 = ".VISUAL_ID));"; - protected final String TEXT_271 = NL + "\t}"; - protected final String TEXT_272 = NL + "\t}"; - protected final String TEXT_273 = NL + "\treturn result;"; - protected final String TEXT_274 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected "; - protected final String TEXT_275 = " getCreate"; - protected final String TEXT_276 = "NotationalChildLinkCommand("; - protected final String TEXT_277 = " parentView, "; - protected final String TEXT_278 = " linkDescriptor) {"; - protected final String TEXT_279 = NL; - protected final String TEXT_280 = "\t\t\t"; - protected final String TEXT_281 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t"; - protected final String TEXT_282 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t"; - protected final String TEXT_283 = " 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_284 = NL + "\t\t\tcase "; - protected final String TEXT_285 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof "; - protected final String TEXT_286 = ") {" + NL + "\t\t\t\t\tdecorator = "; - protected final String TEXT_287 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; - protected final String TEXT_288 = NL + "\t\t\tcase "; - protected final String TEXT_289 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = "; - protected final String TEXT_290 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; - protected final String TEXT_291 = 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_292 = "("; - protected final String TEXT_293 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);"; - protected final String TEXT_294 = NL + "}"; - protected final String TEXT_295 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; - protected final String TEXT_296 = " myViewService;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; - protected final String TEXT_297 = " getViewService() {" + NL + "\treturn myViewService;" + NL + "}"; - protected final String TEXT_298 = NL; - protected final String TEXT_299 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends "; - protected final String TEXT_300 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_301 = " fileField;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected URISelectorPage(String name) {" + NL + "\t\t\tsuper(name);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createControl("; - protected final String TEXT_302 = " parent) {" + NL + "\t\t\t"; - protected final String TEXT_303 = " composite = new "; - protected final String TEXT_304 = "(parent, "; - protected final String TEXT_305 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; - protected final String TEXT_306 = " layout = new "; - protected final String TEXT_307 = "();" + NL + "\t\t\t\tlayout.numColumns = 1;" + NL + "\t\t\t\tlayout.verticalSpacing = 12;" + NL + "\t\t\t\tcomposite.setLayout(layout);" + NL + "" + NL + "\t\t\t\t"; - protected final String TEXT_308 = " data = new "; - protected final String TEXT_309 = "();" + NL + "\t\t\t\tdata.verticalAlignment = "; - protected final String TEXT_310 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = "; - protected final String TEXT_311 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t"; - protected final String TEXT_312 = " resourceURILabel = new "; - protected final String TEXT_313 = "(composite, "; - protected final String TEXT_314 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t"; - protected final String TEXT_315 = " data = new "; - protected final String TEXT_316 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; - protected final String TEXT_317 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t"; - protected final String TEXT_318 = " fileComposite = new "; - protected final String TEXT_319 = "(composite, "; - protected final String TEXT_320 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; - protected final String TEXT_321 = " data = new "; - protected final String TEXT_322 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; - protected final String TEXT_323 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tfileComposite.setLayoutData(data);" + NL + "" + NL + "\t\t\t\t"; - protected final String TEXT_324 = " layout = new "; - protected final String TEXT_325 = "();" + NL + "\t\t\t\tlayout.marginHeight = 0;" + NL + "\t\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\t\tlayout.numColumns = 2;" + NL + "\t\t\t\tfileComposite.setLayout(layout);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField = new "; - protected final String TEXT_326 = "(fileComposite, "; - protected final String TEXT_327 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; - protected final String TEXT_328 = " data = new "; - protected final String TEXT_329 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; - protected final String TEXT_330 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tdata.horizontalSpan = 1;" + NL + "\t\t\t\tfileField.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField.addModifyListener(validator);" + NL + "\t\t\t"; - protected final String TEXT_331 = " resourceURIBrowseFileSystemButton = new "; - protected final String TEXT_332 = "(fileComposite," + NL + "\t\t\t\t\t"; - protected final String TEXT_333 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new "; - protected final String TEXT_334 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected("; - protected final String TEXT_335 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = "; - protected final String TEXT_336 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, "; - protected final String TEXT_337 = ".OPEN);" + NL + "\t\t\t\t\t\t\tif (filePath != null) {" + NL + "\t\t\t\t\t\t\t\tif (!filePath.endsWith(\".\" + fileExtension)) {" + NL + "\t\t\t\t\t\t\t\t\tfilePath = filePath + \".\" + fileExtension;" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\tfileField.setText(filePath);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\tsetControl(composite);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_338 = " validator = new "; - protected final String TEXT_339 = "() {" + NL + "\t\t\tpublic void modifyText("; - protected final String TEXT_340 = " e) {" + NL + "\t\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected final void setFile("; - protected final String TEXT_341 = " file) {" + NL + "\t\t\tfileField.setText(file.getPath());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\t"; - protected final String TEXT_342 = " fileURI = getFileURI();" + NL + "\t\t\tif (fileURI == null || fileURI.isEmpty()) {" + NL + "\t\t\t\tsetErrorMessage(null);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tif (fileURI.isFile()) {" + NL + "\t\t\t\t"; - protected final String TEXT_343 = " file = new "; - protected final String TEXT_344 = "(fileURI.toFileString());" + NL + "\t\t\t\tString fileProblem = validateFile(file);" + NL + "\t\t\t\tif (fileProblem != null) {" + NL + "\t\t\t\t\tsetErrorMessage(fileProblem);" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tString requiredExt = getFileExtension();" + NL + "\t\t\tString enteredExt = fileURI.fileExtension();" + NL + "\t\t\tif (enteredExt == null || !enteredExt.equals(requiredExt)) {" + NL + "\t\t\t\tsetErrorMessage(\"The file name must end in \" + requiredExt);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tsetErrorMessage(null);" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Checks the given file and returns the error message if there are problems or null if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile("; - protected final String TEXT_345 = " file);" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String getFileExtension();" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_346 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn "; - protected final String TEXT_347 = ".createFileURI(fileField.getText());" + NL + "\t\t\t} catch (Exception exception) {" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class SourceURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic SourceURISelectorPage() {" + NL + "\t\t\tsuper(\"Select source file\");" + NL + "\t\t\tsetTitle(\"Source file\");" + NL + "\t\t\tsetDescription(\"Select file with semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \""; - protected final String TEXT_348 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmySelectedModelFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile("; - protected final String TEXT_349 = " file) {" + NL + "\t\t\tif (!file.exists()) {" + NL + "\t\t\t\treturn \"Source file does not exist\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class DiagramURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_350 = " myNewFileURI;" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic DiagramURISelectorPage() {" + NL + "\t\t\tsuper(\"Initialize new "; - protected final String TEXT_351 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on "; - protected final String TEXT_352 = " model content\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \""; - protected final String TEXT_353 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t\tif (visible && mySelectedModelFileURI != null && getFileURI() == null && mySelectedModelFileURI.isFile()) {" + NL + "\t\t\t\t"; - protected final String TEXT_354 = " originalFile = new "; - protected final String TEXT_355 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t"; - protected final String TEXT_356 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t"; - protected final String TEXT_357 = " newFile = new "; - protected final String TEXT_358 = "(parentFile, originalFileName + getFileExtension());" + NL + "\t\t\t\tfor(int i = 1; i > 0 && newFile.exists(); i++) {" + NL + "\t\t\t\t\tnewFile = new "; - protected final String TEXT_359 = "(parentFile, originalFileName + i + getFileExtension());" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (newFile.exists()) {" + NL + "\t\t\t\t\treturn;\t//failed to set name that does not exist, just leave empty." + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFile(newFile);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tmyNewFileURI = null;" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmyNewFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_360 = " getNewFileURI() {" + NL + "\t\t\treturn myNewFileURI;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile("; - protected final String TEXT_361 = " file) {" + NL + "\t\t\tif (file.exists()) {" + NL + "\t\t\t\treturn \"Diagram file already exists\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_362 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends "; - protected final String TEXT_363 = " implements "; - protected final String TEXT_364 = " {"; - protected final String TEXT_365 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; - protected final String TEXT_366 = " myTreeViewer;"; - protected final String TEXT_367 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprotected RootElementSelectorPage() {" + NL + "\t\t\tsuper(\"Select diagram root element\");" + NL + "\t\t\tsetTitle(\"Diagram root element\");" + NL + "\t\t\tsetDescription(\"Select semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */\t\t" + NL + "\t\tpublic void createControl("; - protected final String TEXT_368 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t"; - protected final String TEXT_369 = " topLevel = new "; - protected final String TEXT_370 = "(parent, "; - protected final String TEXT_371 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new "; - protected final String TEXT_372 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new "; - protected final String TEXT_373 = "("; - protected final String TEXT_374 = ".VERTICAL_ALIGN_FILL | "; - protected final String TEXT_375 = ".HORIZONTAL_ALIGN_FILL));" + NL + "\t\t\ttopLevel.setFont(parent.getFont());" + NL + "\t\t\tsetControl(topLevel);" + NL + "\t\t\tcreateModelBrowser(topLevel);" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createModelBrowser("; - protected final String TEXT_376 = " parent) {" + NL + "\t\t\t"; - protected final String TEXT_377 = " panel = new "; - protected final String TEXT_378 = "(parent, "; - protected final String TEXT_379 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new "; - protected final String TEXT_380 = "("; - protected final String TEXT_381 = ".FILL_BOTH));" + NL + "\t\t\t"; - protected final String TEXT_382 = " layout = new "; - protected final String TEXT_383 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t"; - protected final String TEXT_384 = " label = new "; - protected final String TEXT_385 = "(panel, "; - protected final String TEXT_386 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new "; - protected final String TEXT_387 = "("; - protected final String TEXT_388 = ".HORIZONTAL_ALIGN_BEGINNING));"; - protected final String TEXT_389 = NL + "\t\t\t"; - protected final String TEXT_390 = " "; - protected final String TEXT_391 = " = new "; - protected final String TEXT_392 = "(panel, "; - protected final String TEXT_393 = ".SINGLE | "; - protected final String TEXT_394 = ".H_SCROLL | "; - protected final String TEXT_395 = ".V_SCROLL | "; - protected final String TEXT_396 = ".BORDER);" + NL + "\t\t\t"; - protected final String TEXT_397 = " layoutData = new "; + protected final String TEXT_252 = " source = ("; + protected final String TEXT_253 = ")"; + protected final String TEXT_254 = ";"; + protected final String TEXT_255 = NL + "\t\t"; + protected final String TEXT_256 = " source = "; + protected final String TEXT_257 = ".getElement();"; + protected final String TEXT_258 = NL + "\t\t"; + protected final String TEXT_259 = " target = ("; + protected final String TEXT_260 = ")"; + protected final String TEXT_261 = ";"; + protected final String TEXT_262 = NL + "\t\t"; + protected final String TEXT_263 = " target = "; + protected final String TEXT_264 = ".getElement();"; + protected final String TEXT_265 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new "; + protected final String TEXT_266 = "(source, target, nextValue, linkVID));" + NL + "\t\t}"; + protected final String TEXT_267 = NL + "\t\tbreak;" + NL + "\t}"; + protected final String TEXT_268 = NL + "\t}"; + protected final String TEXT_269 = NL + "\t}"; + protected final String TEXT_270 = NL + "\t}"; + protected final String TEXT_271 = NL + "\tfor("; + protected final String TEXT_272 = " it = "; + protected final String TEXT_273 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = ("; + protected final String TEXT_274 = ") it.next();"; + protected final String TEXT_275 = NL + "\tnextValue = ("; + protected final String TEXT_276 = ")"; + protected final String TEXT_277 = ";"; + protected final String TEXT_278 = NL + "\tif (nextValue != null) {"; + protected final String TEXT_279 = NL + "\t\tresult.add(new "; + protected final String TEXT_280 = "(modelObject, nextValue, null, "; + protected final String TEXT_281 = ".VISUAL_ID));"; + protected final String TEXT_282 = NL + "\t}"; + protected final String TEXT_283 = NL + "\t}"; + protected final String TEXT_284 = NL + "\treturn result;"; + protected final String TEXT_285 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected "; + protected final String TEXT_286 = " getCreate"; + protected final String TEXT_287 = "NotationalChildLinkCommand("; + protected final String TEXT_288 = " parentView, "; + protected final String TEXT_289 = " linkDescriptor) {"; + protected final String TEXT_290 = NL; + protected final String TEXT_291 = "\t\t\t"; + protected final String TEXT_292 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t"; + protected final String TEXT_293 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t"; + protected final String TEXT_294 = " 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_295 = NL + "\t\t\tcase "; + protected final String TEXT_296 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof "; + protected final String TEXT_297 = ") {" + NL + "\t\t\t\t\tdecorator = "; + protected final String TEXT_298 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_299 = NL + "\t\t\tcase "; + protected final String TEXT_300 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = "; + protected final String TEXT_301 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;"; + protected final String TEXT_302 = 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_303 = "("; + protected final String TEXT_304 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);"; + protected final String TEXT_305 = NL + "}"; + protected final String TEXT_306 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; + protected final String TEXT_307 = " myViewService;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private "; + protected final String TEXT_308 = " getViewService() {" + NL + "\treturn myViewService;" + NL + "}"; + protected final String TEXT_309 = NL; + protected final String TEXT_310 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends "; + protected final String TEXT_311 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_312 = " fileField;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected URISelectorPage(String name) {" + NL + "\t\t\tsuper(name);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createControl("; + protected final String TEXT_313 = " parent) {" + NL + "\t\t\t"; + protected final String TEXT_314 = " composite = new "; + protected final String TEXT_315 = "(parent, "; + protected final String TEXT_316 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; + protected final String TEXT_317 = " layout = new "; + protected final String TEXT_318 = "();" + NL + "\t\t\t\tlayout.numColumns = 1;" + NL + "\t\t\t\tlayout.verticalSpacing = 12;" + NL + "\t\t\t\tcomposite.setLayout(layout);" + NL + "" + NL + "\t\t\t\t"; + protected final String TEXT_319 = " data = new "; + protected final String TEXT_320 = "();" + NL + "\t\t\t\tdata.verticalAlignment = "; + protected final String TEXT_321 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = "; + protected final String TEXT_322 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t"; + protected final String TEXT_323 = " resourceURILabel = new "; + protected final String TEXT_324 = "(composite, "; + protected final String TEXT_325 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t"; + protected final String TEXT_326 = " data = new "; + protected final String TEXT_327 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; + protected final String TEXT_328 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t"; + protected final String TEXT_329 = " fileComposite = new "; + protected final String TEXT_330 = "(composite, "; + protected final String TEXT_331 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; + protected final String TEXT_332 = " data = new "; + protected final String TEXT_333 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; + protected final String TEXT_334 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tfileComposite.setLayoutData(data);" + NL + "" + NL + "\t\t\t\t"; + protected final String TEXT_335 = " layout = new "; + protected final String TEXT_336 = "();" + NL + "\t\t\t\tlayout.marginHeight = 0;" + NL + "\t\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\t\tlayout.numColumns = 2;" + NL + "\t\t\t\tfileComposite.setLayout(layout);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField = new "; + protected final String TEXT_337 = "(fileComposite, "; + protected final String TEXT_338 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t"; + protected final String TEXT_339 = " data = new "; + protected final String TEXT_340 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = "; + protected final String TEXT_341 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tdata.horizontalSpan = 1;" + NL + "\t\t\t\tfileField.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField.addModifyListener(validator);" + NL + "\t\t\t"; + protected final String TEXT_342 = " resourceURIBrowseFileSystemButton = new "; + protected final String TEXT_343 = "(fileComposite," + NL + "\t\t\t\t\t"; + protected final String TEXT_344 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new "; + protected final String TEXT_345 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected("; + protected final String TEXT_346 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = "; + protected final String TEXT_347 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, "; + protected final String TEXT_348 = ".OPEN);" + NL + "\t\t\t\t\t\t\tif (filePath != null) {" + NL + "\t\t\t\t\t\t\t\tif (!filePath.endsWith(\".\" + fileExtension)) {" + NL + "\t\t\t\t\t\t\t\t\tfilePath = filePath + \".\" + fileExtension;" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\tfileField.setText(filePath);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\tsetControl(composite);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_349 = " validator = new "; + protected final String TEXT_350 = "() {" + NL + "\t\t\tpublic void modifyText("; + protected final String TEXT_351 = " e) {" + NL + "\t\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected final void setFile("; + protected final String TEXT_352 = " file) {" + NL + "\t\t\tfileField.setText(file.getPath());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\t"; + protected final String TEXT_353 = " fileURI = getFileURI();" + NL + "\t\t\tif (fileURI == null || fileURI.isEmpty()) {" + NL + "\t\t\t\tsetErrorMessage(null);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tif (fileURI.isFile()) {" + NL + "\t\t\t\t"; + protected final String TEXT_354 = " file = new "; + protected final String TEXT_355 = "(fileURI.toFileString());" + NL + "\t\t\t\tString fileProblem = validateFile(file);" + NL + "\t\t\t\tif (fileProblem != null) {" + NL + "\t\t\t\t\tsetErrorMessage(fileProblem);" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tString requiredExt = getFileExtension();" + NL + "\t\t\tString enteredExt = fileURI.fileExtension();" + NL + "\t\t\tif (enteredExt == null || !enteredExt.equals(requiredExt)) {" + NL + "\t\t\t\tsetErrorMessage(\"The file name must end in \" + requiredExt);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tsetErrorMessage(null);" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Checks the given file and returns the error message if there are problems or null if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile("; + protected final String TEXT_356 = " file);" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String getFileExtension();" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_357 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn "; + protected final String TEXT_358 = ".createFileURI(fileField.getText());" + NL + "\t\t\t} catch (Exception exception) {" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class SourceURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic SourceURISelectorPage() {" + NL + "\t\t\tsuper(\"Select source file\");" + NL + "\t\t\tsetTitle(\"Source file\");" + NL + "\t\t\tsetDescription(\"Select file with semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \""; + protected final String TEXT_359 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmySelectedModelFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile("; + protected final String TEXT_360 = " file) {" + NL + "\t\t\tif (!file.exists()) {" + NL + "\t\t\t\treturn \"Source file does not exist\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class DiagramURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_361 = " myNewFileURI;" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic DiagramURISelectorPage() {" + NL + "\t\t\tsuper(\"Initialize new "; + protected final String TEXT_362 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on "; + protected final String TEXT_363 = " model content\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \""; + protected final String TEXT_364 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t\tif (visible && mySelectedModelFileURI != null && getFileURI() == null && mySelectedModelFileURI.isFile()) {" + NL + "\t\t\t\t"; + protected final String TEXT_365 = " originalFile = new "; + protected final String TEXT_366 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t"; + protected final String TEXT_367 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t"; + protected final String TEXT_368 = " newFile = new "; + protected final String TEXT_369 = "(parentFile, originalFileName + getFileExtension());" + NL + "\t\t\t\tfor(int i = 1; i > 0 && newFile.exists(); i++) {" + NL + "\t\t\t\t\tnewFile = new "; + protected final String TEXT_370 = "(parentFile, originalFileName + i + getFileExtension());" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (newFile.exists()) {" + NL + "\t\t\t\t\treturn;\t//failed to set name that does not exist, just leave empty." + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFile(newFile);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tmyNewFileURI = null;" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmyNewFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_371 = " getNewFileURI() {" + NL + "\t\t\treturn myNewFileURI;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile("; + protected final String TEXT_372 = " file) {" + NL + "\t\t\tif (file.exists()) {" + NL + "\t\t\t\treturn \"Diagram file already exists\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_373 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends "; + protected final String TEXT_374 = " implements "; + protected final String TEXT_375 = " {"; + protected final String TEXT_376 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate "; + protected final String TEXT_377 = " myTreeViewer;"; + protected final String TEXT_378 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprotected RootElementSelectorPage() {" + NL + "\t\t\tsuper(\"Select diagram root element\");" + NL + "\t\t\tsetTitle(\"Diagram root element\");" + NL + "\t\t\tsetDescription(\"Select semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */\t\t" + NL + "\t\tpublic void createControl("; + protected final String TEXT_379 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t"; + protected final String TEXT_380 = " topLevel = new "; + protected final String TEXT_381 = "(parent, "; + protected final String TEXT_382 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new "; + protected final String TEXT_383 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new "; + protected final String TEXT_384 = "("; + protected final String TEXT_385 = ".VERTICAL_ALIGN_FILL | "; + protected final String TEXT_386 = ".HORIZONTAL_ALIGN_FILL));" + NL + "\t\t\ttopLevel.setFont(parent.getFont());" + NL + "\t\t\tsetControl(topLevel);" + NL + "\t\t\tcreateModelBrowser(topLevel);" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createModelBrowser("; + protected final String TEXT_387 = " parent) {" + NL + "\t\t\t"; + protected final String TEXT_388 = " panel = new "; + protected final String TEXT_389 = "(parent, "; + protected final String TEXT_390 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new "; + protected final String TEXT_391 = "("; + protected final String TEXT_392 = ".FILL_BOTH));" + NL + "\t\t\t"; + protected final String TEXT_393 = " layout = new "; + protected final String TEXT_394 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t"; + protected final String TEXT_395 = " label = new "; + protected final String TEXT_396 = "(panel, "; + protected final String TEXT_397 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new "; protected final String TEXT_398 = "("; - protected final String TEXT_399 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t"; - protected final String TEXT_400 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t"; - protected final String TEXT_401 = ".setContentProvider(new "; - protected final String TEXT_402 = "("; - protected final String TEXT_403 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t"; - protected final String TEXT_404 = ".setLabelProvider(new "; - protected final String TEXT_405 = "("; - protected final String TEXT_406 = ".getInstance().getItemProvidersAdapterFactory()));"; - protected final String TEXT_407 = NL + "\t\t\t"; - protected final String TEXT_408 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t"; - protected final String TEXT_409 = ".setSelection(new "; - protected final String TEXT_410 = "(myDiagramRoot));"; - protected final String TEXT_411 = NL + "\t\t\t"; - protected final String TEXT_412 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL; - protected final String TEXT_413 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tif (visible) {" + NL + "\t\t\t\t"; - protected final String TEXT_414 = ".setInput(myEditingDomain.getResourceSet().getResource(mySelectedModelFileURI, true));" + NL + "\t\t\t\tif (myDiagramRoot != null) {" + NL + "\t\t\t\t\tmyTreeViewer.setSelection(new "; - protected final String TEXT_415 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL; - protected final String TEXT_416 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged("; - protected final String TEXT_417 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof "; - protected final String TEXT_418 = ") {" + NL + "\t\t\t\t"; - protected final String TEXT_419 = " selection = ("; - protected final String TEXT_420 = ") event.getSelection();" + NL + "\t\t\t\tif (selection.size() == 1) {" + NL + "\t\t\t\t\tObject selectedElement = selection.getFirstElement();" + NL + "\t\t\t\t\tif (selectedElement instanceof "; - protected final String TEXT_421 = ") {" + NL + "\t\t\t\t\t\tselectedElement = (("; - protected final String TEXT_422 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof "; - protected final String TEXT_423 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = (("; - protected final String TEXT_424 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof "; - protected final String TEXT_425 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = ("; - protected final String TEXT_426 = ") selectedElement;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */\t" + NL + "\t\tprivate boolean validatePage() {" + NL + "\t\t\tif (myDiagramRoot == null) {" + NL + "\t\t\t\tsetErrorMessage(\"No diagram root element selected\");" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tboolean result = "; - protected final String TEXT_427 = ".VISUAL_ID == "; - protected final String TEXT_428 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\tsetErrorMessage(result ? null : \"Invalid diagram root element was selected\");" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t}" + NL + "}"; - protected final String TEXT_429 = NL; + protected final String TEXT_399 = ".HORIZONTAL_ALIGN_BEGINNING));"; + protected final String TEXT_400 = NL + "\t\t\t"; + protected final String TEXT_401 = " "; + protected final String TEXT_402 = " = new "; + protected final String TEXT_403 = "(panel, "; + protected final String TEXT_404 = ".SINGLE | "; + protected final String TEXT_405 = ".H_SCROLL | "; + protected final String TEXT_406 = ".V_SCROLL | "; + protected final String TEXT_407 = ".BORDER);" + NL + "\t\t\t"; + protected final String TEXT_408 = " layoutData = new "; + protected final String TEXT_409 = "("; + protected final String TEXT_410 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t"; + protected final String TEXT_411 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t"; + protected final String TEXT_412 = ".setContentProvider(new "; + protected final String TEXT_413 = "("; + protected final String TEXT_414 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t"; + protected final String TEXT_415 = ".setLabelProvider(new "; + protected final String TEXT_416 = "("; + protected final String TEXT_417 = ".getInstance().getItemProvidersAdapterFactory()));"; + protected final String TEXT_418 = NL + "\t\t\t"; + protected final String TEXT_419 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t"; + protected final String TEXT_420 = ".setSelection(new "; + protected final String TEXT_421 = "(myDiagramRoot));"; + protected final String TEXT_422 = NL + "\t\t\t"; + protected final String TEXT_423 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL; + protected final String TEXT_424 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tif (visible) {" + NL + "\t\t\t\t"; + protected final String TEXT_425 = ".setInput(myEditingDomain.getResourceSet().getResource(mySelectedModelFileURI, true));" + NL + "\t\t\t\tif (myDiagramRoot != null) {" + NL + "\t\t\t\t\tmyTreeViewer.setSelection(new "; + protected final String TEXT_426 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL; + protected final String TEXT_427 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged("; + protected final String TEXT_428 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof "; + protected final String TEXT_429 = ") {" + NL + "\t\t\t\t"; + protected final String TEXT_430 = " selection = ("; + protected final String TEXT_431 = ") event.getSelection();" + NL + "\t\t\t\tif (selection.size() == 1) {" + NL + "\t\t\t\t\tObject selectedElement = selection.getFirstElement();" + NL + "\t\t\t\t\tif (selectedElement instanceof "; + protected final String TEXT_432 = ") {" + NL + "\t\t\t\t\t\tselectedElement = (("; + protected final String TEXT_433 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof "; + protected final String TEXT_434 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = (("; + protected final String TEXT_435 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof "; + protected final String TEXT_436 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = ("; + protected final String TEXT_437 = ") selectedElement;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */\t" + NL + "\t\tprivate boolean validatePage() {" + NL + "\t\t\tif (myDiagramRoot == null) {" + NL + "\t\t\t\tsetErrorMessage(\"No diagram root element selected\");" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tboolean result = "; + protected final String TEXT_438 = ".VISUAL_ID == "; + protected final String TEXT_439 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\tsetErrorMessage(result ? null : \"Invalid diagram root element was selected\");" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t}" + NL + "}"; + protected final String TEXT_440 = NL; public String generate(Object argument) { @@ -721,58 +732,80 @@ if (isRichClientPlatform) { stringBuffer.append(TEXT_87); - stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart")); stringBuffer.append(TEXT_88); + stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())); + stringBuffer.append(TEXT_89); } else { - stringBuffer.append(TEXT_89); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE")); stringBuffer.append(TEXT_90); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart")); + stringBuffer.append(TEXT_91); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE")); + stringBuffer.append(TEXT_92); } - stringBuffer.append(TEXT_91); + stringBuffer.append(TEXT_93); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); + stringBuffer.append(TEXT_94); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); + stringBuffer.append(TEXT_95); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")); + stringBuffer.append(TEXT_96); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); + stringBuffer.append(TEXT_97); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); + stringBuffer.append(TEXT_98); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); + stringBuffer.append(TEXT_99); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command")); + stringBuffer.append(TEXT_100); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")); + stringBuffer.append(TEXT_101); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")); + stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("java.io.IOException")); - stringBuffer.append(TEXT_92); + stringBuffer.append(TEXT_103); if (isRichClientPlatform) { - stringBuffer.append(TEXT_93); + stringBuffer.append(TEXT_104); stringBuffer.append(pluginActivatorClass); - stringBuffer.append(TEXT_94); + stringBuffer.append(TEXT_105); } else { - stringBuffer.append(TEXT_95); + stringBuffer.append(TEXT_106); stringBuffer.append(pluginActivatorClass); - stringBuffer.append(TEXT_96); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); - stringBuffer.append(TEXT_97); + stringBuffer.append(TEXT_108); stringBuffer.append(pluginActivatorClass); - stringBuffer.append(TEXT_98); + stringBuffer.append(TEXT_109); } - stringBuffer.append(TEXT_99); - stringBuffer.append(TEXT_100); - stringBuffer.append(TEXT_101); + stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_112); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); - stringBuffer.append(TEXT_102); + stringBuffer.append(TEXT_113); stringBuffer.append(genDiagram.getUniqueIdentifier()); - stringBuffer.append(TEXT_103); + stringBuffer.append(TEXT_114); if(!genDiagram.getLinks().isEmpty()) { - stringBuffer.append(TEXT_104); + stringBuffer.append(TEXT_115); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService")); - stringBuffer.append(TEXT_105); + stringBuffer.append(TEXT_116); stringBuffer.append(genDiagram.getUniqueIdentifier()); - stringBuffer.append(TEXT_106); + stringBuffer.append(TEXT_117); } - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_118); final Comparator comparator = new Comparator() { public int compare(GenContainerBase o1, GenContainerBase o2) { @@ -804,11 +837,11 @@ for (Iterator containers = containers2Generate.iterator(); containers.hasNext();) { GenContainerBase nextContainer = containers.next(); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_119); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_120); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_121); if (nextContainer instanceof GenNode) { boolean shouldIterateOverCompartments = false; @@ -821,15 +854,15 @@ } if (shouldIterateOverCompartments) { - stringBuffer.append(TEXT_111); + stringBuffer.append(TEXT_122); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_112); + stringBuffer.append(TEXT_123); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_113); + stringBuffer.append(TEXT_124); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_114); + stringBuffer.append(TEXT_125); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_115); + stringBuffer.append(TEXT_126); for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) { GenCompartment nextCompartment = (GenCompartment) compartments.next(); @@ -837,34 +870,34 @@ continue; } - stringBuffer.append(TEXT_116); + stringBuffer.append(TEXT_127); stringBuffer.append(importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_117); + stringBuffer.append(TEXT_128); stringBuffer.append(nextCompartment.getUniqueIdentifier()); - stringBuffer.append(TEXT_118); + stringBuffer.append(TEXT_129); } - stringBuffer.append(TEXT_119); + stringBuffer.append(TEXT_130); } } - stringBuffer.append(TEXT_120); + stringBuffer.append(TEXT_131); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_121); + stringBuffer.append(TEXT_132); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_122); + stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_123); + stringBuffer.append(TEXT_134); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); - stringBuffer.append(TEXT_124); + stringBuffer.append(TEXT_135); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); - stringBuffer.append(TEXT_125); + stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); - stringBuffer.append(TEXT_126); + stringBuffer.append(TEXT_137); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_127); + stringBuffer.append(TEXT_138); boolean shouldIterateToGenerate = false; for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) { @@ -876,54 +909,54 @@ } if (shouldIterateToGenerate) { - stringBuffer.append(TEXT_128); + stringBuffer.append(TEXT_139); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_129); + stringBuffer.append(TEXT_140); for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) { GenNode nextNode = (GenNode) containedNodes.next(); if (containers2Generate.contains(nextNode)) { - stringBuffer.append(TEXT_130); + stringBuffer.append(TEXT_141); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_131); + stringBuffer.append(TEXT_142); stringBuffer.append(nextNode.getUniqueIdentifier()); - stringBuffer.append(TEXT_132); + stringBuffer.append(TEXT_143); } } - stringBuffer.append(TEXT_133); + stringBuffer.append(TEXT_144); } - stringBuffer.append(TEXT_134); + stringBuffer.append(TEXT_145); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_135); + stringBuffer.append(TEXT_146); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_136); + stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_137); + stringBuffer.append(TEXT_148); { String _getViewCode = "parentView"; List childNodes = nextContainer.getContainedNodes(); - stringBuffer.append(TEXT_138); + stringBuffer.append(TEXT_149); if (childNodes.size() == 0) { - stringBuffer.append(TEXT_139); + stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("java.util.Collections")); - stringBuffer.append(TEXT_140); + stringBuffer.append(TEXT_151); } else { - stringBuffer.append(TEXT_141); + stringBuffer.append(TEXT_152); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_142); + stringBuffer.append(TEXT_153); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_143); + stringBuffer.append(TEXT_154); Map genFeature2genNodeMap = new LinkedHashMap(); for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) { @@ -941,15 +974,15 @@ Set entrySet = genFeature2genNodeMap.entrySet(); if (entrySet.size() > 0) { - stringBuffer.append(TEXT_144); + stringBuffer.append(TEXT_155); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_145); + stringBuffer.append(TEXT_156); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_146); + stringBuffer.append(TEXT_157); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_147); + stringBuffer.append(TEXT_158); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_148); + stringBuffer.append(TEXT_159); } for (Iterator entries = entrySet.iterator(); entries.hasNext();) { @@ -958,92 +991,92 @@ Collection genNodesCollection = (Collection) nextEntry.getValue(); if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_149); + stringBuffer.append(TEXT_160); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_150); + stringBuffer.append(TEXT_161); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true); - stringBuffer.append(TEXT_151); + stringBuffer.append(TEXT_162); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_152); + stringBuffer.append(TEXT_163); } else { - stringBuffer.append(TEXT_153); + stringBuffer.append(TEXT_164); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_154); + stringBuffer.append(TEXT_165); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false); - stringBuffer.append(TEXT_155); + stringBuffer.append(TEXT_166); } - stringBuffer.append(TEXT_156); + stringBuffer.append(TEXT_167); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_157); + stringBuffer.append(TEXT_168); boolean generateSwitch = genNodesCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_158); + stringBuffer.append(TEXT_169); } for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) { GenNode nextNode = (GenNode) genNodesIterator.next(); if (generateSwitch) { - stringBuffer.append(TEXT_159); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_160); + stringBuffer.append(TEXT_171); } else { - stringBuffer.append(TEXT_161); + stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_162); + stringBuffer.append(TEXT_173); } - stringBuffer.append(TEXT_163); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); - stringBuffer.append(TEXT_164); + stringBuffer.append(TEXT_175); if (generateSwitch) { - stringBuffer.append(TEXT_165); + stringBuffer.append(TEXT_176); } else { - stringBuffer.append(TEXT_166); + stringBuffer.append(TEXT_177); } } if (generateSwitch) { - stringBuffer.append(TEXT_167); + stringBuffer.append(TEXT_178); } if (childMetaFeature.isListType()) { - stringBuffer.append(TEXT_168); + stringBuffer.append(TEXT_179); } } - stringBuffer.append(TEXT_169); + stringBuffer.append(TEXT_180); } } - stringBuffer.append(TEXT_170); + stringBuffer.append(TEXT_181); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_182); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_183); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_184); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor")); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_185); { String _parentNode = "parentView"; @@ -1059,10 +1092,10 @@ throw new RuntimeException("Unexpected container"); } - stringBuffer.append(TEXT_175); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_187); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_188); for (Iterator it = childNodes.iterator(); it.hasNext(); ) { GenNode nextNode = (GenNode) it.next(); @@ -1072,15 +1105,15 @@ } String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName()); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_189); stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_179); + stringBuffer.append(TEXT_190); stringBuffer.append(childNodeInterfaceName); - stringBuffer.append(TEXT_180); + stringBuffer.append(TEXT_191); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand")); - stringBuffer.append(TEXT_181); + stringBuffer.append(TEXT_192); stringBuffer.append(_parentNode); - stringBuffer.append(TEXT_182); + stringBuffer.append(TEXT_193); if (!isListLayout) { int defaultWidth = 40; @@ -1091,31 +1124,31 @@ defaultHeight = defSizeAttrs.getHeight(); } - stringBuffer.append(TEXT_183); + stringBuffer.append(TEXT_194); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle")); - stringBuffer.append(TEXT_184); + stringBuffer.append(TEXT_195); stringBuffer.append(defaultWidth); - stringBuffer.append(TEXT_185); + stringBuffer.append(TEXT_196); stringBuffer.append(defaultHeight); - stringBuffer.append(TEXT_186); + stringBuffer.append(TEXT_197); } else { - stringBuffer.append(TEXT_187); + stringBuffer.append(TEXT_198); } - stringBuffer.append(TEXT_188); + stringBuffer.append(TEXT_199); stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_189); + stringBuffer.append(TEXT_200); } - stringBuffer.append(TEXT_190); + stringBuffer.append(TEXT_201); } - stringBuffer.append(TEXT_191); + stringBuffer.append(TEXT_202); } class LinksCollection { @@ -1208,29 +1241,29 @@ Iterator typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks(); Iterator featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks(); - stringBuffer.append(TEXT_192); + stringBuffer.append(TEXT_203); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_193); + stringBuffer.append(TEXT_204); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_194); + stringBuffer.append(TEXT_205); if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) { - stringBuffer.append(TEXT_195); + stringBuffer.append(TEXT_206); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_196); + stringBuffer.append(TEXT_207); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_197); + stringBuffer.append(TEXT_208); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_198); + stringBuffer.append(TEXT_209); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); - stringBuffer.append(TEXT_199); + stringBuffer.append(TEXT_210); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); - stringBuffer.append(TEXT_200); + stringBuffer.append(TEXT_211); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); - stringBuffer.append(TEXT_201); + stringBuffer.append(TEXT_212); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_202); + stringBuffer.append(TEXT_213); } boolean shouldIterateToGenerate = false; @@ -1247,15 +1280,15 @@ } if (shouldIterateToGenerate) { - stringBuffer.append(TEXT_203); + stringBuffer.append(TEXT_214); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_204); + stringBuffer.append(TEXT_215); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_205); + stringBuffer.append(TEXT_216); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_206); + stringBuffer.append(TEXT_217); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_207); + stringBuffer.append(TEXT_218); for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) { GenContainerBase nextChild = (GenContainerBase) childrenIterator.next(); @@ -1263,29 +1296,29 @@ continue; } - stringBuffer.append(TEXT_208); + stringBuffer.append(TEXT_219); stringBuffer.append(importManager.getImportedName(nextChild.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_209); + stringBuffer.append(TEXT_220); stringBuffer.append(nextChild.getUniqueIdentifier()); - stringBuffer.append(TEXT_210); + stringBuffer.append(TEXT_221); } - stringBuffer.append(TEXT_211); + stringBuffer.append(TEXT_222); } - stringBuffer.append(TEXT_212); + stringBuffer.append(TEXT_223); if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) { - stringBuffer.append(TEXT_213); + stringBuffer.append(TEXT_224); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_214); + stringBuffer.append(TEXT_225); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_215); + stringBuffer.append(TEXT_226); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_216); + stringBuffer.append(TEXT_227); { String _getViewCode = "parentView"; @@ -1293,12 +1326,12 @@ Iterator _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();; Iterator _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();; - stringBuffer.append(TEXT_217); - stringBuffer.append(TEXT_218); + stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_229); stringBuffer.append(importManager.getImportedName("java.util.List")); - stringBuffer.append(TEXT_219); + stringBuffer.append(TEXT_230); stringBuffer.append(importManager.getImportedName("java.util.LinkedList")); - stringBuffer.append(TEXT_220); + stringBuffer.append(TEXT_231); Map genFeature2genLinkMap = new LinkedHashMap(); for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) { @@ -1321,18 +1354,18 @@ } if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) { - stringBuffer.append(TEXT_221); + stringBuffer.append(TEXT_232); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_222); + stringBuffer.append(TEXT_233); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_223); + stringBuffer.append(TEXT_234); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_224); + stringBuffer.append(TEXT_235); } if (!genFeature2genLinkMap.isEmpty()) { - stringBuffer.append(TEXT_225); + stringBuffer.append(TEXT_236); } for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) { @@ -1341,32 +1374,32 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_226); + stringBuffer.append(TEXT_237); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_227); + stringBuffer.append(TEXT_238); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); - stringBuffer.append(TEXT_228); + stringBuffer.append(TEXT_239); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_229); + stringBuffer.append(TEXT_240); } else { - stringBuffer.append(TEXT_230); + stringBuffer.append(TEXT_241); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_231); + stringBuffer.append(TEXT_242); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); - stringBuffer.append(TEXT_232); + stringBuffer.append(TEXT_243); } - stringBuffer.append(TEXT_233); + stringBuffer.append(TEXT_244); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_234); + stringBuffer.append(TEXT_245); boolean generateSwitch = genLinksCollection.size() != 1; if (generateSwitch) { - stringBuffer.append(TEXT_235); + stringBuffer.append(TEXT_246); } for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { @@ -1374,67 +1407,67 @@ TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet(); if (generateSwitch) { - stringBuffer.append(TEXT_236); + stringBuffer.append(TEXT_247); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_237); + stringBuffer.append(TEXT_248); } else { - stringBuffer.append(TEXT_238); + stringBuffer.append(TEXT_249); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_239); + stringBuffer.append(TEXT_250); } if (modelFacet.getSourceMetaFeature() != null) { - stringBuffer.append(TEXT_240); + stringBuffer.append(TEXT_251); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_241); + stringBuffer.append(TEXT_252); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_242); + stringBuffer.append(TEXT_253); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false); - stringBuffer.append(TEXT_243); + stringBuffer.append(TEXT_254); } else { - stringBuffer.append(TEXT_244); + stringBuffer.append(TEXT_255); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_245); + stringBuffer.append(TEXT_256); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_246); + stringBuffer.append(TEXT_257); } if (modelFacet.getTargetMetaFeature() != null) { - stringBuffer.append(TEXT_247); + stringBuffer.append(TEXT_258); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_248); + stringBuffer.append(TEXT_259); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_249); + stringBuffer.append(TEXT_260); myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false); - stringBuffer.append(TEXT_250); + stringBuffer.append(TEXT_261); } else { - stringBuffer.append(TEXT_251); + stringBuffer.append(TEXT_262); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_252); + stringBuffer.append(TEXT_263); stringBuffer.append(_getViewCode); - stringBuffer.append(TEXT_253); + stringBuffer.append(TEXT_264); } - stringBuffer.append(TEXT_254); + stringBuffer.append(TEXT_265); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); - stringBuffer.append(TEXT_255); + stringBuffer.append(TEXT_266); if (generateSwitch) { - stringBuffer.append(TEXT_256); + stringBuffer.append(TEXT_267); } else { - stringBuffer.append(TEXT_257); + stringBuffer.append(TEXT_268); } @@ -1442,12 +1475,12 @@ } //iterate over genLinksCollection if (generateSwitch) { - stringBuffer.append(TEXT_258); + stringBuffer.append(TEXT_269); } if (metaFeature.isListType()) { - stringBuffer.append(TEXT_259); + stringBuffer.append(TEXT_270); } } @@ -1457,73 +1490,73 @@ Collection genLinksCollection = (Collection) nextEntry.getValue(); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_260); + stringBuffer.append(TEXT_271); stringBuffer.append(importManager.getImportedName("java.util.Iterator")); - stringBuffer.append(TEXT_261); + stringBuffer.append(TEXT_272); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true); - stringBuffer.append(TEXT_262); + stringBuffer.append(TEXT_273); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_263); + stringBuffer.append(TEXT_274); } else { - stringBuffer.append(TEXT_264); + stringBuffer.append(TEXT_275); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_265); + stringBuffer.append(TEXT_276); myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false); - stringBuffer.append(TEXT_266); + stringBuffer.append(TEXT_277); } - stringBuffer.append(TEXT_267); + stringBuffer.append(TEXT_278); for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) { GenLink nextLink = (GenLink) genLinksIterator.next(); - stringBuffer.append(TEXT_268); + stringBuffer.append(TEXT_279); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); - stringBuffer.append(TEXT_269); + stringBuffer.append(TEXT_280); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_270); + stringBuffer.append(TEXT_281); } - stringBuffer.append(TEXT_271); + stringBuffer.append(TEXT_282); if (metaFeature.isListType()) { - stringBuffer.append(TEXT_272); + stringBuffer.append(TEXT_283); } } - stringBuffer.append(TEXT_273); + stringBuffer.append(TEXT_284); } - stringBuffer.append(TEXT_274); + stringBuffer.append(TEXT_285); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand")); - stringBuffer.append(TEXT_275); + stringBuffer.append(TEXT_286); stringBuffer.append(nextContainer.getUniqueIdentifier()); - stringBuffer.append(TEXT_276); + stringBuffer.append(TEXT_287); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_277); + stringBuffer.append(TEXT_288); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor")); - stringBuffer.append(TEXT_278); + stringBuffer.append(TEXT_289); { String _diagramCode = "parentView.getDiagram()"; Iterator _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();; Iterator _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();; - stringBuffer.append(TEXT_279); - stringBuffer.append(TEXT_280); + stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_291); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_281); + stringBuffer.append(TEXT_292); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View")); - stringBuffer.append(TEXT_282); + stringBuffer.append(TEXT_293); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator")); - stringBuffer.append(TEXT_283); + stringBuffer.append(TEXT_294); for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); @@ -1532,332 +1565,332 @@ continue; } - stringBuffer.append(TEXT_284); + stringBuffer.append(TEXT_295); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_285); + stringBuffer.append(TEXT_296); stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName())); - stringBuffer.append(TEXT_286); + stringBuffer.append(TEXT_297); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_287); + stringBuffer.append(TEXT_298); } for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) { GenLink nextLink = (GenLink) it.next(); - stringBuffer.append(TEXT_288); + stringBuffer.append(TEXT_299); stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_289); + stringBuffer.append(TEXT_300); stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName())); - stringBuffer.append(TEXT_290); + stringBuffer.append(TEXT_301); } - stringBuffer.append(TEXT_291); + stringBuffer.append(TEXT_302); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand")); - stringBuffer.append(TEXT_292); + stringBuffer.append(TEXT_303); stringBuffer.append(_diagramCode); - stringBuffer.append(TEXT_293); + stringBuffer.append(TEXT_304); } - stringBuffer.append(TEXT_294); + stringBuffer.append(TEXT_305); } } } if(!genDiagram.getLinks().isEmpty()) { - stringBuffer.append(TEXT_295); + stringBuffer.append(TEXT_306); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); - stringBuffer.append(TEXT_296); + stringBuffer.append(TEXT_307); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService")); - stringBuffer.append(TEXT_297); + stringBuffer.append(TEXT_308); } - stringBuffer.append(TEXT_298); + stringBuffer.append(TEXT_309); if (isRichClientPlatform) { - stringBuffer.append(TEXT_299); + stringBuffer.append(TEXT_310); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage")); - stringBuffer.append(TEXT_300); + stringBuffer.append(TEXT_311); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text")); - stringBuffer.append(TEXT_301); + stringBuffer.append(TEXT_312); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_302); + stringBuffer.append(TEXT_313); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_303); + stringBuffer.append(TEXT_314); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_304); + stringBuffer.append(TEXT_315); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_305); + stringBuffer.append(TEXT_316); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_306); + stringBuffer.append(TEXT_317); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_307); + stringBuffer.append(TEXT_318); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_308); + stringBuffer.append(TEXT_319); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_309); + stringBuffer.append(TEXT_320); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_310); + stringBuffer.append(TEXT_321); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_311); + stringBuffer.append(TEXT_322); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); - stringBuffer.append(TEXT_312); + stringBuffer.append(TEXT_323); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); - stringBuffer.append(TEXT_313); + stringBuffer.append(TEXT_324); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_314); + stringBuffer.append(TEXT_325); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_315); + stringBuffer.append(TEXT_326); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_316); + stringBuffer.append(TEXT_327); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_317); + stringBuffer.append(TEXT_328); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_318); + stringBuffer.append(TEXT_329); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_319); + stringBuffer.append(TEXT_330); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_320); + stringBuffer.append(TEXT_331); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_321); + stringBuffer.append(TEXT_332); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_322); + stringBuffer.append(TEXT_333); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_323); + stringBuffer.append(TEXT_334); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_324); + stringBuffer.append(TEXT_335); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_325); + stringBuffer.append(TEXT_336); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text")); - stringBuffer.append(TEXT_326); + stringBuffer.append(TEXT_337); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_327); + stringBuffer.append(TEXT_338); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_328); + stringBuffer.append(TEXT_339); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_329); + stringBuffer.append(TEXT_340); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_330); + stringBuffer.append(TEXT_341); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button")); - stringBuffer.append(TEXT_331); + stringBuffer.append(TEXT_342); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button")); - stringBuffer.append(TEXT_332); + stringBuffer.append(TEXT_343); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_333); + stringBuffer.append(TEXT_344); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter")); - stringBuffer.append(TEXT_334); + stringBuffer.append(TEXT_345); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent")); - stringBuffer.append(TEXT_335); + stringBuffer.append(TEXT_346); stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())); - stringBuffer.append(TEXT_336); + stringBuffer.append(TEXT_347); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_337); + stringBuffer.append(TEXT_348); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener")); - stringBuffer.append(TEXT_338); + stringBuffer.append(TEXT_349); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener")); - stringBuffer.append(TEXT_339); + stringBuffer.append(TEXT_350); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent")); - stringBuffer.append(TEXT_340); + stringBuffer.append(TEXT_351); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_341); + stringBuffer.append(TEXT_352); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_342); + stringBuffer.append(TEXT_353); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_343); + stringBuffer.append(TEXT_354); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_344); + stringBuffer.append(TEXT_355); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_345); + stringBuffer.append(TEXT_356); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_346); + stringBuffer.append(TEXT_357); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_347); + stringBuffer.append(TEXT_358); stringBuffer.append(editorGen.getDomainFileExtension()); - stringBuffer.append(TEXT_348); + stringBuffer.append(TEXT_359); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_349); + stringBuffer.append(TEXT_360); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_350); + stringBuffer.append(TEXT_361); stringBuffer.append(editorGen.getDiagramFileExtension()); - stringBuffer.append(TEXT_351); + stringBuffer.append(TEXT_362); stringBuffer.append(editorGen.getDomainGenModel().getModelName()); - stringBuffer.append(TEXT_352); + stringBuffer.append(TEXT_363); stringBuffer.append(editorGen.getDiagramFileExtension()); - stringBuffer.append(TEXT_353); + stringBuffer.append(TEXT_364); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_354); + stringBuffer.append(TEXT_365); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_355); + stringBuffer.append(TEXT_366); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_356); + stringBuffer.append(TEXT_367); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_357); + stringBuffer.append(TEXT_368); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_358); + stringBuffer.append(TEXT_369); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_359); + stringBuffer.append(TEXT_370); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_360); + stringBuffer.append(TEXT_371); stringBuffer.append(importManager.getImportedName("java.io.File")); - stringBuffer.append(TEXT_361); + stringBuffer.append(TEXT_372); } - stringBuffer.append(TEXT_362); + stringBuffer.append(TEXT_373); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage")); - stringBuffer.append(TEXT_363); + stringBuffer.append(TEXT_374); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener")); - stringBuffer.append(TEXT_364); + stringBuffer.append(TEXT_375); if (isRichClientPlatform) { - stringBuffer.append(TEXT_365); + stringBuffer.append(TEXT_376); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); - stringBuffer.append(TEXT_366); + stringBuffer.append(TEXT_377); } - stringBuffer.append(TEXT_367); + stringBuffer.append(TEXT_378); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_368); + stringBuffer.append(TEXT_379); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_369); + stringBuffer.append(TEXT_380); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_370); + stringBuffer.append(TEXT_381); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_371); + stringBuffer.append(TEXT_382); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_372); + stringBuffer.append(TEXT_383); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_373); + stringBuffer.append(TEXT_384); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_374); + stringBuffer.append(TEXT_385); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_375); + stringBuffer.append(TEXT_386); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_376); + stringBuffer.append(TEXT_387); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_377); + stringBuffer.append(TEXT_388); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); - stringBuffer.append(TEXT_378); + stringBuffer.append(TEXT_389); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_379); + stringBuffer.append(TEXT_390); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_380); + stringBuffer.append(TEXT_391); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_381); + stringBuffer.append(TEXT_392); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_382); + stringBuffer.append(TEXT_393); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout")); - stringBuffer.append(TEXT_383); + stringBuffer.append(TEXT_394); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); - stringBuffer.append(TEXT_384); + stringBuffer.append(TEXT_395); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label")); - stringBuffer.append(TEXT_385); + stringBuffer.append(TEXT_396); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_386); + stringBuffer.append(TEXT_397); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_387); + stringBuffer.append(TEXT_398); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_388); + stringBuffer.append(TEXT_399); final String treeViewer = isRichClientPlatform ? "myTreeViewer" : "treeViewer"; - stringBuffer.append(TEXT_389); + stringBuffer.append(TEXT_400); if (!isRichClientPlatform){ stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); - stringBuffer.append(TEXT_390); + stringBuffer.append(TEXT_401); } stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_391); + stringBuffer.append(TEXT_402); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer")); - stringBuffer.append(TEXT_392); + stringBuffer.append(TEXT_403); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_393); + stringBuffer.append(TEXT_404); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_394); + stringBuffer.append(TEXT_405); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_395); + stringBuffer.append(TEXT_406); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); - stringBuffer.append(TEXT_396); + stringBuffer.append(TEXT_407); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_397); + stringBuffer.append(TEXT_408); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_398); + stringBuffer.append(TEXT_409); stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData")); - stringBuffer.append(TEXT_399); + stringBuffer.append(TEXT_410); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_400); + stringBuffer.append(TEXT_411); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_401); + stringBuffer.append(TEXT_412); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider")); - stringBuffer.append(TEXT_402); + stringBuffer.append(TEXT_413); stringBuffer.append(pluginActivatorClass); - stringBuffer.append(TEXT_403); + stringBuffer.append(TEXT_414); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_404); + stringBuffer.append(TEXT_415); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider")); - stringBuffer.append(TEXT_405); + stringBuffer.append(TEXT_416); stringBuffer.append(pluginActivatorClass); - stringBuffer.append(TEXT_406); + stringBuffer.append(TEXT_417); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_407); + stringBuffer.append(TEXT_418); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_408); + stringBuffer.append(TEXT_419); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_409); + stringBuffer.append(TEXT_420); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); - stringBuffer.append(TEXT_410); + stringBuffer.append(TEXT_421); } - stringBuffer.append(TEXT_411); + stringBuffer.append(TEXT_422); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_412); + stringBuffer.append(TEXT_423); if (isRichClientPlatform) { - stringBuffer.append(TEXT_413); + stringBuffer.append(TEXT_424); stringBuffer.append(treeViewer); - stringBuffer.append(TEXT_414); + stringBuffer.append(TEXT_425); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); - stringBuffer.append(TEXT_415); + stringBuffer.append(TEXT_426); } - stringBuffer.append(TEXT_416); + stringBuffer.append(TEXT_427); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent")); - stringBuffer.append(TEXT_417); + stringBuffer.append(TEXT_428); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); - stringBuffer.append(TEXT_418); + stringBuffer.append(TEXT_429); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); - stringBuffer.append(TEXT_419); + stringBuffer.append(TEXT_430); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection")); - stringBuffer.append(TEXT_420); + stringBuffer.append(TEXT_431); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")); - stringBuffer.append(TEXT_421); + stringBuffer.append(TEXT_432); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider")); - stringBuffer.append(TEXT_422); + stringBuffer.append(TEXT_433); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); - stringBuffer.append(TEXT_423); + stringBuffer.append(TEXT_434); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap")); - stringBuffer.append(TEXT_424); + stringBuffer.append(TEXT_435); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_425); + stringBuffer.append(TEXT_436); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); - stringBuffer.append(TEXT_426); + stringBuffer.append(TEXT_437); stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName())); - stringBuffer.append(TEXT_427); + stringBuffer.append(TEXT_438); stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName())); - stringBuffer.append(TEXT_428); + stringBuffer.append(TEXT_439); importManager.emitSortedImports(); - stringBuffer.append(TEXT_429); + stringBuffer.append(TEXT_440); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java,v retrieving revision 1.2 diff -u -r1.2 DiagramEditorUtilGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java 20 Apr 2006 18:27:23 -0000 1.2 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java 29 Sep 2006 14:18:50 -0000 @@ -18,143 +18,144 @@ protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; protected final String TEXT_1 = ""; protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class "; - protected final String TEXT_3 = " {" + 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 + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static boolean 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 false;" + NL + "\t\t} else {" + NL + "\t\t\ttry {" + NL + "\t\t\t\tpage.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 false;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\treturn true;" + NL + "\t}" + NL; - protected final String TEXT_4 = 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_5 = "\");" + 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_6 = "\");" + NL + "\t}"; - protected final String TEXT_7 = NL + "\t/**" + NL + "\t * Looks up a string in the plugin's plugin.properties file." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key) {" + NL + "\t\treturn "; - protected final String TEXT_8 = ".getInstance().getBundleString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's application" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Application implements "; - protected final String TEXT_9 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object run(Object args) {" + NL + "\t\t\t"; - protected final String TEXT_10 = " workbenchAdvisor = new Advisor();" + NL + "\t\t\t"; - protected final String TEXT_11 = " display = "; - protected final String TEXT_12 = ".createDisplay();" + NL + "\t\t\ttry {" + NL + "\t\t\t\tint returnCode = "; - protected final String TEXT_13 = ".createAndRunWorkbench(display, workbenchAdvisor);" + NL + "\t\t\t\tif (returnCode == "; - protected final String TEXT_14 = ".RETURN_RESTART) {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_15 = ".EXIT_RESTART;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\treturn "; - protected final String TEXT_16 = ".EXIT_OK;" + NL + "\t\t\t\t}" + NL + "\t\t\t} finally {" + NL + "\t\t\t\tdisplay.dispose();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + " " + NL + " \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Advisor extends "; - protected final String TEXT_17 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic String getInitialWindowPerspectiveId() {" + NL + "\t\t\treturn Perspective.ID_PERSPECTIVE;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void initialize("; - protected final String TEXT_18 = " configurer) {" + NL + "\t\t\tsuper.initialize(configurer);" + NL + "\t\t\tconfigurer.setSaveAndRestore(true);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WorkbenchWindowAdvisor createWorkbenchWindowAdvisor("; - protected final String TEXT_19 = " configurer) {" + NL + "\t\t\treturn new WindowAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + " \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Perspective implements "; - protected final String TEXT_20 = " {" + NL + "\t\t/**" + NL + "\t\t * Perspective ID" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static final String ID_PERSPECTIVE = \""; - protected final String TEXT_21 = ".Perspective\";\t//$NON-NLS-1$" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createInitialLayout("; - protected final String TEXT_22 = " layout) {" + NL + "\t\t\tlayout.setEditorAreaVisible(true);" + NL + "\t\t\tlayout.addPerspectiveShortcut(ID_PERSPECTIVE);" + NL + "" + NL + "\t\t\t"; - protected final String TEXT_23 = " right = layout.createFolder(\"right\", "; - protected final String TEXT_24 = ".RIGHT, (float)0.66, layout.getEditorArea());\t//$NON-NLS-1$" + NL + "\t\t\tright.addView(IPageLayout.ID_OUTLINE);" + NL + "" + NL + "\t\t\t"; - protected final String TEXT_25 = " bottomRight = layout.createFolder(\"bottonRight\", "; - protected final String TEXT_26 = ".BOTTOM, (float)0.60, \"right\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tbottomRight.addView("; - protected final String TEXT_27 = ".ID_PROP_SHEET);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's window advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowAdvisor extends "; - protected final String TEXT_28 = " {" + NL + "\t\t/**" + NL + "\t\t * @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowAdvisor("; - protected final String TEXT_29 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void preWindowOpen() {" + NL + "\t\t\t"; - protected final String TEXT_30 = " configurer = getWindowConfigurer();" + NL + "\t\t\tconfigurer.setInitialSize(new "; - protected final String TEXT_31 = "(600, 450));" + NL + "\t\t\tconfigurer.setShowCoolBar(false);" + NL + "\t\t\tconfigurer.setShowStatusLine(true);" + NL + "\t\t\tconfigurer.setTitle(getString(\"_UI_Application_title\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_32 = " createActionBarAdvisor("; - protected final String TEXT_33 = " configurer) {" + NL + "\t\t\treturn new WindowActionBarAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's action bar advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowActionBarAdvisor extends "; - protected final String TEXT_34 = " {" + NL + "\t\t/**" + NL + "\t\t * @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowActionBarAdvisor("; - protected final String TEXT_35 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void fillMenuBar("; - protected final String TEXT_36 = " menuBar) {" + NL + "\t\t\t"; - protected final String TEXT_37 = " window = getActionBarConfigurer().getWindowConfigurer().getWindow();" + NL + "\t\t\tmenuBar.add(createFileMenu(window));" + NL + "\t\t\tmenuBar.add(createEditMenu(window));" + NL + "\t\t\tmenuBar.add(new "; - protected final String TEXT_38 = "("; - protected final String TEXT_39 = ".MB_ADDITIONS));" + NL + "\t\t\tmenuBar.add(createWindowMenu(window));" + NL + "\t\t\tmenuBar.add(createHelpMenu(window));\t\t\t\t\t" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'File' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_40 = " createFileMenu("; - protected final String TEXT_41 = " window) {" + NL + "\t\t\t"; - protected final String TEXT_42 = " menu = new "; - protected final String TEXT_43 = "(getString(\"_UI_Menu_File_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; - protected final String TEXT_44 = ".M_FILE);" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_45 = "("; - protected final String TEXT_46 = ".FILE_START));" + NL + "\t" + NL + "\t\t\t"; - protected final String TEXT_47 = " newMenu = new "; - protected final String TEXT_48 = "(getString(\"_UI_Menu_New_label\"), \"new\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tnewMenu.add(new "; - protected final String TEXT_49 = "("; - protected final String TEXT_50 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tmenu.add(newMenu);" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_51 = "());" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_52 = "("; - protected final String TEXT_53 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_54 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_55 = ".CLOSE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_56 = ".CLOSE_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_57 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_58 = ".SAVE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_59 = ".SAVE_AS.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_60 = ".SAVE_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_61 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_62 = ".QUIT.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_63 = "("; - protected final String TEXT_64 = ".FILE_END));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Edit' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_65 = " createEditMenu("; - protected final String TEXT_66 = " window) {" + NL + "\t\t\t"; - protected final String TEXT_67 = " menu = new "; - protected final String TEXT_68 = "(getString(\"_UI_Menu_Edit_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; - protected final String TEXT_69 = ".M_EDIT);" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_70 = "("; - protected final String TEXT_71 = ".EDIT_START));" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_72 = ".UNDO.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_73 = ".REDO.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_74 = "("; - protected final String TEXT_75 = ".UNDO_EXT));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_76 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_77 = ".CUT.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_78 = ".COPY.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_79 = ".PASTE.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_80 = "("; - protected final String TEXT_81 = ".CUT_EXT));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_82 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_83 = ".DELETE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_84 = ".SELECT_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_85 = "());" + NL + "\t" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_86 = "("; - protected final String TEXT_87 = ".ADD_EXT));" + NL + "\t" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_88 = "("; - protected final String TEXT_89 = ".EDIT_END));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_90 = "("; - protected final String TEXT_91 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Window' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_92 = " createWindowMenu("; - protected final String TEXT_93 = " window) {" + NL + "\t\t\t"; - protected final String TEXT_94 = " menu = new "; - protected final String TEXT_95 = "(getString(\"_UI_Menu_Window_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; - protected final String TEXT_96 = ".M_WINDOW);" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; - protected final String TEXT_97 = ".OPEN_NEW_WINDOW.create(window));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_98 = "("; - protected final String TEXT_99 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add("; - protected final String TEXT_100 = ".OPEN_WINDOWS.create(window));" + NL + "\t" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Help' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; - protected final String TEXT_101 = " createHelpMenu("; - protected final String TEXT_102 = " window) {" + NL + "\t\t\t"; - protected final String TEXT_103 = " menu = new "; - protected final String TEXT_104 = "(getString(\"_UI_Menu_Help_label\"), "; - protected final String TEXT_105 = ".M_HELP);\t//$NON-NLS-1$" + NL + "\t\t\t// Welcome or intro page would go here" + NL + "\t\t\t// Help contents would go here" + NL + "\t\t\t// Tips and tricks page would go here" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_106 = "("; - protected final String TEXT_107 = ".HELP_START));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_108 = "("; - protected final String TEXT_109 = ".HELP_END));" + NL + "\t\t\tmenu.add(new "; - protected final String TEXT_110 = "("; - protected final String TEXT_111 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * Adds the specified action to the given menu and also registers the action with the" + NL + "\t\t * action bar configurer, in order to activate its key binding." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void addToMenuAndRegister("; - protected final String TEXT_112 = " menuManager, "; - protected final String TEXT_113 = " action) {" + NL + "\t\t\tmenuManager.add(action);" + NL + "\t\t\tgetActionBarConfigurer().registerGlobalAction(action);\t\t\t" + NL + "\t\t}\t\t" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * About action for the RCP application." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class AboutAction extends "; - protected final String TEXT_114 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; - protected final String TEXT_115 = " action) {" + NL + "\t\t\t"; - protected final String TEXT_116 = ".openInformation(getWindow().getShell(), getString(\"_UI_About_title\"),\t//$NON-NLS-1$" + NL + "\t\t\tgetString(\"_UI_About_text\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_117 = NL + NL + " \t/**" + NL + "\t * Open action for the "; - protected final String TEXT_118 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenDiagramAction extends "; - protected final String TEXT_119 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the file dialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; - protected final String TEXT_120 = " action) {" + NL + "\t\t\tString filePath = openFilePathDialog(getWindow().getShell(), \"*."; - protected final String TEXT_121 = "\", "; - protected final String TEXT_122 = ".OPEN);\t//$NON-NLS-1$" + NL + "\t\t\tif (filePath != null) {" + NL + "\t\t\t\topenEditor(URI.createFileURI(filePath));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + " \t}" + NL + "" + NL + "\t/**" + NL + "\t * Open URI action for the "; - protected final String TEXT_123 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenURIAction extends "; - protected final String TEXT_124 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the LoadResourceDialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; - protected final String TEXT_125 = " action) {" + NL + "\t\t\t"; - protected final String TEXT_126 = ".LoadResourceDialog loadResourceDialog = new "; - protected final String TEXT_127 = ".LoadResourceDialog(getWindow().getShell());" + NL + "\t\t\tif ("; - protected final String TEXT_128 = ".OK == loadResourceDialog.open()) {" + NL + "\t\t\t\tfor ("; - protected final String TEXT_129 = " it = loadResourceDialog.getURIs().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\topenEditor((URI) it.next());" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * New diagram action for the "; - protected final String TEXT_130 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class NewDiagramAction extends "; - protected final String TEXT_131 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the wizard to create the diagram." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; - protected final String TEXT_132 = " action) {" + NL + "\t\t\t"; - protected final String TEXT_133 = " wizard = new "; - protected final String TEXT_134 = "();" + NL + "\t\t\twizard.init(getWindow().getWorkbench(), "; - protected final String TEXT_135 = ".EMPTY);" + NL + "\t\t\t"; - protected final String TEXT_136 = " wizardDialog = new "; - protected final String TEXT_137 = "(getWindow().getShell(), wizard);" + NL + "\t\t\twizardDialog.open();" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_138 = NL + "}"; - protected final String TEXT_139 = NL; + protected final String TEXT_3 = " {" + 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 + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static "; + protected final String TEXT_4 = " 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}" + NL; + protected final String TEXT_5 = 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_6 = "\");" + 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_7 = "\");" + NL + "\t}"; + protected final String TEXT_8 = NL + "\t/**" + NL + "\t * Looks up a string in the plugin's plugin.properties file." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key) {" + NL + "\t\treturn "; + protected final String TEXT_9 = ".getInstance().getBundleString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's application" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Application implements "; + protected final String TEXT_10 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object run(Object args) {" + NL + "\t\t\t"; + protected final String TEXT_11 = " workbenchAdvisor = new Advisor();" + NL + "\t\t\t"; + protected final String TEXT_12 = " display = "; + protected final String TEXT_13 = ".createDisplay();" + NL + "\t\t\ttry {" + NL + "\t\t\t\tint returnCode = "; + protected final String TEXT_14 = ".createAndRunWorkbench(display, workbenchAdvisor);" + NL + "\t\t\t\tif (returnCode == "; + protected final String TEXT_15 = ".RETURN_RESTART) {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_16 = ".EXIT_RESTART;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\treturn "; + protected final String TEXT_17 = ".EXIT_OK;" + NL + "\t\t\t\t}" + NL + "\t\t\t} finally {" + NL + "\t\t\t\tdisplay.dispose();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + " " + NL + " \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Advisor extends "; + protected final String TEXT_18 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic String getInitialWindowPerspectiveId() {" + NL + "\t\t\treturn Perspective.ID_PERSPECTIVE;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void initialize("; + protected final String TEXT_19 = " configurer) {" + NL + "\t\t\tsuper.initialize(configurer);" + NL + "\t\t\tconfigurer.setSaveAndRestore(true);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WorkbenchWindowAdvisor createWorkbenchWindowAdvisor("; + protected final String TEXT_20 = " configurer) {" + NL + "\t\t\treturn new WindowAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + " \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Perspective implements "; + protected final String TEXT_21 = " {" + NL + "\t\t/**" + NL + "\t\t * Perspective ID" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static final String ID_PERSPECTIVE = \""; + protected final String TEXT_22 = ".Perspective\";\t//$NON-NLS-1$" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createInitialLayout("; + protected final String TEXT_23 = " layout) {" + NL + "\t\t\tlayout.setEditorAreaVisible(true);" + NL + "\t\t\tlayout.addPerspectiveShortcut(ID_PERSPECTIVE);" + NL + "" + NL + "\t\t\t"; + protected final String TEXT_24 = " right = layout.createFolder(\"right\", "; + protected final String TEXT_25 = ".RIGHT, (float)0.66, layout.getEditorArea());\t//$NON-NLS-1$" + NL + "\t\t\tright.addView(IPageLayout.ID_OUTLINE);" + NL + "" + NL + "\t\t\t"; + protected final String TEXT_26 = " bottomRight = layout.createFolder(\"bottonRight\", "; + protected final String TEXT_27 = ".BOTTOM, (float)0.60, \"right\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tbottomRight.addView("; + protected final String TEXT_28 = ".ID_PROP_SHEET);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's window advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowAdvisor extends "; + protected final String TEXT_29 = " {" + NL + "\t\t/**" + NL + "\t\t * @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowAdvisor("; + protected final String TEXT_30 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void preWindowOpen() {" + NL + "\t\t\t"; + protected final String TEXT_31 = " configurer = getWindowConfigurer();" + NL + "\t\t\tconfigurer.setInitialSize(new "; + protected final String TEXT_32 = "(600, 450));" + NL + "\t\t\tconfigurer.setShowCoolBar(false);" + NL + "\t\t\tconfigurer.setShowStatusLine(true);" + NL + "\t\t\tconfigurer.setTitle(getString(\"_UI_Application_title\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_33 = " createActionBarAdvisor("; + protected final String TEXT_34 = " configurer) {" + NL + "\t\t\treturn new WindowActionBarAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's action bar advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowActionBarAdvisor extends "; + protected final String TEXT_35 = " {" + NL + "\t\t/**" + NL + "\t\t * @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowActionBarAdvisor("; + protected final String TEXT_36 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void fillMenuBar("; + protected final String TEXT_37 = " menuBar) {" + NL + "\t\t\t"; + protected final String TEXT_38 = " window = getActionBarConfigurer().getWindowConfigurer().getWindow();" + NL + "\t\t\tmenuBar.add(createFileMenu(window));" + NL + "\t\t\tmenuBar.add(createEditMenu(window));" + NL + "\t\t\tmenuBar.add(new "; + protected final String TEXT_39 = "("; + protected final String TEXT_40 = ".MB_ADDITIONS));" + NL + "\t\t\tmenuBar.add(createWindowMenu(window));" + NL + "\t\t\tmenuBar.add(createHelpMenu(window));\t\t\t\t\t" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'File' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_41 = " createFileMenu("; + protected final String TEXT_42 = " window) {" + NL + "\t\t\t"; + protected final String TEXT_43 = " menu = new "; + protected final String TEXT_44 = "(getString(\"_UI_Menu_File_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; + protected final String TEXT_45 = ".M_FILE);" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_46 = "("; + protected final String TEXT_47 = ".FILE_START));" + NL + "\t" + NL + "\t\t\t"; + protected final String TEXT_48 = " newMenu = new "; + protected final String TEXT_49 = "(getString(\"_UI_Menu_New_label\"), \"new\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tnewMenu.add(new "; + protected final String TEXT_50 = "("; + protected final String TEXT_51 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tmenu.add(newMenu);" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_52 = "());" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_53 = "("; + protected final String TEXT_54 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_55 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_56 = ".CLOSE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_57 = ".CLOSE_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_58 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_59 = ".SAVE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_60 = ".SAVE_AS.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_61 = ".SAVE_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_62 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_63 = ".QUIT.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_64 = "("; + protected final String TEXT_65 = ".FILE_END));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Edit' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_66 = " createEditMenu("; + protected final String TEXT_67 = " window) {" + NL + "\t\t\t"; + protected final String TEXT_68 = " menu = new "; + protected final String TEXT_69 = "(getString(\"_UI_Menu_Edit_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; + protected final String TEXT_70 = ".M_EDIT);" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_71 = "("; + protected final String TEXT_72 = ".EDIT_START));" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_73 = ".UNDO.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_74 = ".REDO.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_75 = "("; + protected final String TEXT_76 = ".UNDO_EXT));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_77 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_78 = ".CUT.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_79 = ".COPY.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_80 = ".PASTE.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_81 = "("; + protected final String TEXT_82 = ".CUT_EXT));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_83 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_84 = ".DELETE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_85 = ".SELECT_ALL.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_86 = "());" + NL + "\t" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_87 = "("; + protected final String TEXT_88 = ".ADD_EXT));" + NL + "\t" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_89 = "("; + protected final String TEXT_90 = ".EDIT_END));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_91 = "("; + protected final String TEXT_92 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Window' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_93 = " createWindowMenu("; + protected final String TEXT_94 = " window) {" + NL + "\t\t\t"; + protected final String TEXT_95 = " menu = new "; + protected final String TEXT_96 = "(getString(\"_UI_Menu_Window_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t"; + protected final String TEXT_97 = ".M_WINDOW);" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, "; + protected final String TEXT_98 = ".OPEN_NEW_WINDOW.create(window));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_99 = "("; + protected final String TEXT_100 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add("; + protected final String TEXT_101 = ".OPEN_WINDOWS.create(window));" + NL + "\t" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Help' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected "; + protected final String TEXT_102 = " createHelpMenu("; + protected final String TEXT_103 = " window) {" + NL + "\t\t\t"; + protected final String TEXT_104 = " menu = new "; + protected final String TEXT_105 = "(getString(\"_UI_Menu_Help_label\"), "; + protected final String TEXT_106 = ".M_HELP);\t//$NON-NLS-1$" + NL + "\t\t\t// Welcome or intro page would go here" + NL + "\t\t\t// Help contents would go here" + NL + "\t\t\t// Tips and tricks page would go here" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_107 = "("; + protected final String TEXT_108 = ".HELP_START));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_109 = "("; + protected final String TEXT_110 = ".HELP_END));" + NL + "\t\t\tmenu.add(new "; + protected final String TEXT_111 = "("; + protected final String TEXT_112 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * Adds the specified action to the given menu and also registers the action with the" + NL + "\t\t * action bar configurer, in order to activate its key binding." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void addToMenuAndRegister("; + protected final String TEXT_113 = " menuManager, "; + protected final String TEXT_114 = " action) {" + NL + "\t\t\tmenuManager.add(action);" + NL + "\t\t\tgetActionBarConfigurer().registerGlobalAction(action);\t\t\t" + NL + "\t\t}\t\t" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * About action for the RCP application." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class AboutAction extends "; + protected final String TEXT_115 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; + protected final String TEXT_116 = " action) {" + NL + "\t\t\t"; + protected final String TEXT_117 = ".openInformation(getWindow().getShell(), getString(\"_UI_About_title\"),\t//$NON-NLS-1$" + NL + "\t\t\tgetString(\"_UI_About_text\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_118 = NL + NL + " \t/**" + NL + "\t * Open action for the "; + protected final String TEXT_119 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenDiagramAction extends "; + protected final String TEXT_120 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the file dialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; + protected final String TEXT_121 = " action) {" + NL + "\t\t\tString filePath = openFilePathDialog(getWindow().getShell(), \"*."; + protected final String TEXT_122 = "\", "; + protected final String TEXT_123 = ".OPEN);\t//$NON-NLS-1$" + NL + "\t\t\tif (filePath != null) {" + NL + "\t\t\t\topenEditor(URI.createFileURI(filePath));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + " \t}" + NL + "" + NL + "\t/**" + NL + "\t * Open URI action for the "; + protected final String TEXT_124 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenURIAction extends "; + protected final String TEXT_125 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the LoadResourceDialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; + protected final String TEXT_126 = " action) {" + NL + "\t\t\t"; + protected final String TEXT_127 = ".LoadResourceDialog loadResourceDialog = new "; + protected final String TEXT_128 = ".LoadResourceDialog(getWindow().getShell());" + NL + "\t\t\tif ("; + protected final String TEXT_129 = ".OK == loadResourceDialog.open()) {" + NL + "\t\t\t\tfor ("; + protected final String TEXT_130 = " it = loadResourceDialog.getURIs().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\topenEditor((URI) it.next());" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * New diagram action for the "; + protected final String TEXT_131 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class NewDiagramAction extends "; + protected final String TEXT_132 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the wizard to create the diagram." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run("; + protected final String TEXT_133 = " action) {" + NL + "\t\t\t"; + protected final String TEXT_134 = " wizard = new "; + protected final String TEXT_135 = "();" + NL + "\t\t\twizard.init(getWindow().getWorkbench(), "; + protected final String TEXT_136 = ".EMPTY);" + NL + "\t\t\t"; + protected final String TEXT_137 = " wizardDialog = new "; + protected final String TEXT_138 = "(getWindow().getShell(), wizard);" + NL + "\t\t\twizardDialog.open();" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_139 = NL + "}"; + protected final String TEXT_140 = NL; public String generate(Object argument) { @@ -186,14 +187,16 @@ stringBuffer.append(TEXT_2); stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); stringBuffer.append(TEXT_3); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart")); + stringBuffer.append(TEXT_4); if (!genDiagram.getEditorGen().isSameFileForDiagramAndModel()) { - stringBuffer.append(TEXT_4); - stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_5); - stringBuffer.append(editorGen.getDomainFileExtension()); + stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_6); + stringBuffer.append(editorGen.getDomainFileExtension()); + stringBuffer.append(TEXT_7); } @@ -202,275 +205,275 @@ boolean shouldGenerateApplication = true; /*XXX: option in gmfgen*/ if (shouldGenerateApplication) { - stringBuffer.append(TEXT_7); - stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())); stringBuffer.append(TEXT_8); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable")); + stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName())); stringBuffer.append(TEXT_9); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable")); stringBuffer.append(TEXT_10); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor")); stringBuffer.append(TEXT_11); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display")); stringBuffer.append(TEXT_12); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI")); stringBuffer.append(TEXT_13); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI")); stringBuffer.append(TEXT_14); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI")); stringBuffer.append(TEXT_15); stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable")); stringBuffer.append(TEXT_16); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable")); stringBuffer.append(TEXT_17); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchConfigurer")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor")); stringBuffer.append(TEXT_18); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchConfigurer")); stringBuffer.append(TEXT_19); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPerspectiveFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer")); stringBuffer.append(TEXT_20); - stringBuffer.append(genPlugin.getID()); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPerspectiveFactory")); stringBuffer.append(TEXT_21); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout")); + stringBuffer.append(genPlugin.getID()); stringBuffer.append(TEXT_22); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout")); - stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout")); - stringBuffer.append(TEXT_24); + stringBuffer.append(TEXT_23); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout")); - stringBuffer.append(TEXT_25); + stringBuffer.append(TEXT_24); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout")); + stringBuffer.append(TEXT_25); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout")); stringBuffer.append(TEXT_26); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout")); stringBuffer.append(TEXT_27); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchWindowAdvisor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout")); stringBuffer.append(TEXT_28); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchWindowAdvisor")); stringBuffer.append(TEXT_29); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer")); stringBuffer.append(TEXT_30); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Point")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer")); stringBuffer.append(TEXT_31); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Point")); stringBuffer.append(TEXT_32); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer")); - stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor")); - stringBuffer.append(TEXT_34); + stringBuffer.append(TEXT_33); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer")); + stringBuffer.append(TEXT_34); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor")); stringBuffer.append(TEXT_35); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer")); stringBuffer.append(TEXT_36); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_37); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); stringBuffer.append(TEXT_38); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_39); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_40); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); - stringBuffer.append(TEXT_41); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_41); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); stringBuffer.append(TEXT_42); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_43); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_44); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_45); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(TEXT_45); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_46); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_47); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_48); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_49); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_51); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_54); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_55); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); - stringBuffer.append(TEXT_57); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_57); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_58); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_59); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_60); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); - stringBuffer.append(TEXT_61); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(TEXT_61); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_62); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_63); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_64); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_65); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); - stringBuffer.append(TEXT_66); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_66); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); stringBuffer.append(TEXT_67); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_68); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_69); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_70); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(TEXT_70); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_71); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_72); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_73); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_74); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_75); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_76); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_79); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_80); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_81); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_82); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_84); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_85); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_86); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); - stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_88); + stringBuffer.append(TEXT_87); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(TEXT_88); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_89); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); - stringBuffer.append(TEXT_90); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(TEXT_90); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_91); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_92); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); - stringBuffer.append(TEXT_93); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_93); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); stringBuffer.append(TEXT_94); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_95); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_96); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_97); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_98); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_99); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ContributionItemFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_100); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ContributionItemFactory")); stringBuffer.append(TEXT_101); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); - stringBuffer.append(TEXT_102); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_102); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow")); stringBuffer.append(TEXT_103); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_104); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_105); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); - stringBuffer.append(TEXT_107); + stringBuffer.append(TEXT_106); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_108); + stringBuffer.append(TEXT_107); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); - stringBuffer.append(TEXT_109); + stringBuffer.append(TEXT_108); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); - stringBuffer.append(TEXT_110); + stringBuffer.append(TEXT_109); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); + stringBuffer.append(TEXT_110); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker")); stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants")); stringBuffer.append(TEXT_112); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_113); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); - stringBuffer.append(TEXT_114); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(TEXT_114); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); stringBuffer.append(TEXT_115); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.MessageDialog")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_116); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.MessageDialog")); + stringBuffer.append(TEXT_117); } - stringBuffer.append(TEXT_117); - stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_118); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); + stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_119); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); stringBuffer.append(TEXT_120); - stringBuffer.append(editorGen.getDiagramFileExtension()); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(editorGen.getDiagramFileExtension()); stringBuffer.append(TEXT_122); - stringBuffer.append(genModel.getModelName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_123); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); + stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_124); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); stringBuffer.append(TEXT_125); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_126); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction")); stringBuffer.append(TEXT_127); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.Dialog")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction")); stringBuffer.append(TEXT_128); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.Dialog")); stringBuffer.append(TEXT_129); - stringBuffer.append(genModel.getModelName()); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_130); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); + stringBuffer.append(genModel.getModelName()); stringBuffer.append(TEXT_131); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate")); stringBuffer.append(TEXT_132); - stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_133); stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName())); stringBuffer.append(TEXT_134); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); + stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName())); stringBuffer.append(TEXT_135); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection")); stringBuffer.append(TEXT_136); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog")); stringBuffer.append(TEXT_137); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog")); + stringBuffer.append(TEXT_138); } - stringBuffer.append(TEXT_138); - importManager.emitSortedImports(); stringBuffer.append(TEXT_139); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_140); return stringBuffer.toString(); } } Index: src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java,v retrieving revision 1.9 diff -u -r1.9 EditorGenerator.java --- src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 11 Sep 2006 15:45:01 -0000 1.9 +++ src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java 29 Sep 2006 14:18:50 -0000 @@ -65,162 +65,165 @@ protected final String TEXT_46 = ") this, "; protected final String TEXT_47 = ".MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new "; protected final String TEXT_48 = "(this));" + NL + "\t\taddEditorAction(new "; - protected final String TEXT_49 = "(this));" + NL + "" + NL + "\t\t"; - protected final String TEXT_50 = " zoomIn = new "; - protected final String TEXT_51 = "(getZoomManager());" + NL + "\t\t"; - protected final String TEXT_52 = " zoomOut = new "; - protected final String TEXT_53 = "(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t\t"; - protected final String TEXT_54 = " keyHandler = getGraphicalViewer().getKeyHandler();" + NL + "\t\tkeyHandler.put("; - protected final String TEXT_55 = ".getPressed("; - protected final String TEXT_56 = ".DEL, 127, 0), getActionRegistry().getAction("; - protected final String TEXT_57 = ".DELETE.getId()));" + NL + "\t\tkeyHandler.put("; - protected final String TEXT_58 = ".getPressed("; - protected final String TEXT_59 = ".F2, 0), getActionRegistry().getAction("; - protected final String TEXT_60 = ".DIRECT_EDIT));" + NL + "\t}" + NL; - protected final String TEXT_61 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor("; - protected final String TEXT_62 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}"; - protected final String TEXT_63 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave("; - protected final String TEXT_64 = " monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch ("; - protected final String TEXT_65 = " e) {" + NL + "\t\t\t"; - protected final String TEXT_66 = ".openError(getSite().getShell(), \"Error During Save\", \"The current "; - protected final String TEXT_67 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configurePalette("; - protected final String TEXT_68 = " paletteRoot) {"; - protected final String TEXT_69 = NL + "\t\tnew "; - protected final String TEXT_70 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);"; - protected final String TEXT_71 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_72 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; - protected final String TEXT_73 = " getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init("; - protected final String TEXT_74 = " site, "; - protected final String TEXT_75 = " input) throws "; - protected final String TEXT_76 = " {" + NL + "\t\t"; - protected final String TEXT_77 = " file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new "; - protected final String TEXT_78 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsuper.init(site, input);" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new "; - protected final String TEXT_79 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput("; - protected final String TEXT_80 = " input) {"; - protected final String TEXT_81 = NL + "\t\tif (getEditorInput() instanceof "; - protected final String TEXT_82 = ") {" + NL + "\t\t\t"; - protected final String TEXT_83 = " resource = (("; - protected final String TEXT_84 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; - protected final String TEXT_85 = NL + "\t\t"; - protected final String TEXT_86 = " file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);"; - protected final String TEXT_87 = NL + "\t\tif (getEditorInput() instanceof "; - protected final String TEXT_88 = ") {" + NL + "\t\t\t"; - protected final String TEXT_89 = " resource = (("; - protected final String TEXT_90 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; - protected final String TEXT_91 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; - protected final String TEXT_92 = " getURIFromInput("; - protected final String TEXT_93 = " input) {"; - protected final String TEXT_94 = NL + "\t\tif (input instanceof "; - protected final String TEXT_95 = ") {" + NL + "\t\t\treturn (("; - protected final String TEXT_96 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof "; - protected final String TEXT_97 = ") {" + NL + "\t\t\treturn "; - protected final String TEXT_98 = ".createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}"; - protected final String TEXT_99 = NL + "\t\tif (input instanceof "; - protected final String TEXT_100 = ") {" + NL + "\t\t\treturn "; - protected final String TEXT_101 = ".createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}"; - protected final String TEXT_102 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; - protected final String TEXT_103 = " getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\t"; - protected final String TEXT_104 = " factories = new "; - protected final String TEXT_105 = "();" + NL + "\t\t\tfactories.add(new "; - protected final String TEXT_106 = "());"; - protected final String TEXT_107 = NL + "\t\t\tfactories.add(new "; - protected final String TEXT_108 = "());"; - protected final String TEXT_109 = NL + "\t\t\tfactories.add(new "; - protected final String TEXT_110 = "());" + NL + "\t\t\tfactories.add(new "; - protected final String TEXT_111 = "());" + NL + "\t\t\tdomainAdapterFactory = new "; - protected final String TEXT_112 = "(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load("; - protected final String TEXT_113 = " diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; - protected final String TEXT_114 = " editingDomain = getEditingDomain();" + NL + "\t\t"; - protected final String TEXT_115 = " resourceSet = editingDomain.getResourceSet();" + NL + "\t\t"; - protected final String TEXT_116 = " diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = ("; - protected final String TEXT_117 = ") findInResource(diagramResource, "; - protected final String TEXT_118 = ".class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = "; - protected final String TEXT_119 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save("; - protected final String TEXT_120 = ".EMPTY_MAP);" + NL + "\t\t\t} catch ("; - protected final String TEXT_121 = " e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = ("; - protected final String TEXT_122 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {"; - protected final String TEXT_123 = NL + "\t\t\t"; - protected final String TEXT_124 = " modelFile = "; - protected final String TEXT_125 = ".getModelFileURI(diagramFile);" + NL + "\t\t\t"; - protected final String TEXT_126 = " modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}"; - protected final String TEXT_127 = NL + "\t\t\tdiagramRoot = ("; - protected final String TEXT_128 = ") findInResource("; - protected final String TEXT_129 = ", "; - protected final String TEXT_130 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = "; - protected final String TEXT_131 = ".eINSTANCE.create"; - protected final String TEXT_132 = "();" + NL + "\t\t\t\t"; - protected final String TEXT_133 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t"; - protected final String TEXT_134 = ".save("; - protected final String TEXT_135 = ".EMPTY_MAP);" + NL + "\t\t\t\t} catch ("; - protected final String TEXT_136 = " e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement("; - protected final String TEXT_137 = "("; - protected final String TEXT_138 = ") "; - protected final String TEXT_139 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; - protected final String TEXT_140 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource("; - protected final String TEXT_141 = " resource, Class expectedClass) {" + NL + "\t\tfor("; - protected final String TEXT_142 = " it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer("; - protected final String TEXT_143 = " parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\t"; - protected final String TEXT_144 = " root = new "; - protected final String TEXT_145 = "();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new "; - protected final String TEXT_146 = "());" + NL + "" + NL + "\t\t"; - protected final String TEXT_147 = " printableLayers = ("; - protected final String TEXT_148 = ") root.getLayer("; - protected final String TEXT_149 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; - protected final String TEXT_150 = " extLabelsLayer = new "; - protected final String TEXT_151 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; - protected final String TEXT_152 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; - protected final String TEXT_153 = ".EXTERNAL_NODE_LABELS_LAYER, "; - protected final String TEXT_154 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\t"; - protected final String TEXT_155 = " viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\t"; - protected final String TEXT_156 = " provider = new "; - protected final String TEXT_157 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; - protected final String TEXT_158 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\t"; - protected final String TEXT_159 = " keyHandler = new "; - protected final String TEXT_160 = "(viewer);" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty("; - protected final String TEXT_161 = ".KeyGenerator.getKey("; - protected final String TEXT_162 = ".CTRL), "; - protected final String TEXT_163 = ".SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class "; - protected final String TEXT_164 = "ContextMenuProvider extends "; - protected final String TEXT_165 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; - protected final String TEXT_166 = "ContextMenuProvider("; - protected final String TEXT_167 = " viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t public void buildContextMenu("; - protected final String TEXT_168 = " menuManager) {" + NL + "\t "; - protected final String TEXT_169 = ".addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_170 = ".UNDO.getId(), "; - protected final String TEXT_171 = ".GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_172 = ".REDO.getId(), "; - protected final String TEXT_173 = ".GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_174 = ".COPY.getId(), "; - protected final String TEXT_175 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_176 = ".PASTE.getId(), "; - protected final String TEXT_177 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_178 = ".DELETE.getId(), "; - protected final String TEXT_179 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_180 = ".DIRECT_EDIT, "; - protected final String TEXT_181 = ".GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, "; - protected final String TEXT_182 = ".SAVE.getId(), "; - protected final String TEXT_183 = ".GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu("; - protected final String TEXT_184 = " menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\t"; - protected final String TEXT_185 = " submenu = new "; - protected final String TEXT_186 = "(\"Align\");" + NL + "\t\t\tsubmenu.add(new "; - protected final String TEXT_187 = "("; - protected final String TEXT_188 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_189 = ".ALIGN_LEFT, "; - protected final String TEXT_190 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_191 = ".ALIGN_CENTER, "; - protected final String TEXT_192 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_193 = ".ALIGN_RIGHT, "; - protected final String TEXT_194 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_195 = ".ALIGN_TOP, "; - protected final String TEXT_196 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_197 = ".ALIGN_MIDDLE, "; - protected final String TEXT_198 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; - protected final String TEXT_199 = ".ALIGN_BOTTOM, "; - protected final String TEXT_200 = ".MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup("; - protected final String TEXT_201 = ".GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu("; - protected final String TEXT_202 = " menu, String actionId, String menuGroup) {" + NL + "\t\t\t"; - protected final String TEXT_203 = " action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}"; - protected final String TEXT_204 = NL; + protected final String TEXT_49 = "(this));" + NL + "\t\taddEditorAction(new "; + protected final String TEXT_50 = "(this));" + NL + "" + NL + "\t\t"; + protected final String TEXT_51 = " zoomIn = new "; + protected final String TEXT_52 = "(getZoomManager());" + NL + "\t\t"; + protected final String TEXT_53 = " zoomOut = new "; + protected final String TEXT_54 = "(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t\t"; + protected final String TEXT_55 = " keyHandler = getGraphicalViewer().getKeyHandler();" + NL + "\t\tkeyHandler.put("; + protected final String TEXT_56 = ".getPressed("; + protected final String TEXT_57 = ".DEL, 127, 0), getActionRegistry().getAction("; + protected final String TEXT_58 = ".DELETE.getId()));" + NL + "\t\tkeyHandler.put("; + protected final String TEXT_59 = ".getPressed("; + protected final String TEXT_60 = ".F2, 0), getActionRegistry().getAction("; + protected final String TEXT_61 = ".DIRECT_EDIT));" + NL + "\t}" + NL; + protected final String TEXT_62 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor("; + protected final String TEXT_63 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}"; + protected final String TEXT_64 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave("; + protected final String TEXT_65 = " monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch ("; + protected final String TEXT_66 = " e) {" + NL + "\t\t\t"; + protected final String TEXT_67 = ".openError(getSite().getShell(), \"Error During Save\", \"The current "; + protected final String TEXT_68 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configurePalette("; + protected final String TEXT_69 = " paletteRoot) {"; + protected final String TEXT_70 = NL + "\t\tnew "; + protected final String TEXT_71 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);"; + protected final String TEXT_72 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_73 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic "; + protected final String TEXT_74 = " getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init("; + protected final String TEXT_75 = " site, "; + protected final String TEXT_76 = " input) throws "; + protected final String TEXT_77 = " {" + NL + "\t\t"; + protected final String TEXT_78 = " file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new "; + protected final String TEXT_79 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsuper.init(site, input);" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new "; + protected final String TEXT_80 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput("; + protected final String TEXT_81 = " input) {"; + protected final String TEXT_82 = NL + "\t\tif (getEditorInput() instanceof "; + protected final String TEXT_83 = ") {" + NL + "\t\t\t"; + protected final String TEXT_84 = " resource = (("; + protected final String TEXT_85 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; + protected final String TEXT_86 = NL + "\t\t"; + protected final String TEXT_87 = " file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);"; + protected final String TEXT_88 = NL + "\t\tif (getEditorInput() instanceof "; + protected final String TEXT_89 = ") {" + NL + "\t\t\t"; + protected final String TEXT_90 = " resource = (("; + protected final String TEXT_91 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}"; + protected final String TEXT_92 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; + protected final String TEXT_93 = " getURIFromInput("; + protected final String TEXT_94 = " input) {"; + protected final String TEXT_95 = NL + "\t\tif (input instanceof "; + protected final String TEXT_96 = ") {" + NL + "\t\t\treturn (("; + protected final String TEXT_97 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof "; + protected final String TEXT_98 = ") {" + NL + "\t\t\treturn "; + protected final String TEXT_99 = ".createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}"; + protected final String TEXT_100 = NL + "\t\tif (input instanceof "; + protected final String TEXT_101 = ") {" + NL + "\t\t\treturn "; + protected final String TEXT_102 = ".createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}"; + protected final String TEXT_103 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected "; + protected final String TEXT_104 = " getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\t"; + protected final String TEXT_105 = " factories = new "; + protected final String TEXT_106 = "();" + NL + "\t\t\tfactories.add(new "; + protected final String TEXT_107 = "());"; + protected final String TEXT_108 = NL + "\t\t\tfactories.add(new "; + protected final String TEXT_109 = "());"; + protected final String TEXT_110 = NL + "\t\t\tfactories.add(new "; + protected final String TEXT_111 = "());" + NL + "\t\t\tfactories.add(new "; + protected final String TEXT_112 = "());" + NL + "\t\t\tdomainAdapterFactory = new "; + protected final String TEXT_113 = "(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load("; + protected final String TEXT_114 = " diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t"; + protected final String TEXT_115 = " editingDomain = getEditingDomain();" + NL + "\t\t"; + protected final String TEXT_116 = " resourceSet = editingDomain.getResourceSet();" + NL + "\t\t"; + protected final String TEXT_117 = " diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = ("; + protected final String TEXT_118 = ") findInResource(diagramResource, "; + protected final String TEXT_119 = ".class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = "; + protected final String TEXT_120 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save("; + protected final String TEXT_121 = ".EMPTY_MAP);" + NL + "\t\t\t} catch ("; + protected final String TEXT_122 = " e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = ("; + protected final String TEXT_123 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {"; + protected final String TEXT_124 = NL + "\t\t\t"; + protected final String TEXT_125 = " modelFile = "; + protected final String TEXT_126 = ".getModelFileURI(diagramFile);" + NL + "\t\t\t"; + protected final String TEXT_127 = " modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}"; + protected final String TEXT_128 = NL + "\t\t\tdiagramRoot = ("; + protected final String TEXT_129 = ") findInResource("; + protected final String TEXT_130 = ", "; + protected final String TEXT_131 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = "; + protected final String TEXT_132 = ".eINSTANCE.create"; + protected final String TEXT_133 = "();" + NL + "\t\t\t\t"; + protected final String TEXT_134 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t"; + protected final String TEXT_135 = ".save("; + protected final String TEXT_136 = ".EMPTY_MAP);" + NL + "\t\t\t\t} catch ("; + protected final String TEXT_137 = " e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement("; + protected final String TEXT_138 = "("; + protected final String TEXT_139 = ") "; + protected final String TEXT_140 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}"; + protected final String TEXT_141 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource("; + protected final String TEXT_142 = " resource, Class expectedClass) {" + NL + "\t\tfor("; + protected final String TEXT_143 = " it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer("; + protected final String TEXT_144 = " parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\t"; + protected final String TEXT_145 = " root = new "; + protected final String TEXT_146 = "();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new "; + protected final String TEXT_147 = "());" + NL + "" + NL + "\t\t"; + protected final String TEXT_148 = " printableLayers = ("; + protected final String TEXT_149 = ") root.getLayer("; + protected final String TEXT_150 = ".PRINTABLE_LAYERS);" + NL + "\t\t"; + protected final String TEXT_151 = " extLabelsLayer = new "; + protected final String TEXT_152 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new "; + protected final String TEXT_153 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, "; + protected final String TEXT_154 = ".EXTERNAL_NODE_LABELS_LAYER, "; + protected final String TEXT_155 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\t"; + protected final String TEXT_156 = " viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\t"; + protected final String TEXT_157 = " provider = new "; + protected final String TEXT_158 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu("; + protected final String TEXT_159 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\t"; + protected final String TEXT_160 = " keyHandler = new "; + protected final String TEXT_161 = "(viewer);" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty("; + protected final String TEXT_162 = ".KeyGenerator.getKey("; + protected final String TEXT_163 = ".CTRL), "; + protected final String TEXT_164 = ".SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class "; + protected final String TEXT_165 = "ContextMenuProvider extends "; + protected final String TEXT_166 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic "; + protected final String TEXT_167 = "ContextMenuProvider("; + protected final String TEXT_168 = " viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t public void buildContextMenu("; + protected final String TEXT_169 = " menuManager) {" + NL + "\t "; + protected final String TEXT_170 = ".addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_171 = ".UNDO.getId(), "; + protected final String TEXT_172 = ".GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_173 = ".REDO.getId(), "; + protected final String TEXT_174 = ".GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_175 = ".COPY.getId(), "; + protected final String TEXT_176 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_177 = ".PASTE.getId(), "; + protected final String TEXT_178 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_179 = ".DELETE.getId(), "; + protected final String TEXT_180 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_181 = ".DIRECT_EDIT, "; + protected final String TEXT_182 = ".GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_183 = ".LAYOUT_ALL_ACTION, "; + protected final String TEXT_184 = ".GROUP_REST);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, "; + protected final String TEXT_185 = ".SAVE.getId(), "; + protected final String TEXT_186 = ".GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu("; + protected final String TEXT_187 = " menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\t"; + protected final String TEXT_188 = " submenu = new "; + protected final String TEXT_189 = "(\"Align\");" + NL + "\t\t\tsubmenu.add(new "; + protected final String TEXT_190 = "("; + protected final String TEXT_191 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_192 = ".ALIGN_LEFT, "; + protected final String TEXT_193 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_194 = ".ALIGN_CENTER, "; + protected final String TEXT_195 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_196 = ".ALIGN_RIGHT, "; + protected final String TEXT_197 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_198 = ".ALIGN_TOP, "; + protected final String TEXT_199 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_200 = ".ALIGN_MIDDLE, "; + protected final String TEXT_201 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, "; + protected final String TEXT_202 = ".ALIGN_BOTTOM, "; + protected final String TEXT_203 = ".MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup("; + protected final String TEXT_204 = ".GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu("; + protected final String TEXT_205 = " menu, String actionId, String menuGroup) {" + NL + "\t\t\t"; + protected final String TEXT_206 = " action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}"; + protected final String TEXT_207 = NL; public String generate(Object argument) { @@ -339,175 +342,177 @@ stringBuffer.append(TEXT_48); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction")); stringBuffer.append(TEXT_49); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.LayoutDiagramAction")); stringBuffer.append(TEXT_50); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")); - stringBuffer.append(TEXT_51); stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(TEXT_51); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")); stringBuffer.append(TEXT_52); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); stringBuffer.append(TEXT_53); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")); stringBuffer.append(TEXT_54); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler")); stringBuffer.append(TEXT_55); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); stringBuffer.append(TEXT_56); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_57); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_58); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke")); stringBuffer.append(TEXT_59); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_60); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_61); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_61); - stringBuffer.append(genEditor.getClassName()); stringBuffer.append(TEXT_62); + stringBuffer.append(genEditor.getClassName()); + stringBuffer.append(TEXT_63); } - stringBuffer.append(TEXT_63); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor")); stringBuffer.append(TEXT_64); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor")); stringBuffer.append(TEXT_65); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.ErrorDialog")); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException")); stringBuffer.append(TEXT_66); - stringBuffer.append(genDiagram.getEditorGen().getDomainGenModel().getModelName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.ErrorDialog")); stringBuffer.append(TEXT_67); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.palette.PaletteRoot")); + stringBuffer.append(genDiagram.getEditorGen().getDomainGenModel().getModelName()); stringBuffer.append(TEXT_68); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.palette.PaletteRoot")); + stringBuffer.append(TEXT_69); { final Palette palette = genDiagram.getPalette(); if (palette != null) { - stringBuffer.append(TEXT_69); - stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); stringBuffer.append(TEXT_70); + stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName())); + stringBuffer.append(TEXT_71); } } - stringBuffer.append(TEXT_71); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); stringBuffer.append(TEXT_72); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); stringBuffer.append(TEXT_73); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorSite")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_74); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorSite")); stringBuffer.append(TEXT_75); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); stringBuffer.append(TEXT_76); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); - stringBuffer.append(TEXT_77); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); + stringBuffer.append(TEXT_77); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_78); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); stringBuffer.append(TEXT_79); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException")); stringBuffer.append(TEXT_80); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(TEXT_81); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_81); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); stringBuffer.append(TEXT_82); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); - stringBuffer.append(TEXT_83); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); + stringBuffer.append(TEXT_83); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_84); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); + stringBuffer.append(TEXT_85); } - stringBuffer.append(TEXT_85); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_86); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(TEXT_87); if (!isRichClientPlatform) { - stringBuffer.append(TEXT_87); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); stringBuffer.append(TEXT_88); - stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); - stringBuffer.append(TEXT_89); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); + stringBuffer.append(TEXT_89); + stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile")); stringBuffer.append(TEXT_90); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); + stringBuffer.append(TEXT_91); } - stringBuffer.append(TEXT_91); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_92); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_93); - if (isRichClientPlatform) { + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput")); stringBuffer.append(TEXT_94); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); + if (isRichClientPlatform) { stringBuffer.append(TEXT_95); stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); stringBuffer.append(TEXT_96); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPathEditorInput")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); stringBuffer.append(TEXT_97); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPathEditorInput")); stringBuffer.append(TEXT_98); - } else { + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_99); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); + } else { stringBuffer.append(TEXT_100); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput")); stringBuffer.append(TEXT_101); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_102); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.AdapterFactory")); + } stringBuffer.append(TEXT_103); - stringBuffer.append(importManager.getImportedName("java.util.List")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.AdapterFactory")); stringBuffer.append(TEXT_104); - stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); + stringBuffer.append(importManager.getImportedName("java.util.List")); stringBuffer.append(TEXT_105); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory")); + stringBuffer.append(importManager.getImportedName("java.util.ArrayList")); stringBuffer.append(TEXT_106); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory")); + stringBuffer.append(TEXT_107); final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true); for (int i = 0; i < genPackages.size(); i++) { GenPackage genPackage = (GenPackage) genPackages.get(i); - stringBuffer.append(TEXT_107); - stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName())); stringBuffer.append(TEXT_108); - } + stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName())); stringBuffer.append(TEXT_109); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory")); + } stringBuffer.append(TEXT_110); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory")); stringBuffer.append(TEXT_111); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory")); stringBuffer.append(TEXT_112); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory")); stringBuffer.append(TEXT_113); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_114); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain")); stringBuffer.append(TEXT_115); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet")); stringBuffer.append(TEXT_116); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); stringBuffer.append(TEXT_117); stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_118); - stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram")); stringBuffer.append(TEXT_119); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory")); stringBuffer.append(TEXT_120); - stringBuffer.append(importManager.getImportedName("java.io.IOException")); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_121); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); + stringBuffer.append(importManager.getImportedName("java.io.IOException")); stringBuffer.append(TEXT_122); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_123); { @@ -516,147 +521,145 @@ String resourceToUse; if (!sameFile) { - stringBuffer.append(TEXT_123); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_124); - stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI")); stringBuffer.append(TEXT_125); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(genDiagram.getDiagramEditorUtilClassName()); stringBuffer.append(TEXT_126); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); + stringBuffer.append(TEXT_127); resourceToUse = "modelResource"; } else { resourceToUse = "diagramResource"; } - stringBuffer.append(TEXT_127); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); stringBuffer.append(TEXT_128); - stringBuffer.append(resourceToUse); - stringBuffer.append(TEXT_129); stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); + stringBuffer.append(TEXT_129); + stringBuffer.append(resourceToUse); stringBuffer.append(TEXT_130); - stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName())); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName())); stringBuffer.append(TEXT_131); - stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName()); + stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName())); stringBuffer.append(TEXT_132); - stringBuffer.append(resourceToUse); + stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName()); stringBuffer.append(TEXT_133); stringBuffer.append(resourceToUse); stringBuffer.append(TEXT_134); - stringBuffer.append(importManager.getImportedName("java.util.Collections")); + stringBuffer.append(resourceToUse); stringBuffer.append(TEXT_135); - stringBuffer.append(importManager.getImportedName("java.io.IOException")); + stringBuffer.append(importManager.getImportedName("java.util.Collections")); stringBuffer.append(TEXT_136); - if (genDiagram.getDomainDiagramElement().isExternalInterface()) { + stringBuffer.append(importManager.getImportedName("java.io.IOException")); stringBuffer.append(TEXT_137); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); + if (genDiagram.getDomainDiagramElement().isExternalInterface()) { stringBuffer.append(TEXT_138); - } + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject")); stringBuffer.append(TEXT_139); + } + stringBuffer.append(TEXT_140); } - stringBuffer.append(TEXT_140); - stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); stringBuffer.append(TEXT_141); - stringBuffer.append(importManager.getImportedName("java.util.Iterator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")); stringBuffer.append(TEXT_142); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); + stringBuffer.append(importManager.getImportedName("java.util.Iterator")); stringBuffer.append(TEXT_143); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite")); stringBuffer.append(TEXT_144); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); stringBuffer.append(TEXT_145); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart")); stringBuffer.append(TEXT_146); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); stringBuffer.append(TEXT_147); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); stringBuffer.append(TEXT_148); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane")); stringBuffer.append(TEXT_149); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); stringBuffer.append(TEXT_150); stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); stringBuffer.append(TEXT_151); - stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer")); stringBuffer.append(TEXT_152); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); + stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout")); stringBuffer.append(TEXT_153); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName())); stringBuffer.append(TEXT_154); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants")); stringBuffer.append(TEXT_155); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer")); stringBuffer.append(TEXT_156); - stringBuffer.append(genEditor.getClassName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); stringBuffer.append(TEXT_157); - stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); + stringBuffer.append(genEditor.getClassName()); stringBuffer.append(TEXT_158); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler")); + stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName())); stringBuffer.append(TEXT_159); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler")); stringBuffer.append(TEXT_160); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelHandler")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler")); stringBuffer.append(TEXT_161); - stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelHandler")); stringBuffer.append(TEXT_162); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelZoomHandler")); + stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT")); stringBuffer.append(TEXT_163); - stringBuffer.append(genEditor.getClassName()); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelZoomHandler")); stringBuffer.append(TEXT_164); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); - stringBuffer.append(TEXT_165); stringBuffer.append(genEditor.getClassName()); + stringBuffer.append(TEXT_165); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider")); stringBuffer.append(TEXT_166); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPartViewer")); + stringBuffer.append(genEditor.getClassName()); stringBuffer.append(TEXT_167); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPartViewer")); stringBuffer.append(TEXT_168); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_169); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); - stringBuffer.append(TEXT_171); + stringBuffer.append(TEXT_170); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_172); + stringBuffer.append(TEXT_171); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); - stringBuffer.append(TEXT_173); + stringBuffer.append(TEXT_172); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_174); + stringBuffer.append(TEXT_173); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); - stringBuffer.append(TEXT_175); + stringBuffer.append(TEXT_174); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_176); + stringBuffer.append(TEXT_175); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); - stringBuffer.append(TEXT_177); + stringBuffer.append(TEXT_176); stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_178); + stringBuffer.append(TEXT_177); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_178); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_179); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_180); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_181); - stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); - stringBuffer.append(TEXT_182); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(TEXT_182); + stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.ActionIds")); stringBuffer.append(TEXT_183); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_184); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")); stringBuffer.append(TEXT_185); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_186); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); stringBuffer.append(TEXT_187); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_188); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager")); stringBuffer.append(TEXT_189); - stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator")); stringBuffer.append(TEXT_190); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_191); @@ -680,12 +683,18 @@ stringBuffer.append(TEXT_200); stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_201); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_202); - stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_203); - importManager.emitSortedImports(); + stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")); stringBuffer.append(TEXT_204); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager")); + stringBuffer.append(TEXT_205); + stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction")); + stringBuffer.append(TEXT_206); + importManager.emitSortedImports(); + stringBuffer.append(TEXT_207); return stringBuffer.toString(); } } #P org.eclipse.gmf.runtime.lite Index: META-INF/MANIFEST.MF =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.lite/META-INF/MANIFEST.MF,v retrieving revision 1.3 diff -u -r1.3 MANIFEST.MF --- META-INF/MANIFEST.MF 11 Sep 2006 15:45:03 -0000 1.3 +++ META-INF/MANIFEST.MF 29 Sep 2006 14:19:25 -0000 @@ -26,4 +26,5 @@ org.eclipse.gmf.runtime.lite.parts, org.eclipse.gmf.runtime.lite.properties, org.eclipse.gmf.runtime.lite.requests, - org.eclipse.gmf.runtime.lite.services + org.eclipse.gmf.runtime.lite.services, + org.eclipse.gmf.runtime.lite.ui.actions Index: src/org/eclipse/gmf/runtime/lite/parts/DiagramEditor.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/parts/DiagramEditor.java,v retrieving revision 1.2 diff -u -r1.2 DiagramEditor.java --- src/org/eclipse/gmf/runtime/lite/parts/DiagramEditor.java 11 Sep 2006 15:45:03 -0000 1.2 +++ src/org/eclipse/gmf/runtime/lite/parts/DiagramEditor.java 29 Sep 2006 14:19:25 -0000 @@ -51,6 +51,8 @@ import org.eclipse.gmf.runtime.lite.edit.parts.tree.DiagramTreeEditPartFactory; import org.eclipse.gmf.runtime.lite.properties.PropertySourceProvider; import org.eclipse.gmf.runtime.lite.properties.UndoablePropertySheetEntry; +import org.eclipse.gmf.runtime.lite.services.DefaultDiagramLayouter; +import org.eclipse.gmf.runtime.lite.services.IDiagramLayouter; import org.eclipse.jface.action.IAction; import org.eclipse.jface.viewers.ISelection; import org.eclipse.swt.SWT; @@ -238,10 +240,16 @@ return getOutlinePage(); } else if (type == ZoomManager.class) { return getZoomManager(); + } else if (type == IDiagramLayouter.class) { + return getDiagramLayouter(); } return super.getAdapter(type); } + protected IDiagramLayouter getDiagramLayouter() { + return new DefaultDiagramLayouter(); + } + protected ZoomManager getZoomManager() { return getZoomManager(getGraphicalViewer()); } @@ -342,5 +350,4 @@ // initialize actions createActions(); } - } Index: src/org/eclipse/gmf/runtime/lite/edit/policies/BendpointEditPolicy.java =================================================================== RCS file: /cvsroot/technology/org.eclipse.gmf/plugins/org.eclipse.gmf.runtime.lite/src/org/eclipse/gmf/runtime/lite/edit/policies/BendpointEditPolicy.java,v retrieving revision 1.1 diff -u -r1.1 BendpointEditPolicy.java --- src/org/eclipse/gmf/runtime/lite/edit/policies/BendpointEditPolicy.java 1 Sep 2006 16:14:11 -0000 1.1 +++ src/org/eclipse/gmf/runtime/lite/edit/policies/BendpointEditPolicy.java 29 Sep 2006 14:19:25 -0000 @@ -17,12 +17,16 @@ import org.eclipse.draw2d.Connection; import org.eclipse.draw2d.geometry.Dimension; import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.PointList; import org.eclipse.emf.common.command.AbstractCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gef.Request; import org.eclipse.gef.commands.Command; import org.eclipse.gef.requests.BendpointRequest; import org.eclipse.gmf.runtime.lite.commands.WrappingCommand; +import org.eclipse.gmf.runtime.lite.requests.RequestConstants; +import org.eclipse.gmf.runtime.lite.requests.SetAllBendpointsRequest; import org.eclipse.gmf.runtime.notation.Edge; import org.eclipse.gmf.runtime.notation.NotationFactory; import org.eclipse.gmf.runtime.notation.RelativeBendpoints; @@ -34,6 +38,18 @@ return (Edge) getHost().getModel(); } + @Override + public Command getCommand(Request request) { + if (RequestConstants.REQ_SET_ALL_BENDPOINTS.equals(request.getType())) { + return getSetAllBendpointsCommand((SetAllBendpointsRequest) request); + } + return super.getCommand(request); + } + + protected Command getSetAllBendpointsCommand(SetAllBendpointsRequest request) { + return getModifyBendpointCommand(new BendpointSetter(request.getPoints())); + } + protected Command getCreateBendpointCommand(BendpointRequest request) { return getModifyBendpointCommand(new BendpointCreator(request.getIndex(), request.getLocation())); } @@ -145,4 +161,19 @@ originalBendpoints.add(index, converter.convert(point)); } } + + private static class BendpointSetter implements BendpointModifier { + private PointList myPoints; + + public BendpointSetter(PointList points) { + myPoints = points; + } + + public void applyModification(List originalBendpoints, BendpointConverter converter) { + originalBendpoints.clear(); + for(int i = 0, iMax = myPoints.size(); i < iMax; i++) { + originalBendpoints.add(converter.convert(myPoints.getPoint(i))); + } + } + } } Index: src/org/eclipse/gmf/runtime/lite/requests/RequestConstants.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/requests/RequestConstants.java diff -N src/org/eclipse/gmf/runtime/lite/requests/RequestConstants.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/requests/RequestConstants.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,5 @@ +package org.eclipse.gmf.runtime.lite.requests; + +public interface RequestConstants extends org.eclipse.gef.RequestConstants { + public static final String REQ_SET_ALL_BENDPOINTS = "set_all_bendpoints"; //$NON-NLS-1$ +} Index: src/org/eclipse/gmf/runtime/lite/requests/SetAllBendpointsRequest.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/requests/SetAllBendpointsRequest.java diff -N src/org/eclipse/gmf/runtime/lite/requests/SetAllBendpointsRequest.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/requests/SetAllBendpointsRequest.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,34 @@ +package org.eclipse.gmf.runtime.lite.requests; + +import org.eclipse.draw2d.geometry.PointList; +import org.eclipse.gef.ConnectionEditPart; +import org.eclipse.gef.Request; + +public class SetAllBendpointsRequest extends Request { + private ConnectionEditPart myConnectionEditPart; + private PointList myPoints; + + public SetAllBendpointsRequest() { + super(RequestConstants.REQ_SET_ALL_BENDPOINTS); + } + + public SetAllBendpointsRequest(String type) { + super(type); + } + + public PointList getPoints() { + return myPoints; + } + + public void setPoints(PointList points) { + myPoints = points; + } + + public ConnectionEditPart getConnectionEditPart() { + return myConnectionEditPart; + } + + public void setConnectionEditPart(ConnectionEditPart connectionEditPart) { + myConnectionEditPart = connectionEditPart; + } +} Index: src/org/eclipse/gmf/runtime/lite/ui/actions/ActionIds.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/ui/actions/ActionIds.java diff -N src/org/eclipse/gmf/runtime/lite/ui/actions/ActionIds.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/ui/actions/ActionIds.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2006 Eclipse.org + * + * 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.runtime.lite.ui.actions; + +/** + * Declares Action IDs used within the lite runtime. + */ +public interface ActionIds { + public static final String LAYOUT_ALL_ACTION = "layout_all"; //$NON-NLS-1$ +} Index: src/org/eclipse/gmf/runtime/lite/services/DefaultDiagramLayouter.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/services/DefaultDiagramLayouter.java diff -N src/org/eclipse/gmf/runtime/lite/services/DefaultDiagramLayouter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/services/DefaultDiagramLayouter.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,289 @@ +/** + * Copyright (c) 2006 Eclipse.org + * + * 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.runtime.lite.services; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import org.eclipse.draw2d.geometry.Dimension; +import org.eclipse.draw2d.geometry.Point; +import org.eclipse.draw2d.geometry.PointList; +import org.eclipse.draw2d.geometry.Rectangle; +import org.eclipse.draw2d.graph.CompoundDirectedGraph; +import org.eclipse.draw2d.graph.CompoundDirectedGraphLayout; +import org.eclipse.draw2d.graph.EdgeList; +import org.eclipse.draw2d.graph.NodeList; +import org.eclipse.draw2d.graph.Subgraph; +import org.eclipse.emf.common.command.AbstractCommand; +import org.eclipse.emf.common.command.Command; +import org.eclipse.gef.ConnectionEditPart; +import org.eclipse.gef.EditPart; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.RequestConstants; +import org.eclipse.gef.commands.CompoundCommand; +import org.eclipse.gef.requests.ChangeBoundsRequest; +import org.eclipse.gmf.runtime.lite.requests.SetAllBendpointsRequest; +import org.eclipse.gmf.runtime.notation.Bounds; +import org.eclipse.gmf.runtime.notation.Diagram; +import org.eclipse.gmf.runtime.notation.Edge; +import org.eclipse.gmf.runtime.notation.Node; +import org.eclipse.gmf.runtime.notation.View; + +/** + * Default implementation of IDiagramLayouter that delegates to {@link org.eclipse.draw2d.graph.CompoundDirectedGraphLayout}. + */ +public class DefaultDiagramLayouter implements IDiagramLayouter { + public Command layout(GraphicalEditPart container) { + CompoundDirectedGraph graph = new CompoundDirectedGraph(); + HashMap views2Nodes = buildGraph(container, graph); + CompoundDirectedGraphLayout layout = new CompoundDirectedGraphLayout(); + layout.visit(graph); + return createLayoutCommand(container, views2Nodes, graph); + } + + public Command layout(GraphicalEditPart container, List selectedElements) { + //XXX: Currently, selectedElements argument is ignored. + return layout(container); + } + + protected HashMap buildGraph(GraphicalEditPart container, CompoundDirectedGraph graph) { + HashMap views2Nodes = new HashMap(); + traverseChildren(container, new SubGraphBuilder(null, graph, views2Nodes)); + Diagram diagram = ((View) container.getModel()).getDiagram(); + for(Iterator it = diagram.getEdges().iterator(); it.hasNext(); ) { + Edge nextEdge = (Edge) it.next(); + ConnectionEditPart nextEdgeEP = (ConnectionEditPart) container.getViewer().getEditPartRegistry().get(nextEdge); + EditPart source = nextEdgeEP.getSource(); + EditPart target = nextEdgeEP.getTarget(); + org.eclipse.draw2d.graph.Node sourceNode = views2Nodes.get(source); + org.eclipse.draw2d.graph.Node targetNode = views2Nodes.get(target); + if (sourceNode == null || targetNode == null) { + continue; + } + org.eclipse.draw2d.graph.Edge edge = createEdge(nextEdgeEP, sourceNode, targetNode); + if (edge != null) { + graph.edges.add(edge); + } + } + return views2Nodes; + } + + protected static interface Traverser { + public void acceptChild(GraphicalEditPart childEditPart); + public void childrenTraversed(GraphicalEditPart parentEditPart); + } + + protected void traverseChildren(GraphicalEditPart container, Traverser traverser) { + View view = (View) container.getModel(); + for(Iterator it = view.getChildren().iterator(); it.hasNext(); ) { + View nextChild = (View) it.next(); + GraphicalEditPart nextChildEP = (GraphicalEditPart) container.getViewer().getEditPartRegistry().get(nextChild); + if (nextChildEP == null) { + continue; + } + traverser.acceptChild(nextChildEP); + } + traverser.childrenTraversed(container); + } + + protected class SubGraphBuilder implements Traverser { + private final Subgraph myParent; + private final CompoundDirectedGraph myGraph; + private final HashMap myViews2Nodes; + + public SubGraphBuilder(Subgraph parent, CompoundDirectedGraph graph, HashMap views2Nodes) { + myParent = parent; + myGraph = graph; + myViews2Nodes = views2Nodes; + } + + public void acceptChild(GraphicalEditPart childEditPart) { + org.eclipse.draw2d.graph.Node node = createNode(myParent, childEditPart); + if (node != null) { + setNodePosition(node); + myGraph.nodes.add(node); + myViews2Nodes.put(childEditPart, node); + if (node instanceof org.eclipse.draw2d.graph.Subgraph) { + traverseChildren(childEditPart, new SubGraphBuilder((org.eclipse.draw2d.graph.Subgraph) node, myGraph, myViews2Nodes)); + } + } + } + + public void childrenTraversed(GraphicalEditPart parentEditPart) { + } + } + + protected org.eclipse.draw2d.graph.Edge createEdge(ConnectionEditPart next, org.eclipse.draw2d.graph.Node sourceNode, org.eclipse.draw2d.graph.Node targetNode) { + return new org.eclipse.draw2d.graph.Edge(next, sourceNode, targetNode); + } + + protected org.eclipse.draw2d.graph.Node createNode(org.eclipse.draw2d.graph.Subgraph parent, GraphicalEditPart next) { + if (next.getChildren().isEmpty()) { + return new org.eclipse.draw2d.graph.Node(next, parent); + } + return new org.eclipse.draw2d.graph.Subgraph(next, parent); + } + + protected void setNodePosition(org.eclipse.draw2d.graph.Node node) { + GraphicalEditPart editPart = (GraphicalEditPart) node.data; + Node notationalNode = (Node) editPart.getModel(); + if (notationalNode.getLayoutConstraint() instanceof Bounds) { + Rectangle bounds = editPart.getFigure().getBounds().getCopy(); + editPart.getFigure().translateToAbsolute(bounds); + node.x = bounds.x; + node.y = bounds.y; + node.width = bounds.width; + node.height = bounds.height; + } + } + + protected Rectangle getNodePosition(org.eclipse.draw2d.graph.Node node) { + Rectangle rect = new Rectangle(node.x, node.y, node.width, node.height); + return rect; + } + + protected Command createLayoutCommand(final GraphicalEditPart container, final HashMap views2Nodes, final CompoundDirectedGraph graph) { + return new AbstractCommand() { + /** + * Cache of the executed commands for undo-redo functionality. + */ + private CompoundCommand layoutCommand; + public void redo() { + layoutCommand.execute(); + } + public void execute() { + layoutCommand = new CompoundCommand(); + traverseChildren(container, new ChildrenLayouter(views2Nodes, layoutCommand)); + createLayoutEdgesCommand(graph.edges, layoutCommand); + } + @Override + protected boolean prepare() { + return true; + } + @Override + public boolean canUndo() { + return layoutCommand.canUndo(); + } + @Override + public void undo() { + layoutCommand.undo(); + } + }; + } + + protected class ChildrenLayouter implements Traverser { + private final CompoundCommand myCommand; + private final HashMap myViews2Nodes; + + public ChildrenLayouter(HashMap views2Nodes, CompoundCommand command) { + myViews2Nodes = views2Nodes; + myCommand = command; + } + + public void acceptChild(GraphicalEditPart childEditPart) { + org.eclipse.draw2d.graph.Node node = myViews2Nodes.get(childEditPart); + if (node == null) { + return; + } + ChangeBoundsRequest request = new ChangeBoundsRequest(RequestConstants.REQ_MOVE); + Rectangle bounds = getNodePosition(node); + Point ptLocation = new Point(bounds.x, bounds.y); + Rectangle oldBounds = childEditPart.getFigure().getBounds(); + childEditPart.getFigure().translateToAbsolute(oldBounds); + Point oldLocation = oldBounds.getLocation(); + Dimension delta = ptLocation.getDifference(oldLocation); + request.setEditParts(childEditPart); + request.setMoveDelta(new Point(delta.width, delta.height)); + request.setSizeDelta(bounds.getSize().getDifference(oldBounds.getSize())); + request.setLocation(ptLocation); + org.eclipse.gef.commands.Command cmd = childEditPart.getCommand(request); + if (cmd != null && cmd.canExecute()) { + cmd.execute(); + myCommand.add(cmd); + } + } + + public void childrenTraversed(GraphicalEditPart parentEditPart) { + parentEditPart.getFigure().invalidateTree(); + parentEditPart.getFigure().validate(); + traverseChildren(parentEditPart, new Traverser() { + public void acceptChild(GraphicalEditPart childEditPart) { + traverseChildren(childEditPart, ChildrenLayouter.this); + } + public void childrenTraversed(GraphicalEditPart parentEditPart) { + } + }); + } + } + + protected void createLayoutEdgesCommand(EdgeList edges, CompoundCommand command) { + for(Iterator it = edges.iterator(); it.hasNext(); ) { + org.eclipse.draw2d.graph.Edge next = (org.eclipse.draw2d.graph.Edge) it.next(); + if (next.data instanceof ConnectionEditPart == false) { + continue; + } + ConnectionEditPart connection = (ConnectionEditPart) next.data; + PointList points = getPoints(next); + SetAllBendpointsRequest request = new SetAllBendpointsRequest(); + request.setConnectionEditPart(connection); + request.setPoints(points); + org.eclipse.gef.commands.Command cmd = connection.getCommand(request); + if (cmd != null && cmd.canExecute()) { + cmd.execute(); + command.add(cmd); + } + } + } + + private PointList getPoints(org.eclipse.draw2d.graph.Edge edge) { + PointList result = new PointList(); + result.addPoint(((GraphicalEditPart) ((ConnectionEditPart) edge.data).getSource()).getFigure().getBounds().getCenter()); + NodeList vnodes = edge.vNodes; + if (vnodes != null) { + for (int i = 0; i < vnodes.size(); i++) { + org.eclipse.draw2d.graph.Node vn = vnodes.getNode(i); + Rectangle nextPosition = getNodePosition(vn); + result.addPoint(nextPosition.getCenter()); + } + } + result.addPoint(((GraphicalEditPart) ((ConnectionEditPart) edge.data).getTarget()).getFigure().getBounds().getCenter()); + straightenPoints(result); + result.removePoint(0); + result.removePoint(result.size() - 1); + return result; + } + + private void straightenPoints(PointList points) { + double flatnessTolerance = Math.cos(Math.PI/360); //angles that are almost flat are treated as flat + removeFlatAngles(points, flatnessTolerance); + } + + private void removeFlatAngles(PointList points, double flatnessTolerance) { + for(int i = 0; i < points.size() - 2 && points.size() > 3; i++) { + while (i < points.size() - 2 && points.size() > 3 && cos(points.getPoint(i), points.getPoint(i+1), points.getPoint(i+2)) > flatnessTolerance) { + points.removePoint(i+1); + } + } + } + + /** + * Returns the cosine of the angle abc. + * @return + */ + private double cos(Point a, Point b, Point c) { + double ab2 = b.getDistance2(a); + double ac2 = c.getDistance2(a); + double bc2 = b.getDistance2(c); + return (ab2 + ac2 - bc2) / (2 * Math.sqrt(ab2 * ac2)); + } +} Index: src/org/eclipse/gmf/runtime/lite/ui/actions/LayoutDiagramAction.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/ui/actions/LayoutDiagramAction.java diff -N src/org/eclipse/gmf/runtime/lite/ui/actions/LayoutDiagramAction.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/ui/actions/LayoutDiagramAction.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2006 Eclipse.org + * + * 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.runtime.lite.ui.actions; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.transaction.TransactionalEditingDomain; +import org.eclipse.emf.transaction.util.TransactionUtil; +import org.eclipse.gef.GraphicalEditPart; +import org.eclipse.gef.GraphicalViewer; +import org.eclipse.gef.ui.actions.WorkbenchPartAction; +import org.eclipse.gmf.runtime.lite.commands.WrappingCommand; +import org.eclipse.gmf.runtime.lite.services.IDiagramLayouter; +import org.eclipse.ui.IWorkbenchPart; + + +public class LayoutDiagramAction extends WorkbenchPartAction { + public LayoutDiagramAction(IWorkbenchPart part) { + super(part); + } + + @Override + protected void init() { + super.init(); + setId(ActionIds.LAYOUT_ALL_ACTION); + setText("&Layout all"); + setToolTipText("Layouts the diagram"); + } + + @Override + protected boolean calculateEnabled() { + return getWorkbenchPart().getAdapter(IDiagramLayouter.class) != null && getWorkbenchPart().getAdapter(GraphicalViewer.class) != null; + } + + @Override + public void run() { + GraphicalViewer viewer = (GraphicalViewer) getWorkbenchPart().getAdapter(GraphicalViewer.class); + IDiagramLayouter layouter = (IDiagramLayouter) getWorkbenchPart().getAdapter(IDiagramLayouter.class); + Command layoutCommand = layouter.layout((GraphicalEditPart) viewer.getContents()); + if (layoutCommand != null && layoutCommand.canExecute()) { + TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(viewer.getContents().getModel()); + new WrappingCommand(editingDomain, layoutCommand).execute(); + } + } +} Index: src/org/eclipse/gmf/runtime/lite/services/IDiagramLayouter.java =================================================================== RCS file: src/org/eclipse/gmf/runtime/lite/services/IDiagramLayouter.java diff -N src/org/eclipse/gmf/runtime/lite/services/IDiagramLayouter.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/gmf/runtime/lite/services/IDiagramLayouter.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2006 Eclipse.org + * + * 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.runtime.lite.services; + +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.gef.GraphicalEditPart; + +public interface IDiagramLayouter { + public Command layout(GraphicalEditPart container); + public Command layout(GraphicalEditPart container, List selectedElements); +}