Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbblajer2007-04-10 14:40:10 +0000
committerbblajer2007-04-10 14:40:10 +0000
commit85be5e1aaf2011574ef8d770b4a73a89694df0b3 (patch)
tree126d0b67cc52d00599b34f236a1542c585ef3e5c
parentaf164483efdf16a80016240e397d8045ec3f6b4b (diff)
downloadorg.eclipse.gmf-tooling-85be5e1aaf2011574ef8d770b4a73a89694df0b3.tar.gz
org.eclipse.gmf-tooling-85be5e1aaf2011574ef8d770b4a73a89694df0b3.tar.xz
org.eclipse.gmf-tooling-85be5e1aaf2011574ef8d770b4a73a89694df0b3.zip
[179970] - Adopt code generater to make use of EMF "conditional resource saving";
Correctly set charset for IFiles
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java296
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java682
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/policies/OpenDiagramPolicyGenerator.java6
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet21
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet11
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet1
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/policies/OpenDiagramEditPolicy.javajet4
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt34
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/Editor.xpt14
10 files changed, 572 insertions, 499 deletions
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java
index e01de4188..556b49a84 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java
@@ -88,73 +88,80 @@ public class CreationWizardPageGenerator
protected final String TEXT_69 = " diagramResource = resourceSet.createResource(getDiagramFileURI());";
protected final String TEXT_70 = NL + "\t\tIPath diagramFilePath = getContainerFullPath().append(getFileName());" + NL + "\t\tif (diagramFilePath.getFileExtension() == null) {" + NL + "\t\t\tdiagramFilePath = diagramFilePath.addFileExtension(\"";
protected final String TEXT_71 = "\");\t\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\tfinal IFile diagramFile = ResourcesPlugin.getWorkspace().getRoot().getFile(diagramFilePath);" + NL + "\t\tfinal ";
- protected final String TEXT_72 = " diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFilePath.toString(), true));";
- protected final String TEXT_73 = NL + "\t\tfinal Resource modelResource = resourceSet.createResource(getModelFileURI());";
- protected final String TEXT_74 = NL + "\t\tIPath modelFilePath = diagramFilePath.removeFileExtension().addFileExtension(\"";
- protected final String TEXT_75 = "\"); //$NON-NLS-1$" + NL + "\t\tfinal Resource modelResource = resourceSet.createResource(URI.createPlatformResourceURI(modelFilePath.toString(), true));";
- protected final String TEXT_76 = NL + NL + "\t\tif (diagramResource != null";
- protected final String TEXT_77 = " && modelResource != null";
- protected final String TEXT_78 = ") {" + NL + "\t\t\t";
- protected final String TEXT_79 = " saveOperation = new ";
- protected final String TEXT_80 = "(editingDomain, \"Create diagram\") {" + NL + "\t\t\t\tpublic ";
- protected final String TEXT_81 = " doExecute(";
- protected final String TEXT_82 = " monitor, ";
- protected final String TEXT_83 = " info) throws ";
- protected final String TEXT_84 = " {";
- protected final String TEXT_85 = NL + "\t\t\t\t\t";
- protected final String TEXT_86 = " model = ";
- protected final String TEXT_87 = ".eINSTANCE.create";
- protected final String TEXT_88 = "();";
- protected final String TEXT_89 = NL + "\t\t\t\t\tmodelResource.getContents().add(createInitialRoot(model));";
- protected final String TEXT_90 = NL + "\t\t\t\t\tmodelResource.getContents().add(";
- protected final String TEXT_91 = "(";
- protected final String TEXT_92 = ") ";
- protected final String TEXT_93 = "model);";
- protected final String TEXT_94 = NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tmodelResource.save(";
- protected final String TEXT_95 = ".EMPTY_MAP);" + NL + "\t\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\t\thandleSaveException(e);" + NL + "\t\t\t\t\t}";
- protected final String TEXT_96 = NL + "\t\t\t\t\tdiagramResource.getContents().add(";
- protected final String TEXT_97 = "(";
- protected final String TEXT_98 = ") ";
- protected final String TEXT_99 = "model);";
- protected final String TEXT_100 = NL + "\t\t\t\t\t";
- protected final String TEXT_101 = " diagram = ";
- protected final String TEXT_102 = ".eINSTANCE.createDiagram();" + NL + "\t\t\t\t\tdiagram.setElement(";
- protected final String TEXT_103 = "(";
- protected final String TEXT_104 = ") ";
- protected final String TEXT_105 = "model);" + NL + "\t\t\t\t\t";
- protected final String TEXT_106 = ".INSTANCE.decorateView(diagram);" + NL + "\t\t\t\t\tdiagramResource.getContents().add(diagram);" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tdiagramResource.save(";
- protected final String TEXT_107 = ".EMPTY_MAP);" + NL + "\t\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\t\thandleSaveException(e);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn ";
- protected final String TEXT_108 = ".OK_STATUS;" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\ttry {" + NL + "\t\t\t\tsaveOperation.execute(new ";
- protected final String TEXT_109 = "(), null);" + NL + "\t\t\t} catch (";
- protected final String TEXT_110 = " e) {" + NL + "\t\t\t\t";
- protected final String TEXT_111 = ".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_112 = NL + "\t\tboolean result = ";
- protected final String TEXT_113 = ".openEditor(getDiagramFileURI()) != null;";
- protected final String TEXT_114 = NL + "\t\tboolean result = ";
- protected final String TEXT_115 = ".showView(getDiagramFileURI()) != null;";
- protected final String TEXT_116 = NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();";
- protected final String TEXT_117 = NL + "\t\ttry {" + NL + "\t\t\t";
- protected final String TEXT_118 = ".openEditor(";
- protected final String TEXT_119 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch (";
- protected final String TEXT_120 = " e) {" + NL + "\t\t\t";
- protected final String TEXT_121 = ".getInstance().getLog().log(e.getStatus());" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;";
- protected final String TEXT_122 = NL + "\t\t";
- protected final String TEXT_123 = " diagramFileURI = diagramResource.getURI();" + NL + "\t\tboolean result = ";
- protected final String TEXT_124 = ".showView(diagramFileURI) != null;" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;";
- protected final String TEXT_125 = NL + "\t}" + NL;
- protected final String TEXT_126 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static ";
- protected final String TEXT_127 = " createInitialRoot(";
- protected final String TEXT_128 = " model) {";
+ protected final String TEXT_72 = " diagramResource = resourceSet.createResource(";
+ protected final String TEXT_73 = ".createPlatformResourceURI(diagramFilePath.toString(), true));";
+ protected final String TEXT_74 = NL + "\t\tfinal Resource modelResource = resourceSet.createResource(getModelFileURI());";
+ protected final String TEXT_75 = NL + "\t\tIPath modelFilePath = diagramFilePath.removeFileExtension().addFileExtension(\"";
+ protected final String TEXT_76 = "\"); //$NON-NLS-1$" + NL + "\t\tfinal IFile modelFile = ResourcesPlugin.getWorkspace().getRoot().getFile(modelFilePath);" + NL + "\t\tfinal Resource modelResource = resourceSet.createResource(";
+ protected final String TEXT_77 = ".createPlatformResourceURI(modelFilePath.toString(), true));";
+ protected final String TEXT_78 = NL + NL + "\t\tif (diagramResource != null";
+ protected final String TEXT_79 = " && modelResource != null";
+ protected final String TEXT_80 = ") {" + NL + "\t\t\t";
+ protected final String TEXT_81 = " saveOperation = new ";
+ protected final String TEXT_82 = "(editingDomain, \"Create diagram\") {" + NL + "\t\t\t\tpublic ";
+ protected final String TEXT_83 = " doExecute(";
+ protected final String TEXT_84 = " monitor, ";
+ protected final String TEXT_85 = " info) throws ";
+ protected final String TEXT_86 = " {";
+ protected final String TEXT_87 = NL + "\t\t\t\t\t";
+ protected final String TEXT_88 = " model = ";
+ protected final String TEXT_89 = ".eINSTANCE.create";
+ protected final String TEXT_90 = "();";
+ protected final String TEXT_91 = NL + "\t\t\t\t\tmodelResource.getContents().add(createInitialRoot(model));";
+ protected final String TEXT_92 = NL + "\t\t\t\t\tmodelResource.getContents().add(";
+ protected final String TEXT_93 = "(";
+ protected final String TEXT_94 = ") ";
+ protected final String TEXT_95 = "model);";
+ protected final String TEXT_96 = NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tmodelResource.save(";
+ protected final String TEXT_97 = ".getSaveOptions());" + NL + "\t\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\t\thandleSaveException(e);" + NL + "\t\t\t\t\t}";
+ protected final String TEXT_98 = NL + "\t\t\t\t\tdiagramResource.getContents().add(";
+ protected final String TEXT_99 = "(";
+ protected final String TEXT_100 = ") ";
+ protected final String TEXT_101 = "model);";
+ protected final String TEXT_102 = NL + "\t\t\t\t\t";
+ protected final String TEXT_103 = " diagram = ";
+ protected final String TEXT_104 = ".eINSTANCE.createDiagram();" + NL + "\t\t\t\t\tdiagram.setElement(";
+ protected final String TEXT_105 = "(";
+ protected final String TEXT_106 = ") ";
+ protected final String TEXT_107 = "model);" + NL + "\t\t\t\t\t";
+ protected final String TEXT_108 = ".INSTANCE.decorateView(diagram);" + NL + "\t\t\t\t\tdiagramResource.getContents().add(diagram);" + NL + "\t\t\t\t\ttry {" + NL + "\t\t\t\t\t\tdiagramResource.save(";
+ protected final String TEXT_109 = ".getSaveOptions());" + NL + "\t\t\t\t\t} catch (IOException e) {" + NL + "\t\t\t\t\t\thandleSaveException(e);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\treturn ";
+ protected final String TEXT_110 = ".OK_STATUS;" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "\t\t\ttry {" + NL + "\t\t\t\tsaveOperation.execute(new ";
+ protected final String TEXT_111 = "(), null);" + NL + "\t\t\t} catch (";
+ protected final String TEXT_112 = " e) {" + NL + "\t\t\t\t";
+ protected final String TEXT_113 = ".getInstance().logError(\"exception occurred while creating the diagram\", e);" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
+ protected final String TEXT_114 = NL + "\t\t\t";
+ protected final String TEXT_115 = ".setCharset(diagramFile);";
+ protected final String TEXT_116 = NL + "\t\t\t";
+ protected final String TEXT_117 = ".setCharset(modelFile);";
+ protected final String TEXT_118 = NL + "\t\t}";
+ protected final String TEXT_119 = NL + "\t\tboolean result = ";
+ protected final String TEXT_120 = ".openEditor(getDiagramFileURI()) != null;";
+ protected final String TEXT_121 = NL + "\t\tboolean result = ";
+ protected final String TEXT_122 = ".showView(getDiagramFileURI()) != null;";
+ protected final String TEXT_123 = NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();";
+ protected final String TEXT_124 = NL + "\t\ttry {" + NL + "\t\t\t";
+ protected final String TEXT_125 = ".openEditor(";
+ protected final String TEXT_126 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch (";
+ protected final String TEXT_127 = " e) {" + NL + "\t\t\t";
+ protected final String TEXT_128 = ".getInstance().getLog().log(e.getStatus());" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;";
protected final String TEXT_129 = NL + "\t\t";
- protected final String TEXT_130 = " docRoot = ";
- protected final String TEXT_131 = ".";
- protected final String TEXT_132 = ".create";
- protected final String TEXT_133 = "();" + NL + "\t\tdocRoot.set";
- protected final String TEXT_134 = "(model);" + NL + "\t\treturn docRoot;" + NL + "\t}" + NL;
- protected final String TEXT_135 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void handleSaveException(IOException e) throws ";
- protected final String TEXT_136 = " {" + NL + "\t\tthrow new ";
- protected final String TEXT_137 = "(\"Save failed\", e);" + NL + "\t}" + NL + "}";
- protected final String TEXT_138 = NL;
+ protected final String TEXT_130 = " diagramFileURI = diagramResource.getURI();" + NL + "\t\tboolean result = ";
+ protected final String TEXT_131 = ".showView(diagramFileURI) != null;" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFile;";
+ protected final String TEXT_132 = NL + "\t}" + NL;
+ protected final String TEXT_133 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static ";
+ protected final String TEXT_134 = " createInitialRoot(";
+ protected final String TEXT_135 = " model) {";
+ protected final String TEXT_136 = NL + "\t\t";
+ protected final String TEXT_137 = " docRoot = ";
+ protected final String TEXT_138 = ".";
+ protected final String TEXT_139 = ".create";
+ protected final String TEXT_140 = "();" + NL + "\t\tdocRoot.set";
+ protected final String TEXT_141 = "(model);" + NL + "\t\treturn docRoot;" + NL + "\t}" + NL;
+ protected final String TEXT_142 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void handleSaveException(IOException e) throws ";
+ protected final String TEXT_143 = " {" + NL + "\t\tthrow new ";
+ protected final String TEXT_144 = "(\"Save failed\", e);" + NL + "\t}" + NL + "}";
+ protected final String TEXT_145 = NL;
public String generate(Object argument)
{
@@ -388,6 +395,8 @@ if (isRichClientPlatform) {
stringBuffer.append(TEXT_71);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
stringBuffer.append(TEXT_72);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(TEXT_73);
}
@@ -396,159 +405,178 @@ final boolean standaloneDomainModel = !editorGen.isSameFileForDiagramAndModel()
if (standaloneDomainModel) {
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_73);
+ stringBuffer.append(TEXT_74);
} else {
- stringBuffer.append(TEXT_74);
- stringBuffer.append(editorGen.getDomainFileExtension());
stringBuffer.append(TEXT_75);
+ stringBuffer.append(editorGen.getDomainFileExtension());
+ stringBuffer.append(TEXT_76);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(TEXT_77);
}
}
- stringBuffer.append(TEXT_76);
+ stringBuffer.append(TEXT_78);
if (standaloneDomainModel) {
- stringBuffer.append(TEXT_77);
+ stringBuffer.append(TEXT_79);
}
- stringBuffer.append(TEXT_78);
+ stringBuffer.append(TEXT_80);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.workspace.AbstractEMFOperation"));
- stringBuffer.append(TEXT_79);
+ stringBuffer.append(TEXT_81);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.workspace.AbstractEMFOperation"));
- stringBuffer.append(TEXT_80);
+ stringBuffer.append(TEXT_82);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IStatus"));
- stringBuffer.append(TEXT_81);
+ stringBuffer.append(TEXT_83);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor"));
- stringBuffer.append(TEXT_82);
+ stringBuffer.append(TEXT_84);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IAdaptable"));
- stringBuffer.append(TEXT_83);
+ stringBuffer.append(TEXT_85);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.commands.ExecutionException"));
- stringBuffer.append(TEXT_84);
+ stringBuffer.append(TEXT_86);
if (genDiagram.getDomainDiagramElement() != null) {
- stringBuffer.append(TEXT_85);
+ stringBuffer.append(TEXT_87);
stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_86);
+ stringBuffer.append(TEXT_88);
stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryInterfaceName()));
- stringBuffer.append(TEXT_87);
+ stringBuffer.append(TEXT_89);
stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName());
- stringBuffer.append(TEXT_88);
+ stringBuffer.append(TEXT_90);
if (standaloneDomainModel) {
if (genDiagram.getDomainDiagramElement().getGenPackage().hasDocumentRoot()) {
- stringBuffer.append(TEXT_89);
+ stringBuffer.append(TEXT_91);
} else {
- stringBuffer.append(TEXT_90);
+ stringBuffer.append(TEXT_92);
if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
- stringBuffer.append(TEXT_91);
+ stringBuffer.append(TEXT_93);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_92);
+ stringBuffer.append(TEXT_94);
}
- stringBuffer.append(TEXT_93);
+ stringBuffer.append(TEXT_95);
}
- stringBuffer.append(TEXT_94);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_95);
+ stringBuffer.append(TEXT_96);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(TEXT_97);
} else {
- stringBuffer.append(TEXT_96);
+ stringBuffer.append(TEXT_98);
if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
- stringBuffer.append(TEXT_97);
+ stringBuffer.append(TEXT_99);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_98);
+ stringBuffer.append(TEXT_100);
}
- stringBuffer.append(TEXT_99);
+ stringBuffer.append(TEXT_101);
}
}
- stringBuffer.append(TEXT_100);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_101);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
stringBuffer.append(TEXT_102);
- if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
stringBuffer.append(TEXT_103);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
stringBuffer.append(TEXT_104);
- }
+ if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
stringBuffer.append(TEXT_105);
- stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
stringBuffer.append(TEXT_106);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
+ }
stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.Status"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName()));
stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.NullProgressMonitor"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.commands.ExecutionException"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.Status"));
stringBuffer.append(TEXT_110);
- stringBuffer.append(genPlugin.getActivatorClassName());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.NullProgressMonitor"));
stringBuffer.append(TEXT_111);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.core.commands.ExecutionException"));
+ stringBuffer.append(TEXT_112);
+ stringBuffer.append(genPlugin.getActivatorClassName());
+ stringBuffer.append(TEXT_113);
+
+if (!isRichClientPlatform) {
+
+ stringBuffer.append(TEXT_114);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(TEXT_115);
+
+ if (standaloneDomainModel) {
+
+ stringBuffer.append(TEXT_116);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(TEXT_117);
+
+ }
+}
+
+ stringBuffer.append(TEXT_118);
if (isRichClientPlatform) {
if (genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
- stringBuffer.append(TEXT_112);
+ stringBuffer.append(TEXT_119);
stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
- stringBuffer.append(TEXT_113);
+ stringBuffer.append(TEXT_120);
} else {
- stringBuffer.append(TEXT_114);
+ stringBuffer.append(TEXT_121);
stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
- stringBuffer.append(TEXT_115);
+ stringBuffer.append(TEXT_122);
}
- stringBuffer.append(TEXT_116);
+ stringBuffer.append(TEXT_123);
} else {
if (genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
- stringBuffer.append(TEXT_117);
+ stringBuffer.append(TEXT_124);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE"));
- stringBuffer.append(TEXT_118);
+ stringBuffer.append(TEXT_125);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
- stringBuffer.append(TEXT_119);
+ stringBuffer.append(TEXT_126);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
- stringBuffer.append(TEXT_120);
+ stringBuffer.append(TEXT_127);
stringBuffer.append(genPlugin.getActivatorClassName());
- stringBuffer.append(TEXT_121);
+ stringBuffer.append(TEXT_128);
} else {
- stringBuffer.append(TEXT_122);
+ stringBuffer.append(TEXT_129);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
- stringBuffer.append(TEXT_123);
+ stringBuffer.append(TEXT_130);
stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
- stringBuffer.append(TEXT_124);
+ stringBuffer.append(TEXT_131);
}
}
- stringBuffer.append(TEXT_125);
+ stringBuffer.append(TEXT_132);
if (standaloneDomainModel && genDiagram.getDomainDiagramElement().getGenPackage().hasDocumentRoot()) {
- stringBuffer.append(TEXT_126);
+ stringBuffer.append(TEXT_133);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_127);
+ stringBuffer.append(TEXT_134);
stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_128);
+ stringBuffer.append(TEXT_135);
// would be better to get GenClass for docRoot and directly use setter
GenClass docRoot = genDiagram.getDomainDiagramElement().getGenPackage().getDocumentRoot();
@@ -563,27 +591,27 @@ if (standaloneDomainModel && genDiagram.getDomainDiagramElement().getGenPackage(
}
} /*for*/
- stringBuffer.append(TEXT_129);
+ stringBuffer.append(TEXT_136);
stringBuffer.append(importManager.getImportedName(docRoot.getQualifiedInterfaceName()));
- stringBuffer.append(TEXT_130);
+ stringBuffer.append(TEXT_137);
stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryInterfaceName()));
- stringBuffer.append(TEXT_131);
+ stringBuffer.append(TEXT_138);
stringBuffer.append(genDiagram.getDomainDiagramElement().getGenPackage().getFactoryInstanceName());
- stringBuffer.append(TEXT_132);
+ stringBuffer.append(TEXT_139);
stringBuffer.append(docRoot.getName());
- stringBuffer.append(TEXT_133);
+ stringBuffer.append(TEXT_140);
stringBuffer.append(featureAccessor);
- stringBuffer.append(TEXT_134);
+ stringBuffer.append(TEXT_141);
} /*if standaloneDomainModel && genDiagram.getDomainDiagramElement().getGenPackage().hasDocumentRoot()*/
- stringBuffer.append(TEXT_135);
+ stringBuffer.append(TEXT_142);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.commands.ExecutionException"));
- stringBuffer.append(TEXT_136);
+ stringBuffer.append(TEXT_143);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.commands.ExecutionException"));
- stringBuffer.append(TEXT_137);
+ stringBuffer.append(TEXT_144);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_138);
+ stringBuffer.append(TEXT_145);
return stringBuffer.toString();
}
}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java
index 210de7f11..af19f315b 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/ManifestGenerator.java
@@ -26,7 +26,7 @@ public class ManifestGenerator
protected final String TEXT_8 = NL + " org.eclipse.core.expressions,";
protected final String TEXT_9 = NL + " org.eclipse.ui.ide,";
protected final String TEXT_10 = NL + " org.eclipse.ui.views.properties.tabbed,";
- protected final String TEXT_11 = NL + " org.eclipse.jface," + NL + " org.eclipse.ui.views," + NL + " org.eclipse.ui.workbench," + NL + " org.eclipse.emf.ecore," + NL + " org.eclipse.emf.edit.ui," + NL + " org.eclipse.emf.workspace,";
+ protected final String TEXT_11 = NL + " org.eclipse.jface," + NL + " org.eclipse.ui.views," + NL + " org.eclipse.ui.workbench," + NL + " org.eclipse.emf.ecore," + NL + " org.eclipse.emf.ecore.xmi," + NL + " org.eclipse.emf.edit.ui," + NL + " org.eclipse.emf.workspace,";
protected final String TEXT_12 = NL + " org.eclipse.gef;visibility:=reexport," + NL + " org.eclipse.gmf.runtime.lite," + NL + " org.eclipse.gmf.runtime.notation," + NL + " org.eclipse.gmf.runtime.notation.edit";
protected final String TEXT_13 = ",";
protected final String TEXT_14 = NL + " ";
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java
index 2582d5b5d..23a49f9c4 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java
@@ -70,186 +70,184 @@ public class NewDiagramFileWizardGenerator
protected final String TEXT_52 = NL + "\t\t";
protected final String TEXT_53 = " diagramFileURI = myDiagramURISelectorPage.getNewFileURI();";
protected final String TEXT_54 = NL + "\t\t";
- protected final String TEXT_55 = " diagramFile = myFileCreationPage.createNewFile();" + NL + "\t\ttry {" + NL + "\t\t\tdiagramFile.setCharset(\"UTF-8\", new ";
- protected final String TEXT_56 = "()); //$NON-NLS-1$" + NL + "\t\t} catch (";
- protected final String TEXT_57 = " e) {" + NL + "\t\t\t";
- protected final String TEXT_58 = ".getInstance().logError(\"Unable to set charset for diagram file\", e); //$NON-NLS-1$" + NL + "\t\t}" + NL + "" + NL + "\t\t";
- protected final String TEXT_59 = " diagramFileURI = ";
- protected final String TEXT_60 = ".createPlatformResourceURI(diagramFile.getFullPath().toString(), true);";
- protected final String TEXT_61 = NL + "\t\tfinal ";
- protected final String TEXT_62 = " diagramResource = resourceSet.createResource(diagramFileURI);" + NL + "\t\t";
- protected final String TEXT_63 = " command = new ";
- protected final String TEXT_64 = "(\"Initializing diagram contents\") { //$NON-NLS-1$" + NL + "\t\t\tprivate ";
- protected final String TEXT_65 = " myCreatedDiagram;" + NL + "" + NL + "\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\tint diagramVID = ";
- protected final String TEXT_66 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\t\tif (diagramVID != ";
- protected final String TEXT_67 = ".VISUAL_ID) {" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\tpublic void execute() {" + NL + "\t\t\t\tmyCreatedDiagram = ";
- protected final String TEXT_68 = ".createDiagramFor(myDiagramRoot);" + NL + "\t\t\t\tassert myCreatedDiagram != null;" + NL + "\t\t\t\tdiagramResource.getContents().add(myCreatedDiagram);";
- protected final String TEXT_69 = NL + "\t\t\t\tdiagramResource.getContents().add(myCreatedDiagram.getElement());";
- protected final String TEXT_70 = NL + "\t\t\t}" + NL + "\t\t\tpublic void redo() {" + NL + "\t\t\t\texecute();" + NL + "\t\t\t}" + NL + "\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\ttry {" + NL + "\t\t\tnew ";
- protected final String TEXT_71 = "(myEditingDomain, command).execute();" + NL + "\t\t\tdiagramResource.save(";
- protected final String TEXT_72 = ".EMPTY_MAP);";
- protected final String TEXT_73 = NL + "\t\t\t";
- protected final String TEXT_74 = " editor = ";
- protected final String TEXT_75 = ".showView(diagramFileURI);";
- protected final String TEXT_76 = NL + "\t\t\t";
- protected final String TEXT_77 = " editor = ";
- protected final String TEXT_78 = ".openEditor(diagramFileURI);";
- protected final String TEXT_79 = NL + "\t\t\t";
- protected final String TEXT_80 = " editor = ";
- protected final String TEXT_81 = ".openEditor(myWorkbenchPage, diagramFile);";
- protected final String TEXT_82 = NL + "\t\t\tif (editor != null) {" + NL + "\t\t\t\t";
- protected final String TEXT_83 = " layouter = (";
- protected final String TEXT_84 = ") editor.getAdapter(";
- protected final String TEXT_85 = ".class);" + NL + "\t\t\t\tif (layouter != null) {" + NL + "\t\t\t\t\t";
- protected final String TEXT_86 = " graphicalViewer = (";
- protected final String TEXT_87 = ") editor.getAdapter(";
- protected final String TEXT_88 = ".class);" + NL + "\t\t\t\t\tif (graphicalViewer != null) {" + NL + "\t\t\t\t\t\t";
- protected final String TEXT_89 = " layoutCommand = layouter.layout((";
- protected final String TEXT_90 = ") graphicalViewer.getContents());" + NL + "\t\t\t\t\t\tif (layoutCommand != null && layoutCommand.canExecute()) {" + NL + "\t\t\t\t\t\t\tgraphicalViewer.getEditDomain().getCommandStack().execute(new ";
- protected final String TEXT_91 = "(myEditingDomain, layoutCommand));";
- protected final String TEXT_92 = NL + "\t\t\t\t\t\t\tdiagramResource.save(";
- protected final String TEXT_93 = ".EMPTY_MAP);";
- protected final String TEXT_94 = 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_95 = " ex) {";
+ protected final String TEXT_55 = " diagramFile = myFileCreationPage.createNewFile();" + NL + "\t\t";
+ protected final String TEXT_56 = ".setCharset(diagramFile);" + NL + "\t\t";
+ protected final String TEXT_57 = " diagramFileURI = ";
+ protected final String TEXT_58 = ".createPlatformResourceURI(diagramFile.getFullPath().toString(), true);";
+ protected final String TEXT_59 = NL + "\t\tfinal ";
+ protected final String TEXT_60 = " diagramResource = resourceSet.createResource(diagramFileURI);" + NL + "\t\t";
+ protected final String TEXT_61 = " command = new ";
+ protected final String TEXT_62 = "(\"Initializing diagram contents\") { //$NON-NLS-1$" + NL + "\t\t\tprivate ";
+ protected final String TEXT_63 = " myCreatedDiagram;" + NL + "" + NL + "\t\t\tprotected boolean prepare() {" + NL + "\t\t\t\tint diagramVID = ";
+ protected final String TEXT_64 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\t\tif (diagramVID != ";
+ protected final String TEXT_65 = ".VISUAL_ID) {" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\tpublic void execute() {" + NL + "\t\t\t\tmyCreatedDiagram = ";
+ protected final String TEXT_66 = ".createDiagramFor(myDiagramRoot);" + NL + "\t\t\t\tassert myCreatedDiagram != null;" + NL + "\t\t\t\tdiagramResource.getContents().add(myCreatedDiagram);";
+ protected final String TEXT_67 = NL + "\t\t\t\tdiagramResource.getContents().add(myCreatedDiagram.getElement());";
+ protected final String TEXT_68 = NL + "\t\t\t}" + NL + "\t\t\tpublic void redo() {" + NL + "\t\t\t\texecute();" + NL + "\t\t\t}" + NL + "\t\t\tpublic boolean canUndo() {" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "\t\ttry {" + NL + "\t\t\tnew ";
+ protected final String TEXT_69 = "(myEditingDomain, command).execute();" + NL + "\t\t\tdiagramResource.save(";
+ protected final String TEXT_70 = ".getSaveOptions());";
+ protected final String TEXT_71 = NL + "\t\t\t";
+ protected final String TEXT_72 = " editor = ";
+ protected final String TEXT_73 = ".showView(diagramFileURI);";
+ protected final String TEXT_74 = NL + "\t\t\t";
+ protected final String TEXT_75 = " editor = ";
+ protected final String TEXT_76 = ".openEditor(diagramFileURI);";
+ protected final String TEXT_77 = NL + "\t\t\t";
+ protected final String TEXT_78 = " editor = ";
+ protected final String TEXT_79 = ".openEditor(myWorkbenchPage, diagramFile);";
+ protected final String TEXT_80 = NL + "\t\t\tif (editor != null) {" + NL + "\t\t\t\t";
+ protected final String TEXT_81 = " layouter = (";
+ protected final String TEXT_82 = ") editor.getAdapter(";
+ protected final String TEXT_83 = ".class);" + NL + "\t\t\t\tif (layouter != null) {" + NL + "\t\t\t\t\t";
+ protected final String TEXT_84 = " graphicalViewer = (";
+ protected final String TEXT_85 = ") editor.getAdapter(";
+ protected final String TEXT_86 = ".class);" + NL + "\t\t\t\t\tif (graphicalViewer != null) {" + NL + "\t\t\t\t\t\t";
+ protected final String TEXT_87 = " layoutCommand = layouter.layout((";
+ protected final String TEXT_88 = ") graphicalViewer.getContents());" + NL + "\t\t\t\t\t\tif (layoutCommand != null && layoutCommand.canExecute()) {" + NL + "\t\t\t\t\t\t\tgraphicalViewer.getEditDomain().getCommandStack().execute(new ";
+ protected final String TEXT_89 = "(myEditingDomain, layoutCommand));";
+ protected final String TEXT_90 = NL + "\t\t\t\t\t\t\tdiagramResource.save(";
+ protected final String TEXT_91 = ".getSaveOptions());";
+ protected final String TEXT_92 = 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_93 = " ex) {";
+ protected final String TEXT_94 = NL + "\t\t\t";
+ protected final String TEXT_95 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$";
protected final String TEXT_96 = NL + "\t\t\t";
- protected final String TEXT_97 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$";
- protected final String TEXT_98 = NL + "\t\t\t";
- protected final String TEXT_99 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$";
- protected final String TEXT_100 = NL + "\t\t} catch (";
- protected final String TEXT_101 = " ex) {" + NL + "\t\t\t";
- protected final String TEXT_102 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$";
- protected final String TEXT_103 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL;
- protected final String TEXT_104 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends ";
- protected final String TEXT_105 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_106 = " 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_107 = " parent) {" + NL + "\t\t\t";
- protected final String TEXT_108 = " composite = new ";
- protected final String TEXT_109 = "(parent, ";
- protected final String TEXT_110 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
- protected final String TEXT_111 = " layout = new ";
- protected final String TEXT_112 = "();" + 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_113 = " data = new ";
- protected final String TEXT_114 = "();" + NL + "\t\t\t\tdata.verticalAlignment = ";
- protected final String TEXT_115 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = ";
- protected final String TEXT_116 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t";
- protected final String TEXT_117 = " resourceURILabel = new ";
- protected final String TEXT_118 = "(composite, ";
- protected final String TEXT_119 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t";
- protected final String TEXT_120 = " data = new ";
- protected final String TEXT_121 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
- protected final String TEXT_122 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t";
- protected final String TEXT_123 = " fileComposite = new ";
- protected final String TEXT_124 = "(composite, ";
- protected final String TEXT_125 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
- protected final String TEXT_126 = " data = new ";
- protected final String TEXT_127 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
- protected final String TEXT_128 = ".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_129 = " layout = new ";
- protected final String TEXT_130 = "();" + 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_131 = "(fileComposite, ";
- protected final String TEXT_132 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
- protected final String TEXT_133 = " data = new ";
- protected final String TEXT_134 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
- protected final String TEXT_135 = ".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_136 = " resourceURIBrowseFileSystemButton = new ";
- protected final String TEXT_137 = "(fileComposite," + NL + "\t\t\t\t\t";
- protected final String TEXT_138 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new ";
- protected final String TEXT_139 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected(";
- protected final String TEXT_140 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = ";
- protected final String TEXT_141 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, ";
- protected final String TEXT_142 = ".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_143 = " validator = new ";
- protected final String TEXT_144 = "() {" + NL + "\t\t\tpublic void modifyText(";
- protected final String TEXT_145 = " 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_146 = " 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_147 = " 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_148 = " file = new ";
- protected final String TEXT_149 = "(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 <code>null</code> if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile(";
- protected final String TEXT_150 = " 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_151 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn ";
- protected final String TEXT_152 = ".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_153 = "\";" + 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_154 = " 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_155 = " 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_156 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on ";
- protected final String TEXT_157 = " 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_158 = "\";" + 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_159 = " originalFile = new ";
- protected final String TEXT_160 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t";
- protected final String TEXT_161 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t";
- protected final String TEXT_162 = " newFile = new ";
- protected final String TEXT_163 = "(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_164 = "(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_165 = " 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_166 = " 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_167 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends ";
- protected final String TEXT_168 = " implements ";
- protected final String TEXT_169 = " {";
- protected final String TEXT_170 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
- protected final String TEXT_171 = " myTreeViewer;";
- protected final String TEXT_172 = 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_173 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t";
- protected final String TEXT_174 = " topLevel = new ";
- protected final String TEXT_175 = "(parent, ";
- protected final String TEXT_176 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new ";
- protected final String TEXT_177 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new ";
- protected final String TEXT_178 = "(";
- protected final String TEXT_179 = ".VERTICAL_ALIGN_FILL | ";
- protected final String TEXT_180 = ".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_181 = " parent) {" + NL + "\t\t\t";
- protected final String TEXT_182 = " panel = new ";
- protected final String TEXT_183 = "(parent, ";
- protected final String TEXT_184 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new ";
- protected final String TEXT_185 = "(";
- protected final String TEXT_186 = ".FILL_BOTH));" + NL + "\t\t\t";
- protected final String TEXT_187 = " layout = new ";
- protected final String TEXT_188 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t";
- protected final String TEXT_189 = " label = new ";
- protected final String TEXT_190 = "(panel, ";
- protected final String TEXT_191 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new ";
- protected final String TEXT_192 = "(";
- protected final String TEXT_193 = ".HORIZONTAL_ALIGN_BEGINNING));";
- protected final String TEXT_194 = NL + "\t\t\t";
- protected final String TEXT_195 = " ";
- protected final String TEXT_196 = " = new ";
- protected final String TEXT_197 = "(panel, ";
- protected final String TEXT_198 = ".SINGLE | ";
- protected final String TEXT_199 = ".H_SCROLL | ";
- protected final String TEXT_200 = ".V_SCROLL | ";
- protected final String TEXT_201 = ".BORDER);" + NL + "\t\t\t";
- protected final String TEXT_202 = " layoutData = new ";
- protected final String TEXT_203 = "(";
- protected final String TEXT_204 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t";
- protected final String TEXT_205 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t";
- protected final String TEXT_206 = ".setContentProvider(new ";
- protected final String TEXT_207 = "(";
- protected final String TEXT_208 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t";
- protected final String TEXT_209 = ".setLabelProvider(new ";
- protected final String TEXT_210 = "(";
- protected final String TEXT_211 = ".getInstance().getItemProvidersAdapterFactory()));";
- protected final String TEXT_212 = NL + "\t\t\t";
- protected final String TEXT_213 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t";
- protected final String TEXT_214 = ".setSelection(new ";
- protected final String TEXT_215 = "(myDiagramRoot));";
- protected final String TEXT_216 = NL + "\t\t\t";
- protected final String TEXT_217 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL;
- protected final String TEXT_218 = 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_219 = ".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_220 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL;
- protected final String TEXT_221 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged(";
- protected final String TEXT_222 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof ";
- protected final String TEXT_223 = ") {" + NL + "\t\t\t\t";
- protected final String TEXT_224 = " selection = (";
- protected final String TEXT_225 = ") 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_226 = ") {" + NL + "\t\t\t\t\t\tselectedElement = ((";
- protected final String TEXT_227 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
- protected final String TEXT_228 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = ((";
- protected final String TEXT_229 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
- protected final String TEXT_230 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = (";
- protected final String TEXT_231 = ") 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_232 = ".VISUAL_ID == ";
- protected final String TEXT_233 = ".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_234 = NL;
+ protected final String TEXT_97 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$";
+ protected final String TEXT_98 = NL + "\t\t} catch (";
+ protected final String TEXT_99 = " ex) {" + NL + "\t\t\t";
+ protected final String TEXT_100 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$";
+ protected final String TEXT_101 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL;
+ protected final String TEXT_102 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends ";
+ protected final String TEXT_103 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
+ protected final String TEXT_104 = " 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_105 = " parent) {" + NL + "\t\t\t";
+ protected final String TEXT_106 = " composite = new ";
+ protected final String TEXT_107 = "(parent, ";
+ protected final String TEXT_108 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
+ protected final String TEXT_109 = " layout = new ";
+ protected final String TEXT_110 = "();" + 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_111 = " data = new ";
+ protected final String TEXT_112 = "();" + NL + "\t\t\t\tdata.verticalAlignment = ";
+ protected final String TEXT_113 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = ";
+ protected final String TEXT_114 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t";
+ protected final String TEXT_115 = " resourceURILabel = new ";
+ protected final String TEXT_116 = "(composite, ";
+ protected final String TEXT_117 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t";
+ protected final String TEXT_118 = " data = new ";
+ protected final String TEXT_119 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
+ protected final String TEXT_120 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t";
+ protected final String TEXT_121 = " fileComposite = new ";
+ protected final String TEXT_122 = "(composite, ";
+ protected final String TEXT_123 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
+ protected final String TEXT_124 = " data = new ";
+ protected final String TEXT_125 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
+ protected final String TEXT_126 = ".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_127 = " layout = new ";
+ protected final String TEXT_128 = "();" + 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_129 = "(fileComposite, ";
+ protected final String TEXT_130 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
+ protected final String TEXT_131 = " data = new ";
+ protected final String TEXT_132 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
+ protected final String TEXT_133 = ".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_134 = " resourceURIBrowseFileSystemButton = new ";
+ protected final String TEXT_135 = "(fileComposite," + NL + "\t\t\t\t\t";
+ protected final String TEXT_136 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new ";
+ protected final String TEXT_137 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected(";
+ protected final String TEXT_138 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = ";
+ protected final String TEXT_139 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, ";
+ protected final String TEXT_140 = ".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_141 = " validator = new ";
+ protected final String TEXT_142 = "() {" + NL + "\t\t\tpublic void modifyText(";
+ protected final String TEXT_143 = " 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_144 = " 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_145 = " 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_146 = " file = new ";
+ protected final String TEXT_147 = "(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 <code>null</code> if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile(";
+ protected final String TEXT_148 = " 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_149 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn ";
+ protected final String TEXT_150 = ".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_151 = "\";" + 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_152 = " 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_153 = " 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_154 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on ";
+ protected final String TEXT_155 = " 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_156 = "\";" + 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_157 = " originalFile = new ";
+ protected final String TEXT_158 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t";
+ protected final String TEXT_159 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t";
+ protected final String TEXT_160 = " newFile = new ";
+ protected final String TEXT_161 = "(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_162 = "(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_163 = " 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_164 = " 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_165 = NL + "\t/**" + NL + " * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends ";
+ protected final String TEXT_166 = " implements ";
+ protected final String TEXT_167 = " {";
+ protected final String TEXT_168 = NL + "\t\t/**" + NL + " \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
+ protected final String TEXT_169 = " myTreeViewer;";
+ protected final String TEXT_170 = 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_171 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t";
+ protected final String TEXT_172 = " topLevel = new ";
+ protected final String TEXT_173 = "(parent, ";
+ protected final String TEXT_174 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new ";
+ protected final String TEXT_175 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new ";
+ protected final String TEXT_176 = "(";
+ protected final String TEXT_177 = ".VERTICAL_ALIGN_FILL | ";
+ protected final String TEXT_178 = ".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_179 = " parent) {" + NL + "\t\t\t";
+ protected final String TEXT_180 = " panel = new ";
+ protected final String TEXT_181 = "(parent, ";
+ protected final String TEXT_182 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new ";
+ protected final String TEXT_183 = "(";
+ protected final String TEXT_184 = ".FILL_BOTH));" + NL + "\t\t\t";
+ protected final String TEXT_185 = " layout = new ";
+ protected final String TEXT_186 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t";
+ protected final String TEXT_187 = " label = new ";
+ protected final String TEXT_188 = "(panel, ";
+ protected final String TEXT_189 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new ";
+ protected final String TEXT_190 = "(";
+ protected final String TEXT_191 = ".HORIZONTAL_ALIGN_BEGINNING));";
+ protected final String TEXT_192 = NL + "\t\t\t";
+ protected final String TEXT_193 = " ";
+ protected final String TEXT_194 = " = new ";
+ protected final String TEXT_195 = "(panel, ";
+ protected final String TEXT_196 = ".SINGLE | ";
+ protected final String TEXT_197 = ".H_SCROLL | ";
+ protected final String TEXT_198 = ".V_SCROLL | ";
+ protected final String TEXT_199 = ".BORDER);" + NL + "\t\t\t";
+ protected final String TEXT_200 = " layoutData = new ";
+ protected final String TEXT_201 = "(";
+ protected final String TEXT_202 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t";
+ protected final String TEXT_203 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t";
+ protected final String TEXT_204 = ".setContentProvider(new ";
+ protected final String TEXT_205 = "(";
+ protected final String TEXT_206 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t";
+ protected final String TEXT_207 = ".setLabelProvider(new ";
+ protected final String TEXT_208 = "(";
+ protected final String TEXT_209 = ".getInstance().getItemProvidersAdapterFactory()));";
+ protected final String TEXT_210 = NL + "\t\t\t";
+ protected final String TEXT_211 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t";
+ protected final String TEXT_212 = ".setSelection(new ";
+ protected final String TEXT_213 = "(myDiagramRoot));";
+ protected final String TEXT_214 = NL + "\t\t\t";
+ protected final String TEXT_215 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL;
+ protected final String TEXT_216 = 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_217 = ".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_218 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL;
+ protected final String TEXT_219 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged(";
+ protected final String TEXT_220 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof ";
+ protected final String TEXT_221 = ") {" + NL + "\t\t\t\t";
+ protected final String TEXT_222 = " selection = (";
+ protected final String TEXT_223 = ") 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_224 = ") {" + NL + "\t\t\t\t\t\tselectedElement = ((";
+ protected final String TEXT_225 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
+ protected final String TEXT_226 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = ((";
+ protected final String TEXT_227 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
+ protected final String TEXT_228 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = (";
+ protected final String TEXT_229 = ") 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_230 = ".VISUAL_ID == ";
+ protected final String TEXT_231 = ".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_232 = NL;
public String generate(Object argument)
{
@@ -412,240 +410,240 @@ if (isRichClientPlatform) {
stringBuffer.append(TEXT_54);
stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile"));
stringBuffer.append(TEXT_55);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.NullProgressMonitor"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
stringBuffer.append(TEXT_56);
- stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException"));
- stringBuffer.append(TEXT_57);
- stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_58);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
- stringBuffer.append(TEXT_59);
+ stringBuffer.append(TEXT_57);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
- stringBuffer.append(TEXT_60);
+ stringBuffer.append(TEXT_58);
}
- stringBuffer.append(TEXT_61);
+ stringBuffer.append(TEXT_59);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
- stringBuffer.append(TEXT_62);
+ stringBuffer.append(TEXT_60);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
- stringBuffer.append(TEXT_63);
+ stringBuffer.append(TEXT_61);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.AbstractCommand"));
- stringBuffer.append(TEXT_64);
+ stringBuffer.append(TEXT_62);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
- stringBuffer.append(TEXT_65);
+ stringBuffer.append(TEXT_63);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_66);
+ stringBuffer.append(TEXT_64);
stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_67);
+ stringBuffer.append(TEXT_65);
stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_68);
+ stringBuffer.append(TEXT_66);
if (editorGen.isSameFileForDiagramAndModel()) {
- stringBuffer.append(TEXT_69);
+ stringBuffer.append(TEXT_67);
}
- stringBuffer.append(TEXT_70);
+ stringBuffer.append(TEXT_68);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_71);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_72);
+ stringBuffer.append(TEXT_69);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(TEXT_70);
if (!genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
- stringBuffer.append(TEXT_73);
+ stringBuffer.append(TEXT_71);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IViewPart"));
- stringBuffer.append(TEXT_74);
+ stringBuffer.append(TEXT_72);
stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_75);
+ stringBuffer.append(TEXT_73);
} else {
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_76);
+ stringBuffer.append(TEXT_74);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
- stringBuffer.append(TEXT_77);
+ stringBuffer.append(TEXT_75);
stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
- stringBuffer.append(TEXT_78);
+ stringBuffer.append(TEXT_76);
} else {
- stringBuffer.append(TEXT_79);
+ stringBuffer.append(TEXT_77);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
- stringBuffer.append(TEXT_80);
+ stringBuffer.append(TEXT_78);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE"));
- stringBuffer.append(TEXT_81);
+ stringBuffer.append(TEXT_79);
}
}
+ stringBuffer.append(TEXT_80);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
+ stringBuffer.append(TEXT_81);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
stringBuffer.append(TEXT_82);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
stringBuffer.append(TEXT_83);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
stringBuffer.append(TEXT_84);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
stringBuffer.append(TEXT_85);
stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
stringBuffer.append(TEXT_86);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
- stringBuffer.append(TEXT_87);
- stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
- stringBuffer.append(TEXT_88);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
- stringBuffer.append(TEXT_89);
+ stringBuffer.append(TEXT_87);
stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
- stringBuffer.append(TEXT_90);
+ stringBuffer.append(TEXT_88);
stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
- stringBuffer.append(TEXT_91);
+ stringBuffer.append(TEXT_89);
if (genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
- stringBuffer.append(TEXT_92);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
- stringBuffer.append(TEXT_93);
+ stringBuffer.append(TEXT_90);
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(TEXT_91);
}
- stringBuffer.append(TEXT_94);
+ stringBuffer.append(TEXT_92);
stringBuffer.append(importManager.getImportedName("java.io.IOException"));
- stringBuffer.append(TEXT_95);
+ stringBuffer.append(TEXT_93);
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_96);
+ stringBuffer.append(TEXT_94);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_97);
+ stringBuffer.append(TEXT_95);
} else {
- stringBuffer.append(TEXT_98);
+ stringBuffer.append(TEXT_96);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_99);
+ stringBuffer.append(TEXT_97);
if (genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
- stringBuffer.append(TEXT_100);
+ stringBuffer.append(TEXT_98);
stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
- stringBuffer.append(TEXT_101);
+ stringBuffer.append(TEXT_99);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_102);
+ stringBuffer.append(TEXT_100);
}
}
- stringBuffer.append(TEXT_103);
+ stringBuffer.append(TEXT_101);
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_104);
+ stringBuffer.append(TEXT_102);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
- stringBuffer.append(TEXT_105);
+ stringBuffer.append(TEXT_103);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
+ stringBuffer.append(TEXT_104);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(TEXT_105);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_106);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_107);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_108);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
stringBuffer.append(TEXT_109);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_110);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
+ stringBuffer.append(TEXT_110);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_111);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_112);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_113);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_114);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
stringBuffer.append(TEXT_115);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_116);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
+ stringBuffer.append(TEXT_116);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_117);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_118);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_119);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_120);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_121);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_122);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(TEXT_122);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_123);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_124);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_125);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_126);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
stringBuffer.append(TEXT_127);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_128);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
+ stringBuffer.append(TEXT_128);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
stringBuffer.append(TEXT_129);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_130);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_131);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_132);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_133);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
stringBuffer.append(TEXT_134);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_135);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
+ stringBuffer.append(TEXT_135);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_136);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter"));
stringBuffer.append(TEXT_137);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent"));
stringBuffer.append(TEXT_138);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
stringBuffer.append(TEXT_139);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_140);
- stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
stringBuffer.append(TEXT_141);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_142);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
+ stringBuffer.append(TEXT_142);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent"));
stringBuffer.append(TEXT_143);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
+ stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_144);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
stringBuffer.append(TEXT_145);
stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_146);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_147);
stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_148);
- stringBuffer.append(importManager.getImportedName("java.io.File"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
stringBuffer.append(TEXT_149);
- stringBuffer.append(importManager.getImportedName("java.io.File"));
- stringBuffer.append(TEXT_150);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(TEXT_150);
+ stringBuffer.append(editorGen.getDomainFileExtension());
stringBuffer.append(TEXT_151);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_152);
- stringBuffer.append(editorGen.getDomainFileExtension());
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
stringBuffer.append(TEXT_153);
- stringBuffer.append(importManager.getImportedName("java.io.File"));
+ stringBuffer.append(editorGen.getDiagramFileExtension());
stringBuffer.append(TEXT_154);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
+ stringBuffer.append(editorGen.getDomainGenModel().getModelName());
stringBuffer.append(TEXT_155);
stringBuffer.append(editorGen.getDiagramFileExtension());
stringBuffer.append(TEXT_156);
- stringBuffer.append(editorGen.getDomainGenModel().getModelName());
+ stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_157);
- stringBuffer.append(editorGen.getDiagramFileExtension());
+ stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_158);
stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_159);
@@ -655,168 +653,164 @@ if (isRichClientPlatform) {
stringBuffer.append(TEXT_161);
stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_162);
- stringBuffer.append(importManager.getImportedName("java.io.File"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
stringBuffer.append(TEXT_163);
stringBuffer.append(importManager.getImportedName("java.io.File"));
stringBuffer.append(TEXT_164);
- stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
- stringBuffer.append(TEXT_165);
- stringBuffer.append(importManager.getImportedName("java.io.File"));
- stringBuffer.append(TEXT_166);
}
- stringBuffer.append(TEXT_167);
+ stringBuffer.append(TEXT_165);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
- stringBuffer.append(TEXT_168);
+ stringBuffer.append(TEXT_166);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener"));
- stringBuffer.append(TEXT_169);
+ stringBuffer.append(TEXT_167);
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_170);
+ stringBuffer.append(TEXT_168);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
- stringBuffer.append(TEXT_171);
+ stringBuffer.append(TEXT_169);
}
+ stringBuffer.append(TEXT_170);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(TEXT_171);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_172);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_173);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_174);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
stringBuffer.append(TEXT_175);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_176);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_177);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_178);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_179);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_180);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
stringBuffer.append(TEXT_181);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
- stringBuffer.append(TEXT_182);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
- stringBuffer.append(TEXT_183);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_184);
+ stringBuffer.append(TEXT_182);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_185);
+ stringBuffer.append(TEXT_183);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_186);
+ stringBuffer.append(TEXT_184);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
- stringBuffer.append(TEXT_187);
+ stringBuffer.append(TEXT_185);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
- stringBuffer.append(TEXT_188);
+ stringBuffer.append(TEXT_186);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
- stringBuffer.append(TEXT_189);
+ stringBuffer.append(TEXT_187);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
- stringBuffer.append(TEXT_190);
+ stringBuffer.append(TEXT_188);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
- stringBuffer.append(TEXT_191);
+ stringBuffer.append(TEXT_189);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_192);
+ stringBuffer.append(TEXT_190);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_193);
+ stringBuffer.append(TEXT_191);
final String treeViewer = isRichClientPlatform ? "myTreeViewer" : "treeViewer";
- stringBuffer.append(TEXT_194);
+ stringBuffer.append(TEXT_192);
if (!isRichClientPlatform){
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
- stringBuffer.append(TEXT_195);
+ stringBuffer.append(TEXT_193);
}
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_196);
+ stringBuffer.append(TEXT_194);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
+ stringBuffer.append(TEXT_195);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(TEXT_196);
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_197);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_198);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
stringBuffer.append(TEXT_199);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_200);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
+ stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_201);
stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
stringBuffer.append(TEXT_202);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_203);
- stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
- stringBuffer.append(TEXT_204);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_205);
+ stringBuffer.append(TEXT_203);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_206);
+ stringBuffer.append(TEXT_204);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider"));
- stringBuffer.append(TEXT_207);
+ stringBuffer.append(TEXT_205);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_208);
+ stringBuffer.append(TEXT_206);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_209);
+ stringBuffer.append(TEXT_207);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider"));
- stringBuffer.append(TEXT_210);
+ stringBuffer.append(TEXT_208);
stringBuffer.append(pluginActivatorClass);
- stringBuffer.append(TEXT_211);
+ stringBuffer.append(TEXT_209);
if (!isRichClientPlatform) {
- stringBuffer.append(TEXT_212);
+ stringBuffer.append(TEXT_210);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_213);
+ stringBuffer.append(TEXT_211);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_214);
+ stringBuffer.append(TEXT_212);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
- stringBuffer.append(TEXT_215);
+ stringBuffer.append(TEXT_213);
}
- stringBuffer.append(TEXT_216);
+ stringBuffer.append(TEXT_214);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_217);
+ stringBuffer.append(TEXT_215);
if (isRichClientPlatform) {
- stringBuffer.append(TEXT_218);
+ stringBuffer.append(TEXT_216);
stringBuffer.append(treeViewer);
- stringBuffer.append(TEXT_219);
+ stringBuffer.append(TEXT_217);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
- stringBuffer.append(TEXT_220);
+ stringBuffer.append(TEXT_218);
}
- stringBuffer.append(TEXT_221);
+ stringBuffer.append(TEXT_219);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent"));
- stringBuffer.append(TEXT_222);
+ stringBuffer.append(TEXT_220);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
- stringBuffer.append(TEXT_223);
+ stringBuffer.append(TEXT_221);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
- stringBuffer.append(TEXT_224);
+ stringBuffer.append(TEXT_222);
stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
- stringBuffer.append(TEXT_225);
+ stringBuffer.append(TEXT_223);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
- stringBuffer.append(TEXT_226);
+ stringBuffer.append(TEXT_224);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
- stringBuffer.append(TEXT_227);
+ stringBuffer.append(TEXT_225);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
- stringBuffer.append(TEXT_228);
+ stringBuffer.append(TEXT_226);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
- stringBuffer.append(TEXT_229);
+ stringBuffer.append(TEXT_227);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_230);
+ stringBuffer.append(TEXT_228);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
- stringBuffer.append(TEXT_231);
+ stringBuffer.append(TEXT_229);
stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
- stringBuffer.append(TEXT_232);
+ stringBuffer.append(TEXT_230);
stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
- stringBuffer.append(TEXT_233);
+ stringBuffer.append(TEXT_231);
importManager.emitSortedImports();
- stringBuffer.append(TEXT_234);
+ stringBuffer.append(TEXT_232);
return stringBuffer.toString();
}
}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/policies/OpenDiagramPolicyGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/policies/OpenDiagramPolicyGenerator.java
index 11bced279..d76aba164 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/policies/OpenDiagramPolicyGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/policies/OpenDiagramPolicyGenerator.java
@@ -63,8 +63,8 @@ public class OpenDiagramPolicyGenerator
protected final String TEXT_46 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tmyAnnotation.getReferences().add(result);" + NL + "\t\t\tresult.setElement(getDiagramDomainElement());" + NL + "\t\t\taddToResource(result);" + NL + "\t\t\ttry {" + NL + "\t\t\t\tfor (";
protected final String TEXT_47 = " it = myAnnotation.eResource().getResourceSet().getResources().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\t";
protected final String TEXT_48 = " next = (";
- protected final String TEXT_49 = ") it.next();" + NL + "\t\t\t\t\tif (next.isLoaded() && (!next.isTrackingModification() || next.isModified())) {" + NL + "\t\t\t\t\t\tnext.save(";
- protected final String TEXT_50 = ".EMPTY_MAP);" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t} catch (";
+ protected final String TEXT_49 = ") it.next();" + NL + "\t\t\t\t\tif (next.isLoaded()) {" + NL + "\t\t\t\t\t\tnext.save(";
+ protected final String TEXT_50 = ".getSaveOptions());" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t} catch (";
protected final String TEXT_51 = " e) {" + NL + "\t\t\t\t";
protected final String TEXT_52 = NL + "\t\t\t\tthrow new RuntimeException(\"Can't create diagram of '\" + getDiagramKind() + \"' kind\", e);" + NL + "\t\t\t}" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Returns the element that should be the underlying model element for the diagram." + NL + "\t\t * By default, the element associated with the edit part is returned." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
protected final String TEXT_53 = " getDiagramDomainElement() {" + NL + "\t\t\treturn ((";
@@ -203,7 +203,7 @@ if (openAsEditor) {
stringBuffer.append(TEXT_48);
stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
stringBuffer.append(TEXT_49);
- stringBuffer.append(importManager.getImportedName("java.util.Collections"));
+ stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
stringBuffer.append(TEXT_50);
stringBuffer.append(importManager.getImportedName("java.io.IOException"));
stringBuffer.append(TEXT_51);
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet
index 7f167d7d8..9c48174b7 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/CreationWizardPage.javajet
@@ -381,7 +381,7 @@ if (isRichClientPlatform) {
diagramFilePath = diagramFilePath.addFileExtension("<%=editorGen.getDiagramFileExtension()%>"); //$NON-NLS-1$
}
final IFile diagramFile = ResourcesPlugin.getWorkspace().getRoot().getFile(diagramFilePath);
- final <%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%> diagramResource = resourceSet.createResource(URI.createPlatformResourceURI(diagramFilePath.toString(), true));
+ final <%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%> diagramResource = resourceSet.createResource(<%=importManager.getImportedName("org.eclipse.emf.common.util.URI")%>.createPlatformResourceURI(diagramFilePath.toString(), true));
<%
}
%>
@@ -395,7 +395,8 @@ if (standaloneDomainModel) {
} else {
%>
IPath modelFilePath = diagramFilePath.removeFileExtension().addFileExtension("<%=editorGen.getDomainFileExtension()%>"); //$NON-NLS-1$
- final Resource modelResource = resourceSet.createResource(URI.createPlatformResourceURI(modelFilePath.toString(), true));
+ final IFile modelFile = ResourcesPlugin.getWorkspace().getRoot().getFile(modelFilePath);
+ final Resource modelResource = resourceSet.createResource(<%=importManager.getImportedName("org.eclipse.emf.common.util.URI")%>.createPlatformResourceURI(modelFilePath.toString(), true));
<%
}
}
@@ -421,7 +422,7 @@ if (genDiagram.getDomainDiagramElement() != null) {
}
%>
try {
- modelResource.save(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_MAP);
+ modelResource.save(<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.getSaveOptions());
} catch (IOException e) {
handleSaveException(e);
}
@@ -438,7 +439,7 @@ if (genDiagram.getDomainDiagramElement() != null) {
<%=importManager.getImportedName(genDiagram.getNotationViewFactoryQualifiedClassName())%>.INSTANCE.decorateView(diagram);
diagramResource.getContents().add(diagram);
try {
- diagramResource.save(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_MAP);
+ diagramResource.save(<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.getSaveOptions());
} catch (IOException e) {
handleSaveException(e);
}
@@ -451,6 +452,18 @@ if (genDiagram.getDomainDiagramElement() != null) {
<%=genPlugin.getActivatorClassName()%>.getInstance().logError("exception occurred while creating the diagram", e);
return null;
}
+<%
+if (!isRichClientPlatform) {
+%>
+ <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.setCharset(diagramFile);
+<%
+ if (standaloneDomainModel) {
+%>
+ <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.setCharset(modelFile);
+<%
+ }
+}
+%>
}
<%
if (isRichClientPlatform) {
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet
index 86385547a..2f37569b2 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/NewDiagramFileWizard.javajet
@@ -169,12 +169,7 @@ if (isRichClientPlatform) {
} else {
%>
<%=importManager.getImportedName("org.eclipse.core.resources.IFile")%> diagramFile = myFileCreationPage.createNewFile();
- try {
- diagramFile.setCharset("UTF-8", new <%=importManager.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")%>()); //$NON-NLS-1$
- } catch (<%=importManager.getImportedName("org.eclipse.core.runtime.CoreException")%> e) {
- <%=pluginActivatorClass%>.getInstance().logError("Unable to set charset for diagram file", e); //$NON-NLS-1$
- }
-
+ <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.setCharset(diagramFile);
<%=importManager.getImportedName("org.eclipse.emf.common.util.URI")%> diagramFileURI = <%=importManager.getImportedName("org.eclipse.emf.common.util.URI")%>.createPlatformResourceURI(diagramFile.getFullPath().toString(), true);
<%
}
@@ -209,7 +204,7 @@ if (isRichClientPlatform) {
};
try {
new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")%>(myEditingDomain, command).execute();
- diagramResource.save(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_MAP);
+ diagramResource.save(<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.getSaveOptions());
<%
if (!genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
%>
@@ -238,7 +233,7 @@ if (!genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
<%
if (genDiagram.getEditorGen().getEditor().isEclipseEditor()) {
%>
- diagramResource.save(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_MAP);
+ diagramResource.save(<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.getSaveOptions());
<%
}
%>
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet
index 635bc5df9..f1313e4e0 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/editor/manifest.mfjet
@@ -55,6 +55,7 @@ if (genPlugin.getEditorGen().getApplication() == null) {
org.eclipse.ui.views,
org.eclipse.ui.workbench,
org.eclipse.emf.ecore,
+ org.eclipse.emf.ecore.xmi,
org.eclipse.emf.edit.ui,
org.eclipse.emf.workspace,<%/*XXX: introduces dependency on org.eclipse.core.resources which may be problematic for RCP*/%>
org.eclipse.gef;visibility:=reexport,
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/policies/OpenDiagramEditPolicy.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/policies/OpenDiagramEditPolicy.javajet
index d3ed92d84..2b1305650 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/policies/OpenDiagramEditPolicy.javajet
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/policies/OpenDiagramEditPolicy.javajet
@@ -141,8 +141,8 @@ if (openAsEditor) {
try {
for (<%=importManager.getImportedName("java.util.Iterator")%> it = myAnnotation.eResource().getResourceSet().getResources().iterator(); it.hasNext(); ) {
<%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%> next = (<%=importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource")%>) it.next();
- if (next.isLoaded() && (!next.isTrackingModification() || next.isModified())) {
- next.save(<%=importManager.getImportedName("java.util.Collections")%>.EMPTY_MAP);
+ if (next.isLoaded()) {
+ next.save(<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.getSaveOptions());
}
}
} catch (<%=importManager.getImportedName("java.io.IOException")%> e) {
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt
index 16002c092..35bb8244e 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/DiagramEditorUtil.xpt
@@ -32,6 +32,10 @@ public class «diagramEditorUtilClassName» «EXPAND supertypes» {
«EXPAND convertURIs-»
«ENDIF-»
«EXPAND isReadOnly-»
+«IF editorGen.application == null-»
+ «EXPAND setCharset-»
+«ENDIF-»
+ «EXPAND saveOptions-»
«EXPAND additions-»
}
«ENDDEFINE»
@@ -157,4 +161,34 @@ public static org.eclipse.gmf.runtime.notation.Diagram createDiagramFor(org.ecli
«EXPAND xpt::editor::DiagramInitializer::DiagramInitializer-»
«ENDDEFINE»
+«DEFINE setCharset FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+public static void setCharset(org.eclipse.core.resources.IFile file) {
+ if (file == null) {
+ return;
+ }
+ try {
+ file.setCharset("UTF-8", new org.eclipse.core.runtime.NullProgressMonitor()); «EXPAND xpt::Common::nonNLS»
+ } catch (org.eclipse.core.runtime.CoreException e) {
+ «editorGen.plugin.getActivatorQualifiedClassName()».getInstance().logError("Unable to set charset for file " + file.getFullPath(), e); «EXPAND xpt::Common::nonNLS»
+ }
+}
+«ENDDEFINE»
+
+«DEFINE saveOptions FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::generatedMemberComment»
+private static java.util.Map ourSaveOptions = null;
+
+«EXPAND xpt::Common::generatedMemberComment»
+public static java.util.Map getSaveOptions() {
+ if (ourSaveOptions == null) {
+ ourSaveOptions = new java.util.HashMap();
+ ourSaveOptions.put(org.eclipse.emf.ecore.xmi.XMIResource.OPTION_ENCODING, "UTF-8"); «EXPAND xpt::Common::nonNLS»
+ ourSaveOptions.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);
+ ourSaveOptions.put(org.eclipse.emf.ecore.resource.Resource.OPTION_SAVE_ONLY_IF_CHANGED, org.eclipse.emf.ecore.resource.Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
+ }
+ return ourSaveOptions;
+}
+«ENDDEFINE»
+
«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/Editor.xpt b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/Editor.xpt
index 0682f8a58..fa621b7a7 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/Editor.xpt
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/xpt/editor/Editor.xpt
@@ -49,6 +49,7 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramEdito
«EXPAND initializeGraphicalViewer-»
«EXPAND configureGraphicalViewer-»
«EXPAND flyoutPalette-»
+«EXPAND getSaveOptions-»
«IF editorGen.diagram.validationNeeded() && null == editorGen.application-»
«EXPAND gotoMarker-»
«ENDIF-»
@@ -77,6 +78,7 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramViewP
«EXPAND initializeGraphicalViewer-»
«EXPAND configureGraphicalViewer-»
«EXPAND flyoutPalette-»
+«EXPAND getSaveOptions-»
«EXPAND ContextMenuProvider-»
«EXPAND additions-»
}
@@ -523,7 +525,7 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramViewP
diagramResource.getContents().add(0, diagram);
//Auxiliary creation should not be undoable.
try {
- diagramResource.save(java.util.Collections.EMPTY_MAP);
+ diagramResource.save(getSaveOptions());
} catch (java.io.IOException e) {
diagram = null;
diagramRoot = null;
@@ -548,7 +550,7 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramViewP
«resourceToUse».getContents().add(0, «unparenthesizedCast("diagramRoot", editorGen.diagram.domainDiagramElement, null)»);
//We don't want this auxiliary creation to be undoable.
try {
- «resourceToUse».save(java.util.Collections.EMPTY_MAP);
+ «resourceToUse».save(getSaveOptions());
} catch (java.io.IOException e) {
diagram = null;
diagramRoot = null;
@@ -565,7 +567,7 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramViewP
doSave(new org.eclipse.core.runtime.NullProgressMonitor());
«ELSE-»
try {
- diagramResource.save(java.util.Collections.EMPTY_MAP);
+ diagramResource.save(getSaveOptions());
} catch (java.io.IOException e) {
diagram = null;
diagramRoot = null;
@@ -644,6 +646,12 @@ public class «className» extends org.eclipse.gmf.runtime.lite.parts.DiagramViewP
}
«ENDDEFINE»
+«DEFINE getSaveOptions FOR gmfgen::GenEditorView-»
+protected java.util.Map getSaveOptions() {
+ return «editorGen.diagram.getDiagramEditorUtilQualifiedClassName()».getSaveOptions();
+}
+«ENDDEFINE»
+
«DEFINE gotoMarker FOR gmfgen::GenEditorView-»
«EXPAND xpt::Common::generatedMemberComment»
public void gotoMarker(org.eclipse.core.resources.IMarker marker) {

Back to the top