View | Details | Raw Unified | Return to bug 158023 | Differences between
and this patch

Collapse All | Expand All

(-)templates/editor/Editor.javajet (+3 lines)
Lines 124-129 Link Here
124
124
125
		addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.SaveAction")%>(this));
125
		addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.SaveAction")%>(this));
126
		addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction")%>(this));
126
		addEditorAction(new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction")%>(this));
127
		addEditorAction(new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.LayoutDiagramAction")%>(this));
127
128
128
		<%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomIn = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")%>(getZoomManager());
129
		<%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomIn = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction")%>(getZoomManager());
129
		<%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomOut = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")%>(getZoomManager());
130
		<%=importManager.getImportedName("org.eclipse.jface.action.IAction")%> zoomOut = new <%=importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction")%>(getZoomManager());
Lines 429-434 Link Here
429
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.DELETE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT);
430
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.DELETE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT);
430
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.DIRECT_EDIT, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT);
431
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.DIRECT_EDIT, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_EDIT);
431
432
433
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.ActionIds")%>.LAYOUT_ALL_ACTION, <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_REST);
434
432
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.SAVE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_SAVE);
435
			appendActionToMenu(menuManager, <%=importManager.getImportedName("org.eclipse.ui.actions.ActionFactory")%>.SAVE.getId(), <%=importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants")%>.GROUP_SAVE);
433
436
434
			appendAlignmentSubmenu(menuManager);
437
			appendAlignmentSubmenu(menuManager);
(-)templates/editor/NewDiagramFileWizard.javajet (-2 / +14 lines)
Lines 215-228 Link Here
215
<%
215
<%
216
if (isRichClientPlatform) {
216
if (isRichClientPlatform) {
217
%>
217
%>
218
			<%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.openEditor(diagramResource.getURI());
218
			<%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> editor = <%=importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName())%>.openEditor(diagramResource.getURI());
219
<%
219
<%
220
} else {
220
} else {
221
%>
221
%>
222
			<%=importManager.getImportedName("org.eclipse.ui.ide.IDE")%>.openEditor(myWorkbenchPage, diagramFile);
222
			<%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> editor = <%=importManager.getImportedName("org.eclipse.ui.ide.IDE")%>.openEditor(myWorkbenchPage, diagramFile);
223
<%
223
<%
224
}
224
}
225
%>
225
%>
226
			if (editor != null) {
227
				<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%> layouter = (<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%>) editor.getAdapter(<%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter")%>.class);
228
				if (layouter != null) {
229
					<%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%> graphicalViewer = (<%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%>) editor.getAdapter(<%=importManager.getImportedName("org.eclipse.gef.GraphicalViewer")%>.class);
230
					if (graphicalViewer != null) {
231
						<%=importManager.getImportedName("org.eclipse.emf.common.command.Command")%> layoutCommand = layouter.layout((<%=importManager.getImportedName("org.eclipse.gef.GraphicalEditPart")%>) graphicalViewer.getContents());
232
						if (layoutCommand != null && layoutCommand.canExecute()) {
233
							new <%=importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand")%>(myEditingDomain, layoutCommand).execute();
234
						}
235
					}
236
				}
237
			}
226
		} catch (<%=importManager.getImportedName("java.io.IOException")%> ex) {
238
		} catch (<%=importManager.getImportedName("java.io.IOException")%> ex) {
227
<%
239
<%
228
if (isRichClientPlatform) {
240
if (isRichClientPlatform) {
(-)templates/editor/DiagramEditorUtil.javajet (-6 / +4 lines)
Lines 49-55 Link Here
49
	/**
49
	/**
50
	 * @generated
50
	 * @generated
51
	 */
51
	 */
52
	public static boolean openEditor(URI fileURI) {
52
	public static <%=importManager.getImportedName("org.eclipse.ui.IEditorPart")%> openEditor(URI fileURI) {
53
		IWorkbench workbench = PlatformUI.getWorkbench();
53
		IWorkbench workbench = PlatformUI.getWorkbench();
54
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
54
		IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
55
		IWorkbenchPage page = workbenchWindow.getActivePage();
55
		IWorkbenchPage page = workbenchWindow.getActivePage();
Lines 60-79 Link Here
60
			workbenchWindow.getShell(),
60
			workbenchWindow.getShell(),
61
			"Error",
61
			"Error",
62
			"There is no editor registered for the file " + fileURI.toFileString());
62
			"There is no editor registered for the file " + fileURI.toFileString());
63
			return false;
63
			return null;
64
		} else {
64
		} else {
65
			try {
65
			try {
66
				page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());
66
				return page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());
67
			} catch (PartInitException exception) {
67
			} catch (PartInitException exception) {
68
				MessageDialog.openError(
68
				MessageDialog.openError(
69
				workbenchWindow.getShell(),
69
				workbenchWindow.getShell(),
70
				"Error Opening Editor",
70
				"Error Opening Editor",
71
				exception.getMessage());
71
				exception.getMessage());
72
				return false;
72
				return null;
73
			}
73
			}
74
		}
74
		}
75
76
		return true;
77
	}
75
	}
78
76
79
<%
77
<%
(-)templates/editor/CreationWizardPage.javajet (-1 / +1 lines)
Lines 455-461 Link Here
455
<%
455
<%
456
if (isRichClientPlatform) {
456
if (isRichClientPlatform) {
457
%>
457
%>
458
		boolean result = <%=genDiagram.getDiagramEditorUtilClassName()%>.openEditor(getDiagramFileURI());
458
		boolean result = <%=genDiagram.getDiagramEditorUtilClassName()%>.openEditor(getDiagramFileURI()) != null;
459
		if (!result) {
459
		if (!result) {
460
			return null;
460
			return null;
461
		}
461
		}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/CreationWizardPageGenerator.java (-1 / +1 lines)
Lines 122-128 Link Here
122
  protected final String TEXT_103 = " e) {" + NL + "\t\t\t\t";
122
  protected final String TEXT_103 = " e) {" + NL + "\t\t\t\t";
123
  protected final String TEXT_104 = ".getInstance().logError(\"exception occurred while creating the diagram\", e);" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}";
123
  protected final String TEXT_104 = ".getInstance().logError(\"exception occurred while creating the diagram\", e);" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}";
124
  protected final String TEXT_105 = NL + "\t\tboolean result = ";
124
  protected final String TEXT_105 = NL + "\t\tboolean result = ";
125
  protected final String TEXT_106 = ".openEditor(getDiagramFileURI());" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();";
125
  protected final String TEXT_106 = ".openEditor(getDiagramFileURI()) != null;" + NL + "\t\tif (!result) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn getDiagramFileURI();";
126
  protected final String TEXT_107 = NL + "\t\ttry {" + NL + "\t\t\t";
126
  protected final String TEXT_107 = NL + "\t\ttry {" + NL + "\t\t\t";
127
  protected final String TEXT_108 = ".openEditor(";
127
  protected final String TEXT_108 = ".openEditor(";
128
  protected final String TEXT_109 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch (";
128
  protected final String TEXT_109 = ".getWorkbench().getActiveWorkbenchWindow().getActivePage(), diagramFile);" + NL + "\t\t} catch (";
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/NewDiagramFileWizardGenerator.java (-680 / +713 lines)
Lines 104-451 Link Here
104
  protected final String TEXT_85 = "(myEditingDomain, command).execute();" + NL + "\t\t\tdiagramResource.save(";
104
  protected final String TEXT_85 = "(myEditingDomain, command).execute();" + NL + "\t\t\tdiagramResource.save(";
105
  protected final String TEXT_86 = ".EMPTY_MAP);";
105
  protected final String TEXT_86 = ".EMPTY_MAP);";
106
  protected final String TEXT_87 = NL + "\t\t\t";
106
  protected final String TEXT_87 = NL + "\t\t\t";
107
  protected final String TEXT_88 = ".openEditor(diagramResource.getURI());";
107
  protected final String TEXT_88 = " editor = ";
108
  protected final String TEXT_89 = NL + "\t\t\t";
108
  protected final String TEXT_89 = ".openEditor(diagramResource.getURI());";
109
  protected final String TEXT_90 = ".openEditor(myWorkbenchPage, diagramFile);";
109
  protected final String TEXT_90 = NL + "\t\t\t";
110
  protected final String TEXT_91 = NL + "\t\t} catch (";
110
  protected final String TEXT_91 = " editor = ";
111
  protected final String TEXT_92 = " ex) {";
111
  protected final String TEXT_92 = ".openEditor(myWorkbenchPage, diagramFile);";
112
  protected final String TEXT_93 = NL + "\t\t\t";
112
  protected final String TEXT_93 = NL + "\t\t\tif (editor != null) {" + NL + "\t\t\t\t";
113
  protected final String TEXT_94 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$";
113
  protected final String TEXT_94 = " layouter = (";
114
  protected final String TEXT_95 = NL + "\t\t\t";
114
  protected final String TEXT_95 = ") editor.getAdapter(";
115
  protected final String TEXT_96 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$" + NL + "\t\t} catch (";
115
  protected final String TEXT_96 = ".class);" + NL + "\t\t\t\tif (layouter != null) {" + NL + "\t\t\t\t\t";
116
  protected final String TEXT_97 = " ex) {" + NL + "\t\t\t";
116
  protected final String TEXT_97 = " graphicalViewer = (";
117
  protected final String TEXT_98 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$";
117
  protected final String TEXT_98 = ") editor.getAdapter(";
118
  protected final String TEXT_99 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL;
118
  protected final String TEXT_99 = ".class);" + NL + "\t\t\t\t\tif (graphicalViewer != null) {" + NL + "\t\t\t\t\t\t";
119
  protected final String TEXT_100 = NL;
119
  protected final String TEXT_100 = " layoutCommand = layouter.layout((";
120
  protected final String TEXT_101 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents(";
120
  protected final String TEXT_101 = ") graphicalViewer.getContents());" + NL + "\t\t\t\t\t\tif (layoutCommand != null && layoutCommand.canExecute()) {" + NL + "\t\t\t\t\t\t\tnew ";
121
  protected final String TEXT_102 = " diagram) {" + NL + "\tcreate";
121
  protected final String TEXT_102 = "(myEditingDomain, layoutCommand).execute();" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t} catch (";
122
  protected final String TEXT_103 = "Children(diagram);";
122
  protected final String TEXT_103 = " ex) {";
123
  protected final String TEXT_104 = NL + "\tmyViewService = new ";
123
  protected final String TEXT_104 = NL + "\t\t\t";
124
  protected final String TEXT_105 = "(diagram);" + NL + "\tcreate";
124
  protected final String TEXT_105 = ".getInstance().logError(\"Save operation failed for: \" + diagramFileURI.toString(), ex); //$NON-NLS-1$";
125
  protected final String TEXT_106 = "ChildLinks(diagram);";
125
  protected final String TEXT_106 = NL + "\t\t\t";
126
  protected final String TEXT_107 = NL + "}" + NL;
126
  protected final String TEXT_107 = ".getInstance().logError(\"Save operation failed for: \" + diagramFile.getFullPath().toString(), ex); //$NON-NLS-1$" + NL + "\t\t} catch (";
127
  protected final String TEXT_108 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
127
  protected final String TEXT_108 = " ex) {" + NL + "\t\t\t";
128
  protected final String TEXT_109 = "Children(";
128
  protected final String TEXT_109 = ".getInstance().logError(\"Unable to open editor\", ex); //$NON-NLS-1$";
129
  protected final String TEXT_110 = " viewObject) {";
129
  protected final String TEXT_110 = NL + "\t\t}" + NL + "\t\treturn true;" + NL + "\t}" + NL;
130
  protected final String TEXT_111 = NL + "\tfor(";
130
  protected final String TEXT_111 = NL;
131
  protected final String TEXT_112 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
131
  protected final String TEXT_112 = "/**" + NL + " * @generated" + NL + " */" + NL + "private void initDiagramContents(";
132
  protected final String TEXT_113 = " next = (";
132
  protected final String TEXT_113 = " diagram) {" + NL + "\tcreate";
133
  protected final String TEXT_114 = ") it.next();" + NL + "\t\tint visualID = ";
133
  protected final String TEXT_114 = "Children(diagram);";
134
  protected final String TEXT_115 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
134
  protected final String TEXT_115 = NL + "\tmyViewService = new ";
135
  protected final String TEXT_116 = NL + "\t\tcase ";
135
  protected final String TEXT_116 = "(diagram);" + NL + "\tcreate";
136
  protected final String TEXT_117 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
136
  protected final String TEXT_117 = "ChildLinks(diagram);";
137
  protected final String TEXT_118 = "Children(next);" + NL + "\t\t\tbreak;";
137
  protected final String TEXT_118 = NL + "}" + NL;
138
  protected final String TEXT_119 = NL + "\t\t}" + NL + "\t}";
138
  protected final String TEXT_119 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
139
  protected final String TEXT_120 = NL + "\t";
139
  protected final String TEXT_120 = "Children(";
140
  protected final String TEXT_121 = " semanticChildren = get";
140
  protected final String TEXT_121 = " viewObject) {";
141
  protected final String TEXT_122 = "SemanticChildNodes(viewObject);" + NL + "\tfor(";
141
  protected final String TEXT_122 = NL + "\tfor(";
142
  protected final String TEXT_123 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t";
142
  protected final String TEXT_123 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
143
  protected final String TEXT_124 = " nextDescriptor = (";
143
  protected final String TEXT_124 = " next = (";
144
  protected final String TEXT_125 = ") it.next();" + NL + "\t\t";
144
  protected final String TEXT_125 = ") it.next();" + NL + "\t\tint visualID = ";
145
  protected final String TEXT_126 = " createCommand = getCreate";
145
  protected final String TEXT_126 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
146
  protected final String TEXT_127 = "NotationalChildNodeCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();";
146
  protected final String TEXT_127 = NL + "\t\tcase ";
147
  protected final String TEXT_128 = NL + "\t\t\t";
147
  protected final String TEXT_128 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
148
  protected final String TEXT_129 = " nextChild = createCommand.getCreatedView();" + NL + "\t\t\tint childVisualID = nextDescriptor.getVisualID();" + NL + "\t\t\tswitch (childVisualID) {";
148
  protected final String TEXT_129 = "Children(next);" + NL + "\t\t\tbreak;";
149
  protected final String TEXT_130 = NL + "\t\t\tcase ";
149
  protected final String TEXT_130 = NL + "\t\t}" + NL + "\t}";
150
  protected final String TEXT_131 = ".VISUAL_ID:" + NL + "\t\t\t\tcreate";
150
  protected final String TEXT_131 = NL + "\t";
151
  protected final String TEXT_132 = "Children(nextChild);" + NL + "\t\t\t\tbreak;";
151
  protected final String TEXT_132 = " semanticChildren = get";
152
  protected final String TEXT_133 = NL + "\t\t\t}";
152
  protected final String TEXT_133 = "SemanticChildNodes(viewObject);" + NL + "\tfor(";
153
  protected final String TEXT_134 = NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
153
  protected final String TEXT_134 = " it = semanticChildren.iterator(); it.hasNext(); ) {" + NL + "\t\t";
154
  protected final String TEXT_135 = " get";
154
  protected final String TEXT_135 = " nextDescriptor = (";
155
  protected final String TEXT_136 = "SemanticChildNodes(";
155
  protected final String TEXT_136 = ") it.next();" + NL + "\t\t";
156
  protected final String TEXT_137 = " parentView) {";
156
  protected final String TEXT_137 = " createCommand = getCreate";
157
  protected final String TEXT_138 = NL;
157
  protected final String TEXT_138 = "NotationalChildNodeCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();";
158
  protected final String TEXT_139 = NL + "\treturn ";
158
  protected final String TEXT_139 = NL + "\t\t\t";
159
  protected final String TEXT_140 = ".EMPTY_LIST;";
159
  protected final String TEXT_140 = " nextChild = createCommand.getCreatedView();" + NL + "\t\t\tint childVisualID = nextDescriptor.getVisualID();" + NL + "\t\t\tswitch (childVisualID) {";
160
  protected final String TEXT_141 = NL + "\t";
160
  protected final String TEXT_141 = NL + "\t\t\tcase ";
161
  protected final String TEXT_142 = " result = new ";
161
  protected final String TEXT_142 = ".VISUAL_ID:" + NL + "\t\t\t\tcreate";
162
  protected final String TEXT_143 = "();";
162
  protected final String TEXT_143 = "Children(nextChild);" + NL + "\t\t\t\tbreak;";
163
  protected final String TEXT_144 = NL + "\t";
163
  protected final String TEXT_144 = NL + "\t\t\t}";
164
  protected final String TEXT_145 = " viewObject = ";
164
  protected final String TEXT_145 = NL + "\t\t}" + NL + "\t}" + NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
165
  protected final String TEXT_146 = ";" + NL + "\t";
165
  protected final String TEXT_146 = " get";
166
  protected final String TEXT_147 = " modelObject = viewObject.getElement();" + NL + "\t";
166
  protected final String TEXT_147 = "SemanticChildNodes(";
167
  protected final String TEXT_148 = " nextValue;" + NL + "\tint nodeVID;";
167
  protected final String TEXT_148 = " parentView) {";
168
  protected final String TEXT_149 = NL + "\tfor(";
168
  protected final String TEXT_149 = NL;
169
  protected final String TEXT_150 = " it = ";
169
  protected final String TEXT_150 = NL + "\treturn ";
170
  protected final String TEXT_151 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
170
  protected final String TEXT_151 = ".EMPTY_LIST;";
171
  protected final String TEXT_152 = ") it.next();";
171
  protected final String TEXT_152 = NL + "\t";
172
  protected final String TEXT_153 = NL + "\tnextValue = (";
172
  protected final String TEXT_153 = " result = new ";
173
  protected final String TEXT_154 = ")";
173
  protected final String TEXT_154 = "();";
174
  protected final String TEXT_155 = ";";
174
  protected final String TEXT_155 = NL + "\t";
175
  protected final String TEXT_156 = NL + "\tnodeVID = ";
175
  protected final String TEXT_156 = " viewObject = ";
176
  protected final String TEXT_157 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
176
  protected final String TEXT_157 = ";" + NL + "\t";
177
  protected final String TEXT_158 = NL + "\tswitch (nodeVID) {";
177
  protected final String TEXT_158 = " modelObject = viewObject.getElement();" + NL + "\t";
178
  protected final String TEXT_159 = NL + "\tcase ";
178
  protected final String TEXT_159 = " nextValue;" + NL + "\tint nodeVID;";
179
  protected final String TEXT_160 = ".VISUAL_ID: {";
179
  protected final String TEXT_160 = NL + "\tfor(";
180
  protected final String TEXT_161 = NL + "\tif (";
180
  protected final String TEXT_161 = " it = ";
181
  protected final String TEXT_162 = ".VISUAL_ID == nodeVID) {";
181
  protected final String TEXT_162 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
182
  protected final String TEXT_163 = NL + "\t\tresult.add(new ";
182
  protected final String TEXT_163 = ") it.next();";
183
  protected final String TEXT_164 = "(nextValue, nodeVID));";
183
  protected final String TEXT_164 = NL + "\tnextValue = (";
184
  protected final String TEXT_165 = NL + "\t\tbreak;" + NL + "\t\t}";
184
  protected final String TEXT_165 = ")";
185
  protected final String TEXT_166 = NL + "\t\t}";
185
  protected final String TEXT_166 = ";";
186
  protected final String TEXT_167 = NL + "\t}";
186
  protected final String TEXT_167 = NL + "\tnodeVID = ";
187
  protected final String TEXT_168 = NL + "\t}";
187
  protected final String TEXT_168 = ".INSTANCE.getNodeVisualID(viewObject, nextValue);";
188
  protected final String TEXT_169 = NL + "\treturn result;";
188
  protected final String TEXT_169 = NL + "\tswitch (nodeVID) {";
189
  protected final String TEXT_170 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
189
  protected final String TEXT_170 = NL + "\tcase ";
190
  protected final String TEXT_171 = " getCreate";
190
  protected final String TEXT_171 = ".VISUAL_ID: {";
191
  protected final String TEXT_172 = "NotationalChildNodeCommand(";
191
  protected final String TEXT_172 = NL + "\tif (";
192
  protected final String TEXT_173 = " parentView, ";
192
  protected final String TEXT_173 = ".VISUAL_ID == nodeVID) {";
193
  protected final String TEXT_174 = " descriptor) {";
193
  protected final String TEXT_174 = NL + "\t\tresult.add(new ";
194
  protected final String TEXT_175 = NL;
194
  protected final String TEXT_175 = "(nextValue, nodeVID));";
195
  protected final String TEXT_176 = "\t\t\t";
195
  protected final String TEXT_176 = NL + "\t\tbreak;" + NL + "\t\t}";
196
  protected final String TEXT_177 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
196
  protected final String TEXT_177 = NL + "\t\t}";
197
  protected final String TEXT_178 = NL + "\t\t\tcase ";
197
  protected final String TEXT_178 = NL + "\t}";
198
  protected final String TEXT_179 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
198
  protected final String TEXT_179 = NL + "\t}";
199
  protected final String TEXT_180 = ") {" + NL + "\t\t\t\t\treturn new ";
199
  protected final String TEXT_180 = NL + "\treturn result;";
200
  protected final String TEXT_181 = "(";
200
  protected final String TEXT_181 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
201
  protected final String TEXT_182 = ", domainElement, ";
201
  protected final String TEXT_182 = " getCreate";
202
  protected final String TEXT_183 = "new ";
202
  protected final String TEXT_183 = "NotationalChildNodeCommand(";
203
  protected final String TEXT_184 = "(0, 0, ";
203
  protected final String TEXT_184 = " parentView, ";
204
  protected final String TEXT_185 = ", ";
204
  protected final String TEXT_185 = " descriptor) {";
205
  protected final String TEXT_186 = ")";
205
  protected final String TEXT_186 = NL;
206
  protected final String TEXT_187 = NL + "null";
206
  protected final String TEXT_187 = "\t\t\t";
207
  protected final String TEXT_188 = ", ";
207
  protected final String TEXT_188 = " domainElement = descriptor.getElement();" + NL + "\t\t\tint nodeVisualID = descriptor.getVisualID();" + NL + "\t\t\tswitch (nodeVisualID) {";
208
  protected final String TEXT_189 = ".INSTANCE);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
208
  protected final String TEXT_189 = NL + "\t\t\tcase ";
209
  protected final String TEXT_190 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
209
  protected final String TEXT_190 = ".VISUAL_ID:" + NL + "\t\t\t\tif (domainElement instanceof ";
210
  protected final String TEXT_191 = NL + "}";
210
  protected final String TEXT_191 = ") {" + NL + "\t\t\t\t\treturn new ";
211
  protected final String TEXT_192 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
211
  protected final String TEXT_192 = "(";
212
  protected final String TEXT_193 = "ChildLinks(";
212
  protected final String TEXT_193 = ", domainElement, ";
213
  protected final String TEXT_194 = " viewObject) {";
213
  protected final String TEXT_194 = "new ";
214
  protected final String TEXT_195 = NL + "\t";
214
  protected final String TEXT_195 = "(0, 0, ";
215
  protected final String TEXT_196 = " semanticChildLinks = get";
215
  protected final String TEXT_196 = ", ";
216
  protected final String TEXT_197 = "SemanticChildLinks(viewObject);" + NL + "\tfor(";
216
  protected final String TEXT_197 = ")";
217
  protected final String TEXT_198 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t";
217
  protected final String TEXT_198 = NL + "null";
218
  protected final String TEXT_199 = " nextDescriptor = (";
218
  protected final String TEXT_199 = ", ";
219
  protected final String TEXT_200 = ") it.next();" + NL + "\t\t";
219
  protected final String TEXT_200 = ".INSTANCE);" + NL + "\t\t\t\t}" + NL + "\t\t\t\treturn null;";
220
  protected final String TEXT_201 = " createCommand = getCreate";
220
  protected final String TEXT_201 = NL + "\t\t\tdefault:" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}";
221
  protected final String TEXT_202 = "NotationalChildLinkCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();" + NL + "\t\t}" + NL + "\t}";
221
  protected final String TEXT_202 = NL + "}";
222
  protected final String TEXT_203 = NL + "\tfor(";
222
  protected final String TEXT_203 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private void create";
223
  protected final String TEXT_204 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
223
  protected final String TEXT_204 = "ChildLinks(";
224
  protected final String TEXT_205 = " next = (";
224
  protected final String TEXT_205 = " viewObject) {";
225
  protected final String TEXT_206 = ") it.next();" + NL + "\t\tint visualID = ";
225
  protected final String TEXT_206 = NL + "\t";
226
  protected final String TEXT_207 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
226
  protected final String TEXT_207 = " semanticChildLinks = get";
227
  protected final String TEXT_208 = NL + "\t\tcase ";
227
  protected final String TEXT_208 = "SemanticChildLinks(viewObject);" + NL + "\tfor(";
228
  protected final String TEXT_209 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
228
  protected final String TEXT_209 = " it = semanticChildLinks.iterator(); it.hasNext(); ) {" + NL + "\t\t";
229
  protected final String TEXT_210 = "ChildLinks(next);" + NL + "\t\t\tbreak;";
229
  protected final String TEXT_210 = " nextDescriptor = (";
230
  protected final String TEXT_211 = NL + "\t\t}" + NL + "\t}";
230
  protected final String TEXT_211 = ") it.next();" + NL + "\t\t";
231
  protected final String TEXT_212 = NL + "}" + NL;
231
  protected final String TEXT_212 = " createCommand = getCreate";
232
  protected final String TEXT_213 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
232
  protected final String TEXT_213 = "NotationalChildLinkCommand(viewObject, nextDescriptor);" + NL + "\t\tif (createCommand != null && createCommand.canExecute()) {" + NL + "\t\t\tcreateCommand.execute();" + NL + "\t\t}" + NL + "\t}";
233
  protected final String TEXT_214 = " get";
233
  protected final String TEXT_214 = NL + "\tfor(";
234
  protected final String TEXT_215 = "SemanticChildLinks(";
234
  protected final String TEXT_215 = " it = viewObject.getChildren().iterator(); it.hasNext(); ) {" + NL + "\t\t";
235
  protected final String TEXT_216 = " parentView) {";
235
  protected final String TEXT_216 = " next = (";
236
  protected final String TEXT_217 = NL;
236
  protected final String TEXT_217 = ") it.next();" + NL + "\t\tint visualID = ";
237
  protected final String TEXT_218 = "\t";
237
  protected final String TEXT_218 = ".getVisualID(next);" + NL + "\t\tswitch (visualID) {";
238
  protected final String TEXT_219 = " result = new ";
238
  protected final String TEXT_219 = NL + "\t\tcase ";
239
  protected final String TEXT_220 = "();";
239
  protected final String TEXT_220 = ".VISUAL_ID:" + NL + "\t\t\tcreate";
240
  protected final String TEXT_221 = NL + "\t";
240
  protected final String TEXT_221 = "ChildLinks(next);" + NL + "\t\t\tbreak;";
241
  protected final String TEXT_222 = " modelObject = ";
241
  protected final String TEXT_222 = NL + "\t\t}" + NL + "\t}";
242
  protected final String TEXT_223 = ".getElement();" + NL + "\t";
242
  protected final String TEXT_223 = NL + "}" + NL;
243
  protected final String TEXT_224 = " nextValue;";
243
  protected final String TEXT_224 = NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
244
  protected final String TEXT_225 = NL + "\tint linkVID;";
244
  protected final String TEXT_225 = " get";
245
  protected final String TEXT_226 = NL + "\tfor(";
245
  protected final String TEXT_226 = "SemanticChildLinks(";
246
  protected final String TEXT_227 = " it = ";
246
  protected final String TEXT_227 = " parentView) {";
247
  protected final String TEXT_228 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
247
  protected final String TEXT_228 = NL;
248
  protected final String TEXT_229 = ") it.next();";
248
  protected final String TEXT_229 = "\t";
249
  protected final String TEXT_230 = NL + "\tnextValue = (";
249
  protected final String TEXT_230 = " result = new ";
250
  protected final String TEXT_231 = ")";
250
  protected final String TEXT_231 = "();";
251
  protected final String TEXT_232 = ";";
251
  protected final String TEXT_232 = NL + "\t";
252
  protected final String TEXT_233 = NL + "\tlinkVID = ";
252
  protected final String TEXT_233 = " modelObject = ";
253
  protected final String TEXT_234 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
253
  protected final String TEXT_234 = ".getElement();" + NL + "\t";
254
  protected final String TEXT_235 = NL + "\tswitch (linkVID) {";
254
  protected final String TEXT_235 = " nextValue;";
255
  protected final String TEXT_236 = NL + "\tcase ";
255
  protected final String TEXT_236 = NL + "\tint linkVID;";
256
  protected final String TEXT_237 = ".VISUAL_ID: {";
256
  protected final String TEXT_237 = NL + "\tfor(";
257
  protected final String TEXT_238 = NL + "\tif (";
257
  protected final String TEXT_238 = " it = ";
258
  protected final String TEXT_239 = ".VISUAL_ID == linkVID) {";
258
  protected final String TEXT_239 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
259
  protected final String TEXT_240 = NL + "\t\t";
259
  protected final String TEXT_240 = ") it.next();";
260
  protected final String TEXT_241 = " source = (";
260
  protected final String TEXT_241 = NL + "\tnextValue = (";
261
  protected final String TEXT_242 = ")";
261
  protected final String TEXT_242 = ")";
262
  protected final String TEXT_243 = ";";
262
  protected final String TEXT_243 = ";";
263
  protected final String TEXT_244 = NL + "\t\t";
263
  protected final String TEXT_244 = NL + "\tlinkVID = ";
264
  protected final String TEXT_245 = " source = ";
264
  protected final String TEXT_245 = ".INSTANCE.getLinkWithClassVisualID(nextValue);";
265
  protected final String TEXT_246 = ".getElement();";
265
  protected final String TEXT_246 = NL + "\tswitch (linkVID) {";
266
  protected final String TEXT_247 = NL + "\t\t";
266
  protected final String TEXT_247 = NL + "\tcase ";
267
  protected final String TEXT_248 = " target = (";
267
  protected final String TEXT_248 = ".VISUAL_ID: {";
268
  protected final String TEXT_249 = ")";
268
  protected final String TEXT_249 = NL + "\tif (";
269
  protected final String TEXT_250 = ";";
269
  protected final String TEXT_250 = ".VISUAL_ID == linkVID) {";
270
  protected final String TEXT_251 = NL + "\t\t";
270
  protected final String TEXT_251 = NL + "\t\t";
271
  protected final String TEXT_252 = " target = ";
271
  protected final String TEXT_252 = " source = (";
272
  protected final String TEXT_253 = ".getElement();";
272
  protected final String TEXT_253 = ")";
273
  protected final String TEXT_254 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new ";
273
  protected final String TEXT_254 = ";";
274
  protected final String TEXT_255 = "(source, target, nextValue, linkVID));" + NL + "\t\t}";
274
  protected final String TEXT_255 = NL + "\t\t";
275
  protected final String TEXT_256 = NL + "\t\tbreak;" + NL + "\t}";
275
  protected final String TEXT_256 = " source = ";
276
  protected final String TEXT_257 = NL + "\t}";
276
  protected final String TEXT_257 = ".getElement();";
277
  protected final String TEXT_258 = NL + "\t}";
277
  protected final String TEXT_258 = NL + "\t\t";
278
  protected final String TEXT_259 = NL + "\t}";
278
  protected final String TEXT_259 = " target = (";
279
  protected final String TEXT_260 = NL + "\tfor(";
279
  protected final String TEXT_260 = ")";
280
  protected final String TEXT_261 = " it = ";
280
  protected final String TEXT_261 = ";";
281
  protected final String TEXT_262 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
281
  protected final String TEXT_262 = NL + "\t\t";
282
  protected final String TEXT_263 = ") it.next();";
282
  protected final String TEXT_263 = " target = ";
283
  protected final String TEXT_264 = NL + "\tnextValue = (";
283
  protected final String TEXT_264 = ".getElement();";
284
  protected final String TEXT_265 = ")";
284
  protected final String TEXT_265 = NL + "\t\tif (source != null && target != null) {" + NL + "\t\t\tresult.add(new ";
285
  protected final String TEXT_266 = ";";
285
  protected final String TEXT_266 = "(source, target, nextValue, linkVID));" + NL + "\t\t}";
286
  protected final String TEXT_267 = NL + "\tif (nextValue != null) {";
286
  protected final String TEXT_267 = NL + "\t\tbreak;" + NL + "\t}";
287
  protected final String TEXT_268 = NL + "\t\tresult.add(new ";
287
  protected final String TEXT_268 = NL + "\t}";
288
  protected final String TEXT_269 = "(modelObject, nextValue, null, ";
288
  protected final String TEXT_269 = NL + "\t}";
289
  protected final String TEXT_270 = ".VISUAL_ID));";
289
  protected final String TEXT_270 = NL + "\t}";
290
  protected final String TEXT_271 = NL + "\t}";
290
  protected final String TEXT_271 = NL + "\tfor(";
291
  protected final String TEXT_272 = NL + "\t}";
291
  protected final String TEXT_272 = " it = ";
292
  protected final String TEXT_273 = NL + "\treturn result;";
292
  protected final String TEXT_273 = ".iterator(); it.hasNext(); ) {" + NL + "\t\tnextValue = (";
293
  protected final String TEXT_274 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
293
  protected final String TEXT_274 = ") it.next();";
294
  protected final String TEXT_275 = " getCreate";
294
  protected final String TEXT_275 = NL + "\tnextValue = (";
295
  protected final String TEXT_276 = "NotationalChildLinkCommand(";
295
  protected final String TEXT_276 = ")";
296
  protected final String TEXT_277 = " parentView, ";
296
  protected final String TEXT_277 = ";";
297
  protected final String TEXT_278 = " linkDescriptor) {";
297
  protected final String TEXT_278 = NL + "\tif (nextValue != null) {";
298
  protected final String TEXT_279 = NL;
298
  protected final String TEXT_279 = NL + "\t\tresult.add(new ";
299
  protected final String TEXT_280 = "\t\t\t";
299
  protected final String TEXT_280 = "(modelObject, nextValue, null, ";
300
  protected final String TEXT_281 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t";
300
  protected final String TEXT_281 = ".VISUAL_ID));";
301
  protected final String TEXT_282 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t";
301
  protected final String TEXT_282 = NL + "\t}";
302
  protected final String TEXT_283 = " decorator = null;" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {";
302
  protected final String TEXT_283 = NL + "\t}";
303
  protected final String TEXT_284 = NL + "\t\t\tcase ";
303
  protected final String TEXT_284 = NL + "\treturn result;";
304
  protected final String TEXT_285 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof ";
304
  protected final String TEXT_285 = NL + "}" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "protected ";
305
  protected final String TEXT_286 = ") {" + NL + "\t\t\t\t\tdecorator = ";
305
  protected final String TEXT_286 = " getCreate";
306
  protected final String TEXT_287 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
306
  protected final String TEXT_287 = "NotationalChildLinkCommand(";
307
  protected final String TEXT_288 = NL + "\t\t\tcase ";
307
  protected final String TEXT_288 = " parentView, ";
308
  protected final String TEXT_289 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = ";
308
  protected final String TEXT_289 = " linkDescriptor) {";
309
  protected final String TEXT_290 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
309
  protected final String TEXT_290 = NL;
310
  protected final String TEXT_291 = NL + "\t\t\t}" + NL + "\t\t\tif (decorator == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new ";
310
  protected final String TEXT_291 = "\t\t\t";
311
  protected final String TEXT_292 = "(";
311
  protected final String TEXT_292 = " sourceView = getViewService().findView(linkDescriptor.getSource());" + NL + "\t\t\t";
312
  protected final String TEXT_293 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);";
312
  protected final String TEXT_293 = " targetView = getViewService().findView(linkDescriptor.getDestination());" + NL + "\t\t\t";
313
  protected final String TEXT_294 = NL + "}";
313
  protected final String TEXT_294 = " decorator = null;" + NL + "\t\t\tif (sourceView == null || targetView == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\tswitch (linkDescriptor.getVisualID()) {";
314
  protected final String TEXT_295 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
314
  protected final String TEXT_295 = NL + "\t\t\tcase ";
315
  protected final String TEXT_296 = " myViewService;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
315
  protected final String TEXT_296 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() instanceof ";
316
  protected final String TEXT_297 = " getViewService() {" + NL + "\treturn myViewService;" + NL + "}";
316
  protected final String TEXT_297 = ") {" + NL + "\t\t\t\t\tdecorator = ";
317
  protected final String TEXT_298 = NL;
317
  protected final String TEXT_298 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
318
  protected final String TEXT_299 = NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends ";
318
  protected final String TEXT_299 = NL + "\t\t\tcase ";
319
  protected final String TEXT_300 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
319
  protected final String TEXT_300 = ".VISUAL_ID:" + NL + "\t\t\t\tif (linkDescriptor.getElement() == null) {" + NL + "\t\t\t\t\tdecorator = ";
320
  protected final String TEXT_301 = " fileField;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected URISelectorPage(String name) {" + NL + "\t\t\tsuper(name);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createControl(";
320
  protected final String TEXT_301 = ".INSTANCE;" + NL + "\t\t\t\t}" + NL + "\t\t\t\tbreak;";
321
  protected final String TEXT_302 = " parent) {" + NL + "\t\t\t";
321
  protected final String TEXT_302 = NL + "\t\t\t}" + NL + "\t\t\tif (decorator == null) {" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t\treturn new ";
322
  protected final String TEXT_303 = " composite = new ";
322
  protected final String TEXT_303 = "(";
323
  protected final String TEXT_304 = "(parent, ";
323
  protected final String TEXT_304 = ", linkDescriptor.getElement(), sourceView, targetView, decorator);";
324
  protected final String TEXT_305 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
324
  protected final String TEXT_305 = NL + "}";
325
  protected final String TEXT_306 = " layout = new ";
325
  protected final String TEXT_306 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
326
  protected final String TEXT_307 = "();" + NL + "\t\t\t\tlayout.numColumns = 1;" + NL + "\t\t\t\tlayout.verticalSpacing = 12;" + NL + "\t\t\t\tcomposite.setLayout(layout);" + NL + "" + NL + "\t\t\t\t";
326
  protected final String TEXT_307 = " myViewService;" + NL + "" + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "private ";
327
  protected final String TEXT_308 = " data = new ";
327
  protected final String TEXT_308 = " getViewService() {" + NL + "\treturn myViewService;" + NL + "}";
328
  protected final String TEXT_309 = "();" + NL + "\t\t\t\tdata.verticalAlignment = ";
328
  protected final String TEXT_309 = NL;
329
  protected final String TEXT_310 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = ";
329
  protected final String TEXT_310 = NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate abstract class URISelectorPage extends ";
330
  protected final String TEXT_311 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t";
330
  protected final String TEXT_311 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
331
  protected final String TEXT_312 = " resourceURILabel = new ";
331
  protected final String TEXT_312 = " fileField;" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected URISelectorPage(String name) {" + NL + "\t\t\tsuper(name);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createControl(";
332
  protected final String TEXT_313 = "(composite, ";
332
  protected final String TEXT_313 = " parent) {" + NL + "\t\t\t";
333
  protected final String TEXT_314 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t";
333
  protected final String TEXT_314 = " composite = new ";
334
  protected final String TEXT_315 = " data = new ";
334
  protected final String TEXT_315 = "(parent, ";
335
  protected final String TEXT_316 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
335
  protected final String TEXT_316 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
336
  protected final String TEXT_317 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t";
336
  protected final String TEXT_317 = " layout = new ";
337
  protected final String TEXT_318 = " fileComposite = new ";
337
  protected final String TEXT_318 = "();" + NL + "\t\t\t\tlayout.numColumns = 1;" + NL + "\t\t\t\tlayout.verticalSpacing = 12;" + NL + "\t\t\t\tcomposite.setLayout(layout);" + NL + "" + NL + "\t\t\t\t";
338
  protected final String TEXT_319 = "(composite, ";
338
  protected final String TEXT_319 = " data = new ";
339
  protected final String TEXT_320 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
339
  protected final String TEXT_320 = "();" + NL + "\t\t\t\tdata.verticalAlignment = ";
340
  protected final String TEXT_321 = " data = new ";
340
  protected final String TEXT_321 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessVerticalSpace = true;" + NL + "\t\t\t\tdata.horizontalAlignment = ";
341
  protected final String TEXT_322 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
341
  protected final String TEXT_322 = ".FILL;" + NL + "\t\t\t\tcomposite.setLayoutData(data);" + NL + "\t\t\t}" + NL + "\t\t\t";
342
  protected final String TEXT_323 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tfileComposite.setLayoutData(data);" + NL + "" + NL + "\t\t\t\t";
342
  protected final String TEXT_323 = " resourceURILabel = new ";
343
  protected final String TEXT_324 = " layout = new ";
343
  protected final String TEXT_324 = "(composite, ";
344
  protected final String TEXT_325 = "();" + NL + "\t\t\t\tlayout.marginHeight = 0;" + NL + "\t\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\t\tlayout.numColumns = 2;" + NL + "\t\t\t\tfileComposite.setLayout(layout);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField = new ";
344
  protected final String TEXT_325 = ".LEFT);" + NL + "\t\t\t{" + NL + "\t\t\t\tresourceURILabel.setText(\"&File\");" + NL + "" + NL + "\t\t\t\t";
345
  protected final String TEXT_326 = "(fileComposite, ";
345
  protected final String TEXT_326 = " data = new ";
346
  protected final String TEXT_327 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
346
  protected final String TEXT_327 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
347
  protected final String TEXT_328 = " data = new ";
347
  protected final String TEXT_328 = ".FILL;" + NL + "\t\t\t\tresourceURILabel.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\t";
348
  protected final String TEXT_329 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
348
  protected final String TEXT_329 = " fileComposite = new ";
349
  protected final String TEXT_330 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tdata.horizontalSpan = 1;" + NL + "\t\t\t\tfileField.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField.addModifyListener(validator);" + NL + "\t\t\t";
349
  protected final String TEXT_330 = "(composite, ";
350
  protected final String TEXT_331 = " resourceURIBrowseFileSystemButton = new ";
350
  protected final String TEXT_331 = ".NONE);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
351
  protected final String TEXT_332 = "(fileComposite," + NL + "\t\t\t\t\t";
351
  protected final String TEXT_332 = " data = new ";
352
  protected final String TEXT_333 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new ";
352
  protected final String TEXT_333 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
353
  protected final String TEXT_334 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected(";
353
  protected final String TEXT_334 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tfileComposite.setLayoutData(data);" + NL + "" + NL + "\t\t\t\t";
354
  protected final String TEXT_335 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = ";
354
  protected final String TEXT_335 = " layout = new ";
355
  protected final String TEXT_336 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, ";
355
  protected final String TEXT_336 = "();" + NL + "\t\t\t\tlayout.marginHeight = 0;" + NL + "\t\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\t\tlayout.numColumns = 2;" + NL + "\t\t\t\tfileComposite.setLayout(layout);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField = new ";
356
  protected final String TEXT_337 = ".OPEN);" + NL + "\t\t\t\t\t\t\tif (filePath != null) {" + NL + "\t\t\t\t\t\t\t\tif (!filePath.endsWith(\".\" + fileExtension)) {" + NL + "\t\t\t\t\t\t\t\t\tfilePath = filePath + \".\" + fileExtension;" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\tfileField.setText(filePath);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\tsetControl(composite);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
356
  protected final String TEXT_337 = "(fileComposite, ";
357
  protected final String TEXT_338 = " validator = new ";
357
  protected final String TEXT_338 = ".BORDER);" + NL + "\t\t\t{" + NL + "\t\t\t\t";
358
  protected final String TEXT_339 = "() {" + NL + "\t\t\tpublic void modifyText(";
358
  protected final String TEXT_339 = " data = new ";
359
  protected final String TEXT_340 = " e) {" + NL + "\t\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected final void setFile(";
359
  protected final String TEXT_340 = "();" + NL + "\t\t\t\tdata.horizontalAlignment = ";
360
  protected final String TEXT_341 = " file) {" + NL + "\t\t\tfileField.setText(file.getPath());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\t";
360
  protected final String TEXT_341 = ".FILL;" + NL + "\t\t\t\tdata.grabExcessHorizontalSpace = true;" + NL + "\t\t\t\tdata.horizontalSpan = 1;" + NL + "\t\t\t\tfileField.setLayoutData(data);" + NL + "\t\t\t}" + NL + "" + NL + "\t\t\tfileField.addModifyListener(validator);" + NL + "\t\t\t";
361
  protected final String TEXT_342 = " fileURI = getFileURI();" + NL + "\t\t\tif (fileURI == null || fileURI.isEmpty()) {" + NL + "\t\t\t\tsetErrorMessage(null);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tif (fileURI.isFile()) {" + NL + "\t\t\t\t";
361
  protected final String TEXT_342 = " resourceURIBrowseFileSystemButton = new ";
362
  protected final String TEXT_343 = " file = new ";
362
  protected final String TEXT_343 = "(fileComposite," + NL + "\t\t\t\t\t";
363
  protected final String TEXT_344 = "(fileURI.toFileString());" + NL + "\t\t\t\tString fileProblem = validateFile(file);" + NL + "\t\t\t\tif (fileProblem != null) {" + NL + "\t\t\t\t\tsetErrorMessage(fileProblem);" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tString requiredExt = getFileExtension();" + NL + "\t\t\tString enteredExt = fileURI.fileExtension();" + NL + "\t\t\tif (enteredExt == null || !enteredExt.equals(requiredExt)) {" + NL + "\t\t\t\tsetErrorMessage(\"The file name must end in \" + requiredExt);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tsetErrorMessage(null);" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Checks the given file and returns the error message if there are problems or <code>null</code> if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile(";
363
  protected final String TEXT_344 = ".PUSH);" + NL + "\t\t\tresourceURIBrowseFileSystemButton.setText(\"&Browse\");" + NL + "" + NL + "\t\t\tresourceURIBrowseFileSystemButton" + NL + "\t\t\t\t\t.addSelectionListener(new ";
364
  protected final String TEXT_345 = " file);" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String getFileExtension();" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
364
  protected final String TEXT_345 = "() {" + NL + "\t\t\t\t\t\tpublic void widgetSelected(";
365
  protected final String TEXT_346 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn ";
365
  protected final String TEXT_346 = " event) {" + NL + "\t\t\t\t\t\t\tString fileExtension = getFileExtension();" + NL + "\t\t\t\t\t\t\tString filePath = ";
366
  protected final String TEXT_347 = ".createFileURI(fileField.getText());" + NL + "\t\t\t} catch (Exception exception) {" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class SourceURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic SourceURISelectorPage() {" + NL + "\t\t\tsuper(\"Select source file\");" + NL + "\t\t\tsetTitle(\"Source file\");" + NL + "\t\t\tsetDescription(\"Select file with semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \"";
366
  protected final String TEXT_347 = ".openFilePathDialog(getShell(), \"*.\" + fileExtension, ";
367
  protected final String TEXT_348 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmySelectedModelFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile(";
367
  protected final String TEXT_348 = ".OPEN);" + NL + "\t\t\t\t\t\t\tif (filePath != null) {" + NL + "\t\t\t\t\t\t\t\tif (!filePath.endsWith(\".\" + fileExtension)) {" + NL + "\t\t\t\t\t\t\t\t\tfilePath = filePath + \".\" + fileExtension;" + NL + "\t\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\t\tfileField.setText(filePath);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t});" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\tsetControl(composite);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
368
  protected final String TEXT_349 = " file) {" + NL + "\t\t\tif (!file.exists()) {" + NL + "\t\t\t\treturn \"Source file does not exist\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class DiagramURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
368
  protected final String TEXT_349 = " validator = new ";
369
  protected final String TEXT_350 = " myNewFileURI;" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic DiagramURISelectorPage() {" + NL + "\t\t\tsuper(\"Initialize new ";
369
  protected final String TEXT_350 = "() {" + NL + "\t\t\tpublic void modifyText(";
370
  protected final String TEXT_351 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on ";
370
  protected final String TEXT_351 = " e) {" + NL + "\t\t\t\tsetPageComplete(validatePage());" + NL + "\t\t\t}" + NL + "\t\t};" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected final void setFile(";
371
  protected final String TEXT_352 = " model content\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \"";
371
  protected final String TEXT_352 = " file) {" + NL + "\t\t\tfileField.setText(file.getPath());" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\t";
372
  protected final String TEXT_353 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t\tif (visible && mySelectedModelFileURI != null && getFileURI() == null && mySelectedModelFileURI.isFile()) {" + NL + "\t\t\t\t";
372
  protected final String TEXT_353 = " fileURI = getFileURI();" + NL + "\t\t\tif (fileURI == null || fileURI.isEmpty()) {" + NL + "\t\t\t\tsetErrorMessage(null);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tif (fileURI.isFile()) {" + NL + "\t\t\t\t";
373
  protected final String TEXT_354 = " originalFile = new ";
373
  protected final String TEXT_354 = " file = new ";
374
  protected final String TEXT_355 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t";
374
  protected final String TEXT_355 = "(fileURI.toFileString());" + NL + "\t\t\t\tString fileProblem = validateFile(file);" + NL + "\t\t\t\tif (fileProblem != null) {" + NL + "\t\t\t\t\tsetErrorMessage(fileProblem);" + NL + "\t\t\t\t\treturn false;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tString requiredExt = getFileExtension();" + NL + "\t\t\tString enteredExt = fileURI.fileExtension();" + NL + "\t\t\tif (enteredExt == null || !enteredExt.equals(requiredExt)) {" + NL + "\t\t\t\tsetErrorMessage(\"The file name must end in \" + requiredExt);" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tsetErrorMessage(null);" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Checks the given file and returns the error message if there are problems or <code>null</code> if the file is OK." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String validateFile(";
375
  protected final String TEXT_356 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t";
375
  protected final String TEXT_356 = " file);" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected abstract String getFileExtension();" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
376
  protected final String TEXT_357 = " newFile = new ";
376
  protected final String TEXT_357 = " getFileURI() {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn ";
377
  protected final String TEXT_358 = "(parentFile, originalFileName + getFileExtension());" + NL + "\t\t\t\tfor(int i = 1; i > 0 && newFile.exists(); i++) {" + NL + "\t\t\t\t\tnewFile = new ";
377
  protected final String TEXT_358 = ".createFileURI(fileField.getText());" + NL + "\t\t\t} catch (Exception exception) {" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class SourceURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic SourceURISelectorPage() {" + NL + "\t\t\tsuper(\"Select source file\");" + NL + "\t\t\tsetTitle(\"Source file\");" + NL + "\t\t\tsetDescription(\"Select file with semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \"";
378
  protected final String TEXT_359 = "(parentFile, originalFileName + i + getFileExtension());" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (newFile.exists()) {" + NL + "\t\t\t\t\treturn;\t//failed to set name that does not exist, just leave empty." + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFile(newFile);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tmyNewFileURI = null;" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmyNewFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
378
  protected final String TEXT_359 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmySelectedModelFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile(";
379
  protected final String TEXT_360 = " getNewFileURI() {" + NL + "\t\t\treturn myNewFileURI;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile(";
379
  protected final String TEXT_360 = " file) {" + NL + "\t\t\tif (!file.exists()) {" + NL + "\t\t\t\treturn \"Source file does not exist\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class DiagramURISelectorPage extends URISelectorPage {" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
380
  protected final String TEXT_361 = " file) {" + NL + "\t\t\tif (file.exists()) {" + NL + "\t\t\t\treturn \"Diagram file already exists\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}";
380
  protected final String TEXT_361 = " myNewFileURI;" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic DiagramURISelectorPage() {" + NL + "\t\t\tsuper(\"Initialize new ";
381
  protected final String TEXT_362 = NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends ";
381
  protected final String TEXT_362 = " diagram file\");" + NL + "\t\t\tsetTitle(\"Diagram file\");" + NL + "\t\t\tsetDescription(\"Create new diagram based on ";
382
  protected final String TEXT_363 = " implements ";
382
  protected final String TEXT_363 = " model content\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String getFileExtension() {" + NL + "\t\t\treturn \"";
383
  protected final String TEXT_364 = " {";
383
  protected final String TEXT_364 = "\";" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t\tif (visible && mySelectedModelFileURI != null && getFileURI() == null && mySelectedModelFileURI.isFile()) {" + NL + "\t\t\t\t";
384
  protected final String TEXT_365 = NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
384
  protected final String TEXT_365 = " originalFile = new ";
385
  protected final String TEXT_366 = " myTreeViewer;";
385
  protected final String TEXT_366 = "(mySelectedModelFileURI.toFileString());" + NL + "\t\t\t\tString originalFileName = mySelectedModelFileURI.trimFileExtension().lastSegment();" + NL + "\t\t\t\t";
386
  protected final String TEXT_367 = NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */" + NL + "\t\tprotected RootElementSelectorPage() {" + NL + "\t\t\tsuper(\"Select diagram root element\");" + NL + "\t\t\tsetTitle(\"Diagram root element\");" + NL + "\t\t\tsetDescription(\"Select semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */\t\t" + NL + "\t\tpublic void createControl(";
386
  protected final String TEXT_367 = " parentFile = originalFile.getParentFile();" + NL + "\t\t\t\t";
387
  protected final String TEXT_368 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t";
387
  protected final String TEXT_368 = " newFile = new ";
388
  protected final String TEXT_369 = " topLevel = new ";
388
  protected final String TEXT_369 = "(parentFile, originalFileName + getFileExtension());" + NL + "\t\t\t\tfor(int i = 1; i > 0 && newFile.exists(); i++) {" + NL + "\t\t\t\t\tnewFile = new ";
389
  protected final String TEXT_370 = "(parent, ";
389
  protected final String TEXT_370 = "(parentFile, originalFileName + i + getFileExtension());" + NL + "\t\t\t\t}" + NL + "\t\t\t\tif (newFile.exists()) {" + NL + "\t\t\t\t\treturn;\t//failed to set name that does not exist, just leave empty." + NL + "\t\t\t\t}" + NL + "\t\t\t\tsetFile(newFile);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected boolean validatePage() {" + NL + "\t\t\tmyNewFileURI = null;" + NL + "\t\t\tif (super.validatePage()) {" + NL + "\t\t\t\tmyNewFileURI = getFileURI();" + NL + "\t\t\t\treturn true;" + NL + "\t\t\t}" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
390
  protected final String TEXT_371 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new ";
390
  protected final String TEXT_371 = " getNewFileURI() {" + NL + "\t\t\treturn myNewFileURI;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t     * @generated" + NL + "\t\t */" + NL + "\t\tprotected String validateFile(";
391
  protected final String TEXT_372 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new ";
391
  protected final String TEXT_372 = " file) {" + NL + "\t\t\tif (file.exists()) {" + NL + "\t\t\t\treturn \"Diagram file already exists\";" + NL + "\t\t\t}" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}";
392
  protected final String TEXT_373 = "(";
392
  protected final String TEXT_373 = NL + "\t/**" + NL + "     * @generated" + NL + "\t */" + NL + "\tprivate class RootElementSelectorPage extends ";
393
  protected final String TEXT_374 = ".VERTICAL_ALIGN_FILL | ";
393
  protected final String TEXT_374 = " implements ";
394
  protected final String TEXT_375 = ".HORIZONTAL_ALIGN_FILL));" + NL + "\t\t\ttopLevel.setFont(parent.getFont());" + NL + "\t\t\tsetControl(topLevel);" + NL + "\t\t\tcreateModelBrowser(topLevel);" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createModelBrowser(";
394
  protected final String TEXT_375 = " {";
395
  protected final String TEXT_376 = " parent) {" + NL + "\t\t\t";
395
  protected final String TEXT_376 = NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */" + NL + "\t\tprivate ";
396
  protected final String TEXT_377 = " panel = new ";
396
  protected final String TEXT_377 = " myTreeViewer;";
397
  protected final String TEXT_378 = "(parent, ";
397
  protected final String TEXT_378 = NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */" + NL + "\t\tprotected RootElementSelectorPage() {" + NL + "\t\t\tsuper(\"Select diagram root element\");" + NL + "\t\t\tsetTitle(\"Diagram root element\");" + NL + "\t\t\tsetDescription(\"Select semantic model element to be depicted on diagram\");" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */\t\t" + NL + "\t\tpublic void createControl(";
398
  protected final String TEXT_379 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new ";
398
  protected final String TEXT_379 = " parent) {" + NL + "\t\t\tinitializeDialogUnits(parent);" + NL + "\t\t\t";
399
  protected final String TEXT_380 = "(";
399
  protected final String TEXT_380 = " topLevel = new ";
400
  protected final String TEXT_381 = ".FILL_BOTH));" + NL + "\t\t\t";
400
  protected final String TEXT_381 = "(parent, ";
401
  protected final String TEXT_382 = " layout = new ";
401
  protected final String TEXT_382 = ".NONE);" + NL + "\t\t\ttopLevel.setLayout(new ";
402
  protected final String TEXT_383 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t";
402
  protected final String TEXT_383 = "());" + NL + "\t\t\ttopLevel.setLayoutData(new ";
403
  protected final String TEXT_384 = " label = new ";
403
  protected final String TEXT_384 = "(";
404
  protected final String TEXT_385 = "(panel, ";
404
  protected final String TEXT_385 = ".VERTICAL_ALIGN_FILL | ";
405
  protected final String TEXT_386 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new ";
405
  protected final String TEXT_386 = ".HORIZONTAL_ALIGN_FILL));" + NL + "\t\t\ttopLevel.setFont(parent.getFont());" + NL + "\t\t\tsetControl(topLevel);" + NL + "\t\t\tcreateModelBrowser(topLevel);" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void createModelBrowser(";
406
  protected final String TEXT_387 = "(";
406
  protected final String TEXT_387 = " parent) {" + NL + "\t\t\t";
407
  protected final String TEXT_388 = ".HORIZONTAL_ALIGN_BEGINNING));";
407
  protected final String TEXT_388 = " panel = new ";
408
  protected final String TEXT_389 = NL + "\t\t\t";
408
  protected final String TEXT_389 = "(parent, ";
409
  protected final String TEXT_390 = " ";
409
  protected final String TEXT_390 = ".NONE);" + NL + "\t\t\tpanel.setLayoutData(new ";
410
  protected final String TEXT_391 = " = new ";
410
  protected final String TEXT_391 = "(";
411
  protected final String TEXT_392 = "(panel, ";
411
  protected final String TEXT_392 = ".FILL_BOTH));" + NL + "\t\t\t";
412
  protected final String TEXT_393 = ".SINGLE | ";
412
  protected final String TEXT_393 = " layout = new ";
413
  protected final String TEXT_394 = ".H_SCROLL | ";
413
  protected final String TEXT_394 = "();" + NL + "\t\t\tlayout.marginWidth = 0;" + NL + "\t\t\tpanel.setLayout(layout);" + NL + "\t\t\t" + NL + "\t\t\t";
414
  protected final String TEXT_395 = ".V_SCROLL | ";
414
  protected final String TEXT_395 = " label = new ";
415
  protected final String TEXT_396 = ".BORDER);" + NL + "\t\t\t";
415
  protected final String TEXT_396 = "(panel, ";
416
  protected final String TEXT_397 = " layoutData = new ";
416
  protected final String TEXT_397 = ".NONE);" + NL + "\t\t\tlabel.setText(\"Select diagram root element:\");" + NL + "\t\t\tlabel.setLayoutData(new ";
417
  protected final String TEXT_398 = "(";
417
  protected final String TEXT_398 = "(";
418
  protected final String TEXT_399 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t";
418
  protected final String TEXT_399 = ".HORIZONTAL_ALIGN_BEGINNING));";
419
  protected final String TEXT_400 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t";
419
  protected final String TEXT_400 = NL + "\t\t\t";
420
  protected final String TEXT_401 = ".setContentProvider(new ";
420
  protected final String TEXT_401 = " ";
421
  protected final String TEXT_402 = "(";
421
  protected final String TEXT_402 = " = new ";
422
  protected final String TEXT_403 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t";
422
  protected final String TEXT_403 = "(panel, ";
423
  protected final String TEXT_404 = ".setLabelProvider(new ";
423
  protected final String TEXT_404 = ".SINGLE | ";
424
  protected final String TEXT_405 = "(";
424
  protected final String TEXT_405 = ".H_SCROLL | ";
425
  protected final String TEXT_406 = ".getInstance().getItemProvidersAdapterFactory()));";
425
  protected final String TEXT_406 = ".V_SCROLL | ";
426
  protected final String TEXT_407 = NL + "\t\t\t";
426
  protected final String TEXT_407 = ".BORDER);" + NL + "\t\t\t";
427
  protected final String TEXT_408 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t";
427
  protected final String TEXT_408 = " layoutData = new ";
428
  protected final String TEXT_409 = ".setSelection(new ";
428
  protected final String TEXT_409 = "(";
429
  protected final String TEXT_410 = "(myDiagramRoot));";
429
  protected final String TEXT_410 = ".FILL_BOTH);" + NL + "\t\t\tlayoutData.heightHint = 300;" + NL + "\t\t\tlayoutData.widthHint = 300;" + NL + "\t\t\t";
430
  protected final String TEXT_411 = NL + "\t\t\t";
430
  protected final String TEXT_411 = ".getTree().setLayoutData(layoutData);" + NL + "\t\t\t";
431
  protected final String TEXT_412 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL;
431
  protected final String TEXT_412 = ".setContentProvider(new ";
432
  protected final String TEXT_413 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tif (visible) {" + NL + "\t\t\t\t";
432
  protected final String TEXT_413 = "(";
433
  protected final String TEXT_414 = ".setInput(myEditingDomain.getResourceSet().getResource(mySelectedModelFileURI, true));" + NL + "\t\t\t\tif (myDiagramRoot != null) {" + NL + "\t\t\t\t\tmyTreeViewer.setSelection(new ";
433
  protected final String TEXT_414 = ".getInstance().getItemProvidersAdapterFactory()));" + NL + "\t\t\t";
434
  protected final String TEXT_415 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL;
434
  protected final String TEXT_415 = ".setLabelProvider(new ";
435
  protected final String TEXT_416 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged(";
435
  protected final String TEXT_416 = "(";
436
  protected final String TEXT_417 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof ";
436
  protected final String TEXT_417 = ".getInstance().getItemProvidersAdapterFactory()));";
437
  protected final String TEXT_418 = ") {" + NL + "\t\t\t\t";
437
  protected final String TEXT_418 = NL + "\t\t\t";
438
  protected final String TEXT_419 = " selection = (";
438
  protected final String TEXT_419 = ".setInput(myDiagramRoot.eResource());" + NL + "\t\t\t";
439
  protected final String TEXT_420 = ") event.getSelection();" + NL + "\t\t\t\tif (selection.size() == 1) {" + NL + "\t\t\t\t\tObject selectedElement = selection.getFirstElement();" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
439
  protected final String TEXT_420 = ".setSelection(new ";
440
  protected final String TEXT_421 = ") {" + NL + "\t\t\t\t\t\tselectedElement = ((";
440
  protected final String TEXT_421 = "(myDiagramRoot));";
441
  protected final String TEXT_422 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
441
  protected final String TEXT_422 = NL + "\t\t\t";
442
  protected final String TEXT_423 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = ((";
442
  protected final String TEXT_423 = ".addSelectionChangedListener(this);" + NL + "\t\t}" + NL;
443
  protected final String TEXT_424 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
443
  protected final String TEXT_424 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void setVisible(boolean visible) {" + NL + "\t\t\tif (visible) {" + NL + "\t\t\t\t";
444
  protected final String TEXT_425 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = (";
444
  protected final String TEXT_425 = ".setInput(myEditingDomain.getResourceSet().getResource(mySelectedModelFileURI, true));" + NL + "\t\t\t\tif (myDiagramRoot != null) {" + NL + "\t\t\t\t\tmyTreeViewer.setSelection(new ";
445
  protected final String TEXT_426 = ") selectedElement;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */\t" + NL + "\t\tprivate boolean validatePage() {" + NL + "\t\t\tif (myDiagramRoot == null) {" + NL + "\t\t\t\tsetErrorMessage(\"No diagram root element selected\");" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tboolean result = ";
445
  protected final String TEXT_426 = "(myDiagramRoot));" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsuper.setVisible(visible);" + NL + "\t\t}" + NL;
446
  protected final String TEXT_427 = ".VISUAL_ID == ";
446
  protected final String TEXT_427 = NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void selectionChanged(";
447
  protected final String TEXT_428 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\tsetErrorMessage(result ? null : \"Invalid diagram root element was selected\");" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
447
  protected final String TEXT_428 = " event) {" + NL + "\t\t\tmyDiagramRoot = null;" + NL + "\t\t\tif (event.getSelection() instanceof ";
448
  protected final String TEXT_429 = NL;
448
  protected final String TEXT_429 = ") {" + NL + "\t\t\t\t";
449
  protected final String TEXT_430 = " selection = (";
450
  protected final String TEXT_431 = ") event.getSelection();" + NL + "\t\t\t\tif (selection.size() == 1) {" + NL + "\t\t\t\t\tObject selectedElement = selection.getFirstElement();" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
451
  protected final String TEXT_432 = ") {" + NL + "\t\t\t\t\t\tselectedElement = ((";
452
  protected final String TEXT_433 = ") selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
453
  protected final String TEXT_434 = ".Entry) {" + NL + "\t\t\t\t\t\tselectedElement = ((";
454
  protected final String TEXT_435 = ".Entry) selectedElement).getValue();" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tif (selectedElement instanceof ";
455
  protected final String TEXT_436 = ") {" + NL + "\t\t\t\t\t\tmyDiagramRoot = (";
456
  protected final String TEXT_437 = ") selectedElement;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tsetPageComplete(validatePage());" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "    \t * @generated" + NL + "\t\t */\t" + NL + "\t\tprivate boolean validatePage() {" + NL + "\t\t\tif (myDiagramRoot == null) {" + NL + "\t\t\t\tsetErrorMessage(\"No diagram root element selected\");" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t\tboolean result = ";
457
  protected final String TEXT_438 = ".VISUAL_ID == ";
458
  protected final String TEXT_439 = ".INSTANCE.getDiagramVisualID(myDiagramRoot);" + NL + "\t\t\tsetErrorMessage(result ? null : \"Invalid diagram root element was selected\");" + NL + "\t\t\treturn result;" + NL + "\t\t}" + NL + "\t}" + NL + "}";
459
  protected final String TEXT_440 = NL;
449
460
450
  public String generate(Object argument)
461
  public String generate(Object argument)
451
  {
462
  {
Lines 721-778 Link Here
721
if (isRichClientPlatform) {
732
if (isRichClientPlatform) {
722
733
723
    stringBuffer.append(TEXT_87);
734
    stringBuffer.append(TEXT_87);
724
    stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
735
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
725
    stringBuffer.append(TEXT_88);
736
    stringBuffer.append(TEXT_88);
737
    stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
738
    stringBuffer.append(TEXT_89);
726
    
739
    
727
} else {
740
} else {
728
741
729
    stringBuffer.append(TEXT_89);
730
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE"));
731
    stringBuffer.append(TEXT_90);
742
    stringBuffer.append(TEXT_90);
743
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
744
    stringBuffer.append(TEXT_91);
745
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.ide.IDE"));
746
    stringBuffer.append(TEXT_92);
732
    
747
    
733
}
748
}
734
749
735
    stringBuffer.append(TEXT_91);
750
    stringBuffer.append(TEXT_93);
751
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
752
    stringBuffer.append(TEXT_94);
753
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
754
    stringBuffer.append(TEXT_95);
755
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IDiagramLayouter"));
756
    stringBuffer.append(TEXT_96);
757
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
758
    stringBuffer.append(TEXT_97);
759
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
760
    stringBuffer.append(TEXT_98);
761
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
762
    stringBuffer.append(TEXT_99);
763
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.command.Command"));
764
    stringBuffer.append(TEXT_100);
765
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalEditPart"));
766
    stringBuffer.append(TEXT_101);
767
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.WrappingCommand"));
768
    stringBuffer.append(TEXT_102);
736
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
769
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
737
    stringBuffer.append(TEXT_92);
770
    stringBuffer.append(TEXT_103);
738
    
771
    
739
if (isRichClientPlatform) {
772
if (isRichClientPlatform) {
740
773
741
    stringBuffer.append(TEXT_93);
774
    stringBuffer.append(TEXT_104);
742
    stringBuffer.append(pluginActivatorClass);
775
    stringBuffer.append(pluginActivatorClass);
743
    stringBuffer.append(TEXT_94);
776
    stringBuffer.append(TEXT_105);
744
    
777
    
745
} else {
778
} else {
746
779
747
    stringBuffer.append(TEXT_95);
780
    stringBuffer.append(TEXT_106);
748
    stringBuffer.append(pluginActivatorClass);
781
    stringBuffer.append(pluginActivatorClass);
749
    stringBuffer.append(TEXT_96);
782
    stringBuffer.append(TEXT_107);
750
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
783
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
751
    stringBuffer.append(TEXT_97);
784
    stringBuffer.append(TEXT_108);
752
    stringBuffer.append(pluginActivatorClass);
785
    stringBuffer.append(pluginActivatorClass);
753
    stringBuffer.append(TEXT_98);
786
    stringBuffer.append(TEXT_109);
754
    
787
    
755
}
788
}
756
789
757
    stringBuffer.append(TEXT_99);
790
    stringBuffer.append(TEXT_110);
758
    stringBuffer.append(TEXT_100);
791
    stringBuffer.append(TEXT_111);
759
    stringBuffer.append(TEXT_101);
792
    stringBuffer.append(TEXT_112);
760
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
793
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
761
    stringBuffer.append(TEXT_102);
794
    stringBuffer.append(TEXT_113);
762
    stringBuffer.append(genDiagram.getUniqueIdentifier());
795
    stringBuffer.append(genDiagram.getUniqueIdentifier());
763
    stringBuffer.append(TEXT_103);
796
    stringBuffer.append(TEXT_114);
764
    
797
    
765
if(!genDiagram.getLinks().isEmpty()) {
798
if(!genDiagram.getLinks().isEmpty()) {
766
799
767
    stringBuffer.append(TEXT_104);
800
    stringBuffer.append(TEXT_115);
768
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService"));
801
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.NaiveViewService"));
769
    stringBuffer.append(TEXT_105);
802
    stringBuffer.append(TEXT_116);
770
    stringBuffer.append(genDiagram.getUniqueIdentifier());
803
    stringBuffer.append(genDiagram.getUniqueIdentifier());
771
    stringBuffer.append(TEXT_106);
804
    stringBuffer.append(TEXT_117);
772
    
805
    
773
}
806
}
774
807
775
    stringBuffer.append(TEXT_107);
808
    stringBuffer.append(TEXT_118);
776
    
809
    
777
final Comparator<GenContainerBase> comparator = new Comparator<GenContainerBase>() {
810
final Comparator<GenContainerBase> comparator = new Comparator<GenContainerBase>() {
778
	public int compare(GenContainerBase o1, GenContainerBase o2) {
811
	public int compare(GenContainerBase o1, GenContainerBase o2) {
Lines 804-814 Link Here
804
for (Iterator<GenContainerBase> containers = containers2Generate.iterator(); containers.hasNext();) {
837
for (Iterator<GenContainerBase> containers = containers2Generate.iterator(); containers.hasNext();) {
805
	GenContainerBase nextContainer = containers.next();
838
	GenContainerBase nextContainer = containers.next();
806
839
807
    stringBuffer.append(TEXT_108);
840
    stringBuffer.append(TEXT_119);
808
    stringBuffer.append(nextContainer.getUniqueIdentifier());
841
    stringBuffer.append(nextContainer.getUniqueIdentifier());
809
    stringBuffer.append(TEXT_109);
842
    stringBuffer.append(TEXT_120);
810
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
843
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
811
    stringBuffer.append(TEXT_110);
844
    stringBuffer.append(TEXT_121);
812
    
845
    
813
	if (nextContainer instanceof GenNode) {
846
	if (nextContainer instanceof GenNode) {
814
		boolean shouldIterateOverCompartments = false;
847
		boolean shouldIterateOverCompartments = false;
Lines 821-835 Link Here
821
		}
854
		}
822
		if (shouldIterateOverCompartments) {
855
		if (shouldIterateOverCompartments) {
823
856
824
    stringBuffer.append(TEXT_111);
857
    stringBuffer.append(TEXT_122);
825
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
858
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
826
    stringBuffer.append(TEXT_112);
859
    stringBuffer.append(TEXT_123);
827
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
860
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
828
    stringBuffer.append(TEXT_113);
861
    stringBuffer.append(TEXT_124);
829
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
862
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
830
    stringBuffer.append(TEXT_114);
863
    stringBuffer.append(TEXT_125);
831
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
864
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
832
    stringBuffer.append(TEXT_115);
865
    stringBuffer.append(TEXT_126);
833
    
866
    
834
			for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
867
			for(Iterator compartments = ((GenNode) nextContainer).getCompartments().iterator(); compartments.hasNext(); ) {
835
				GenCompartment nextCompartment = (GenCompartment) compartments.next();
868
				GenCompartment nextCompartment = (GenCompartment) compartments.next();
Lines 837-870 Link Here
837
					continue;
870
					continue;
838
				}
871
				}
839
872
840
    stringBuffer.append(TEXT_116);
873
    stringBuffer.append(TEXT_127);
841
    stringBuffer.append(importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName()));
874
    stringBuffer.append(importManager.getImportedName(nextCompartment.getEditPartQualifiedClassName()));
842
    stringBuffer.append(TEXT_117);
875
    stringBuffer.append(TEXT_128);
843
    stringBuffer.append(nextCompartment.getUniqueIdentifier());
876
    stringBuffer.append(nextCompartment.getUniqueIdentifier());
844
    stringBuffer.append(TEXT_118);
877
    stringBuffer.append(TEXT_129);
845
    
878
    
846
			}
879
			}
847
880
848
    stringBuffer.append(TEXT_119);
881
    stringBuffer.append(TEXT_130);
849
    
882
    
850
		}
883
		}
851
	}
884
	}
852
885
853
    stringBuffer.append(TEXT_120);
886
    stringBuffer.append(TEXT_131);
854
    stringBuffer.append(importManager.getImportedName("java.util.List"));
887
    stringBuffer.append(importManager.getImportedName("java.util.List"));
855
    stringBuffer.append(TEXT_121);
888
    stringBuffer.append(TEXT_132);
856
    stringBuffer.append(nextContainer.getUniqueIdentifier());
889
    stringBuffer.append(nextContainer.getUniqueIdentifier());
857
    stringBuffer.append(TEXT_122);
890
    stringBuffer.append(TEXT_133);
858
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
891
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
859
    stringBuffer.append(TEXT_123);
892
    stringBuffer.append(TEXT_134);
860
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
893
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
861
    stringBuffer.append(TEXT_124);
894
    stringBuffer.append(TEXT_135);
862
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
895
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
863
    stringBuffer.append(TEXT_125);
896
    stringBuffer.append(TEXT_136);
864
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
897
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
865
    stringBuffer.append(TEXT_126);
898
    stringBuffer.append(TEXT_137);
866
    stringBuffer.append(nextContainer.getUniqueIdentifier());
899
    stringBuffer.append(nextContainer.getUniqueIdentifier());
867
    stringBuffer.append(TEXT_127);
900
    stringBuffer.append(TEXT_138);
868
    
901
    
869
	boolean shouldIterateToGenerate = false;
902
	boolean shouldIterateToGenerate = false;
870
	for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
903
	for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
Lines 876-929 Link Here
876
	}
909
	}
877
	if (shouldIterateToGenerate) {
910
	if (shouldIterateToGenerate) {
878
911
879
    stringBuffer.append(TEXT_128);
912
    stringBuffer.append(TEXT_139);
880
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
913
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
881
    stringBuffer.append(TEXT_129);
914
    stringBuffer.append(TEXT_140);
882
    
915
    
883
		for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
916
		for(Iterator containedNodes = nextContainer.getContainedNodes().iterator(); containedNodes.hasNext(); ) {
884
			GenNode nextNode = (GenNode) containedNodes.next();
917
			GenNode nextNode = (GenNode) containedNodes.next();
885
			if (containers2Generate.contains(nextNode)) {
918
			if (containers2Generate.contains(nextNode)) {
886
919
887
    stringBuffer.append(TEXT_130);
920
    stringBuffer.append(TEXT_141);
888
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
921
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
889
    stringBuffer.append(TEXT_131);
922
    stringBuffer.append(TEXT_142);
890
    stringBuffer.append(nextNode.getUniqueIdentifier());
923
    stringBuffer.append(nextNode.getUniqueIdentifier());
891
    stringBuffer.append(TEXT_132);
924
    stringBuffer.append(TEXT_143);
892
    
925
    
893
			}
926
			}
894
		}
927
		}
895
928
896
    stringBuffer.append(TEXT_133);
929
    stringBuffer.append(TEXT_144);
897
    
930
    
898
	}
931
	}
899
932
900
    stringBuffer.append(TEXT_134);
933
    stringBuffer.append(TEXT_145);
901
    stringBuffer.append(importManager.getImportedName("java.util.List"));
934
    stringBuffer.append(importManager.getImportedName("java.util.List"));
902
    stringBuffer.append(TEXT_135);
935
    stringBuffer.append(TEXT_146);
903
    stringBuffer.append(nextContainer.getUniqueIdentifier());
936
    stringBuffer.append(nextContainer.getUniqueIdentifier());
904
    stringBuffer.append(TEXT_136);
937
    stringBuffer.append(TEXT_147);
905
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
938
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
906
    stringBuffer.append(TEXT_137);
939
    stringBuffer.append(TEXT_148);
907
    
940
    
908
	{
941
	{
909
		String _getViewCode = "parentView";
942
		String _getViewCode = "parentView";
910
		List childNodes = nextContainer.getContainedNodes();
943
		List childNodes = nextContainer.getContainedNodes();
911
944
912
    stringBuffer.append(TEXT_138);
945
    stringBuffer.append(TEXT_149);
913
    
946
    
914
if (childNodes.size() == 0) {
947
if (childNodes.size() == 0) {
915
948
916
    stringBuffer.append(TEXT_139);
949
    stringBuffer.append(TEXT_150);
917
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
950
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
918
    stringBuffer.append(TEXT_140);
951
    stringBuffer.append(TEXT_151);
919
    
952
    
920
} else {
953
} else {
921
954
922
    stringBuffer.append(TEXT_141);
955
    stringBuffer.append(TEXT_152);
923
    stringBuffer.append(importManager.getImportedName("java.util.List"));
956
    stringBuffer.append(importManager.getImportedName("java.util.List"));
924
    stringBuffer.append(TEXT_142);
957
    stringBuffer.append(TEXT_153);
925
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
958
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
926
    stringBuffer.append(TEXT_143);
959
    stringBuffer.append(TEXT_154);
927
    
960
    
928
	Map genFeature2genNodeMap = new LinkedHashMap();
961
	Map genFeature2genNodeMap = new LinkedHashMap();
929
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
962
	for (int nodeIndex = 0; nodeIndex < childNodes.size(); nodeIndex++) {
Lines 941-955 Link Here
941
	Set entrySet = genFeature2genNodeMap.entrySet();
974
	Set entrySet = genFeature2genNodeMap.entrySet();
942
	if (entrySet.size() > 0) {
975
	if (entrySet.size() > 0) {
943
976
944
    stringBuffer.append(TEXT_144);
977
    stringBuffer.append(TEXT_155);
945
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
978
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
946
    stringBuffer.append(TEXT_145);
979
    stringBuffer.append(TEXT_156);
947
    stringBuffer.append(_getViewCode);
980
    stringBuffer.append(_getViewCode);
948
    stringBuffer.append(TEXT_146);
981
    stringBuffer.append(TEXT_157);
949
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
982
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
950
    stringBuffer.append(TEXT_147);
983
    stringBuffer.append(TEXT_158);
951
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
984
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
952
    stringBuffer.append(TEXT_148);
985
    stringBuffer.append(TEXT_159);
953
    
986
    
954
	}
987
	}
955
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
988
	for (Iterator entries = entrySet.iterator(); entries.hasNext();) {
Lines 958-1049 Link Here
958
		Collection genNodesCollection = (Collection) nextEntry.getValue();
991
		Collection genNodesCollection = (Collection) nextEntry.getValue();
959
		if (childMetaFeature.isListType()) {
992
		if (childMetaFeature.isListType()) {
960
993
961
    stringBuffer.append(TEXT_149);
994
    stringBuffer.append(TEXT_160);
962
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
995
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
963
    stringBuffer.append(TEXT_150);
996
    stringBuffer.append(TEXT_161);
964
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
997
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, true);
965
    stringBuffer.append(TEXT_151);
998
    stringBuffer.append(TEXT_162);
966
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
999
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
967
    stringBuffer.append(TEXT_152);
1000
    stringBuffer.append(TEXT_163);
968
    
1001
    
969
		} else {
1002
		} else {
970
1003
971
    stringBuffer.append(TEXT_153);
1004
    stringBuffer.append(TEXT_164);
972
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1005
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
973
    stringBuffer.append(TEXT_154);
1006
    stringBuffer.append(TEXT_165);
974
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
1007
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", childMetaFeature, null, false);
975
    stringBuffer.append(TEXT_155);
1008
    stringBuffer.append(TEXT_166);
976
    
1009
    
977
	}
1010
	}
978
1011
979
    stringBuffer.append(TEXT_156);
1012
    stringBuffer.append(TEXT_167);
980
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1013
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
981
    stringBuffer.append(TEXT_157);
1014
    stringBuffer.append(TEXT_168);
982
    
1015
    
983
	boolean generateSwitch = genNodesCollection.size() != 1;
1016
	boolean generateSwitch = genNodesCollection.size() != 1;
984
	if (generateSwitch) {
1017
	if (generateSwitch) {
985
1018
986
    stringBuffer.append(TEXT_158);
1019
    stringBuffer.append(TEXT_169);
987
    
1020
    
988
	}
1021
	}
989
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
1022
	for (Iterator genNodesIterator = genNodesCollection.iterator(); genNodesIterator.hasNext();) {
990
		GenNode nextNode = (GenNode) genNodesIterator.next();
1023
		GenNode nextNode = (GenNode) genNodesIterator.next();
991
		if (generateSwitch) {
1024
		if (generateSwitch) {
992
1025
993
    stringBuffer.append(TEXT_159);
1026
    stringBuffer.append(TEXT_170);
994
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1027
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
995
    stringBuffer.append(TEXT_160);
1028
    stringBuffer.append(TEXT_171);
996
    
1029
    
997
		} else {
1030
		} else {
998
1031
999
    stringBuffer.append(TEXT_161);
1032
    stringBuffer.append(TEXT_172);
1000
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1033
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1001
    stringBuffer.append(TEXT_162);
1034
    stringBuffer.append(TEXT_173);
1002
    
1035
    
1003
		}
1036
		}
1004
1037
1005
    stringBuffer.append(TEXT_163);
1038
    stringBuffer.append(TEXT_174);
1006
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
1039
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
1007
    stringBuffer.append(TEXT_164);
1040
    stringBuffer.append(TEXT_175);
1008
    
1041
    
1009
		if (generateSwitch) {
1042
		if (generateSwitch) {
1010
1043
1011
    stringBuffer.append(TEXT_165);
1044
    stringBuffer.append(TEXT_176);
1012
    
1045
    
1013
		} else {
1046
		} else {
1014
1047
1015
    stringBuffer.append(TEXT_166);
1048
    stringBuffer.append(TEXT_177);
1016
    
1049
    
1017
		}
1050
		}
1018
	}
1051
	}
1019
	if (generateSwitch) {
1052
	if (generateSwitch) {
1020
1053
1021
    stringBuffer.append(TEXT_167);
1054
    stringBuffer.append(TEXT_178);
1022
    
1055
    
1023
	}
1056
	}
1024
	if (childMetaFeature.isListType()) {
1057
	if (childMetaFeature.isListType()) {
1025
1058
1026
    stringBuffer.append(TEXT_168);
1059
    stringBuffer.append(TEXT_179);
1027
    
1060
    
1028
	}
1061
	}
1029
}
1062
}
1030
1063
1031
    stringBuffer.append(TEXT_169);
1064
    stringBuffer.append(TEXT_180);
1032
    
1065
    
1033
}
1066
}
1034
1067
1035
    
1068
    
1036
	}
1069
	}
1037
1070
1038
    stringBuffer.append(TEXT_170);
1071
    stringBuffer.append(TEXT_181);
1039
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1072
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1040
    stringBuffer.append(TEXT_171);
1073
    stringBuffer.append(TEXT_182);
1041
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1074
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1042
    stringBuffer.append(TEXT_172);
1075
    stringBuffer.append(TEXT_183);
1043
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1076
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1044
    stringBuffer.append(TEXT_173);
1077
    stringBuffer.append(TEXT_184);
1045
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
1078
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.ElementDescriptor"));
1046
    stringBuffer.append(TEXT_174);
1079
    stringBuffer.append(TEXT_185);
1047
    
1080
    
1048
	{
1081
	{
1049
		String _parentNode = "parentView";
1082
		String _parentNode = "parentView";
Lines 1059-1068 Link Here
1059
			throw new RuntimeException("Unexpected container");
1092
			throw new RuntimeException("Unexpected container");
1060
		}
1093
		}
1061
1094
1062
    stringBuffer.append(TEXT_175);
1095
    stringBuffer.append(TEXT_186);
1063
    stringBuffer.append(TEXT_176);
1096
    stringBuffer.append(TEXT_187);
1064
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1097
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1065
    stringBuffer.append(TEXT_177);
1098
    stringBuffer.append(TEXT_188);
1066
    
1099
    
1067
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
1100
for (Iterator it = childNodes.iterator(); it.hasNext(); ) {
1068
	GenNode nextNode = (GenNode) it.next();
1101
	GenNode nextNode = (GenNode) it.next();
Lines 1072-1086 Link Here
1072
	}
1105
	}
1073
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
1106
	String childNodeInterfaceName = importManager.getImportedName(nextNode.getDomainMetaClass().getQualifiedInterfaceName());
1074
1107
1075
    stringBuffer.append(TEXT_178);
1108
    stringBuffer.append(TEXT_189);
1076
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1109
    stringBuffer.append(importManager.getImportedName(nextNode.getEditPartQualifiedClassName()));
1077
    stringBuffer.append(TEXT_179);
1110
    stringBuffer.append(TEXT_190);
1078
    stringBuffer.append(childNodeInterfaceName);
1111
    stringBuffer.append(childNodeInterfaceName);
1079
    stringBuffer.append(TEXT_180);
1112
    stringBuffer.append(TEXT_191);
1080
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
1113
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalNodeCommand"));
1081
    stringBuffer.append(TEXT_181);
1114
    stringBuffer.append(TEXT_192);
1082
    stringBuffer.append(_parentNode);
1115
    stringBuffer.append(_parentNode);
1083
    stringBuffer.append(TEXT_182);
1116
    stringBuffer.append(TEXT_193);
1084
    
1117
    
1085
	if (!isListLayout) {
1118
	if (!isListLayout) {
1086
		int defaultWidth = 40;
1119
		int defaultWidth = 40;
Lines 1091-1121 Link Here
1091
			defaultHeight = defSizeAttrs.getHeight();
1124
			defaultHeight = defSizeAttrs.getHeight();
1092
		}
1125
		}
1093
1126
1094
    stringBuffer.append(TEXT_183);
1127
    stringBuffer.append(TEXT_194);
1095
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1128
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.geometry.Rectangle"));
1096
    stringBuffer.append(TEXT_184);
1129
    stringBuffer.append(TEXT_195);
1097
    stringBuffer.append(defaultWidth);
1130
    stringBuffer.append(defaultWidth);
1098
    stringBuffer.append(TEXT_185);
1131
    stringBuffer.append(TEXT_196);
1099
    stringBuffer.append(defaultHeight);
1132
    stringBuffer.append(defaultHeight);
1100
    stringBuffer.append(TEXT_186);
1133
    stringBuffer.append(TEXT_197);
1101
    
1134
    
1102
	} else {
1135
	} else {
1103
1136
1104
    stringBuffer.append(TEXT_187);
1137
    stringBuffer.append(TEXT_198);
1105
    
1138
    
1106
	}
1139
	}
1107
1140
1108
    stringBuffer.append(TEXT_188);
1141
    stringBuffer.append(TEXT_199);
1109
    stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
1142
    stringBuffer.append(importManager.getImportedName(nextNode.getNotationViewFactoryQualifiedClassName()));
1110
    stringBuffer.append(TEXT_189);
1143
    stringBuffer.append(TEXT_200);
1111
    
1144
    
1112
}
1145
}
1113
1146
1114
    stringBuffer.append(TEXT_190);
1147
    stringBuffer.append(TEXT_201);
1115
    
1148
    
1116
	}
1149
	}
1117
1150
1118
    stringBuffer.append(TEXT_191);
1151
    stringBuffer.append(TEXT_202);
1119
    
1152
    
1120
}
1153
}
1121
class LinksCollection {
1154
class LinksCollection {
Lines 1208-1236 Link Here
1208
		Iterator<GenLink> typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();
1241
		Iterator<GenLink> typeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();
1209
		Iterator<GenLink> featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();
1242
		Iterator<GenLink> featureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();
1210
1243
1211
    stringBuffer.append(TEXT_192);
1244
    stringBuffer.append(TEXT_203);
1212
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1245
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1213
    stringBuffer.append(TEXT_193);
1246
    stringBuffer.append(TEXT_204);
1214
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1247
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1215
    stringBuffer.append(TEXT_194);
1248
    stringBuffer.append(TEXT_205);
1216
    
1249
    
1217
		if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
1250
		if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
1218
1251
1219
    stringBuffer.append(TEXT_195);
1252
    stringBuffer.append(TEXT_206);
1220
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1253
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1221
    stringBuffer.append(TEXT_196);
1254
    stringBuffer.append(TEXT_207);
1222
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1255
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1223
    stringBuffer.append(TEXT_197);
1256
    stringBuffer.append(TEXT_208);
1224
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1257
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1225
    stringBuffer.append(TEXT_198);
1258
    stringBuffer.append(TEXT_209);
1226
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1259
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1227
    stringBuffer.append(TEXT_199);
1260
    stringBuffer.append(TEXT_210);
1228
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1261
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1229
    stringBuffer.append(TEXT_200);
1262
    stringBuffer.append(TEXT_211);
1230
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1263
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1231
    stringBuffer.append(TEXT_201);
1264
    stringBuffer.append(TEXT_212);
1232
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1265
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1233
    stringBuffer.append(TEXT_202);
1266
    stringBuffer.append(TEXT_213);
1234
    
1267
    
1235
		}
1268
		}
1236
		boolean shouldIterateToGenerate = false;
1269
		boolean shouldIterateToGenerate = false;
Lines 1247-1261 Link Here
1247
		}
1280
		}
1248
		if (shouldIterateToGenerate) {
1281
		if (shouldIterateToGenerate) {
1249
1282
1250
    stringBuffer.append(TEXT_203);
1283
    stringBuffer.append(TEXT_214);
1251
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1284
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1252
    stringBuffer.append(TEXT_204);
1285
    stringBuffer.append(TEXT_215);
1253
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1286
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1254
    stringBuffer.append(TEXT_205);
1287
    stringBuffer.append(TEXT_216);
1255
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1288
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1256
    stringBuffer.append(TEXT_206);
1289
    stringBuffer.append(TEXT_217);
1257
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1290
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1258
    stringBuffer.append(TEXT_207);
1291
    stringBuffer.append(TEXT_218);
1259
    
1292
    
1260
			for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
1293
			for(Iterator childrenIterator = childElements.iterator(); childrenIterator.hasNext(); ) {
1261
				GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
1294
				GenContainerBase nextChild = (GenContainerBase) childrenIterator.next();
Lines 1263-1291 Link Here
1263
					continue;
1296
					continue;
1264
				}
1297
				}
1265
1298
1266
    stringBuffer.append(TEXT_208);
1299
    stringBuffer.append(TEXT_219);
1267
    stringBuffer.append(importManager.getImportedName(nextChild.getEditPartQualifiedClassName()));
1300
    stringBuffer.append(importManager.getImportedName(nextChild.getEditPartQualifiedClassName()));
1268
    stringBuffer.append(TEXT_209);
1301
    stringBuffer.append(TEXT_220);
1269
    stringBuffer.append(nextChild.getUniqueIdentifier());
1302
    stringBuffer.append(nextChild.getUniqueIdentifier());
1270
    stringBuffer.append(TEXT_210);
1303
    stringBuffer.append(TEXT_221);
1271
    
1304
    
1272
			}
1305
			}
1273
1306
1274
    stringBuffer.append(TEXT_211);
1307
    stringBuffer.append(TEXT_222);
1275
    
1308
    
1276
		}
1309
		}
1277
1310
1278
    stringBuffer.append(TEXT_212);
1311
    stringBuffer.append(TEXT_223);
1279
    
1312
    
1280
		if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
1313
		if (typeModelFacetLinks.hasNext() || featureModelFacetLinks.hasNext()) {
1281
1314
1282
    stringBuffer.append(TEXT_213);
1315
    stringBuffer.append(TEXT_224);
1283
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1316
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1284
    stringBuffer.append(TEXT_214);
1317
    stringBuffer.append(TEXT_225);
1285
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1318
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1286
    stringBuffer.append(TEXT_215);
1319
    stringBuffer.append(TEXT_226);
1287
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1320
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1288
    stringBuffer.append(TEXT_216);
1321
    stringBuffer.append(TEXT_227);
1289
    
1322
    
1290
			{
1323
			{
1291
				String _getViewCode = "parentView";
1324
				String _getViewCode = "parentView";
Lines 1293-1304 Link Here
1293
				Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
1326
				Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
1294
				Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
1327
				Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
1295
1328
1296
    stringBuffer.append(TEXT_217);
1329
    stringBuffer.append(TEXT_228);
1297
    stringBuffer.append(TEXT_218);
1330
    stringBuffer.append(TEXT_229);
1298
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1331
    stringBuffer.append(importManager.getImportedName("java.util.List"));
1299
    stringBuffer.append(TEXT_219);
1332
    stringBuffer.append(TEXT_230);
1300
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1333
    stringBuffer.append(importManager.getImportedName("java.util.LinkedList"));
1301
    stringBuffer.append(TEXT_220);
1334
    stringBuffer.append(TEXT_231);
1302
    
1335
    
1303
Map genFeature2genLinkMap = new LinkedHashMap();
1336
Map genFeature2genLinkMap = new LinkedHashMap();
1304
for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
1337
for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
Lines 1321-1338 Link Here
1321
}
1354
}
1322
if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
1355
if (!genFeature2genLinkMap.isEmpty() || !genFeature2featureGenLinkMap.isEmpty()) {
1323
1356
1324
    stringBuffer.append(TEXT_221);
1357
    stringBuffer.append(TEXT_232);
1325
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1358
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1326
    stringBuffer.append(TEXT_222);
1359
    stringBuffer.append(TEXT_233);
1327
    stringBuffer.append(_getViewCode);
1360
    stringBuffer.append(_getViewCode);
1328
    stringBuffer.append(TEXT_223);
1361
    stringBuffer.append(TEXT_234);
1329
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1362
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1330
    stringBuffer.append(TEXT_224);
1363
    stringBuffer.append(TEXT_235);
1331
    
1364
    
1332
}
1365
}
1333
if (!genFeature2genLinkMap.isEmpty()) {
1366
if (!genFeature2genLinkMap.isEmpty()) {
1334
1367
1335
    stringBuffer.append(TEXT_225);
1368
    stringBuffer.append(TEXT_236);
1336
    
1369
    
1337
}
1370
}
1338
for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
1371
for (Iterator entries = genFeature2genLinkMap.entrySet().iterator(); entries.hasNext();) {
Lines 1341-1372 Link Here
1341
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1374
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1342
	if (metaFeature.isListType()) {
1375
	if (metaFeature.isListType()) {
1343
1376
1344
    stringBuffer.append(TEXT_226);
1377
    stringBuffer.append(TEXT_237);
1345
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1378
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1346
    stringBuffer.append(TEXT_227);
1379
    stringBuffer.append(TEXT_238);
1347
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
1380
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
1348
    stringBuffer.append(TEXT_228);
1381
    stringBuffer.append(TEXT_239);
1349
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1382
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1350
    stringBuffer.append(TEXT_229);
1383
    stringBuffer.append(TEXT_240);
1351
    
1384
    
1352
	} else {
1385
	} else {
1353
1386
1354
    stringBuffer.append(TEXT_230);
1387
    stringBuffer.append(TEXT_241);
1355
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1388
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1356
    stringBuffer.append(TEXT_231);
1389
    stringBuffer.append(TEXT_242);
1357
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
1390
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
1358
    stringBuffer.append(TEXT_232);
1391
    stringBuffer.append(TEXT_243);
1359
    
1392
    
1360
	}
1393
	}
1361
1394
1362
    stringBuffer.append(TEXT_233);
1395
    stringBuffer.append(TEXT_244);
1363
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1396
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1364
    stringBuffer.append(TEXT_234);
1397
    stringBuffer.append(TEXT_245);
1365
    
1398
    
1366
	boolean generateSwitch = genLinksCollection.size() != 1;
1399
	boolean generateSwitch = genLinksCollection.size() != 1;
1367
	if (generateSwitch) {
1400
	if (generateSwitch) {
1368
1401
1369
    stringBuffer.append(TEXT_235);
1402
    stringBuffer.append(TEXT_246);
1370
    
1403
    
1371
	}
1404
	}
1372
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
1405
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
Lines 1374-1440 Link Here
1374
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1407
		TypeLinkModelFacet modelFacet = (TypeLinkModelFacet) nextLink.getModelFacet();
1375
		if (generateSwitch) {
1408
		if (generateSwitch) {
1376
1409
1377
    stringBuffer.append(TEXT_236);
1410
    stringBuffer.append(TEXT_247);
1378
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1411
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1379
    stringBuffer.append(TEXT_237);
1412
    stringBuffer.append(TEXT_248);
1380
    
1413
    
1381
		} else {
1414
		} else {
1382
1415
1383
    stringBuffer.append(TEXT_238);
1416
    stringBuffer.append(TEXT_249);
1384
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1417
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1385
    stringBuffer.append(TEXT_239);
1418
    stringBuffer.append(TEXT_250);
1386
    
1419
    
1387
		}
1420
		}
1388
		if (modelFacet.getSourceMetaFeature() != null) {
1421
		if (modelFacet.getSourceMetaFeature() != null) {
1389
1422
1390
    stringBuffer.append(TEXT_240);
1423
    stringBuffer.append(TEXT_251);
1391
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1424
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1392
    stringBuffer.append(TEXT_241);
1425
    stringBuffer.append(TEXT_252);
1393
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1426
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1394
    stringBuffer.append(TEXT_242);
1427
    stringBuffer.append(TEXT_253);
1395
    myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);
1428
    myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getSourceMetaFeature(), null, false);
1396
    stringBuffer.append(TEXT_243);
1429
    stringBuffer.append(TEXT_254);
1397
    
1430
    
1398
		} else {
1431
		} else {
1399
1432
1400
    stringBuffer.append(TEXT_244);
1433
    stringBuffer.append(TEXT_255);
1401
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1402
    stringBuffer.append(TEXT_245);
1435
    stringBuffer.append(TEXT_256);
1403
    stringBuffer.append(_getViewCode);
1436
    stringBuffer.append(_getViewCode);
1404
    stringBuffer.append(TEXT_246);
1437
    stringBuffer.append(TEXT_257);
1405
    
1438
    
1406
		}
1439
		}
1407
		if (modelFacet.getTargetMetaFeature() != null) {
1440
		if (modelFacet.getTargetMetaFeature() != null) {
1408
1441
1409
    stringBuffer.append(TEXT_247);
1442
    stringBuffer.append(TEXT_258);
1410
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1443
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1411
    stringBuffer.append(TEXT_248);
1444
    stringBuffer.append(TEXT_259);
1412
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1445
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1413
    stringBuffer.append(TEXT_249);
1446
    stringBuffer.append(TEXT_260);
1414
    myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);
1447
    myFeatureGetAccessorHelper.appendFeatureValueGetter("nextValue", modelFacet.getTargetMetaFeature(), null, false);
1415
    stringBuffer.append(TEXT_250);
1448
    stringBuffer.append(TEXT_261);
1416
    
1449
    
1417
		} else {
1450
		} else {
1418
1451
1419
    stringBuffer.append(TEXT_251);
1452
    stringBuffer.append(TEXT_262);
1420
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1421
    stringBuffer.append(TEXT_252);
1454
    stringBuffer.append(TEXT_263);
1422
    stringBuffer.append(_getViewCode);
1455
    stringBuffer.append(_getViewCode);
1423
    stringBuffer.append(TEXT_253);
1456
    stringBuffer.append(TEXT_264);
1424
    
1457
    
1425
		}
1458
		}
1426
1459
1427
    stringBuffer.append(TEXT_254);
1460
    stringBuffer.append(TEXT_265);
1428
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1461
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1429
    stringBuffer.append(TEXT_255);
1462
    stringBuffer.append(TEXT_266);
1430
    
1463
    
1431
		if (generateSwitch) {
1464
		if (generateSwitch) {
1432
1465
1433
    stringBuffer.append(TEXT_256);
1466
    stringBuffer.append(TEXT_267);
1434
    
1467
    
1435
		} else {
1468
		} else {
1436
1469
1437
    stringBuffer.append(TEXT_257);
1470
    stringBuffer.append(TEXT_268);
1438
    
1471
    
1439
		}
1472
		}
1440
1473
Lines 1442-1453 Link Here
1442
	}	//iterate over genLinksCollection
1475
	}	//iterate over genLinksCollection
1443
	if (generateSwitch) {
1476
	if (generateSwitch) {
1444
1477
1445
    stringBuffer.append(TEXT_258);
1478
    stringBuffer.append(TEXT_269);
1446
    
1479
    
1447
	}
1480
	}
1448
	if (metaFeature.isListType()) {
1481
	if (metaFeature.isListType()) {
1449
1482
1450
    stringBuffer.append(TEXT_259);
1483
    stringBuffer.append(TEXT_270);
1451
    
1484
    
1452
	}
1485
	}
1453
}
1486
}
Lines 1457-1529 Link Here
1457
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1490
	Collection genLinksCollection = (Collection) nextEntry.getValue();
1458
	if (metaFeature.isListType()) {
1491
	if (metaFeature.isListType()) {
1459
1492
1460
    stringBuffer.append(TEXT_260);
1493
    stringBuffer.append(TEXT_271);
1461
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1494
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
1462
    stringBuffer.append(TEXT_261);
1495
    stringBuffer.append(TEXT_272);
1463
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
1496
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, true);
1464
    stringBuffer.append(TEXT_262);
1497
    stringBuffer.append(TEXT_273);
1465
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1498
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1466
    stringBuffer.append(TEXT_263);
1499
    stringBuffer.append(TEXT_274);
1467
    
1500
    
1468
	} else {
1501
	} else {
1469
1502
1470
    stringBuffer.append(TEXT_264);
1503
    stringBuffer.append(TEXT_275);
1471
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1504
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1472
    stringBuffer.append(TEXT_265);
1505
    stringBuffer.append(TEXT_276);
1473
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
1506
    myFeatureGetAccessorHelper.appendFeatureValueGetter("modelObject", metaFeature, null, false);
1474
    stringBuffer.append(TEXT_266);
1507
    stringBuffer.append(TEXT_277);
1475
    
1508
    
1476
	}
1509
	}
1477
1510
1478
    stringBuffer.append(TEXT_267);
1511
    stringBuffer.append(TEXT_278);
1479
    
1512
    
1480
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
1513
	for (Iterator genLinksIterator = genLinksCollection.iterator(); genLinksIterator.hasNext(); ) {
1481
		GenLink nextLink = (GenLink) genLinksIterator.next();
1514
		GenLink nextLink = (GenLink) genLinksIterator.next();
1482
1515
1483
    stringBuffer.append(TEXT_268);
1516
    stringBuffer.append(TEXT_279);
1484
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1517
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1485
    stringBuffer.append(TEXT_269);
1518
    stringBuffer.append(TEXT_280);
1486
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1519
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1487
    stringBuffer.append(TEXT_270);
1520
    stringBuffer.append(TEXT_281);
1488
    
1521
    
1489
	}
1522
	}
1490
1523
1491
    stringBuffer.append(TEXT_271);
1524
    stringBuffer.append(TEXT_282);
1492
    
1525
    
1493
	if (metaFeature.isListType()) {
1526
	if (metaFeature.isListType()) {
1494
1527
1495
    stringBuffer.append(TEXT_272);
1528
    stringBuffer.append(TEXT_283);
1496
    
1529
    
1497
	}
1530
	}
1498
}
1531
}
1499
1532
1500
    stringBuffer.append(TEXT_273);
1533
    stringBuffer.append(TEXT_284);
1501
    
1534
    
1502
			}
1535
			}
1503
1536
1504
    stringBuffer.append(TEXT_274);
1537
    stringBuffer.append(TEXT_285);
1505
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1538
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalElementCommand"));
1506
    stringBuffer.append(TEXT_275);
1539
    stringBuffer.append(TEXT_286);
1507
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1540
    stringBuffer.append(nextContainer.getUniqueIdentifier());
1508
    stringBuffer.append(TEXT_276);
1541
    stringBuffer.append(TEXT_287);
1509
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1542
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1510
    stringBuffer.append(TEXT_277);
1543
    stringBuffer.append(TEXT_288);
1511
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1544
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.LinkDescriptor"));
1512
    stringBuffer.append(TEXT_278);
1545
    stringBuffer.append(TEXT_289);
1513
    
1546
    
1514
			{
1547
			{
1515
				String _diagramCode = "parentView.getDiagram()";
1548
				String _diagramCode = "parentView.getDiagram()";
1516
				Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
1549
				Iterator<GenLink> _containedTypeModelFacetLinks = linksCollection.getContainedTypeModelFacetLinks();;
1517
				Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
1550
				Iterator<GenLink> _containedFeatureModelFacetLinks = linksCollection.getContainedFeatureModelFacetLinks();;
1518
1551
1519
    stringBuffer.append(TEXT_279);
1552
    stringBuffer.append(TEXT_290);
1520
    stringBuffer.append(TEXT_280);
1553
    stringBuffer.append(TEXT_291);
1521
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1554
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1522
    stringBuffer.append(TEXT_281);
1555
    stringBuffer.append(TEXT_292);
1523
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1556
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.View"));
1524
    stringBuffer.append(TEXT_282);
1557
    stringBuffer.append(TEXT_293);
1525
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator"));
1558
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.services.IViewDecorator"));
1526
    stringBuffer.append(TEXT_283);
1559
    stringBuffer.append(TEXT_294);
1527
    
1560
    
1528
	for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
1561
	for(Iterator it = _containedTypeModelFacetLinks; it.hasNext(); ) {
1529
		GenLink nextLink = (GenLink) it.next();
1562
		GenLink nextLink = (GenLink) it.next();
Lines 1532-1863 Link Here
1532
			continue;
1565
			continue;
1533
		}
1566
		}
1534
1567
1535
    stringBuffer.append(TEXT_284);
1568
    stringBuffer.append(TEXT_295);
1536
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1569
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1537
    stringBuffer.append(TEXT_285);
1570
    stringBuffer.append(TEXT_296);
1538
    stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
1571
    stringBuffer.append(importManager.getImportedName(modelFacet.getMetaClass().getQualifiedInterfaceName()));
1539
    stringBuffer.append(TEXT_286);
1572
    stringBuffer.append(TEXT_297);
1540
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1573
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1541
    stringBuffer.append(TEXT_287);
1574
    stringBuffer.append(TEXT_298);
1542
    
1575
    
1543
	}
1576
	}
1544
	for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
1577
	for(Iterator it = _containedFeatureModelFacetLinks; it.hasNext(); ) {
1545
		GenLink nextLink = (GenLink) it.next();
1578
		GenLink nextLink = (GenLink) it.next();
1546
1579
1547
    stringBuffer.append(TEXT_288);
1580
    stringBuffer.append(TEXT_299);
1548
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1581
    stringBuffer.append(importManager.getImportedName(nextLink.getEditPartQualifiedClassName()));
1549
    stringBuffer.append(TEXT_289);
1582
    stringBuffer.append(TEXT_300);
1550
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1583
    stringBuffer.append(importManager.getImportedName(nextLink.getNotationViewFactoryQualifiedClassName()));
1551
    stringBuffer.append(TEXT_290);
1584
    stringBuffer.append(TEXT_301);
1552
    
1585
    
1553
	}
1586
	}
1554
1587
1555
    stringBuffer.append(TEXT_291);
1588
    stringBuffer.append(TEXT_302);
1556
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand"));
1589
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.commands.CreateNotationalEdgeCommand"));
1557
    stringBuffer.append(TEXT_292);
1590
    stringBuffer.append(TEXT_303);
1558
    stringBuffer.append(_diagramCode);
1591
    stringBuffer.append(_diagramCode);
1559
    stringBuffer.append(TEXT_293);
1592
    stringBuffer.append(TEXT_304);
1560
    
1593
    
1561
			}
1594
			}
1562
1595
1563
    stringBuffer.append(TEXT_294);
1596
    stringBuffer.append(TEXT_305);
1564
    
1597
    
1565
		}
1598
		}
1566
	}
1599
	}
1567
}
1600
}
1568
if(!genDiagram.getLinks().isEmpty()) {
1601
if(!genDiagram.getLinks().isEmpty()) {
1569
1602
1570
    stringBuffer.append(TEXT_295);
1603
    stringBuffer.append(TEXT_306);
1571
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
1604
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
1572
    stringBuffer.append(TEXT_296);
1605
    stringBuffer.append(TEXT_307);
1573
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
1606
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.edit.parts.update.canonical.IViewService"));
1574
    stringBuffer.append(TEXT_297);
1607
    stringBuffer.append(TEXT_308);
1575
    
1608
    
1576
}
1609
}
1577
1610
1578
    stringBuffer.append(TEXT_298);
1611
    stringBuffer.append(TEXT_309);
1579
    
1612
    
1580
if (isRichClientPlatform) {
1613
if (isRichClientPlatform) {
1581
1614
1582
    stringBuffer.append(TEXT_299);
1615
    stringBuffer.append(TEXT_310);
1583
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
1616
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
1584
    stringBuffer.append(TEXT_300);
1617
    stringBuffer.append(TEXT_311);
1585
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
1618
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
1586
    stringBuffer.append(TEXT_301);
1619
    stringBuffer.append(TEXT_312);
1587
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1620
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1588
    stringBuffer.append(TEXT_302);
1621
    stringBuffer.append(TEXT_313);
1589
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1622
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1590
    stringBuffer.append(TEXT_303);
1623
    stringBuffer.append(TEXT_314);
1591
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1624
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1592
    stringBuffer.append(TEXT_304);
1625
    stringBuffer.append(TEXT_315);
1593
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1626
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1594
    stringBuffer.append(TEXT_305);
1627
    stringBuffer.append(TEXT_316);
1595
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1628
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1596
    stringBuffer.append(TEXT_306);
1629
    stringBuffer.append(TEXT_317);
1597
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1630
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1598
    stringBuffer.append(TEXT_307);
1631
    stringBuffer.append(TEXT_318);
1599
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1632
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1600
    stringBuffer.append(TEXT_308);
1633
    stringBuffer.append(TEXT_319);
1601
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1634
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1602
    stringBuffer.append(TEXT_309);
1635
    stringBuffer.append(TEXT_320);
1603
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1636
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1604
    stringBuffer.append(TEXT_310);
1637
    stringBuffer.append(TEXT_321);
1605
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1638
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1606
    stringBuffer.append(TEXT_311);
1639
    stringBuffer.append(TEXT_322);
1607
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1640
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1608
    stringBuffer.append(TEXT_312);
1641
    stringBuffer.append(TEXT_323);
1609
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1642
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1610
    stringBuffer.append(TEXT_313);
1643
    stringBuffer.append(TEXT_324);
1611
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1644
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1612
    stringBuffer.append(TEXT_314);
1645
    stringBuffer.append(TEXT_325);
1613
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1646
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1614
    stringBuffer.append(TEXT_315);
1647
    stringBuffer.append(TEXT_326);
1615
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1648
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1616
    stringBuffer.append(TEXT_316);
1649
    stringBuffer.append(TEXT_327);
1617
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1650
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1618
    stringBuffer.append(TEXT_317);
1651
    stringBuffer.append(TEXT_328);
1619
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1652
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1620
    stringBuffer.append(TEXT_318);
1653
    stringBuffer.append(TEXT_329);
1621
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1654
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1622
    stringBuffer.append(TEXT_319);
1655
    stringBuffer.append(TEXT_330);
1623
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1656
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1624
    stringBuffer.append(TEXT_320);
1657
    stringBuffer.append(TEXT_331);
1625
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1658
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1626
    stringBuffer.append(TEXT_321);
1659
    stringBuffer.append(TEXT_332);
1627
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1660
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1628
    stringBuffer.append(TEXT_322);
1661
    stringBuffer.append(TEXT_333);
1629
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1662
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1630
    stringBuffer.append(TEXT_323);
1663
    stringBuffer.append(TEXT_334);
1631
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1664
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1632
    stringBuffer.append(TEXT_324);
1665
    stringBuffer.append(TEXT_335);
1633
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1666
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1634
    stringBuffer.append(TEXT_325);
1667
    stringBuffer.append(TEXT_336);
1635
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
1668
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Text"));
1636
    stringBuffer.append(TEXT_326);
1669
    stringBuffer.append(TEXT_337);
1637
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1670
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1638
    stringBuffer.append(TEXT_327);
1671
    stringBuffer.append(TEXT_338);
1639
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1672
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1640
    stringBuffer.append(TEXT_328);
1673
    stringBuffer.append(TEXT_339);
1641
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1674
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1642
    stringBuffer.append(TEXT_329);
1675
    stringBuffer.append(TEXT_340);
1643
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1676
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1644
    stringBuffer.append(TEXT_330);
1677
    stringBuffer.append(TEXT_341);
1645
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
1678
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
1646
    stringBuffer.append(TEXT_331);
1679
    stringBuffer.append(TEXT_342);
1647
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
1680
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Button"));
1648
    stringBuffer.append(TEXT_332);
1681
    stringBuffer.append(TEXT_343);
1649
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1682
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1650
    stringBuffer.append(TEXT_333);
1683
    stringBuffer.append(TEXT_344);
1651
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter"));
1684
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionAdapter"));
1652
    stringBuffer.append(TEXT_334);
1685
    stringBuffer.append(TEXT_345);
1653
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent"));
1686
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.SelectionEvent"));
1654
    stringBuffer.append(TEXT_335);
1687
    stringBuffer.append(TEXT_346);
1655
    stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
1688
    stringBuffer.append(importManager.getImportedName(genDiagram.getDiagramEditorUtilQualifiedClassName()));
1656
    stringBuffer.append(TEXT_336);
1689
    stringBuffer.append(TEXT_347);
1657
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1690
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1658
    stringBuffer.append(TEXT_337);
1691
    stringBuffer.append(TEXT_348);
1659
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
1692
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
1660
    stringBuffer.append(TEXT_338);
1693
    stringBuffer.append(TEXT_349);
1661
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
1694
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyListener"));
1662
    stringBuffer.append(TEXT_339);
1695
    stringBuffer.append(TEXT_350);
1663
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent"));
1696
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.events.ModifyEvent"));
1664
    stringBuffer.append(TEXT_340);
1697
    stringBuffer.append(TEXT_351);
1665
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1698
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1666
    stringBuffer.append(TEXT_341);
1699
    stringBuffer.append(TEXT_352);
1667
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1700
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1668
    stringBuffer.append(TEXT_342);
1701
    stringBuffer.append(TEXT_353);
1669
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1702
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1670
    stringBuffer.append(TEXT_343);
1703
    stringBuffer.append(TEXT_354);
1671
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1704
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1672
    stringBuffer.append(TEXT_344);
1705
    stringBuffer.append(TEXT_355);
1673
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1706
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1674
    stringBuffer.append(TEXT_345);
1707
    stringBuffer.append(TEXT_356);
1675
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1708
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1676
    stringBuffer.append(TEXT_346);
1709
    stringBuffer.append(TEXT_357);
1677
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1710
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1678
    stringBuffer.append(TEXT_347);
1711
    stringBuffer.append(TEXT_358);
1679
    stringBuffer.append(editorGen.getDomainFileExtension());
1712
    stringBuffer.append(editorGen.getDomainFileExtension());
1680
    stringBuffer.append(TEXT_348);
1713
    stringBuffer.append(TEXT_359);
1681
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1714
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1682
    stringBuffer.append(TEXT_349);
1715
    stringBuffer.append(TEXT_360);
1683
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1716
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1684
    stringBuffer.append(TEXT_350);
1717
    stringBuffer.append(TEXT_361);
1685
    stringBuffer.append(editorGen.getDiagramFileExtension());
1718
    stringBuffer.append(editorGen.getDiagramFileExtension());
1686
    stringBuffer.append(TEXT_351);
1719
    stringBuffer.append(TEXT_362);
1687
    stringBuffer.append(editorGen.getDomainGenModel().getModelName());
1720
    stringBuffer.append(editorGen.getDomainGenModel().getModelName());
1688
    stringBuffer.append(TEXT_352);
1721
    stringBuffer.append(TEXT_363);
1689
    stringBuffer.append(editorGen.getDiagramFileExtension());
1722
    stringBuffer.append(editorGen.getDiagramFileExtension());
1690
    stringBuffer.append(TEXT_353);
1723
    stringBuffer.append(TEXT_364);
1691
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1724
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1692
    stringBuffer.append(TEXT_354);
1725
    stringBuffer.append(TEXT_365);
1693
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1726
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1694
    stringBuffer.append(TEXT_355);
1727
    stringBuffer.append(TEXT_366);
1695
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1728
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1696
    stringBuffer.append(TEXT_356);
1729
    stringBuffer.append(TEXT_367);
1697
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1730
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1698
    stringBuffer.append(TEXT_357);
1731
    stringBuffer.append(TEXT_368);
1699
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1732
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1700
    stringBuffer.append(TEXT_358);
1733
    stringBuffer.append(TEXT_369);
1701
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1734
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1702
    stringBuffer.append(TEXT_359);
1735
    stringBuffer.append(TEXT_370);
1703
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1736
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
1704
    stringBuffer.append(TEXT_360);
1737
    stringBuffer.append(TEXT_371);
1705
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1738
    stringBuffer.append(importManager.getImportedName("java.io.File"));
1706
    stringBuffer.append(TEXT_361);
1739
    stringBuffer.append(TEXT_372);
1707
    
1740
    
1708
}
1741
}
1709
1742
1710
    stringBuffer.append(TEXT_362);
1743
    stringBuffer.append(TEXT_373);
1711
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
1744
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardPage"));
1712
    stringBuffer.append(TEXT_363);
1745
    stringBuffer.append(TEXT_374);
1713
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener"));
1746
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.ISelectionChangedListener"));
1714
    stringBuffer.append(TEXT_364);
1747
    stringBuffer.append(TEXT_375);
1715
    
1748
    
1716
if (isRichClientPlatform) {
1749
if (isRichClientPlatform) {
1717
1750
1718
    stringBuffer.append(TEXT_365);
1751
    stringBuffer.append(TEXT_376);
1719
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1752
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1720
    stringBuffer.append(TEXT_366);
1753
    stringBuffer.append(TEXT_377);
1721
    
1754
    
1722
}
1755
}
1723
1756
1724
    stringBuffer.append(TEXT_367);
1757
    stringBuffer.append(TEXT_378);
1725
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1758
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1726
    stringBuffer.append(TEXT_368);
1759
    stringBuffer.append(TEXT_379);
1727
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1760
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1728
    stringBuffer.append(TEXT_369);
1761
    stringBuffer.append(TEXT_380);
1729
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1762
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1730
    stringBuffer.append(TEXT_370);
1763
    stringBuffer.append(TEXT_381);
1731
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1764
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1732
    stringBuffer.append(TEXT_371);
1765
    stringBuffer.append(TEXT_382);
1733
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1766
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1734
    stringBuffer.append(TEXT_372);
1767
    stringBuffer.append(TEXT_383);
1735
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1768
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1736
    stringBuffer.append(TEXT_373);
1769
    stringBuffer.append(TEXT_384);
1737
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1770
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1738
    stringBuffer.append(TEXT_374);
1771
    stringBuffer.append(TEXT_385);
1739
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1772
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1740
    stringBuffer.append(TEXT_375);
1773
    stringBuffer.append(TEXT_386);
1741
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1774
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1742
    stringBuffer.append(TEXT_376);
1775
    stringBuffer.append(TEXT_387);
1743
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1776
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1744
    stringBuffer.append(TEXT_377);
1777
    stringBuffer.append(TEXT_388);
1745
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1778
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
1746
    stringBuffer.append(TEXT_378);
1779
    stringBuffer.append(TEXT_389);
1747
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1780
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1748
    stringBuffer.append(TEXT_379);
1781
    stringBuffer.append(TEXT_390);
1749
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1782
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1750
    stringBuffer.append(TEXT_380);
1783
    stringBuffer.append(TEXT_391);
1751
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1784
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1752
    stringBuffer.append(TEXT_381);
1785
    stringBuffer.append(TEXT_392);
1753
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1786
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1754
    stringBuffer.append(TEXT_382);
1787
    stringBuffer.append(TEXT_393);
1755
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1788
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridLayout"));
1756
    stringBuffer.append(TEXT_383);
1789
    stringBuffer.append(TEXT_394);
1757
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1790
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1758
    stringBuffer.append(TEXT_384);
1791
    stringBuffer.append(TEXT_395);
1759
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1792
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Label"));
1760
    stringBuffer.append(TEXT_385);
1793
    stringBuffer.append(TEXT_396);
1761
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1794
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1762
    stringBuffer.append(TEXT_386);
1795
    stringBuffer.append(TEXT_397);
1763
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1796
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1764
    stringBuffer.append(TEXT_387);
1797
    stringBuffer.append(TEXT_398);
1765
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1798
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1766
    stringBuffer.append(TEXT_388);
1799
    stringBuffer.append(TEXT_399);
1767
    
1800
    
1768
final String treeViewer = isRichClientPlatform ? "myTreeViewer" : "treeViewer";
1801
final String treeViewer = isRichClientPlatform ? "myTreeViewer" : "treeViewer";
1769
1802
1770
    stringBuffer.append(TEXT_389);
1803
    stringBuffer.append(TEXT_400);
1771
    if (!isRichClientPlatform){
1804
    if (!isRichClientPlatform){
1772
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1805
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1773
    stringBuffer.append(TEXT_390);
1806
    stringBuffer.append(TEXT_401);
1774
    }
1807
    }
1775
    stringBuffer.append(treeViewer);
1808
    stringBuffer.append(treeViewer);
1776
    stringBuffer.append(TEXT_391);
1809
    stringBuffer.append(TEXT_402);
1777
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1810
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.TreeViewer"));
1778
    stringBuffer.append(TEXT_392);
1811
    stringBuffer.append(TEXT_403);
1779
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1812
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1780
    stringBuffer.append(TEXT_393);
1813
    stringBuffer.append(TEXT_404);
1781
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1814
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1782
    stringBuffer.append(TEXT_394);
1815
    stringBuffer.append(TEXT_405);
1783
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1816
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1784
    stringBuffer.append(TEXT_395);
1817
    stringBuffer.append(TEXT_406);
1785
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1818
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
1786
    stringBuffer.append(TEXT_396);
1819
    stringBuffer.append(TEXT_407);
1787
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1820
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1788
    stringBuffer.append(TEXT_397);
1821
    stringBuffer.append(TEXT_408);
1789
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1822
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1790
    stringBuffer.append(TEXT_398);
1823
    stringBuffer.append(TEXT_409);
1791
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1824
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.layout.GridData"));
1792
    stringBuffer.append(TEXT_399);
1825
    stringBuffer.append(TEXT_410);
1793
    stringBuffer.append(treeViewer);
1826
    stringBuffer.append(treeViewer);
1794
    stringBuffer.append(TEXT_400);
1827
    stringBuffer.append(TEXT_411);
1795
    stringBuffer.append(treeViewer);
1828
    stringBuffer.append(treeViewer);
1796
    stringBuffer.append(TEXT_401);
1829
    stringBuffer.append(TEXT_412);
1797
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider"));
1830
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider"));
1798
    stringBuffer.append(TEXT_402);
1831
    stringBuffer.append(TEXT_413);
1799
    stringBuffer.append(pluginActivatorClass);
1832
    stringBuffer.append(pluginActivatorClass);
1800
    stringBuffer.append(TEXT_403);
1833
    stringBuffer.append(TEXT_414);
1801
    stringBuffer.append(treeViewer);
1834
    stringBuffer.append(treeViewer);
1802
    stringBuffer.append(TEXT_404);
1835
    stringBuffer.append(TEXT_415);
1803
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider"));
1836
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider"));
1804
    stringBuffer.append(TEXT_405);
1837
    stringBuffer.append(TEXT_416);
1805
    stringBuffer.append(pluginActivatorClass);
1838
    stringBuffer.append(pluginActivatorClass);
1806
    stringBuffer.append(TEXT_406);
1839
    stringBuffer.append(TEXT_417);
1807
    
1840
    
1808
if (!isRichClientPlatform) {
1841
if (!isRichClientPlatform) {
1809
1842
1810
    stringBuffer.append(TEXT_407);
1843
    stringBuffer.append(TEXT_418);
1811
    stringBuffer.append(treeViewer);
1844
    stringBuffer.append(treeViewer);
1812
    stringBuffer.append(TEXT_408);
1845
    stringBuffer.append(TEXT_419);
1813
    stringBuffer.append(treeViewer);
1846
    stringBuffer.append(treeViewer);
1814
    stringBuffer.append(TEXT_409);
1847
    stringBuffer.append(TEXT_420);
1815
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
1848
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
1816
    stringBuffer.append(TEXT_410);
1849
    stringBuffer.append(TEXT_421);
1817
    
1850
    
1818
}
1851
}
1819
1852
1820
    stringBuffer.append(TEXT_411);
1853
    stringBuffer.append(TEXT_422);
1821
    stringBuffer.append(treeViewer);
1854
    stringBuffer.append(treeViewer);
1822
    stringBuffer.append(TEXT_412);
1855
    stringBuffer.append(TEXT_423);
1823
    
1856
    
1824
if (isRichClientPlatform) {
1857
if (isRichClientPlatform) {
1825
1858
1826
    stringBuffer.append(TEXT_413);
1859
    stringBuffer.append(TEXT_424);
1827
    stringBuffer.append(treeViewer);
1860
    stringBuffer.append(treeViewer);
1828
    stringBuffer.append(TEXT_414);
1861
    stringBuffer.append(TEXT_425);
1829
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
1862
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
1830
    stringBuffer.append(TEXT_415);
1863
    stringBuffer.append(TEXT_426);
1831
    
1864
    
1832
}
1865
}
1833
1866
1834
    stringBuffer.append(TEXT_416);
1867
    stringBuffer.append(TEXT_427);
1835
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent"));
1868
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.SelectionChangedEvent"));
1836
    stringBuffer.append(TEXT_417);
1869
    stringBuffer.append(TEXT_428);
1837
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1870
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1838
    stringBuffer.append(TEXT_418);
1871
    stringBuffer.append(TEXT_429);
1839
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1872
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1840
    stringBuffer.append(TEXT_419);
1873
    stringBuffer.append(TEXT_430);
1841
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1874
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.IStructuredSelection"));
1842
    stringBuffer.append(TEXT_420);
1875
    stringBuffer.append(TEXT_431);
1843
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
1876
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
1844
    stringBuffer.append(TEXT_421);
1877
    stringBuffer.append(TEXT_432);
1845
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
1878
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.IWrapperItemProvider"));
1846
    stringBuffer.append(TEXT_422);
1879
    stringBuffer.append(TEXT_433);
1847
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
1880
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
1848
    stringBuffer.append(TEXT_423);
1881
    stringBuffer.append(TEXT_434);
1849
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
1882
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.util.FeatureMap"));
1850
    stringBuffer.append(TEXT_424);
1883
    stringBuffer.append(TEXT_435);
1851
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1884
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1852
    stringBuffer.append(TEXT_425);
1885
    stringBuffer.append(TEXT_436);
1853
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1886
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
1854
    stringBuffer.append(TEXT_426);
1887
    stringBuffer.append(TEXT_437);
1855
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1888
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartQualifiedClassName()));
1856
    stringBuffer.append(TEXT_427);
1889
    stringBuffer.append(TEXT_438);
1857
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1890
    stringBuffer.append(importManager.getImportedName(genDiagram.getVisualIDRegistryQualifiedClassName()));
1858
    stringBuffer.append(TEXT_428);
1891
    stringBuffer.append(TEXT_439);
1859
    importManager.emitSortedImports();
1892
    importManager.emitSortedImports();
1860
    stringBuffer.append(TEXT_429);
1893
    stringBuffer.append(TEXT_440);
1861
    return stringBuffer.toString();
1894
    return stringBuffer.toString();
1862
  }
1895
  }
1863
}
1896
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/DiagramEditorUtilGenerator.java (-258 / +261 lines)
Lines 18-160 Link Here
18
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
18
  protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
19
  protected final String TEXT_1 = "";
19
  protected final String TEXT_1 = "";
20
  protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
20
  protected final String TEXT_2 = NL + NL + "/**" + NL + " * @generated" + NL + " */" + NL + "public class ";
21
  protected final String TEXT_3 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String openFilePathDialog(Shell shell, String fileExtensionFilter, int style) {" + NL + "\t\tFileDialog fileDialog = new FileDialog(shell, style);" + NL + "\t\tfileDialog.setFilterExtensions(new String[]{fileExtensionFilter});" + NL + "" + NL + "\t\tfileDialog.open();" + NL + "\t\tif (fileDialog.getFileName() != null && fileDialog.getFileName().length() > 0) {" + NL + "\t\t\treturn fileDialog.getFilterPath() + File.separator + fileDialog.getFileName();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static boolean openEditor(URI fileURI) {" + NL + "\t\tIWorkbench workbench = PlatformUI.getWorkbench();" + NL + "\t\tIWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();" + NL + "\t\tIWorkbenchPage page = workbenchWindow.getActivePage();" + NL + "" + NL + "\t\tIEditorDescriptor editorDescriptor = workbench.getEditorRegistry().getDefaultEditor(fileURI.lastSegment());" + NL + "\t\tif (editorDescriptor == null) {" + NL + "\t\t\tMessageDialog.openError(" + NL + "\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\"Error\"," + NL + "\t\t\t\"There is no editor registered for the file \" + fileURI.toFileString());" + NL + "\t\t\treturn false;" + NL + "\t\t} else {" + NL + "\t\t\ttry {" + NL + "\t\t\t\tpage.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());" + NL + "\t\t\t} catch (PartInitException exception) {" + NL + "\t\t\t\tMessageDialog.openError(" + NL + "\t\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\t\"Error Opening Editor\"," + NL + "\t\t\t\texception.getMessage());" + NL + "\t\t\t\treturn false;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\treturn true;" + NL + "\t}" + NL;
21
  protected final String TEXT_3 = " {" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static String openFilePathDialog(Shell shell, String fileExtensionFilter, int style) {" + NL + "\t\tFileDialog fileDialog = new FileDialog(shell, style);" + NL + "\t\tfileDialog.setFilterExtensions(new String[]{fileExtensionFilter});" + NL + "" + NL + "\t\tfileDialog.open();" + NL + "\t\tif (fileDialog.getFileName() != null && fileDialog.getFileName().length() > 0) {" + NL + "\t\t\treturn fileDialog.getFilterPath() + File.separator + fileDialog.getFileName();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static ";
22
  protected final String TEXT_4 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getDiagramFileURI(URI modelFileURI) {" + NL + "\t\tif (modelFileURI == null || !modelFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn modelFileURI.trimFileExtension().appendFileExtension(\"";
22
  protected final String TEXT_4 = " openEditor(URI fileURI) {" + NL + "\t\tIWorkbench workbench = PlatformUI.getWorkbench();" + NL + "\t\tIWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();" + NL + "\t\tIWorkbenchPage page = workbenchWindow.getActivePage();" + NL + "" + NL + "\t\tIEditorDescriptor editorDescriptor = workbench.getEditorRegistry().getDefaultEditor(fileURI.lastSegment());" + NL + "\t\tif (editorDescriptor == null) {" + NL + "\t\t\tMessageDialog.openError(" + NL + "\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\"Error\"," + NL + "\t\t\t\"There is no editor registered for the file \" + fileURI.toFileString());" + NL + "\t\t\treturn null;" + NL + "\t\t} else {" + NL + "\t\t\ttry {" + NL + "\t\t\t\treturn page.openEditor(new URIEditorInput(fileURI), editorDescriptor.getId());" + NL + "\t\t\t} catch (PartInitException exception) {" + NL + "\t\t\t\tMessageDialog.openError(" + NL + "\t\t\t\tworkbenchWindow.getShell()," + NL + "\t\t\t\t\"Error Opening Editor\"," + NL + "\t\t\t\texception.getMessage());" + NL + "\t\t\t\treturn null;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL;
23
  protected final String TEXT_5 = "\");" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getModelFileURI(URI diagramFileURI) {" + NL + "\t\tif (diagramFileURI == null || !diagramFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFileURI.trimFileExtension().appendFileExtension(\"";
23
  protected final String TEXT_5 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getDiagramFileURI(URI modelFileURI) {" + NL + "\t\tif (modelFileURI == null || !modelFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn modelFileURI.trimFileExtension().appendFileExtension(\"";
24
  protected final String TEXT_6 = "\");" + NL + "\t}";
24
  protected final String TEXT_6 = "\");" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static URI getModelFileURI(URI diagramFileURI) {" + NL + "\t\tif (diagramFileURI == null || !diagramFileURI.isFile()) {" + NL + "\t\t\treturn null;" + NL + "\t\t}" + NL + "\t\treturn diagramFileURI.trimFileExtension().appendFileExtension(\"";
25
  protected final String TEXT_7 = NL + "\t/**" + NL + "\t * Looks up a string in the plugin's plugin.properties file." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key) {" + NL + "\t\treturn ";
25
  protected final String TEXT_7 = "\");" + NL + "\t}";
26
  protected final String TEXT_8 = ".getInstance().getBundleString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's application" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Application implements ";
26
  protected final String TEXT_8 = NL + "\t/**" + NL + "\t * Looks up a string in the plugin's plugin.properties file." + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key) {" + NL + "\t\treturn ";
27
  protected final String TEXT_9 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object run(Object args) {" + NL + "\t\t\t";
27
  protected final String TEXT_9 = ".getInstance().getBundleString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's application" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Application implements ";
28
  protected final String TEXT_10 = " workbenchAdvisor = new Advisor();" + NL + "\t\t\t";
28
  protected final String TEXT_10 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.core.runtime.IPlatformRunnable#run(java.lang.Object)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic Object run(Object args) {" + NL + "\t\t\t";
29
  protected final String TEXT_11 = " display = ";
29
  protected final String TEXT_11 = " workbenchAdvisor = new Advisor();" + NL + "\t\t\t";
30
  protected final String TEXT_12 = ".createDisplay();" + NL + "\t\t\ttry {" + NL + "\t\t\t\tint returnCode = ";
30
  protected final String TEXT_12 = " display = ";
31
  protected final String TEXT_13 = ".createAndRunWorkbench(display, workbenchAdvisor);" + NL + "\t\t\t\tif (returnCode == ";
31
  protected final String TEXT_13 = ".createDisplay();" + NL + "\t\t\ttry {" + NL + "\t\t\t\tint returnCode = ";
32
  protected final String TEXT_14 = ".RETURN_RESTART) {" + NL + "\t\t\t\t\treturn ";
32
  protected final String TEXT_14 = ".createAndRunWorkbench(display, workbenchAdvisor);" + NL + "\t\t\t\tif (returnCode == ";
33
  protected final String TEXT_15 = ".EXIT_RESTART;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\treturn ";
33
  protected final String TEXT_15 = ".RETURN_RESTART) {" + NL + "\t\t\t\t\treturn ";
34
  protected final String TEXT_16 = ".EXIT_OK;" + NL + "\t\t\t\t}" + NL + "\t\t\t} finally {" + NL + "\t\t\t\tdisplay.dispose();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + " " + NL + "  \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Advisor extends ";
34
  protected final String TEXT_16 = ".EXIT_RESTART;" + NL + "\t\t\t\t} else {" + NL + "\t\t\t\t\treturn ";
35
  protected final String TEXT_17 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic String getInitialWindowPerspectiveId() {" + NL + "\t\t\treturn Perspective.ID_PERSPECTIVE;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void initialize(";
35
  protected final String TEXT_17 = ".EXIT_OK;" + NL + "\t\t\t\t}" + NL + "\t\t\t} finally {" + NL + "\t\t\t\tdisplay.dispose();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + " " + NL + "  \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Advisor extends ";
36
  protected final String TEXT_18 = " configurer) {" + NL + "\t\t\tsuper.initialize(configurer);" + NL + "\t\t\tconfigurer.setSaveAndRestore(true);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(";
36
  protected final String TEXT_18 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic String getInitialWindowPerspectiveId() {" + NL + "\t\t\treturn Perspective.ID_PERSPECTIVE;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void initialize(";
37
  protected final String TEXT_19 = " configurer) {" + NL + "\t\t\treturn new WindowAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "  \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Perspective implements ";
37
  protected final String TEXT_19 = " configurer) {" + NL + "\t\t\tsuper.initialize(configurer);" + NL + "\t\t\tconfigurer.setSaveAndRestore(true);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(";
38
  protected final String TEXT_20 = " {" + NL + "\t\t/**" + NL + "\t\t * Perspective ID" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static final String ID_PERSPECTIVE = \"";
38
  protected final String TEXT_20 = " configurer) {" + NL + "\t\t\treturn new WindowAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "  \t/**" + NL + "\t * RCP's perspective" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class Perspective implements ";
39
  protected final String TEXT_21 = ".Perspective\";\t//$NON-NLS-1$" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createInitialLayout(";
39
  protected final String TEXT_21 = " {" + NL + "\t\t/**" + NL + "\t\t * Perspective ID" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic static final String ID_PERSPECTIVE = \"";
40
  protected final String TEXT_22 = " layout) {" + NL + "\t\t\tlayout.setEditorAreaVisible(true);" + NL + "\t\t\tlayout.addPerspectiveShortcut(ID_PERSPECTIVE);" + NL + "" + NL + "\t\t\t";
40
  protected final String TEXT_22 = ".Perspective\";\t//$NON-NLS-1$" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void createInitialLayout(";
41
  protected final String TEXT_23 = " right = layout.createFolder(\"right\", ";
41
  protected final String TEXT_23 = " layout) {" + NL + "\t\t\tlayout.setEditorAreaVisible(true);" + NL + "\t\t\tlayout.addPerspectiveShortcut(ID_PERSPECTIVE);" + NL + "" + NL + "\t\t\t";
42
  protected final String TEXT_24 = ".RIGHT, (float)0.66, layout.getEditorArea());\t//$NON-NLS-1$" + NL + "\t\t\tright.addView(IPageLayout.ID_OUTLINE);" + NL + "" + NL + "\t\t\t";
42
  protected final String TEXT_24 = " right = layout.createFolder(\"right\", ";
43
  protected final String TEXT_25 = " bottomRight = layout.createFolder(\"bottonRight\", ";
43
  protected final String TEXT_25 = ".RIGHT, (float)0.66, layout.getEditorArea());\t//$NON-NLS-1$" + NL + "\t\t\tright.addView(IPageLayout.ID_OUTLINE);" + NL + "" + NL + "\t\t\t";
44
  protected final String TEXT_26 = ".BOTTOM, (float)0.60, \"right\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tbottomRight.addView(";
44
  protected final String TEXT_26 = " bottomRight = layout.createFolder(\"bottonRight\", ";
45
  protected final String TEXT_27 = ".ID_PROP_SHEET);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's window advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowAdvisor extends ";
45
  protected final String TEXT_27 = ".BOTTOM, (float)0.60, \"right\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tbottomRight.addView(";
46
  protected final String TEXT_28 = " {" + NL + "\t\t/**" + NL + "\t\t * @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowAdvisor(";
46
  protected final String TEXT_28 = ".ID_PROP_SHEET);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's window advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowAdvisor extends ";
47
  protected final String TEXT_29 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void preWindowOpen() {" + NL + "\t\t\t";
47
  protected final String TEXT_29 = " {" + NL + "\t\t/**" + NL + "\t\t * @see WorkbenchWindowAdvisor#WorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowAdvisor(";
48
  protected final String TEXT_30 = " configurer = getWindowConfigurer();" + NL + "\t\t\tconfigurer.setInitialSize(new ";
48
  protected final String TEXT_30 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#preWindowOpen()" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void preWindowOpen() {" + NL + "\t\t\t";
49
  protected final String TEXT_31 = "(600, 450));" + NL + "\t\t\tconfigurer.setShowCoolBar(false);" + NL + "\t\t\tconfigurer.setShowStatusLine(true);" + NL + "\t\t\tconfigurer.setTitle(getString(\"_UI_Application_title\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
49
  protected final String TEXT_31 = " configurer = getWindowConfigurer();" + NL + "\t\t\tconfigurer.setInitialSize(new ";
50
  protected final String TEXT_32 = " createActionBarAdvisor(";
50
  protected final String TEXT_32 = "(600, 450));" + NL + "\t\t\tconfigurer.setShowCoolBar(false);" + NL + "\t\t\tconfigurer.setShowStatusLine(true);" + NL + "\t\t\tconfigurer.setTitle(getString(\"_UI_Application_title\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#createActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
51
  protected final String TEXT_33 = " configurer) {" + NL + "\t\t\treturn new WindowActionBarAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's action bar advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowActionBarAdvisor extends ";
51
  protected final String TEXT_33 = " createActionBarAdvisor(";
52
  protected final String TEXT_34 = " {" + NL + "\t\t/**" + NL + "\t\t * @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowActionBarAdvisor(";
52
  protected final String TEXT_34 = " configurer) {" + NL + "\t\t\treturn new WindowActionBarAdvisor(configurer);" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * RCP's action bar advisor" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class WindowActionBarAdvisor extends ";
53
  protected final String TEXT_35 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void fillMenuBar(";
53
  protected final String TEXT_35 = " {" + NL + "\t\t/**" + NL + "\t\t * @see ActionBarAdvisor#ActionBarAdvisor(org.eclipse.ui.application.IActionBarConfigurer)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic WindowActionBarAdvisor(";
54
  protected final String TEXT_36 = " menuBar) {" + NL + "\t\t\t";
54
  protected final String TEXT_36 = " configurer) {" + NL + "\t\t\tsuper(configurer);" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.application.ActionBarAdvisor#fillMenuBar(org.eclipse.jface.action.IMenuManager)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void fillMenuBar(";
55
  protected final String TEXT_37 = " window = getActionBarConfigurer().getWindowConfigurer().getWindow();" + NL + "\t\t\tmenuBar.add(createFileMenu(window));" + NL + "\t\t\tmenuBar.add(createEditMenu(window));" + NL + "\t\t\tmenuBar.add(new ";
55
  protected final String TEXT_37 = " menuBar) {" + NL + "\t\t\t";
56
  protected final String TEXT_38 = "(";
56
  protected final String TEXT_38 = " window = getActionBarConfigurer().getWindowConfigurer().getWindow();" + NL + "\t\t\tmenuBar.add(createFileMenu(window));" + NL + "\t\t\tmenuBar.add(createEditMenu(window));" + NL + "\t\t\tmenuBar.add(new ";
57
  protected final String TEXT_39 = ".MB_ADDITIONS));" + NL + "\t\t\tmenuBar.add(createWindowMenu(window));" + NL + "\t\t\tmenuBar.add(createHelpMenu(window));\t\t\t\t\t" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'File' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
57
  protected final String TEXT_39 = "(";
58
  protected final String TEXT_40 = " createFileMenu(";
58
  protected final String TEXT_40 = ".MB_ADDITIONS));" + NL + "\t\t\tmenuBar.add(createWindowMenu(window));" + NL + "\t\t\tmenuBar.add(createHelpMenu(window));\t\t\t\t\t" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'File' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
59
  protected final String TEXT_41 = " window) {" + NL + "\t\t\t";
59
  protected final String TEXT_41 = " createFileMenu(";
60
  protected final String TEXT_42 = " menu = new ";
60
  protected final String TEXT_42 = " window) {" + NL + "\t\t\t";
61
  protected final String TEXT_43 = "(getString(\"_UI_Menu_File_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
61
  protected final String TEXT_43 = " menu = new ";
62
  protected final String TEXT_44 = ".M_FILE);" + NL + "\t\t\tmenu.add(new ";
62
  protected final String TEXT_44 = "(getString(\"_UI_Menu_File_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
63
  protected final String TEXT_45 = "(";
63
  protected final String TEXT_45 = ".M_FILE);" + NL + "\t\t\tmenu.add(new ";
64
  protected final String TEXT_46 = ".FILE_START));" + NL + "\t" + NL + "\t\t\t";
64
  protected final String TEXT_46 = "(";
65
  protected final String TEXT_47 = " newMenu = new ";
65
  protected final String TEXT_47 = ".FILE_START));" + NL + "\t" + NL + "\t\t\t";
66
  protected final String TEXT_48 = "(getString(\"_UI_Menu_New_label\"), \"new\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tnewMenu.add(new ";
66
  protected final String TEXT_48 = " newMenu = new ";
67
  protected final String TEXT_49 = "(";
67
  protected final String TEXT_49 = "(getString(\"_UI_Menu_New_label\"), \"new\");\t//$NON-NLS-1$\t//$NON-NLS-2$" + NL + "\t\t\tnewMenu.add(new ";
68
  protected final String TEXT_50 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tmenu.add(newMenu);" + NL + "\t\t\tmenu.add(new ";
68
  protected final String TEXT_50 = "(";
69
  protected final String TEXT_51 = "());" + NL + "\t\t\tmenu.add(new ";
69
  protected final String TEXT_51 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tmenu.add(newMenu);" + NL + "\t\t\tmenu.add(new ";
70
  protected final String TEXT_52 = "(";
70
  protected final String TEXT_52 = "());" + NL + "\t\t\tmenu.add(new ";
71
  protected final String TEXT_53 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(new ";
71
  protected final String TEXT_53 = "(";
72
  protected final String TEXT_54 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
72
  protected final String TEXT_54 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(new ";
73
  protected final String TEXT_55 = ".CLOSE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
73
  protected final String TEXT_55 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
74
  protected final String TEXT_56 = ".CLOSE_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
74
  protected final String TEXT_56 = ".CLOSE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
75
  protected final String TEXT_57 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
75
  protected final String TEXT_57 = ".CLOSE_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
76
  protected final String TEXT_58 = ".SAVE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
76
  protected final String TEXT_58 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
77
  protected final String TEXT_59 = ".SAVE_AS.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
77
  protected final String TEXT_59 = ".SAVE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
78
  protected final String TEXT_60 = ".SAVE_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
78
  protected final String TEXT_60 = ".SAVE_AS.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
79
  protected final String TEXT_61 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
79
  protected final String TEXT_61 = ".SAVE_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
80
  protected final String TEXT_62 = ".QUIT.create(window));" + NL + "\t\t\tmenu.add(new ";
80
  protected final String TEXT_62 = "());" + NL + "\t\t\taddToMenuAndRegister(menu, ";
81
  protected final String TEXT_63 = "(";
81
  protected final String TEXT_63 = ".QUIT.create(window));" + NL + "\t\t\tmenu.add(new ";
82
  protected final String TEXT_64 = ".FILE_END));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Edit' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
82
  protected final String TEXT_64 = "(";
83
  protected final String TEXT_65 = " createEditMenu(";
83
  protected final String TEXT_65 = ".FILE_END));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Edit' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
84
  protected final String TEXT_66 = " window) {" + NL + "\t\t\t";
84
  protected final String TEXT_66 = " createEditMenu(";
85
  protected final String TEXT_67 = " menu = new ";
85
  protected final String TEXT_67 = " window) {" + NL + "\t\t\t";
86
  protected final String TEXT_68 = "(getString(\"_UI_Menu_Edit_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
86
  protected final String TEXT_68 = " menu = new ";
87
  protected final String TEXT_69 = ".M_EDIT);" + NL + "\t\t\tmenu.add(new ";
87
  protected final String TEXT_69 = "(getString(\"_UI_Menu_Edit_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
88
  protected final String TEXT_70 = "(";
88
  protected final String TEXT_70 = ".M_EDIT);" + NL + "\t\t\tmenu.add(new ";
89
  protected final String TEXT_71 = ".EDIT_START));" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
89
  protected final String TEXT_71 = "(";
90
  protected final String TEXT_72 = ".UNDO.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
90
  protected final String TEXT_72 = ".EDIT_START));" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
91
  protected final String TEXT_73 = ".REDO.create(window));" + NL + "\t\t\tmenu.add(new ";
91
  protected final String TEXT_73 = ".UNDO.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
92
  protected final String TEXT_74 = "(";
92
  protected final String TEXT_74 = ".REDO.create(window));" + NL + "\t\t\tmenu.add(new ";
93
  protected final String TEXT_75 = ".UNDO_EXT));" + NL + "\t\t\tmenu.add(new ";
93
  protected final String TEXT_75 = "(";
94
  protected final String TEXT_76 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
94
  protected final String TEXT_76 = ".UNDO_EXT));" + NL + "\t\t\tmenu.add(new ";
95
  protected final String TEXT_77 = ".CUT.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
95
  protected final String TEXT_77 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
96
  protected final String TEXT_78 = ".COPY.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
96
  protected final String TEXT_78 = ".CUT.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
97
  protected final String TEXT_79 = ".PASTE.create(window));" + NL + "\t\t\tmenu.add(new ";
97
  protected final String TEXT_79 = ".COPY.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
98
  protected final String TEXT_80 = "(";
98
  protected final String TEXT_80 = ".PASTE.create(window));" + NL + "\t\t\tmenu.add(new ";
99
  protected final String TEXT_81 = ".CUT_EXT));" + NL + "\t\t\tmenu.add(new ";
99
  protected final String TEXT_81 = "(";
100
  protected final String TEXT_82 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
100
  protected final String TEXT_82 = ".CUT_EXT));" + NL + "\t\t\tmenu.add(new ";
101
  protected final String TEXT_83 = ".DELETE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
101
  protected final String TEXT_83 = "());" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
102
  protected final String TEXT_84 = ".SELECT_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
102
  protected final String TEXT_84 = ".DELETE.create(window));" + NL + "\t\t\taddToMenuAndRegister(menu, ";
103
  protected final String TEXT_85 = "());" + NL + "\t" + NL + "\t\t\tmenu.add(new ";
103
  protected final String TEXT_85 = ".SELECT_ALL.create(window));" + NL + "\t\t\tmenu.add(new ";
104
  protected final String TEXT_86 = "(";
104
  protected final String TEXT_86 = "());" + NL + "\t" + NL + "\t\t\tmenu.add(new ";
105
  protected final String TEXT_87 = ".ADD_EXT));" + NL + "\t" + NL + "\t\t\tmenu.add(new ";
105
  protected final String TEXT_87 = "(";
106
  protected final String TEXT_88 = "(";
106
  protected final String TEXT_88 = ".ADD_EXT));" + NL + "\t" + NL + "\t\t\tmenu.add(new ";
107
  protected final String TEXT_89 = ".EDIT_END));" + NL + "\t\t\tmenu.add(new ";
107
  protected final String TEXT_89 = "(";
108
  protected final String TEXT_90 = "(";
108
  protected final String TEXT_90 = ".EDIT_END));" + NL + "\t\t\tmenu.add(new ";
109
  protected final String TEXT_91 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Window' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
109
  protected final String TEXT_91 = "(";
110
  protected final String TEXT_92 = " createWindowMenu(";
110
  protected final String TEXT_92 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Window' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
111
  protected final String TEXT_93 = " window) {" + NL + "\t\t\t";
111
  protected final String TEXT_93 = " createWindowMenu(";
112
  protected final String TEXT_94 = " menu = new ";
112
  protected final String TEXT_94 = " window) {" + NL + "\t\t\t";
113
  protected final String TEXT_95 = "(getString(\"_UI_Menu_Window_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
113
  protected final String TEXT_95 = " menu = new ";
114
  protected final String TEXT_96 = ".M_WINDOW);" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
114
  protected final String TEXT_96 = "(getString(\"_UI_Menu_Window_label\"),\t//$NON-NLS-1$" + NL + "\t\t\t\t";
115
  protected final String TEXT_97 = ".OPEN_NEW_WINDOW.create(window));" + NL + "\t\t\tmenu.add(new ";
115
  protected final String TEXT_97 = ".M_WINDOW);" + NL + "\t" + NL + "\t\t\taddToMenuAndRegister(menu, ";
116
  protected final String TEXT_98 = "(";
116
  protected final String TEXT_98 = ".OPEN_NEW_WINDOW.create(window));" + NL + "\t\t\tmenu.add(new ";
117
  protected final String TEXT_99 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(";
117
  protected final String TEXT_99 = "(";
118
  protected final String TEXT_100 = ".OPEN_WINDOWS.create(window));" + NL + "\t" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Help' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
118
  protected final String TEXT_100 = ".MB_ADDITIONS));" + NL + "\t\t\tmenu.add(";
119
  protected final String TEXT_101 = " createHelpMenu(";
119
  protected final String TEXT_101 = ".OPEN_WINDOWS.create(window));" + NL + "\t" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t" + NL + "\t\t/**" + NL + "\t\t * Creates the 'Help' menu." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected ";
120
  protected final String TEXT_102 = " window) {" + NL + "\t\t\t";
120
  protected final String TEXT_102 = " createHelpMenu(";
121
  protected final String TEXT_103 = " menu = new ";
121
  protected final String TEXT_103 = " window) {" + NL + "\t\t\t";
122
  protected final String TEXT_104 = "(getString(\"_UI_Menu_Help_label\"), ";
122
  protected final String TEXT_104 = " menu = new ";
123
  protected final String TEXT_105 = ".M_HELP);\t//$NON-NLS-1$" + NL + "\t\t\t// Welcome or intro page would go here" + NL + "\t\t\t// Help contents would go here" + NL + "\t\t\t// Tips and tricks page would go here" + NL + "\t\t\tmenu.add(new ";
123
  protected final String TEXT_105 = "(getString(\"_UI_Menu_Help_label\"), ";
124
  protected final String TEXT_106 = "(";
124
  protected final String TEXT_106 = ".M_HELP);\t//$NON-NLS-1$" + NL + "\t\t\t// Welcome or intro page would go here" + NL + "\t\t\t// Help contents would go here" + NL + "\t\t\t// Tips and tricks page would go here" + NL + "\t\t\tmenu.add(new ";
125
  protected final String TEXT_107 = ".HELP_START));" + NL + "\t\t\tmenu.add(new ";
125
  protected final String TEXT_107 = "(";
126
  protected final String TEXT_108 = "(";
126
  protected final String TEXT_108 = ".HELP_START));" + NL + "\t\t\tmenu.add(new ";
127
  protected final String TEXT_109 = ".HELP_END));" + NL + "\t\t\tmenu.add(new ";
127
  protected final String TEXT_109 = "(";
128
  protected final String TEXT_110 = "(";
128
  protected final String TEXT_110 = ".HELP_END));" + NL + "\t\t\tmenu.add(new ";
129
  protected final String TEXT_111 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * Adds the specified action to the given menu and also registers the action with the" + NL + "\t\t * action bar configurer, in order to activate its key binding." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void addToMenuAndRegister(";
129
  protected final String TEXT_111 = "(";
130
  protected final String TEXT_112 = " menuManager, ";
130
  protected final String TEXT_112 = ".MB_ADDITIONS));" + NL + "\t\t\treturn menu;" + NL + "\t\t}" + NL + "\t\t" + NL + "\t\t/**" + NL + "\t\t * Adds the specified action to the given menu and also registers the action with the" + NL + "\t\t * action bar configurer, in order to activate its key binding." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprotected void addToMenuAndRegister(";
131
  protected final String TEXT_113 = " action) {" + NL + "\t\t\tmenuManager.add(action);" + NL + "\t\t\tgetActionBarConfigurer().registerGlobalAction(action);\t\t\t" + NL + "\t\t}\t\t" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * About action for the RCP application." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class AboutAction extends ";
131
  protected final String TEXT_113 = " menuManager, ";
132
  protected final String TEXT_114 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
132
  protected final String TEXT_114 = " action) {" + NL + "\t\t\tmenuManager.add(action);" + NL + "\t\t\tgetActionBarConfigurer().registerGlobalAction(action);\t\t\t" + NL + "\t\t}\t\t" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * About action for the RCP application." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class AboutAction extends ";
133
  protected final String TEXT_115 = " action) {" + NL + "\t\t\t";
133
  protected final String TEXT_115 = " {" + NL + "\t\t/**" + NL + "\t\t * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
134
  protected final String TEXT_116 = ".openInformation(getWindow().getShell(), getString(\"_UI_About_title\"),\t//$NON-NLS-1$" + NL + "\t\t\tgetString(\"_UI_About_text\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t}";
134
  protected final String TEXT_116 = " action) {" + NL + "\t\t\t";
135
  protected final String TEXT_117 = NL + NL + " \t/**" + NL + "\t * Open action for the ";
135
  protected final String TEXT_117 = ".openInformation(getWindow().getShell(), getString(\"_UI_About_title\"),\t//$NON-NLS-1$" + NL + "\t\t\tgetString(\"_UI_About_text\"));\t//$NON-NLS-1$" + NL + "\t\t}" + NL + "\t}";
136
  protected final String TEXT_118 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenDiagramAction extends ";
136
  protected final String TEXT_118 = NL + NL + " \t/**" + NL + "\t * Open action for the ";
137
  protected final String TEXT_119 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the file dialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
137
  protected final String TEXT_119 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenDiagramAction extends ";
138
  protected final String TEXT_120 = " action) {" + NL + "\t\t\tString filePath = openFilePathDialog(getWindow().getShell(), \"*.";
138
  protected final String TEXT_120 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the file dialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
139
  protected final String TEXT_121 = "\", ";
139
  protected final String TEXT_121 = " action) {" + NL + "\t\t\tString filePath = openFilePathDialog(getWindow().getShell(), \"*.";
140
  protected final String TEXT_122 = ".OPEN);\t//$NON-NLS-1$" + NL + "\t\t\tif (filePath != null) {" + NL + "\t\t\t\topenEditor(URI.createFileURI(filePath));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + " \t}" + NL + "" + NL + "\t/**" + NL + "\t * Open URI action for the ";
140
  protected final String TEXT_122 = "\", ";
141
  protected final String TEXT_123 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenURIAction extends ";
141
  protected final String TEXT_123 = ".OPEN);\t//$NON-NLS-1$" + NL + "\t\t\tif (filePath != null) {" + NL + "\t\t\t\topenEditor(URI.createFileURI(filePath));" + NL + "\t\t\t}" + NL + "\t\t}" + NL + " \t}" + NL + "" + NL + "\t/**" + NL + "\t * Open URI action for the ";
142
  protected final String TEXT_124 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the LoadResourceDialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
142
  protected final String TEXT_124 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class OpenURIAction extends ";
143
  protected final String TEXT_125 = " action) {" + NL + "\t\t\t";
143
  protected final String TEXT_125 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the editors for the files selected using the LoadResourceDialog." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
144
  protected final String TEXT_126 = ".LoadResourceDialog loadResourceDialog = new ";
144
  protected final String TEXT_126 = " action) {" + NL + "\t\t\t";
145
  protected final String TEXT_127 = ".LoadResourceDialog(getWindow().getShell());" + NL + "\t\t\tif (";
145
  protected final String TEXT_127 = ".LoadResourceDialog loadResourceDialog = new ";
146
  protected final String TEXT_128 = ".OK == loadResourceDialog.open()) {" + NL + "\t\t\t\tfor (";
146
  protected final String TEXT_128 = ".LoadResourceDialog(getWindow().getShell());" + NL + "\t\t\tif (";
147
  protected final String TEXT_129 = " it = loadResourceDialog.getURIs().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\topenEditor((URI) it.next());" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * New diagram action for the ";
147
  protected final String TEXT_129 = ".OK == loadResourceDialog.open()) {" + NL + "\t\t\t\tfor (";
148
  protected final String TEXT_130 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class NewDiagramAction extends ";
148
  protected final String TEXT_130 = " it = loadResourceDialog.getURIs().iterator(); it.hasNext(); ) {" + NL + "\t\t\t\t\topenEditor((URI) it.next());" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * New diagram action for the ";
149
  protected final String TEXT_131 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the wizard to create the diagram." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
149
  protected final String TEXT_131 = " diagram." + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic static class NewDiagramAction extends ";
150
  protected final String TEXT_132 = " action) {" + NL + "\t\t\t";
150
  protected final String TEXT_132 = " {" + NL + "\t\t/**" + NL + "\t\t * Opens the wizard to create the diagram." + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic void run(";
151
  protected final String TEXT_133 = " wizard = new ";
151
  protected final String TEXT_133 = " action) {" + NL + "\t\t\t";
152
  protected final String TEXT_134 = "();" + NL + "\t\t\twizard.init(getWindow().getWorkbench(), ";
152
  protected final String TEXT_134 = " wizard = new ";
153
  protected final String TEXT_135 = ".EMPTY);" + NL + "\t\t\t";
153
  protected final String TEXT_135 = "();" + NL + "\t\t\twizard.init(getWindow().getWorkbench(), ";
154
  protected final String TEXT_136 = " wizardDialog = new ";
154
  protected final String TEXT_136 = ".EMPTY);" + NL + "\t\t\t";
155
  protected final String TEXT_137 = "(getWindow().getShell(), wizard);" + NL + "\t\t\twizardDialog.open();" + NL + "\t\t}" + NL + "\t}";
155
  protected final String TEXT_137 = " wizardDialog = new ";
156
  protected final String TEXT_138 = NL + "}";
156
  protected final String TEXT_138 = "(getWindow().getShell(), wizard);" + NL + "\t\t\twizardDialog.open();" + NL + "\t\t}" + NL + "\t}";
157
  protected final String TEXT_139 = NL;
157
  protected final String TEXT_139 = NL + "}";
158
  protected final String TEXT_140 = NL;
158
159
159
  public String generate(Object argument)
160
  public String generate(Object argument)
160
  {
161
  {
Lines 186-199 Link Here
186
    stringBuffer.append(TEXT_2);
187
    stringBuffer.append(TEXT_2);
187
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
188
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
188
    stringBuffer.append(TEXT_3);
189
    stringBuffer.append(TEXT_3);
190
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorPart"));
191
    stringBuffer.append(TEXT_4);
189
    
192
    
190
if (!genDiagram.getEditorGen().isSameFileForDiagramAndModel()) {
193
if (!genDiagram.getEditorGen().isSameFileForDiagramAndModel()) {
191
194
192
    stringBuffer.append(TEXT_4);
193
    stringBuffer.append(editorGen.getDiagramFileExtension());
194
    stringBuffer.append(TEXT_5);
195
    stringBuffer.append(TEXT_5);
195
    stringBuffer.append(editorGen.getDomainFileExtension());
196
    stringBuffer.append(editorGen.getDiagramFileExtension());
196
    stringBuffer.append(TEXT_6);
197
    stringBuffer.append(TEXT_6);
198
    stringBuffer.append(editorGen.getDomainFileExtension());
199
    stringBuffer.append(TEXT_7);
197
    
200
    
198
}
201
}
199
202
Lines 202-476 Link Here
202
	boolean shouldGenerateApplication = true;	/*XXX: option in gmfgen*/
205
	boolean shouldGenerateApplication = true;	/*XXX: option in gmfgen*/
203
	if (shouldGenerateApplication) {
206
	if (shouldGenerateApplication) {
204
207
205
    stringBuffer.append(TEXT_7);
206
    stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName()));
207
    stringBuffer.append(TEXT_8);
208
    stringBuffer.append(TEXT_8);
208
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
209
    stringBuffer.append(importManager.getImportedName(genPlugin.getActivatorQualifiedClassName()));
209
    stringBuffer.append(TEXT_9);
210
    stringBuffer.append(TEXT_9);
210
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor"));
211
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
211
    stringBuffer.append(TEXT_10);
212
    stringBuffer.append(TEXT_10);
212
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display"));
213
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor"));
213
    stringBuffer.append(TEXT_11);
214
    stringBuffer.append(TEXT_11);
214
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
215
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Display"));
215
    stringBuffer.append(TEXT_12);
216
    stringBuffer.append(TEXT_12);
216
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
217
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
217
    stringBuffer.append(TEXT_13);
218
    stringBuffer.append(TEXT_13);
218
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
219
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
219
    stringBuffer.append(TEXT_14);
220
    stringBuffer.append(TEXT_14);
220
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
221
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PlatformUI"));
221
    stringBuffer.append(TEXT_15);
222
    stringBuffer.append(TEXT_15);
222
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
223
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
223
    stringBuffer.append(TEXT_16);
224
    stringBuffer.append(TEXT_16);
224
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor"));
225
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IPlatformRunnable"));
225
    stringBuffer.append(TEXT_17);
226
    stringBuffer.append(TEXT_17);
226
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchConfigurer"));
227
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchAdvisor"));
227
    stringBuffer.append(TEXT_18);
228
    stringBuffer.append(TEXT_18);
228
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
229
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchConfigurer"));
229
    stringBuffer.append(TEXT_19);
230
    stringBuffer.append(TEXT_19);
230
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPerspectiveFactory"));
231
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
231
    stringBuffer.append(TEXT_20);
232
    stringBuffer.append(TEXT_20);
232
    stringBuffer.append(genPlugin.getID());
233
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPerspectiveFactory"));
233
    stringBuffer.append(TEXT_21);
234
    stringBuffer.append(TEXT_21);
234
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
235
    stringBuffer.append(genPlugin.getID());
235
    stringBuffer.append(TEXT_22);
236
    stringBuffer.append(TEXT_22);
236
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout"));
237
    stringBuffer.append(TEXT_23);
238
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
237
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
239
    stringBuffer.append(TEXT_24);
238
    stringBuffer.append(TEXT_23);
240
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout"));
239
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout"));
241
    stringBuffer.append(TEXT_25);
240
    stringBuffer.append(TEXT_24);
242
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
241
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
242
    stringBuffer.append(TEXT_25);
243
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFolderLayout"));
243
    stringBuffer.append(TEXT_26);
244
    stringBuffer.append(TEXT_26);
244
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
245
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
245
    stringBuffer.append(TEXT_27);
246
    stringBuffer.append(TEXT_27);
246
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchWindowAdvisor"));
247
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPageLayout"));
247
    stringBuffer.append(TEXT_28);
248
    stringBuffer.append(TEXT_28);
248
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
249
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.WorkbenchWindowAdvisor"));
249
    stringBuffer.append(TEXT_29);
250
    stringBuffer.append(TEXT_29);
250
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
251
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
251
    stringBuffer.append(TEXT_30);
252
    stringBuffer.append(TEXT_30);
252
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Point"));
253
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IWorkbenchWindowConfigurer"));
253
    stringBuffer.append(TEXT_31);
254
    stringBuffer.append(TEXT_31);
254
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor"));
255
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.graphics.Point"));
255
    stringBuffer.append(TEXT_32);
256
    stringBuffer.append(TEXT_32);
256
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer"));
257
    stringBuffer.append(TEXT_33);
258
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor"));
257
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor"));
259
    stringBuffer.append(TEXT_34);
258
    stringBuffer.append(TEXT_33);
260
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer"));
259
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer"));
260
    stringBuffer.append(TEXT_34);
261
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.ActionBarAdvisor"));
261
    stringBuffer.append(TEXT_35);
262
    stringBuffer.append(TEXT_35);
262
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
263
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.application.IActionBarConfigurer"));
263
    stringBuffer.append(TEXT_36);
264
    stringBuffer.append(TEXT_36);
264
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
265
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
265
    stringBuffer.append(TEXT_37);
266
    stringBuffer.append(TEXT_37);
266
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
267
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
267
    stringBuffer.append(TEXT_38);
268
    stringBuffer.append(TEXT_38);
268
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
269
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
269
    stringBuffer.append(TEXT_39);
270
    stringBuffer.append(TEXT_39);
270
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
271
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
271
    stringBuffer.append(TEXT_40);
272
    stringBuffer.append(TEXT_40);
272
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
273
    stringBuffer.append(TEXT_41);
274
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
273
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
274
    stringBuffer.append(TEXT_41);
275
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
275
    stringBuffer.append(TEXT_42);
276
    stringBuffer.append(TEXT_42);
276
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
277
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
277
    stringBuffer.append(TEXT_43);
278
    stringBuffer.append(TEXT_43);
278
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
279
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
279
    stringBuffer.append(TEXT_44);
280
    stringBuffer.append(TEXT_44);
280
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
281
    stringBuffer.append(TEXT_45);
282
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
281
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
282
    stringBuffer.append(TEXT_45);
283
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
283
    stringBuffer.append(TEXT_46);
284
    stringBuffer.append(TEXT_46);
284
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
285
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
285
    stringBuffer.append(TEXT_47);
286
    stringBuffer.append(TEXT_47);
286
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
287
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
287
    stringBuffer.append(TEXT_48);
288
    stringBuffer.append(TEXT_48);
288
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
289
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
289
    stringBuffer.append(TEXT_49);
290
    stringBuffer.append(TEXT_49);
290
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
291
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
291
    stringBuffer.append(TEXT_50);
292
    stringBuffer.append(TEXT_50);
292
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
293
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
293
    stringBuffer.append(TEXT_51);
294
    stringBuffer.append(TEXT_51);
294
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
295
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
295
    stringBuffer.append(TEXT_52);
296
    stringBuffer.append(TEXT_52);
296
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
297
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
297
    stringBuffer.append(TEXT_53);
298
    stringBuffer.append(TEXT_53);
298
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
299
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
299
    stringBuffer.append(TEXT_54);
300
    stringBuffer.append(TEXT_54);
300
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
301
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
301
    stringBuffer.append(TEXT_55);
302
    stringBuffer.append(TEXT_55);
302
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
303
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
303
    stringBuffer.append(TEXT_56);
304
    stringBuffer.append(TEXT_56);
304
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
305
    stringBuffer.append(TEXT_57);
306
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
305
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
306
    stringBuffer.append(TEXT_57);
307
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
307
    stringBuffer.append(TEXT_58);
308
    stringBuffer.append(TEXT_58);
308
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
309
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
309
    stringBuffer.append(TEXT_59);
310
    stringBuffer.append(TEXT_59);
310
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
311
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
311
    stringBuffer.append(TEXT_60);
312
    stringBuffer.append(TEXT_60);
312
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
313
    stringBuffer.append(TEXT_61);
314
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
313
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
314
    stringBuffer.append(TEXT_61);
315
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
315
    stringBuffer.append(TEXT_62);
316
    stringBuffer.append(TEXT_62);
316
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
317
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
317
    stringBuffer.append(TEXT_63);
318
    stringBuffer.append(TEXT_63);
318
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
319
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
319
    stringBuffer.append(TEXT_64);
320
    stringBuffer.append(TEXT_64);
320
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
321
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
321
    stringBuffer.append(TEXT_65);
322
    stringBuffer.append(TEXT_65);
322
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
323
    stringBuffer.append(TEXT_66);
324
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
323
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
324
    stringBuffer.append(TEXT_66);
325
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
325
    stringBuffer.append(TEXT_67);
326
    stringBuffer.append(TEXT_67);
326
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
327
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
327
    stringBuffer.append(TEXT_68);
328
    stringBuffer.append(TEXT_68);
328
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
329
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
329
    stringBuffer.append(TEXT_69);
330
    stringBuffer.append(TEXT_69);
330
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
331
    stringBuffer.append(TEXT_70);
332
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
331
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
332
    stringBuffer.append(TEXT_70);
333
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
333
    stringBuffer.append(TEXT_71);
334
    stringBuffer.append(TEXT_71);
334
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
335
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
335
    stringBuffer.append(TEXT_72);
336
    stringBuffer.append(TEXT_72);
336
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
337
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
337
    stringBuffer.append(TEXT_73);
338
    stringBuffer.append(TEXT_73);
338
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
339
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
339
    stringBuffer.append(TEXT_74);
340
    stringBuffer.append(TEXT_74);
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
341
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
341
    stringBuffer.append(TEXT_75);
342
    stringBuffer.append(TEXT_75);
342
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
343
    stringBuffer.append(TEXT_76);
344
    stringBuffer.append(TEXT_76);
344
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
345
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
345
    stringBuffer.append(TEXT_77);
346
    stringBuffer.append(TEXT_77);
346
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
347
    stringBuffer.append(TEXT_78);
348
    stringBuffer.append(TEXT_78);
348
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
349
    stringBuffer.append(TEXT_79);
350
    stringBuffer.append(TEXT_79);
350
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
351
    stringBuffer.append(TEXT_80);
352
    stringBuffer.append(TEXT_80);
352
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
353
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
353
    stringBuffer.append(TEXT_81);
354
    stringBuffer.append(TEXT_81);
354
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
355
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
355
    stringBuffer.append(TEXT_82);
356
    stringBuffer.append(TEXT_82);
356
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
357
    stringBuffer.append(TEXT_83);
358
    stringBuffer.append(TEXT_83);
358
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
359
    stringBuffer.append(TEXT_84);
360
    stringBuffer.append(TEXT_84);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
361
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
361
    stringBuffer.append(TEXT_85);
362
    stringBuffer.append(TEXT_85);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
363
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
363
    stringBuffer.append(TEXT_86);
364
    stringBuffer.append(TEXT_86);
364
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
365
    stringBuffer.append(TEXT_87);
366
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
367
    stringBuffer.append(TEXT_88);
366
    stringBuffer.append(TEXT_87);
368
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
367
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
368
    stringBuffer.append(TEXT_88);
369
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
369
    stringBuffer.append(TEXT_89);
370
    stringBuffer.append(TEXT_89);
370
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
371
    stringBuffer.append(TEXT_90);
372
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
371
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
372
    stringBuffer.append(TEXT_90);
373
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
373
    stringBuffer.append(TEXT_91);
374
    stringBuffer.append(TEXT_91);
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
375
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
375
    stringBuffer.append(TEXT_92);
376
    stringBuffer.append(TEXT_92);
376
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
377
    stringBuffer.append(TEXT_93);
378
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
377
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
378
    stringBuffer.append(TEXT_93);
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
379
    stringBuffer.append(TEXT_94);
380
    stringBuffer.append(TEXT_94);
380
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
381
    stringBuffer.append(TEXT_95);
382
    stringBuffer.append(TEXT_95);
382
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
383
    stringBuffer.append(TEXT_96);
384
    stringBuffer.append(TEXT_96);
384
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
385
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
385
    stringBuffer.append(TEXT_97);
386
    stringBuffer.append(TEXT_97);
386
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
387
    stringBuffer.append(TEXT_98);
388
    stringBuffer.append(TEXT_98);
388
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
389
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
389
    stringBuffer.append(TEXT_99);
390
    stringBuffer.append(TEXT_99);
390
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ContributionItemFactory"));
391
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
391
    stringBuffer.append(TEXT_100);
392
    stringBuffer.append(TEXT_100);
392
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
393
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ContributionItemFactory"));
393
    stringBuffer.append(TEXT_101);
394
    stringBuffer.append(TEXT_101);
394
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
395
    stringBuffer.append(TEXT_102);
396
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
395
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
396
    stringBuffer.append(TEXT_102);
397
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchWindow"));
397
    stringBuffer.append(TEXT_103);
398
    stringBuffer.append(TEXT_103);
398
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
399
    stringBuffer.append(TEXT_104);
400
    stringBuffer.append(TEXT_104);
400
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
401
    stringBuffer.append(TEXT_105);
402
    stringBuffer.append(TEXT_105);
402
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
403
    stringBuffer.append(TEXT_106);
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
403
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
405
    stringBuffer.append(TEXT_107);
404
    stringBuffer.append(TEXT_106);
406
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
405
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
407
    stringBuffer.append(TEXT_108);
406
    stringBuffer.append(TEXT_107);
408
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
407
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
409
    stringBuffer.append(TEXT_109);
408
    stringBuffer.append(TEXT_108);
410
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
411
    stringBuffer.append(TEXT_110);
410
    stringBuffer.append(TEXT_109);
412
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
412
    stringBuffer.append(TEXT_110);
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.GroupMarker"));
413
    stringBuffer.append(TEXT_111);
414
    stringBuffer.append(TEXT_111);
414
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
415
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IWorkbenchActionConstants"));
415
    stringBuffer.append(TEXT_112);
416
    stringBuffer.append(TEXT_112);
416
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
417
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
417
    stringBuffer.append(TEXT_113);
418
    stringBuffer.append(TEXT_113);
418
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
419
    stringBuffer.append(TEXT_114);
420
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
419
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
420
    stringBuffer.append(TEXT_114);
421
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
421
    stringBuffer.append(TEXT_115);
422
    stringBuffer.append(TEXT_115);
422
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.MessageDialog"));
423
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
423
    stringBuffer.append(TEXT_116);
424
    stringBuffer.append(TEXT_116);
425
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.MessageDialog"));
426
    stringBuffer.append(TEXT_117);
424
    
427
    
425
 	}
428
 	}
426
 
429
 
427
    stringBuffer.append(TEXT_117);
428
    stringBuffer.append(genModel.getModelName());
429
    stringBuffer.append(TEXT_118);
430
    stringBuffer.append(TEXT_118);
430
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
431
    stringBuffer.append(genModel.getModelName());
431
    stringBuffer.append(TEXT_119);
432
    stringBuffer.append(TEXT_119);
432
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
433
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
433
    stringBuffer.append(TEXT_120);
434
    stringBuffer.append(TEXT_120);
434
    stringBuffer.append(editorGen.getDiagramFileExtension());
435
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
435
    stringBuffer.append(TEXT_121);
436
    stringBuffer.append(TEXT_121);
436
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
437
    stringBuffer.append(editorGen.getDiagramFileExtension());
437
    stringBuffer.append(TEXT_122);
438
    stringBuffer.append(TEXT_122);
438
    stringBuffer.append(genModel.getModelName());
439
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
439
    stringBuffer.append(TEXT_123);
440
    stringBuffer.append(TEXT_123);
440
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
441
    stringBuffer.append(genModel.getModelName());
441
    stringBuffer.append(TEXT_124);
442
    stringBuffer.append(TEXT_124);
442
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
443
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
443
    stringBuffer.append(TEXT_125);
444
    stringBuffer.append(TEXT_125);
444
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction"));
445
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
445
    stringBuffer.append(TEXT_126);
446
    stringBuffer.append(TEXT_126);
446
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction"));
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction"));
447
    stringBuffer.append(TEXT_127);
448
    stringBuffer.append(TEXT_127);
448
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.Dialog"));
449
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.ui.action.LoadResourceAction"));
449
    stringBuffer.append(TEXT_128);
450
    stringBuffer.append(TEXT_128);
450
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.Dialog"));
451
    stringBuffer.append(TEXT_129);
452
    stringBuffer.append(TEXT_129);
452
    stringBuffer.append(genModel.getModelName());
453
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
453
    stringBuffer.append(TEXT_130);
454
    stringBuffer.append(TEXT_130);
454
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
455
    stringBuffer.append(genModel.getModelName());
455
    stringBuffer.append(TEXT_131);
456
    stringBuffer.append(TEXT_131);
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate"));
457
    stringBuffer.append(TEXT_132);
458
    stringBuffer.append(TEXT_132);
458
    stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName()));
459
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
459
    stringBuffer.append(TEXT_133);
460
    stringBuffer.append(TEXT_133);
460
    stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName()));
461
    stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName()));
461
    stringBuffer.append(TEXT_134);
462
    stringBuffer.append(TEXT_134);
462
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
463
    stringBuffer.append(importManager.getImportedName(genDiagram.getCreationWizardQualifiedClassName()));
463
    stringBuffer.append(TEXT_135);
464
    stringBuffer.append(TEXT_135);
464
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog"));
465
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.viewers.StructuredSelection"));
465
    stringBuffer.append(TEXT_136);
466
    stringBuffer.append(TEXT_136);
466
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog"));
467
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog"));
467
    stringBuffer.append(TEXT_137);
468
    stringBuffer.append(TEXT_137);
469
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.wizard.WizardDialog"));
470
    stringBuffer.append(TEXT_138);
468
    
471
    
469
}
472
}
470
473
471
    stringBuffer.append(TEXT_138);
472
    importManager.emitSortedImports();
473
    stringBuffer.append(TEXT_139);
474
    stringBuffer.append(TEXT_139);
475
    importManager.emitSortedImports();
476
    stringBuffer.append(TEXT_140);
474
    return stringBuffer.toString();
477
    return stringBuffer.toString();
475
  }
478
  }
476
}
479
}
(-)src-templates/org/eclipse/gmf/codegen/templates/lite/editor/EditorGenerator.java (-291 / +300 lines)
Lines 65-226 Link Here
65
  protected final String TEXT_46 = ") this, ";
65
  protected final String TEXT_46 = ") this, ";
66
  protected final String TEXT_47 = ".MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new ";
66
  protected final String TEXT_47 = ".MIDDLE));" + NL + "" + NL + "\t\taddEditorAction(new ";
67
  protected final String TEXT_48 = "(this));" + NL + "\t\taddEditorAction(new ";
67
  protected final String TEXT_48 = "(this));" + NL + "\t\taddEditorAction(new ";
68
  protected final String TEXT_49 = "(this));" + NL + "" + NL + "\t\t";
68
  protected final String TEXT_49 = "(this));" + NL + "\t\taddEditorAction(new ";
69
  protected final String TEXT_50 = " zoomIn = new ";
69
  protected final String TEXT_50 = "(this));" + NL + "" + NL + "\t\t";
70
  protected final String TEXT_51 = "(getZoomManager());" + NL + "\t\t";
70
  protected final String TEXT_51 = " zoomIn = new ";
71
  protected final String TEXT_52 = " zoomOut = new ";
71
  protected final String TEXT_52 = "(getZoomManager());" + NL + "\t\t";
72
  protected final String TEXT_53 = "(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t\t";
72
  protected final String TEXT_53 = " zoomOut = new ";
73
  protected final String TEXT_54 = " keyHandler = getGraphicalViewer().getKeyHandler();" + NL + "\t\tkeyHandler.put(";
73
  protected final String TEXT_54 = "(getZoomManager());" + NL + "\t\taddAction(zoomIn);" + NL + "\t\taddAction(zoomOut);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomIn);" + NL + "\t\tgetSite().getKeyBindingService().registerAction(zoomOut);" + NL + "\t\t";
74
  protected final String TEXT_55 = ".getPressed(";
74
  protected final String TEXT_55 = " keyHandler = getGraphicalViewer().getKeyHandler();" + NL + "\t\tkeyHandler.put(";
75
  protected final String TEXT_56 = ".DEL, 127, 0), getActionRegistry().getAction(";
75
  protected final String TEXT_56 = ".getPressed(";
76
  protected final String TEXT_57 = ".DELETE.getId()));" + NL + "\t\tkeyHandler.put(";
76
  protected final String TEXT_57 = ".DEL, 127, 0), getActionRegistry().getAction(";
77
  protected final String TEXT_58 = ".getPressed(";
77
  protected final String TEXT_58 = ".DELETE.getId()));" + NL + "\t\tkeyHandler.put(";
78
  protected final String TEXT_59 = ".F2, 0), getActionRegistry().getAction(";
78
  protected final String TEXT_59 = ".getPressed(";
79
  protected final String TEXT_60 = ".DIRECT_EDIT));" + NL + "\t}" + NL;
79
  protected final String TEXT_60 = ".F2, 0), getActionRegistry().getAction(";
80
  protected final String TEXT_61 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor(";
80
  protected final String TEXT_61 = ".DIRECT_EDIT));" + NL + "\t}" + NL;
81
  protected final String TEXT_62 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}";
81
  protected final String TEXT_62 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tvoid closeEditor() {" + NL + "\t\tgetSite().getShell().getDisplay().syncExec(new Runnable() {" + NL + "\t\t\tpublic void run() {" + NL + "\t\t\t\tgetSite().getPage().closeEditor(";
82
  protected final String TEXT_63 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave(";
82
  protected final String TEXT_63 = ".this, false);" + NL + "\t\t\t}" + NL + "\t\t});" + NL + "\t}";
83
  protected final String TEXT_64 = " monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch (";
83
  protected final String TEXT_64 = NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void dispose() {" + NL + "\t\t// important: always call super implementation of dispose" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void doSave(";
84
  protected final String TEXT_65 = " e) {" + NL + "\t\t\t";
84
  protected final String TEXT_65 = " monitor) {" + NL + "\t\ttry {" + NL + "\t\t\tsave(monitor);" + NL + "\t\t\tgetCommandStack().markSaveLocation();" + NL + "\t\t} catch (";
85
  protected final String TEXT_66 = ".openError(getSite().getShell(), \"Error During Save\", \"The current ";
85
  protected final String TEXT_66 = " e) {" + NL + "\t\t\t";
86
  protected final String TEXT_67 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configurePalette(";
86
  protected final String TEXT_67 = ".openError(getSite().getShell(), \"Error During Save\", \"The current ";
87
  protected final String TEXT_68 = " paletteRoot) {";
87
  protected final String TEXT_68 = " model could not be saved.\", e.getStatus());" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configurePalette(";
88
  protected final String TEXT_69 = NL + "\t\tnew ";
88
  protected final String TEXT_69 = " paletteRoot) {";
89
  protected final String TEXT_70 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);";
89
  protected final String TEXT_70 = NL + "\t\tnew ";
90
  protected final String TEXT_71 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
90
  protected final String TEXT_71 = "(getDomainAdapterFactory()).contributeToPalette(paletteRoot);";
91
  protected final String TEXT_72 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
91
  protected final String TEXT_72 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
92
  protected final String TEXT_73 = " getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init(";
92
  protected final String TEXT_73 = " getDiagramRoot() {" + NL + "\t\treturn diagramRoot;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ";
93
  protected final String TEXT_74 = " site, ";
93
  protected final String TEXT_74 = " getDiagram() {" + NL + "\t\treturn diagram;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void init(";
94
  protected final String TEXT_75 = " input) throws ";
94
  protected final String TEXT_75 = " site, ";
95
  protected final String TEXT_76 = " {" + NL + "\t\t";
95
  protected final String TEXT_76 = " input) throws ";
96
  protected final String TEXT_77 = " file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new ";
96
  protected final String TEXT_77 = " {" + NL + "\t\t";
97
  protected final String TEXT_78 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsuper.init(site, input);" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new ";
97
  protected final String TEXT_78 = " file = getURIFromInput(input);" + NL + "\t\tif (file == null) {" + NL + "\t\t\tthrow new ";
98
  protected final String TEXT_79 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput(";
98
  protected final String TEXT_79 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t\tsuper.init(site, input);" + NL + "\t\t// validate" + NL + "\t\tif (getDiagramRoot() == null) {" + NL + "\t\t\tthrow new ";
99
  protected final String TEXT_80 = " input)  {";
99
  protected final String TEXT_80 = "(\"The specified input is not valid.\");" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void setInput(";
100
  protected final String TEXT_81 = NL + "\t\tif (getEditorInput() instanceof ";
100
  protected final String TEXT_81 = " input)  {";
101
  protected final String TEXT_82 = ") {" + NL + "\t\t\t";
101
  protected final String TEXT_82 = NL + "\t\tif (getEditorInput() instanceof ";
102
  protected final String TEXT_83 = " resource = ((";
102
  protected final String TEXT_83 = ") {" + NL + "\t\t\t";
103
  protected final String TEXT_84 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}";
103
  protected final String TEXT_84 = " resource = ((";
104
  protected final String TEXT_85 = NL + "\t\t";
104
  protected final String TEXT_85 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().removeResourceChangeListener(getResourceTracker());" + NL + "\t\t}";
105
  protected final String TEXT_86 = " file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);";
105
  protected final String TEXT_86 = NL + "\t\t";
106
  protected final String TEXT_87 = NL + "\t\tif (getEditorInput() instanceof ";
106
  protected final String TEXT_87 = " file = getURIFromInput(input);" + NL + "\t\tload(file);" + NL + "\t\tsetPartName(file.lastSegment());" + NL + "\t\tsuper.setInput(input);";
107
  protected final String TEXT_88 = ") {" + NL + "\t\t\t";
107
  protected final String TEXT_88 = NL + "\t\tif (getEditorInput() instanceof ";
108
  protected final String TEXT_89 = " resource = ((";
108
  protected final String TEXT_89 = ") {" + NL + "\t\t\t";
109
  protected final String TEXT_90 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}";
109
  protected final String TEXT_90 = " resource = ((";
110
  protected final String TEXT_91 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
110
  protected final String TEXT_91 = ") getEditorInput()).getFile();" + NL + "\t\t\tresource.getWorkspace().addResourceChangeListener(getResourceTracker());" + NL + "\t\t}";
111
  protected final String TEXT_92 = " getURIFromInput(";
111
  protected final String TEXT_92 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate ";
112
  protected final String TEXT_93 = " input) {";
112
  protected final String TEXT_93 = " getURIFromInput(";
113
  protected final String TEXT_94 = NL + "\t\tif (input instanceof ";
113
  protected final String TEXT_94 = " input) {";
114
  protected final String TEXT_95 = ") {" + NL + "\t\t\treturn ((";
114
  protected final String TEXT_95 = NL + "\t\tif (input instanceof ";
115
  protected final String TEXT_96 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof ";
115
  protected final String TEXT_96 = ") {" + NL + "\t\t\treturn ((";
116
  protected final String TEXT_97 = ") {" + NL + "\t\t\treturn ";
116
  protected final String TEXT_97 = ") input).getURI();" + NL + "\t\t}" + NL + "\t\tif (input instanceof ";
117
  protected final String TEXT_98 = ".createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}";
117
  protected final String TEXT_98 = ") {" + NL + "\t\t\treturn ";
118
  protected final String TEXT_99 = NL + "\t\tif (input instanceof ";
118
  protected final String TEXT_99 = ".createFileURI(((IPathEditorInput)input).getPath().toOSString());" + NL + "\t\t}";
119
  protected final String TEXT_100 = ") {" + NL + "\t\t\treturn ";
119
  protected final String TEXT_100 = NL + "\t\tif (input instanceof ";
120
  protected final String TEXT_101 = ".createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}";
120
  protected final String TEXT_101 = ") {" + NL + "\t\t\treturn ";
121
  protected final String TEXT_102 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
121
  protected final String TEXT_102 = ".createPlatformResourceURI(((IFileEditorInput)input).getFile().getFullPath().toString());" + NL + "\t\t}";
122
  protected final String TEXT_103 = " getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\t";
122
  protected final String TEXT_103 = NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected ";
123
  protected final String TEXT_104 = " factories = new ";
123
  protected final String TEXT_104 = " getDomainAdapterFactory() {" + NL + "\t\tif (domainAdapterFactory == null) {" + NL + "\t\t\t";
124
  protected final String TEXT_105 = "();" + NL + "\t\t\tfactories.add(new ";
124
  protected final String TEXT_105 = " factories = new ";
125
  protected final String TEXT_106 = "());";
125
  protected final String TEXT_106 = "();" + NL + "\t\t\tfactories.add(new ";
126
  protected final String TEXT_107 = NL + "\t\t\tfactories.add(new ";
126
  protected final String TEXT_107 = "());";
127
  protected final String TEXT_108 = "());";
127
  protected final String TEXT_108 = NL + "\t\t\tfactories.add(new ";
128
  protected final String TEXT_109 = NL + "\t\t\tfactories.add(new ";
128
  protected final String TEXT_109 = "());";
129
  protected final String TEXT_110 = "());" + NL + "\t\t\tfactories.add(new ";
129
  protected final String TEXT_110 = NL + "\t\t\tfactories.add(new ";
130
  protected final String TEXT_111 = "());" + NL + "\t\t\tdomainAdapterFactory = new ";
130
  protected final String TEXT_111 = "());" + NL + "\t\t\tfactories.add(new ";
131
  protected final String TEXT_112 = "(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load(";
131
  protected final String TEXT_112 = "());" + NL + "\t\t\tdomainAdapterFactory = new ";
132
  protected final String TEXT_113 = " diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
132
  protected final String TEXT_113 = "(factories);" + NL + "\t\t}" + NL + "\t\treturn domainAdapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate void load(";
133
  protected final String TEXT_114 = " editingDomain = getEditingDomain();" + NL + "\t\t";
133
  protected final String TEXT_114 = " diagramFile) {" + NL + "\t\tdiagramRoot = null;" + NL + "\t\tdiagram = null;" + NL + "\t\tif (diagramFile == null) {" + NL + "\t\t\treturn;" + NL + "\t\t}" + NL + "\t\t";
134
  protected final String TEXT_115 = " resourceSet = editingDomain.getResourceSet();" + NL + "\t\t";
134
  protected final String TEXT_115 = " editingDomain = getEditingDomain();" + NL + "\t\t";
135
  protected final String TEXT_116 = " diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = (";
135
  protected final String TEXT_116 = " resourceSet = editingDomain.getResourceSet();" + NL + "\t\t";
136
  protected final String TEXT_117 = ") findInResource(diagramResource, ";
136
  protected final String TEXT_117 = " diagramResource = resourceSet.getResource(diagramFile, true);" + NL + "\t\tif (diagramResource == null) {" + NL + "\t\t\tdiagramResource = resourceSet.createResource(diagramFile);" + NL + "\t\t}" + NL + "\t\tdiagram = (";
137
  protected final String TEXT_118 = ".class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = ";
137
  protected final String TEXT_118 = ") findInResource(diagramResource, ";
138
  protected final String TEXT_119 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(";
138
  protected final String TEXT_119 = ".class);" + NL + "\t\tif (diagram == null) {" + NL + "\t\t\tdiagram = ";
139
  protected final String TEXT_120 = ".EMPTY_MAP);" + NL + "\t\t\t} catch (";
139
  protected final String TEXT_120 = ".eINSTANCE.createDiagram();" + NL + "\t\t\tdiagramResource.getContents().add(0, diagram);" + NL + "\t\t\t//Auxiliary creation should not be undoable." + NL + "\t\t\ttry {" + NL + "\t\t\t\tdiagramResource.save(";
140
  protected final String TEXT_121 = " e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = (";
140
  protected final String TEXT_121 = ".EMPTY_MAP);" + NL + "\t\t\t} catch (";
141
  protected final String TEXT_122 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {";
141
  protected final String TEXT_122 = " e) {" + NL + "\t\t\t\tdiagram = null;" + NL + "\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\treturn;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tdiagramRoot = (";
142
  protected final String TEXT_123 = NL + "\t\t\t";
142
  protected final String TEXT_123 = ") diagram.getElement();" + NL + "\t\tif (diagramRoot == null) {";
143
  protected final String TEXT_124 = " modelFile = ";
143
  protected final String TEXT_124 = NL + "\t\t\t";
144
  protected final String TEXT_125 = ".getModelFileURI(diagramFile);" + NL + "\t\t\t";
144
  protected final String TEXT_125 = " modelFile = ";
145
  protected final String TEXT_126 = " modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}";
145
  protected final String TEXT_126 = ".getModelFileURI(diagramFile);" + NL + "\t\t\t";
146
  protected final String TEXT_127 = NL + "\t\t\tdiagramRoot = (";
146
  protected final String TEXT_127 = " modelResource = resourceSet.getResource(modelFile, true);" + NL + "\t\t\tif (modelResource == null) {" + NL + "\t\t\t\tmodelResource = resourceSet.createResource(modelFile);" + NL + "\t\t\t}";
147
  protected final String TEXT_128 = ") findInResource(";
147
  protected final String TEXT_128 = NL + "\t\t\tdiagramRoot = (";
148
  protected final String TEXT_129 = ", ";
148
  protected final String TEXT_129 = ") findInResource(";
149
  protected final String TEXT_130 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = ";
149
  protected final String TEXT_130 = ", ";
150
  protected final String TEXT_131 = ".eINSTANCE.create";
150
  protected final String TEXT_131 = ".class);" + NL + "\t\t\tif (diagramRoot == null) {" + NL + "\t\t\t\tdiagramRoot = ";
151
  protected final String TEXT_132 = "();" + NL + "\t\t\t\t";
151
  protected final String TEXT_132 = ".eINSTANCE.create";
152
  protected final String TEXT_133 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t";
152
  protected final String TEXT_133 = "();" + NL + "\t\t\t\t";
153
  protected final String TEXT_134 = ".save(";
153
  protected final String TEXT_134 = ".getContents().add(0, diagramRoot);" + NL + "\t\t\t\t//We don't want this auxiliary creation to be undoable." + NL + "\t\t\t\ttry {" + NL + "\t\t\t\t\t";
154
  protected final String TEXT_135 = ".EMPTY_MAP);" + NL + "\t\t\t\t} catch (";
154
  protected final String TEXT_135 = ".save(";
155
  protected final String TEXT_136 = " e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement(";
155
  protected final String TEXT_136 = ".EMPTY_MAP);" + NL + "\t\t\t\t} catch (";
156
  protected final String TEXT_137 = "(";
156
  protected final String TEXT_137 = " e) {" + NL + "\t\t\t\t\tdiagram = null;" + NL + "\t\t\t\t\tdiagramRoot = null;" + NL + "\t\t\t\t\treturn;" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\tif (!diagram.isSetElement()) {" + NL + "\t\t\t\tdiagram.setElement(";
157
  protected final String TEXT_138 = ") ";
157
  protected final String TEXT_138 = "(";
158
  protected final String TEXT_139 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
158
  protected final String TEXT_139 = ") ";
159
  protected final String TEXT_140 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource(";
159
  protected final String TEXT_140 = "diagramRoot);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}";
160
  protected final String TEXT_141 = " resource, Class expectedClass) {" + NL + "\t\tfor(";
160
  protected final String TEXT_141 = NL + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate Object findInResource(";
161
  protected final String TEXT_142 = " it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer(";
161
  protected final String TEXT_142 = " resource, Class expectedClass) {" + NL + "\t\tfor(";
162
  protected final String TEXT_143 = " parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\t";
162
  protected final String TEXT_143 = " it = resource.getContents().iterator(); it.hasNext(); ) {" + NL + "\t\t\tObject next = it.next();" + NL + "\t\t\tif (expectedClass.isInstance(next)) {" + NL + "\t\t\t\treturn next;" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\treturn null;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void createGraphicalViewer(";
163
  protected final String TEXT_144 = " root = new ";
163
  protected final String TEXT_144 = " parent) {" + NL + "\t\tsuper.createGraphicalViewer(parent);" + NL + "\t\t// initialize the viewer with input" + NL + "\t\t";
164
  protected final String TEXT_145 = "();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new ";
164
  protected final String TEXT_145 = " root = new ";
165
  protected final String TEXT_146 = "());" + NL + "" + NL + "\t\t";
165
  protected final String TEXT_146 = "();" + NL + "\t\tgetGraphicalViewer().setRootEditPart(root);" + NL + "\t\tgetGraphicalViewer().setEditPartFactory(new ";
166
  protected final String TEXT_147 = " printableLayers = (";
166
  protected final String TEXT_147 = "());" + NL + "" + NL + "\t\t";
167
  protected final String TEXT_148 = ") root.getLayer(";
167
  protected final String TEXT_148 = " printableLayers = (";
168
  protected final String TEXT_149 = ".PRINTABLE_LAYERS);" + NL + "\t\t";
168
  protected final String TEXT_149 = ") root.getLayer(";
169
  protected final String TEXT_150 = " extLabelsLayer = new ";
169
  protected final String TEXT_150 = ".PRINTABLE_LAYERS);" + NL + "\t\t";
170
  protected final String TEXT_151 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new ";
170
  protected final String TEXT_151 = " extLabelsLayer = new ";
171
  protected final String TEXT_152 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, ";
171
  protected final String TEXT_152 = "();" + NL + "\t\textLabelsLayer.setLayoutManager(new ";
172
  protected final String TEXT_153 = ".EXTERNAL_NODE_LABELS_LAYER, ";
172
  protected final String TEXT_153 = "());" + NL + "\t\tprintableLayers.addLayerAfter(extLabelsLayer, ";
173
  protected final String TEXT_154 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\t";
173
  protected final String TEXT_154 = ".EXTERNAL_NODE_LABELS_LAYER, ";
174
  protected final String TEXT_155 = " viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\t";
174
  protected final String TEXT_155 = ".PRIMARY_LAYER);" + NL + "\t\tgetGraphicalViewer().setContents(getDiagram());" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void configureGraphicalViewer() {" + NL + "\t\tsuper.configureGraphicalViewer();" + NL + "\t\t";
175
  protected final String TEXT_156 = " provider = new ";
175
  protected final String TEXT_156 = " viewer = getGraphicalViewer();" + NL + "\t\t// configure the context menu" + NL + "\t\t";
176
  protected final String TEXT_157 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu(";
176
  protected final String TEXT_157 = " provider = new ";
177
  protected final String TEXT_158 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\t";
177
  protected final String TEXT_158 = "ContextMenuProvider(viewer);" + NL + "\t\tviewer.setContextMenu(provider);" + NL + "\t\tgetSite().registerContextMenu(";
178
  protected final String TEXT_159 = " keyHandler = new ";
178
  protected final String TEXT_159 = ".ID + \".editor.contextmenu\", provider, getSite().getSelectionProvider()); //$NON-NLS-1$" + NL + "" + NL + "\t\t";
179
  protected final String TEXT_160 = "(viewer);" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty(";
179
  protected final String TEXT_160 = " keyHandler = new ";
180
  protected final String TEXT_161 = ".KeyGenerator.getKey(";
180
  protected final String TEXT_161 = "(viewer);" + NL + "\t\tviewer.setKeyHandler(keyHandler);" + NL + "" + NL + "\t\tviewer.setProperty(";
181
  protected final String TEXT_162 = ".CTRL), ";
181
  protected final String TEXT_162 = ".KeyGenerator.getKey(";
182
  protected final String TEXT_163 = ".SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ";
182
  protected final String TEXT_163 = ".CTRL), ";
183
  protected final String TEXT_164 = "ContextMenuProvider extends ";
183
  protected final String TEXT_164 = ".SINGLETON);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate class ";
184
  protected final String TEXT_165 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
184
  protected final String TEXT_165 = "ContextMenuProvider extends ";
185
  protected final String TEXT_166 = "ContextMenuProvider(";
185
  protected final String TEXT_166 = " {" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tpublic ";
186
  protected final String TEXT_167 = " viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t    public void buildContextMenu(";
186
  protected final String TEXT_167 = "ContextMenuProvider(";
187
  protected final String TEXT_168 = " menuManager) {" + NL + "\t        ";
187
  protected final String TEXT_168 = " viewer) {" + NL + "\t\t\tsuper(viewer);" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t    public void buildContextMenu(";
188
  protected final String TEXT_169 = ".addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
188
  protected final String TEXT_169 = " menuManager) {" + NL + "\t        ";
189
  protected final String TEXT_170 = ".UNDO.getId(), ";
189
  protected final String TEXT_170 = ".addStandardActionGroups(menuManager);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
190
  protected final String TEXT_171 = ".GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
190
  protected final String TEXT_171 = ".UNDO.getId(), ";
191
  protected final String TEXT_172 = ".REDO.getId(), ";
191
  protected final String TEXT_172 = ".GROUP_UNDO);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
192
  protected final String TEXT_173 = ".GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, ";
192
  protected final String TEXT_173 = ".REDO.getId(), ";
193
  protected final String TEXT_174 = ".COPY.getId(), ";
193
  protected final String TEXT_174 = ".GROUP_UNDO);" + NL + "\t" + NL + "\t\t\tappendActionToMenu(menuManager, ";
194
  protected final String TEXT_175 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
194
  protected final String TEXT_175 = ".COPY.getId(), ";
195
  protected final String TEXT_176 = ".PASTE.getId(), ";
195
  protected final String TEXT_176 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
196
  protected final String TEXT_177 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
196
  protected final String TEXT_177 = ".PASTE.getId(), ";
197
  protected final String TEXT_178 = ".DELETE.getId(), ";
197
  protected final String TEXT_178 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
198
  protected final String TEXT_179 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
198
  protected final String TEXT_179 = ".DELETE.getId(), ";
199
  protected final String TEXT_180 = ".DIRECT_EDIT, ";
199
  protected final String TEXT_180 = ".GROUP_EDIT);" + NL + "\t\t\tappendActionToMenu(menuManager, ";
200
  protected final String TEXT_181 = ".GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ";
200
  protected final String TEXT_181 = ".DIRECT_EDIT, ";
201
  protected final String TEXT_182 = ".SAVE.getId(), ";
201
  protected final String TEXT_182 = ".GROUP_EDIT);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ";
202
  protected final String TEXT_183 = ".GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t    }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu(";
202
  protected final String TEXT_183 = ".LAYOUT_ALL_ACTION, ";
203
  protected final String TEXT_184 = " menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\t";
203
  protected final String TEXT_184 = ".GROUP_REST);" + NL + "" + NL + "\t\t\tappendActionToMenu(menuManager, ";
204
  protected final String TEXT_185 = " submenu = new ";
204
  protected final String TEXT_185 = ".SAVE.getId(), ";
205
  protected final String TEXT_186 = "(\"Align\");" + NL + "\t\t\tsubmenu.add(new ";
205
  protected final String TEXT_186 = ".GROUP_SAVE);" + NL + "" + NL + "\t\t\tappendAlignmentSubmenu(menuManager);" + NL + "\t    }" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendAlignmentSubmenu(";
206
  protected final String TEXT_187 = "(";
206
  protected final String TEXT_187 = " menuManager) {" + NL + "\t\t\t// Alignment Actions" + NL + "\t\t\t";
207
  protected final String TEXT_188 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, ";
207
  protected final String TEXT_188 = " submenu = new ";
208
  protected final String TEXT_189 = ".ALIGN_LEFT, ";
208
  protected final String TEXT_189 = "(\"Align\");" + NL + "\t\t\tsubmenu.add(new ";
209
  protected final String TEXT_190 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
209
  protected final String TEXT_190 = "(";
210
  protected final String TEXT_191 = ".ALIGN_CENTER, ";
210
  protected final String TEXT_191 = ".MB_ADDITIONS));" + NL + "\t" + NL + "\t\t\tappendActionToMenu(submenu, ";
211
  protected final String TEXT_192 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
211
  protected final String TEXT_192 = ".ALIGN_LEFT, ";
212
  protected final String TEXT_193 = ".ALIGN_RIGHT, ";
212
  protected final String TEXT_193 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
213
  protected final String TEXT_194 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
213
  protected final String TEXT_194 = ".ALIGN_CENTER, ";
214
  protected final String TEXT_195 = ".ALIGN_TOP, ";
214
  protected final String TEXT_195 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
215
  protected final String TEXT_196 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
215
  protected final String TEXT_196 = ".ALIGN_RIGHT, ";
216
  protected final String TEXT_197 = ".ALIGN_MIDDLE, ";
216
  protected final String TEXT_197 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
217
  protected final String TEXT_198 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
217
  protected final String TEXT_198 = ".ALIGN_TOP, ";
218
  protected final String TEXT_199 = ".ALIGN_BOTTOM, ";
218
  protected final String TEXT_199 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
219
  protected final String TEXT_200 = ".MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup(";
219
  protected final String TEXT_200 = ".ALIGN_MIDDLE, ";
220
  protected final String TEXT_201 = ".GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu(";
220
  protected final String TEXT_201 = ".MB_ADDITIONS);" + NL + "\t\t\tappendActionToMenu(submenu, ";
221
  protected final String TEXT_202 = " menu, String actionId, String menuGroup) {" + NL + "\t\t\t";
221
  protected final String TEXT_202 = ".ALIGN_BOTTOM, ";
222
  protected final String TEXT_203 = " action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}";
222
  protected final String TEXT_203 = ".MB_ADDITIONS);" + NL + "\t" + NL + "\t\t\tif (!submenu.isEmpty()) {" + NL + "\t\t\t\tmenuManager.appendToGroup(";
223
  protected final String TEXT_204 = NL;
223
  protected final String TEXT_204 = ".GROUP_REST, submenu);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "" + NL + "\t\t/**" + NL + "\t\t * @generated" + NL + "\t\t */" + NL + "\t\tprivate void appendActionToMenu(";
224
  protected final String TEXT_205 = " menu, String actionId, String menuGroup) {" + NL + "\t\t\t";
225
  protected final String TEXT_206 = " action = getActionRegistry().getAction(actionId);" + NL + "\t\t\tif (action != null && action.isEnabled()) {" + NL + "\t\t\t\tmenu.appendToGroup(menuGroup, action);" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "}";
226
  protected final String TEXT_207 = NL;
224
227
225
  public String generate(Object argument)
228
  public String generate(Object argument)
226
  {
229
  {
Lines 339-513 Link Here
339
    stringBuffer.append(TEXT_48);
342
    stringBuffer.append(TEXT_48);
340
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction"));
343
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.PrintAction"));
341
    stringBuffer.append(TEXT_49);
344
    stringBuffer.append(TEXT_49);
342
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
345
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.LayoutDiagramAction"));
343
    stringBuffer.append(TEXT_50);
346
    stringBuffer.append(TEXT_50);
344
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction"));
345
    stringBuffer.append(TEXT_51);
346
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
347
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
348
    stringBuffer.append(TEXT_51);
349
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomInAction"));
347
    stringBuffer.append(TEXT_52);
350
    stringBuffer.append(TEXT_52);
348
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction"));
351
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
349
    stringBuffer.append(TEXT_53);
352
    stringBuffer.append(TEXT_53);
350
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler"));
353
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.ZoomOutAction"));
351
    stringBuffer.append(TEXT_54);
354
    stringBuffer.append(TEXT_54);
352
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke"));
355
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler"));
353
    stringBuffer.append(TEXT_55);
356
    stringBuffer.append(TEXT_55);
354
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
357
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke"));
355
    stringBuffer.append(TEXT_56);
358
    stringBuffer.append(TEXT_56);
356
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
359
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
357
    stringBuffer.append(TEXT_57);
360
    stringBuffer.append(TEXT_57);
358
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke"));
361
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
359
    stringBuffer.append(TEXT_58);
362
    stringBuffer.append(TEXT_58);
360
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
363
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyStroke"));
361
    stringBuffer.append(TEXT_59);
364
    stringBuffer.append(TEXT_59);
362
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
365
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
363
    stringBuffer.append(TEXT_60);
366
    stringBuffer.append(TEXT_60);
367
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
368
    stringBuffer.append(TEXT_61);
364
    
369
    
365
if (!isRichClientPlatform) {
370
if (!isRichClientPlatform) {
366
371
367
    stringBuffer.append(TEXT_61);
368
    stringBuffer.append(genEditor.getClassName());
369
    stringBuffer.append(TEXT_62);
372
    stringBuffer.append(TEXT_62);
373
    stringBuffer.append(genEditor.getClassName());
374
    stringBuffer.append(TEXT_63);
370
    
375
    
371
}
376
}
372
377
373
    stringBuffer.append(TEXT_63);
374
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor"));
375
    stringBuffer.append(TEXT_64);
378
    stringBuffer.append(TEXT_64);
376
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException"));
379
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.IProgressMonitor"));
377
    stringBuffer.append(TEXT_65);
380
    stringBuffer.append(TEXT_65);
378
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.ErrorDialog"));
381
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.runtime.CoreException"));
379
    stringBuffer.append(TEXT_66);
382
    stringBuffer.append(TEXT_66);
380
    stringBuffer.append(genDiagram.getEditorGen().getDomainGenModel().getModelName());
383
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.dialogs.ErrorDialog"));
381
    stringBuffer.append(TEXT_67);
384
    stringBuffer.append(TEXT_67);
382
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.palette.PaletteRoot"));
385
    stringBuffer.append(genDiagram.getEditorGen().getDomainGenModel().getModelName());
383
    stringBuffer.append(TEXT_68);
386
    stringBuffer.append(TEXT_68);
387
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.palette.PaletteRoot"));
388
    stringBuffer.append(TEXT_69);
384
    
389
    
385
{
390
{
386
	final Palette palette = genDiagram.getPalette();
391
	final Palette palette = genDiagram.getPalette();
387
	if (palette != null) {
392
	if (palette != null) {
388
393
389
    stringBuffer.append(TEXT_69);
390
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
391
    stringBuffer.append(TEXT_70);
394
    stringBuffer.append(TEXT_70);
395
    stringBuffer.append(importManager.getImportedName(palette.getFactoryQualifiedClassName()));
396
    stringBuffer.append(TEXT_71);
392
    
397
    
393
	}
398
	}
394
}
399
}
395
400
396
    stringBuffer.append(TEXT_71);
397
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
398
    stringBuffer.append(TEXT_72);
401
    stringBuffer.append(TEXT_72);
399
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
402
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
400
    stringBuffer.append(TEXT_73);
403
    stringBuffer.append(TEXT_73);
401
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorSite"));
404
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
402
    stringBuffer.append(TEXT_74);
405
    stringBuffer.append(TEXT_74);
403
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
406
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorSite"));
404
    stringBuffer.append(TEXT_75);
407
    stringBuffer.append(TEXT_75);
405
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
408
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
406
    stringBuffer.append(TEXT_76);
409
    stringBuffer.append(TEXT_76);
407
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
408
    stringBuffer.append(TEXT_77);
409
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
410
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
411
    stringBuffer.append(TEXT_77);
412
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
410
    stringBuffer.append(TEXT_78);
413
    stringBuffer.append(TEXT_78);
411
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
414
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
412
    stringBuffer.append(TEXT_79);
415
    stringBuffer.append(TEXT_79);
413
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
416
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.PartInitException"));
414
    stringBuffer.append(TEXT_80);
417
    stringBuffer.append(TEXT_80);
418
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
419
    stringBuffer.append(TEXT_81);
415
    
420
    
416
if (!isRichClientPlatform) {
421
if (!isRichClientPlatform) {
417
422
418
    stringBuffer.append(TEXT_81);
419
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
420
    stringBuffer.append(TEXT_82);
423
    stringBuffer.append(TEXT_82);
421
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile"));
422
    stringBuffer.append(TEXT_83);
423
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
424
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
425
    stringBuffer.append(TEXT_83);
426
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile"));
424
    stringBuffer.append(TEXT_84);
427
    stringBuffer.append(TEXT_84);
428
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
429
    stringBuffer.append(TEXT_85);
425
    
430
    
426
}
431
}
427
432
428
    stringBuffer.append(TEXT_85);
429
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
430
    stringBuffer.append(TEXT_86);
433
    stringBuffer.append(TEXT_86);
434
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
435
    stringBuffer.append(TEXT_87);
431
    
436
    
432
if (!isRichClientPlatform) {
437
if (!isRichClientPlatform) {
433
438
434
    stringBuffer.append(TEXT_87);
435
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
436
    stringBuffer.append(TEXT_88);
439
    stringBuffer.append(TEXT_88);
437
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile"));
438
    stringBuffer.append(TEXT_89);
439
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
440
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
441
    stringBuffer.append(TEXT_89);
442
    stringBuffer.append(importManager.getImportedName("org.eclipse.core.resources.IFile"));
440
    stringBuffer.append(TEXT_90);
443
    stringBuffer.append(TEXT_90);
444
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
445
    stringBuffer.append(TEXT_91);
441
    
446
    
442
}
447
}
443
448
444
    stringBuffer.append(TEXT_91);
445
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
446
    stringBuffer.append(TEXT_92);
449
    stringBuffer.append(TEXT_92);
447
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
450
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
448
    stringBuffer.append(TEXT_93);
451
    stringBuffer.append(TEXT_93);
449
    if (isRichClientPlatform) {
452
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IEditorInput"));
450
    stringBuffer.append(TEXT_94);
453
    stringBuffer.append(TEXT_94);
451
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
454
    if (isRichClientPlatform) {
452
    stringBuffer.append(TEXT_95);
455
    stringBuffer.append(TEXT_95);
453
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
456
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
454
    stringBuffer.append(TEXT_96);
457
    stringBuffer.append(TEXT_96);
455
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPathEditorInput"));
458
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.ui.URIEditorInput"));
456
    stringBuffer.append(TEXT_97);
459
    stringBuffer.append(TEXT_97);
457
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
460
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IPathEditorInput"));
458
    stringBuffer.append(TEXT_98);
461
    stringBuffer.append(TEXT_98);
459
    } else {
462
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
460
    stringBuffer.append(TEXT_99);
463
    stringBuffer.append(TEXT_99);
461
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
464
    } else {
462
    stringBuffer.append(TEXT_100);
465
    stringBuffer.append(TEXT_100);
463
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
466
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.IFileEditorInput"));
464
    stringBuffer.append(TEXT_101);
467
    stringBuffer.append(TEXT_101);
465
    }
468
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
466
    stringBuffer.append(TEXT_102);
469
    stringBuffer.append(TEXT_102);
467
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.AdapterFactory"));
470
    }
468
    stringBuffer.append(TEXT_103);
471
    stringBuffer.append(TEXT_103);
469
    stringBuffer.append(importManager.getImportedName("java.util.List"));
472
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.notify.AdapterFactory"));
470
    stringBuffer.append(TEXT_104);
473
    stringBuffer.append(TEXT_104);
471
    stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
474
    stringBuffer.append(importManager.getImportedName("java.util.List"));
472
    stringBuffer.append(TEXT_105);
475
    stringBuffer.append(TEXT_105);
473
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"));
476
    stringBuffer.append(importManager.getImportedName("java.util.ArrayList"));
474
    stringBuffer.append(TEXT_106);
477
    stringBuffer.append(TEXT_106);
478
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory"));
479
    stringBuffer.append(TEXT_107);
475
    
480
    
476
final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true);
481
final EList genPackages = genDiagram.getEditorGen().getAllDomainGenPackages(true);
477
for (int i = 0; i < genPackages.size(); i++) {
482
for (int i = 0; i < genPackages.size(); i++) {
478
	GenPackage genPackage = (GenPackage) genPackages.get(i);
483
	GenPackage genPackage = (GenPackage) genPackages.get(i);
479
484
480
    stringBuffer.append(TEXT_107);
481
    stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName()));
482
    stringBuffer.append(TEXT_108);
485
    stringBuffer.append(TEXT_108);
483
    }
486
    stringBuffer.append(importManager.getImportedName(genPackage.getQualifiedItemProviderAdapterFactoryClassName()));
484
    stringBuffer.append(TEXT_109);
487
    stringBuffer.append(TEXT_109);
485
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory"));
488
    }
486
    stringBuffer.append(TEXT_110);
489
    stringBuffer.append(TEXT_110);
487
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory"));
490
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory"));
488
    stringBuffer.append(TEXT_111);
491
    stringBuffer.append(TEXT_111);
489
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory"));
492
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.provider.NotationItemProviderAdapterFactory"));
490
    stringBuffer.append(TEXT_112);
493
    stringBuffer.append(TEXT_112);
491
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
494
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.edit.provider.ComposedAdapterFactory"));
492
    stringBuffer.append(TEXT_113);
495
    stringBuffer.append(TEXT_113);
493
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
496
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
494
    stringBuffer.append(TEXT_114);
497
    stringBuffer.append(TEXT_114);
495
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet"));
498
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.transaction.TransactionalEditingDomain"));
496
    stringBuffer.append(TEXT_115);
499
    stringBuffer.append(TEXT_115);
497
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
500
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.ResourceSet"));
498
    stringBuffer.append(TEXT_116);
501
    stringBuffer.append(TEXT_116);
499
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
502
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
500
    stringBuffer.append(TEXT_117);
503
    stringBuffer.append(TEXT_117);
501
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
504
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
502
    stringBuffer.append(TEXT_118);
505
    stringBuffer.append(TEXT_118);
503
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
506
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.Diagram"));
504
    stringBuffer.append(TEXT_119);
507
    stringBuffer.append(TEXT_119);
505
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
508
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.notation.NotationFactory"));
506
    stringBuffer.append(TEXT_120);
509
    stringBuffer.append(TEXT_120);
507
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
510
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
508
    stringBuffer.append(TEXT_121);
511
    stringBuffer.append(TEXT_121);
509
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
512
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
510
    stringBuffer.append(TEXT_122);
513
    stringBuffer.append(TEXT_122);
514
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
515
    stringBuffer.append(TEXT_123);
511
    
516
    
512
{
517
{
513
518
Lines 516-662 Link Here
516
	String resourceToUse;
521
	String resourceToUse;
517
	if (!sameFile) {
522
	if (!sameFile) {
518
523
519
    stringBuffer.append(TEXT_123);
520
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
521
    stringBuffer.append(TEXT_124);
524
    stringBuffer.append(TEXT_124);
522
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
525
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.common.util.URI"));
523
    stringBuffer.append(TEXT_125);
526
    stringBuffer.append(TEXT_125);
524
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
527
    stringBuffer.append(genDiagram.getDiagramEditorUtilClassName());
525
    stringBuffer.append(TEXT_126);
528
    stringBuffer.append(TEXT_126);
529
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
530
    stringBuffer.append(TEXT_127);
526
    
531
    
527
		resourceToUse = "modelResource";
532
		resourceToUse = "modelResource";
528
	} else {
533
	} else {
529
		resourceToUse = "diagramResource";
534
		resourceToUse = "diagramResource";
530
	}
535
	}
531
536
532
    stringBuffer.append(TEXT_127);
533
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
534
    stringBuffer.append(TEXT_128);
537
    stringBuffer.append(TEXT_128);
535
    stringBuffer.append(resourceToUse);
536
    stringBuffer.append(TEXT_129);
537
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
538
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
539
    stringBuffer.append(TEXT_129);
540
    stringBuffer.append(resourceToUse);
538
    stringBuffer.append(TEXT_130);
541
    stringBuffer.append(TEXT_130);
539
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName()));
542
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getQualifiedInterfaceName()));
540
    stringBuffer.append(TEXT_131);
543
    stringBuffer.append(TEXT_131);
541
    stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName());
544
    stringBuffer.append(importManager.getImportedName(genDiagram.getDomainDiagramElement().getGenPackage().getQualifiedFactoryClassName()));
542
    stringBuffer.append(TEXT_132);
545
    stringBuffer.append(TEXT_132);
543
    stringBuffer.append(resourceToUse);
546
    stringBuffer.append(genDiagram.getDomainDiagramElement().getClassifierAccessorName());
544
    stringBuffer.append(TEXT_133);
547
    stringBuffer.append(TEXT_133);
545
    stringBuffer.append(resourceToUse);
548
    stringBuffer.append(resourceToUse);
546
    stringBuffer.append(TEXT_134);
549
    stringBuffer.append(TEXT_134);
547
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
550
    stringBuffer.append(resourceToUse);
548
    stringBuffer.append(TEXT_135);
551
    stringBuffer.append(TEXT_135);
549
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
552
    stringBuffer.append(importManager.getImportedName("java.util.Collections"));
550
    stringBuffer.append(TEXT_136);
553
    stringBuffer.append(TEXT_136);
551
    if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
554
    stringBuffer.append(importManager.getImportedName("java.io.IOException"));
552
    stringBuffer.append(TEXT_137);
555
    stringBuffer.append(TEXT_137);
553
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
556
    if (genDiagram.getDomainDiagramElement().isExternalInterface()) {
554
    stringBuffer.append(TEXT_138);
557
    stringBuffer.append(TEXT_138);
555
    }
558
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.EObject"));
556
    stringBuffer.append(TEXT_139);
559
    stringBuffer.append(TEXT_139);
560
    }
561
    stringBuffer.append(TEXT_140);
557
    
562
    
558
}
563
}
559
564
560
    stringBuffer.append(TEXT_140);
561
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
562
    stringBuffer.append(TEXT_141);
565
    stringBuffer.append(TEXT_141);
563
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
566
    stringBuffer.append(importManager.getImportedName("org.eclipse.emf.ecore.resource.Resource"));
564
    stringBuffer.append(TEXT_142);
567
    stringBuffer.append(TEXT_142);
565
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
568
    stringBuffer.append(importManager.getImportedName("java.util.Iterator"));
566
    stringBuffer.append(TEXT_143);
569
    stringBuffer.append(TEXT_143);
567
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
570
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.widgets.Composite"));
568
    stringBuffer.append(TEXT_144);
571
    stringBuffer.append(TEXT_144);
569
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
572
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
570
    stringBuffer.append(TEXT_145);
573
    stringBuffer.append(TEXT_145);
571
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
574
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.editparts.ScalableFreeformRootEditPart"));
572
    stringBuffer.append(TEXT_146);
575
    stringBuffer.append(TEXT_146);
573
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
576
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
574
    stringBuffer.append(TEXT_147);
577
    stringBuffer.append(TEXT_147);
575
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
578
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
576
    stringBuffer.append(TEXT_148);
579
    stringBuffer.append(TEXT_148);
577
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
580
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.LayeredPane"));
578
    stringBuffer.append(TEXT_149);
581
    stringBuffer.append(TEXT_149);
579
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
582
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
580
    stringBuffer.append(TEXT_150);
583
    stringBuffer.append(TEXT_150);
581
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
584
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
582
    stringBuffer.append(TEXT_151);
585
    stringBuffer.append(TEXT_151);
583
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout"));
586
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.FreeformLayer"));
584
    stringBuffer.append(TEXT_152);
587
    stringBuffer.append(TEXT_152);
585
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
588
    stringBuffer.append(importManager.getImportedName("org.eclipse.draw2d.DelegatingLayout"));
586
    stringBuffer.append(TEXT_153);
589
    stringBuffer.append(TEXT_153);
587
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
590
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditPartFactoryQualifiedClassName()));
588
    stringBuffer.append(TEXT_154);
591
    stringBuffer.append(TEXT_154);
589
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
592
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.LayerConstants"));
590
    stringBuffer.append(TEXT_155);
593
    stringBuffer.append(TEXT_155);
591
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider"));
594
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.GraphicalViewer"));
592
    stringBuffer.append(TEXT_156);
595
    stringBuffer.append(TEXT_156);
593
    stringBuffer.append(genEditor.getClassName());
596
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider"));
594
    stringBuffer.append(TEXT_157);
597
    stringBuffer.append(TEXT_157);
595
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
598
    stringBuffer.append(genEditor.getClassName());
596
    stringBuffer.append(TEXT_158);
599
    stringBuffer.append(TEXT_158);
597
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler"));
600
    stringBuffer.append(importManager.getImportedName(genDiagram.getEditorGen().getPlugin().getActivatorQualifiedClassName()));
598
    stringBuffer.append(TEXT_159);
601
    stringBuffer.append(TEXT_159);
599
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler"));
602
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.KeyHandler"));
600
    stringBuffer.append(TEXT_160);
603
    stringBuffer.append(TEXT_160);
601
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelHandler"));
604
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.parts.GraphicalViewerKeyHandler"));
602
    stringBuffer.append(TEXT_161);
605
    stringBuffer.append(TEXT_161);
603
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
606
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelHandler"));
604
    stringBuffer.append(TEXT_162);
607
    stringBuffer.append(TEXT_162);
605
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelZoomHandler"));
608
    stringBuffer.append(importManager.getImportedName("org.eclipse.swt.SWT"));
606
    stringBuffer.append(TEXT_163);
609
    stringBuffer.append(TEXT_163);
607
    stringBuffer.append(genEditor.getClassName());
610
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.MouseWheelZoomHandler"));
608
    stringBuffer.append(TEXT_164);
611
    stringBuffer.append(TEXT_164);
609
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider"));
610
    stringBuffer.append(TEXT_165);
611
    stringBuffer.append(genEditor.getClassName());
612
    stringBuffer.append(genEditor.getClassName());
613
    stringBuffer.append(TEXT_165);
614
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ContextMenuProvider"));
612
    stringBuffer.append(TEXT_166);
615
    stringBuffer.append(TEXT_166);
613
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPartViewer"));
616
    stringBuffer.append(genEditor.getClassName());
614
    stringBuffer.append(TEXT_167);
617
    stringBuffer.append(TEXT_167);
615
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
618
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.EditPartViewer"));
616
    stringBuffer.append(TEXT_168);
619
    stringBuffer.append(TEXT_168);
617
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
620
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
618
    stringBuffer.append(TEXT_169);
621
    stringBuffer.append(TEXT_169);
619
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
620
    stringBuffer.append(TEXT_170);
621
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
622
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
622
    stringBuffer.append(TEXT_171);
623
    stringBuffer.append(TEXT_170);
623
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
624
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
624
    stringBuffer.append(TEXT_172);
625
    stringBuffer.append(TEXT_171);
625
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
626
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
626
    stringBuffer.append(TEXT_173);
627
    stringBuffer.append(TEXT_172);
627
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
628
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
628
    stringBuffer.append(TEXT_174);
629
    stringBuffer.append(TEXT_173);
629
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
630
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
630
    stringBuffer.append(TEXT_175);
631
    stringBuffer.append(TEXT_174);
631
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
632
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
632
    stringBuffer.append(TEXT_176);
633
    stringBuffer.append(TEXT_175);
633
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
634
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
634
    stringBuffer.append(TEXT_177);
635
    stringBuffer.append(TEXT_176);
635
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
636
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
636
    stringBuffer.append(TEXT_178);
637
    stringBuffer.append(TEXT_177);
637
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
638
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
639
    stringBuffer.append(TEXT_178);
640
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
638
    stringBuffer.append(TEXT_179);
641
    stringBuffer.append(TEXT_179);
639
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
642
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
640
    stringBuffer.append(TEXT_180);
643
    stringBuffer.append(TEXT_180);
641
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
644
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
642
    stringBuffer.append(TEXT_181);
645
    stringBuffer.append(TEXT_181);
643
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
644
    stringBuffer.append(TEXT_182);
645
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
646
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
647
    stringBuffer.append(TEXT_182);
648
    stringBuffer.append(importManager.getImportedName("org.eclipse.gmf.runtime.lite.ui.actions.ActionIds"));
646
    stringBuffer.append(TEXT_183);
649
    stringBuffer.append(TEXT_183);
647
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
650
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
648
    stringBuffer.append(TEXT_184);
651
    stringBuffer.append(TEXT_184);
649
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
652
    stringBuffer.append(importManager.getImportedName("org.eclipse.ui.actions.ActionFactory"));
650
    stringBuffer.append(TEXT_185);
653
    stringBuffer.append(TEXT_185);
651
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
654
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
652
    stringBuffer.append(TEXT_186);
655
    stringBuffer.append(TEXT_186);
653
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
656
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
654
    stringBuffer.append(TEXT_187);
657
    stringBuffer.append(TEXT_187);
655
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
658
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
656
    stringBuffer.append(TEXT_188);
659
    stringBuffer.append(TEXT_188);
657
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
660
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.MenuManager"));
658
    stringBuffer.append(TEXT_189);
661
    stringBuffer.append(TEXT_189);
659
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
662
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.Separator"));
660
    stringBuffer.append(TEXT_190);
663
    stringBuffer.append(TEXT_190);
661
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
664
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
662
    stringBuffer.append(TEXT_191);
665
    stringBuffer.append(TEXT_191);
Lines 680-691 Link Here
680
    stringBuffer.append(TEXT_200);
683
    stringBuffer.append(TEXT_200);
681
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
684
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
682
    stringBuffer.append(TEXT_201);
685
    stringBuffer.append(TEXT_201);
683
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
686
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
684
    stringBuffer.append(TEXT_202);
687
    stringBuffer.append(TEXT_202);
685
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
688
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
686
    stringBuffer.append(TEXT_203);
689
    stringBuffer.append(TEXT_203);
687
    importManager.emitSortedImports();
690
    stringBuffer.append(importManager.getImportedName("org.eclipse.gef.ui.actions.GEFActionConstants"));
688
    stringBuffer.append(TEXT_204);
691
    stringBuffer.append(TEXT_204);
692
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IMenuManager"));
693
    stringBuffer.append(TEXT_205);
694
    stringBuffer.append(importManager.getImportedName("org.eclipse.jface.action.IAction"));
695
    stringBuffer.append(TEXT_206);
696
    importManager.emitSortedImports();
697
    stringBuffer.append(TEXT_207);
689
    return stringBuffer.toString();
698
    return stringBuffer.toString();
690
  }
699
  }
691
}
700
}
(-)META-INF/MANIFEST.MF (-1 / +2 lines)
Lines 26-29 Link Here
26
 org.eclipse.gmf.runtime.lite.parts,
26
 org.eclipse.gmf.runtime.lite.parts,
27
 org.eclipse.gmf.runtime.lite.properties,
27
 org.eclipse.gmf.runtime.lite.properties,
28
 org.eclipse.gmf.runtime.lite.requests,
28
 org.eclipse.gmf.runtime.lite.requests,
29
 org.eclipse.gmf.runtime.lite.services
29
 org.eclipse.gmf.runtime.lite.services,
30
 org.eclipse.gmf.runtime.lite.ui.actions
(-)src/org/eclipse/gmf/runtime/lite/parts/DiagramEditor.java (-1 / +8 lines)
Lines 51-56 Link Here
51
import org.eclipse.gmf.runtime.lite.edit.parts.tree.DiagramTreeEditPartFactory;
51
import org.eclipse.gmf.runtime.lite.edit.parts.tree.DiagramTreeEditPartFactory;
52
import org.eclipse.gmf.runtime.lite.properties.PropertySourceProvider;
52
import org.eclipse.gmf.runtime.lite.properties.PropertySourceProvider;
53
import org.eclipse.gmf.runtime.lite.properties.UndoablePropertySheetEntry;
53
import org.eclipse.gmf.runtime.lite.properties.UndoablePropertySheetEntry;
54
import org.eclipse.gmf.runtime.lite.services.DefaultDiagramLayouter;
55
import org.eclipse.gmf.runtime.lite.services.IDiagramLayouter;
54
import org.eclipse.jface.action.IAction;
56
import org.eclipse.jface.action.IAction;
55
import org.eclipse.jface.viewers.ISelection;
57
import org.eclipse.jface.viewers.ISelection;
56
import org.eclipse.swt.SWT;
58
import org.eclipse.swt.SWT;
Lines 238-247 Link Here
238
			return getOutlinePage();
240
			return getOutlinePage();
239
		} else if (type == ZoomManager.class) {
241
		} else if (type == ZoomManager.class) {
240
			return getZoomManager();
242
			return getZoomManager();
243
		} else if (type == IDiagramLayouter.class) {
244
			return getDiagramLayouter();
241
		}
245
		}
242
		return super.getAdapter(type);
246
		return super.getAdapter(type);
243
	}
247
	}
244
248
249
	protected IDiagramLayouter getDiagramLayouter() {
250
		return new DefaultDiagramLayouter();
251
	}
252
245
	protected ZoomManager getZoomManager() {
253
	protected ZoomManager getZoomManager() {
246
		return getZoomManager(getGraphicalViewer());
254
		return getZoomManager(getGraphicalViewer());
247
	}
255
	}
Lines 342-346 Link Here
342
		// initialize actions
350
		// initialize actions
343
		createActions();
351
		createActions();
344
	}
352
	}
345
346
}
353
}
(-)src/org/eclipse/gmf/runtime/lite/edit/policies/BendpointEditPolicy.java (+31 lines)
Lines 17-28 Link Here
17
import org.eclipse.draw2d.Connection;
17
import org.eclipse.draw2d.Connection;
18
import org.eclipse.draw2d.geometry.Dimension;
18
import org.eclipse.draw2d.geometry.Dimension;
19
import org.eclipse.draw2d.geometry.Point;
19
import org.eclipse.draw2d.geometry.Point;
20
import org.eclipse.draw2d.geometry.PointList;
20
import org.eclipse.emf.common.command.AbstractCommand;
21
import org.eclipse.emf.common.command.AbstractCommand;
21
import org.eclipse.emf.transaction.TransactionalEditingDomain;
22
import org.eclipse.emf.transaction.TransactionalEditingDomain;
22
import org.eclipse.emf.transaction.util.TransactionUtil;
23
import org.eclipse.emf.transaction.util.TransactionUtil;
24
import org.eclipse.gef.Request;
23
import org.eclipse.gef.commands.Command;
25
import org.eclipse.gef.commands.Command;
24
import org.eclipse.gef.requests.BendpointRequest;
26
import org.eclipse.gef.requests.BendpointRequest;
25
import org.eclipse.gmf.runtime.lite.commands.WrappingCommand;
27
import org.eclipse.gmf.runtime.lite.commands.WrappingCommand;
28
import org.eclipse.gmf.runtime.lite.requests.RequestConstants;
29
import org.eclipse.gmf.runtime.lite.requests.SetAllBendpointsRequest;
26
import org.eclipse.gmf.runtime.notation.Edge;
30
import org.eclipse.gmf.runtime.notation.Edge;
27
import org.eclipse.gmf.runtime.notation.NotationFactory;
31
import org.eclipse.gmf.runtime.notation.NotationFactory;
28
import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
32
import org.eclipse.gmf.runtime.notation.RelativeBendpoints;
Lines 34-39 Link Here
34
		return (Edge) getHost().getModel();
38
		return (Edge) getHost().getModel();
35
	}
39
	}
36
40
41
	@Override
42
	public Command getCommand(Request request) {
43
		if (RequestConstants.REQ_SET_ALL_BENDPOINTS.equals(request.getType())) {
44
			return getSetAllBendpointsCommand((SetAllBendpointsRequest) request);
45
		}
46
		return super.getCommand(request);
47
	}
48
49
	protected Command getSetAllBendpointsCommand(SetAllBendpointsRequest request) {
50
		return getModifyBendpointCommand(new BendpointSetter(request.getPoints()));
51
	}
52
37
	protected Command getCreateBendpointCommand(BendpointRequest request) {
53
	protected Command getCreateBendpointCommand(BendpointRequest request) {
38
		return getModifyBendpointCommand(new BendpointCreator(request.getIndex(), request.getLocation()));
54
		return getModifyBendpointCommand(new BendpointCreator(request.getIndex(), request.getLocation()));
39
	}
55
	}
Lines 145-148 Link Here
145
			originalBendpoints.add(index, converter.convert(point));
161
			originalBendpoints.add(index, converter.convert(point));
146
		}
162
		}
147
	}
163
	}
164
165
	private static class BendpointSetter implements BendpointModifier {
166
		private PointList myPoints;
167
168
		public BendpointSetter(PointList points) {
169
			myPoints = points;
170
		}
171
172
		public void applyModification(List originalBendpoints, BendpointConverter converter) {
173
			originalBendpoints.clear();
174
			for(int i = 0, iMax = myPoints.size(); i < iMax; i++) {
175
				originalBendpoints.add(converter.convert(myPoints.getPoint(i)));
176
			}
177
		}
178
	}
148
}
179
}
(-)src/org/eclipse/gmf/runtime/lite/requests/RequestConstants.java (+5 lines)
Added Link Here
1
package org.eclipse.gmf.runtime.lite.requests;
2
3
public interface RequestConstants extends org.eclipse.gef.RequestConstants {
4
	public static final String REQ_SET_ALL_BENDPOINTS = "set_all_bendpoints";	//$NON-NLS-1$
5
}
(-)src/org/eclipse/gmf/runtime/lite/requests/SetAllBendpointsRequest.java (+34 lines)
Added Link Here
1
package org.eclipse.gmf.runtime.lite.requests;
2
3
import org.eclipse.draw2d.geometry.PointList;
4
import org.eclipse.gef.ConnectionEditPart;
5
import org.eclipse.gef.Request;
6
7
public class SetAllBendpointsRequest extends Request {
8
	private ConnectionEditPart myConnectionEditPart;
9
	private PointList myPoints;
10
11
	public SetAllBendpointsRequest() {
12
		super(RequestConstants.REQ_SET_ALL_BENDPOINTS);
13
	}
14
15
	public SetAllBendpointsRequest(String type) {
16
		super(type);
17
	}
18
19
	public PointList getPoints() {
20
		return myPoints;
21
	}
22
23
	public void setPoints(PointList points) {
24
		myPoints = points;
25
	}
26
27
	public ConnectionEditPart getConnectionEditPart() {
28
		return myConnectionEditPart;
29
	}
30
31
	public void setConnectionEditPart(ConnectionEditPart connectionEditPart) {
32
		myConnectionEditPart = connectionEditPart;
33
	}
34
}
(-)src/org/eclipse/gmf/runtime/lite/ui/actions/ActionIds.java (+19 lines)
Added Link Here
1
/**
2
 * Copyright (c) 2006 Eclipse.org
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    bblajer - initial API and implementation
11
 */
12
package org.eclipse.gmf.runtime.lite.ui.actions;
13
14
/**
15
 * Declares Action IDs used within the lite runtime.
16
 */
17
public interface ActionIds {
18
	public static final String LAYOUT_ALL_ACTION = "layout_all";	//$NON-NLS-1$
19
}
(-)src/org/eclipse/gmf/runtime/lite/services/DefaultDiagramLayouter.java (+289 lines)
Added Link Here
1
/**
2
 * Copyright (c) 2006 Eclipse.org
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    bblajer - initial API and implementation
11
 */
12
package org.eclipse.gmf.runtime.lite.services;
13
14
import java.util.HashMap;
15
import java.util.Iterator;
16
import java.util.List;
17
18
import org.eclipse.draw2d.geometry.Dimension;
19
import org.eclipse.draw2d.geometry.Point;
20
import org.eclipse.draw2d.geometry.PointList;
21
import org.eclipse.draw2d.geometry.Rectangle;
22
import org.eclipse.draw2d.graph.CompoundDirectedGraph;
23
import org.eclipse.draw2d.graph.CompoundDirectedGraphLayout;
24
import org.eclipse.draw2d.graph.EdgeList;
25
import org.eclipse.draw2d.graph.NodeList;
26
import org.eclipse.draw2d.graph.Subgraph;
27
import org.eclipse.emf.common.command.AbstractCommand;
28
import org.eclipse.emf.common.command.Command;
29
import org.eclipse.gef.ConnectionEditPart;
30
import org.eclipse.gef.EditPart;
31
import org.eclipse.gef.GraphicalEditPart;
32
import org.eclipse.gef.RequestConstants;
33
import org.eclipse.gef.commands.CompoundCommand;
34
import org.eclipse.gef.requests.ChangeBoundsRequest;
35
import org.eclipse.gmf.runtime.lite.requests.SetAllBendpointsRequest;
36
import org.eclipse.gmf.runtime.notation.Bounds;
37
import org.eclipse.gmf.runtime.notation.Diagram;
38
import org.eclipse.gmf.runtime.notation.Edge;
39
import org.eclipse.gmf.runtime.notation.Node;
40
import org.eclipse.gmf.runtime.notation.View;
41
42
/**
43
 * Default implementation of <code>IDiagramLayouter</code> that delegates to {@link org.eclipse.draw2d.graph.CompoundDirectedGraphLayout}.
44
 */
45
public class DefaultDiagramLayouter implements IDiagramLayouter {
46
	public Command layout(GraphicalEditPart container) {
47
		CompoundDirectedGraph graph = new CompoundDirectedGraph();
48
		HashMap<EditPart, org.eclipse.draw2d.graph.Node> views2Nodes = buildGraph(container, graph);
49
		CompoundDirectedGraphLayout layout = new CompoundDirectedGraphLayout();
50
		layout.visit(graph);
51
		return createLayoutCommand(container, views2Nodes, graph);
52
	}
53
54
	public Command layout(GraphicalEditPart container, List<GraphicalEditPart> selectedElements) {
55
		//XXX: Currently, selectedElements argument is ignored.
56
		return layout(container);
57
	}
58
59
	protected HashMap<EditPart, org.eclipse.draw2d.graph.Node> buildGraph(GraphicalEditPart container, CompoundDirectedGraph graph) {
60
		HashMap<EditPart, org.eclipse.draw2d.graph.Node> views2Nodes = new HashMap<EditPart, org.eclipse.draw2d.graph.Node>();
61
		traverseChildren(container, new SubGraphBuilder(null, graph, views2Nodes));
62
		Diagram diagram = ((View) container.getModel()).getDiagram();
63
		for(Iterator it = diagram.getEdges().iterator(); it.hasNext(); ) {
64
			Edge nextEdge = (Edge) it.next();
65
			ConnectionEditPart nextEdgeEP = (ConnectionEditPart) container.getViewer().getEditPartRegistry().get(nextEdge);
66
			EditPart source = nextEdgeEP.getSource();
67
			EditPart target = nextEdgeEP.getTarget();
68
			org.eclipse.draw2d.graph.Node sourceNode = views2Nodes.get(source);
69
			org.eclipse.draw2d.graph.Node targetNode = views2Nodes.get(target);
70
			if (sourceNode == null || targetNode == null) {
71
				continue;
72
			}
73
			org.eclipse.draw2d.graph.Edge edge = createEdge(nextEdgeEP, sourceNode, targetNode);
74
			if (edge != null) {
75
				graph.edges.add(edge);
76
			}
77
		}
78
		return views2Nodes;
79
	}
80
81
	protected static interface Traverser {
82
		public void acceptChild(GraphicalEditPart childEditPart);
83
		public void childrenTraversed(GraphicalEditPart parentEditPart);
84
	}
85
86
	protected void traverseChildren(GraphicalEditPart container, Traverser traverser) {
87
		View view = (View) container.getModel();
88
		for(Iterator it = view.getChildren().iterator(); it.hasNext(); ) {
89
			View nextChild = (View) it.next();
90
			GraphicalEditPart nextChildEP = (GraphicalEditPart) container.getViewer().getEditPartRegistry().get(nextChild);
91
			if (nextChildEP == null) {
92
				continue;
93
			}
94
			traverser.acceptChild(nextChildEP);
95
		}
96
		traverser.childrenTraversed(container);
97
	}
98
99
	protected class SubGraphBuilder implements Traverser {
100
		private final Subgraph myParent;
101
		private final CompoundDirectedGraph myGraph;
102
		private final HashMap<EditPart, org.eclipse.draw2d.graph.Node> myViews2Nodes;
103
104
		public SubGraphBuilder(Subgraph parent, CompoundDirectedGraph graph, HashMap<EditPart, org.eclipse.draw2d.graph.Node> views2Nodes) {
105
			myParent = parent;
106
			myGraph = graph;
107
			myViews2Nodes = views2Nodes;
108
		}
109
110
		public void acceptChild(GraphicalEditPart childEditPart) {
111
			org.eclipse.draw2d.graph.Node node = createNode(myParent, childEditPart);
112
			if (node != null) {
113
				setNodePosition(node);
114
				myGraph.nodes.add(node);
115
				myViews2Nodes.put(childEditPart, node);
116
				if (node instanceof org.eclipse.draw2d.graph.Subgraph) {
117
					traverseChildren(childEditPart, new SubGraphBuilder((org.eclipse.draw2d.graph.Subgraph) node, myGraph, myViews2Nodes));
118
				}
119
			}
120
		}
121
122
		public void childrenTraversed(GraphicalEditPart parentEditPart) {
123
		}
124
	}
125
126
	protected org.eclipse.draw2d.graph.Edge createEdge(ConnectionEditPart next, org.eclipse.draw2d.graph.Node sourceNode, org.eclipse.draw2d.graph.Node targetNode) {
127
		return new org.eclipse.draw2d.graph.Edge(next, sourceNode, targetNode);
128
	}
129
130
	protected org.eclipse.draw2d.graph.Node createNode(org.eclipse.draw2d.graph.Subgraph parent, GraphicalEditPart next) {
131
		if (next.getChildren().isEmpty()) {
132
			return new org.eclipse.draw2d.graph.Node(next, parent);
133
		}
134
		return new org.eclipse.draw2d.graph.Subgraph(next, parent);
135
	}
136
137
	protected void setNodePosition(org.eclipse.draw2d.graph.Node node) {
138
		GraphicalEditPart editPart = (GraphicalEditPart) node.data;
139
		Node notationalNode = (Node) editPart.getModel();
140
		if (notationalNode.getLayoutConstraint() instanceof Bounds) {
141
			Rectangle bounds = editPart.getFigure().getBounds().getCopy();
142
			editPart.getFigure().translateToAbsolute(bounds);
143
			node.x = bounds.x;
144
			node.y = bounds.y;
145
			node.width = bounds.width;
146
			node.height = bounds.height;
147
		}
148
	}
149
150
	protected Rectangle getNodePosition(org.eclipse.draw2d.graph.Node node) {
151
        Rectangle rect = new Rectangle(node.x, node.y, node.width, node.height);
152
        return rect;
153
	}
154
155
	protected Command createLayoutCommand(final GraphicalEditPart container, final HashMap<EditPart, org.eclipse.draw2d.graph.Node> views2Nodes, final CompoundDirectedGraph graph) {
156
		return new AbstractCommand() {
157
			/**
158
			 * Cache of the executed commands for undo-redo functionality.
159
			 */
160
			private CompoundCommand layoutCommand;
161
			public void redo() {
162
				layoutCommand.execute();
163
			}
164
			public void execute() {
165
				layoutCommand = new CompoundCommand();
166
				traverseChildren(container, new ChildrenLayouter(views2Nodes, layoutCommand));
167
				createLayoutEdgesCommand(graph.edges, layoutCommand);
168
			}
169
			@Override
170
			protected boolean prepare() {
171
				return true;
172
			}
173
			@Override
174
			public boolean canUndo() {
175
				return layoutCommand.canUndo();
176
			}
177
			@Override
178
			public void undo() {
179
				layoutCommand.undo();
180
			}
181
		};
182
	}
183
184
	protected class ChildrenLayouter implements Traverser {
185
		private final CompoundCommand myCommand;
186
		private final HashMap<EditPart, org.eclipse.draw2d.graph.Node> myViews2Nodes;
187
188
		public ChildrenLayouter(HashMap<EditPart, org.eclipse.draw2d.graph.Node> views2Nodes, CompoundCommand command) {
189
			myViews2Nodes = views2Nodes;
190
			myCommand = command;
191
		}
192
193
		public void acceptChild(GraphicalEditPart childEditPart) {
194
			org.eclipse.draw2d.graph.Node node = myViews2Nodes.get(childEditPart);
195
			if (node == null) {
196
				return;
197
			}
198
			ChangeBoundsRequest request = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
199
			Rectangle bounds = getNodePosition(node);
200
			Point ptLocation = new Point(bounds.x, bounds.y);
201
			Rectangle oldBounds = childEditPart.getFigure().getBounds();
202
			childEditPart.getFigure().translateToAbsolute(oldBounds);
203
			Point oldLocation = oldBounds.getLocation();
204
			Dimension delta = ptLocation.getDifference(oldLocation);
205
			request.setEditParts(childEditPart);
206
			request.setMoveDelta(new Point(delta.width, delta.height));
207
			request.setSizeDelta(bounds.getSize().getDifference(oldBounds.getSize()));
208
			request.setLocation(ptLocation);
209
			org.eclipse.gef.commands.Command cmd = childEditPart.getCommand(request);
210
			if (cmd != null && cmd.canExecute()) {
211
				cmd.execute();
212
				myCommand.add(cmd);
213
			}
214
		}
215
216
		public void childrenTraversed(GraphicalEditPart parentEditPart) {
217
			parentEditPart.getFigure().invalidateTree();
218
			parentEditPart.getFigure().validate();
219
			traverseChildren(parentEditPart, new Traverser() {
220
				public void acceptChild(GraphicalEditPart childEditPart) {
221
					traverseChildren(childEditPart, ChildrenLayouter.this);
222
				}
223
				public void childrenTraversed(GraphicalEditPart parentEditPart) {
224
				}
225
			});
226
		}
227
	}
228
229
	protected void createLayoutEdgesCommand(EdgeList edges, CompoundCommand command) {
230
		for(Iterator it = edges.iterator(); it.hasNext(); ) {
231
			org.eclipse.draw2d.graph.Edge next = (org.eclipse.draw2d.graph.Edge) it.next();
232
			if (next.data instanceof ConnectionEditPart == false) {
233
				continue;
234
			}
235
			ConnectionEditPart connection = (ConnectionEditPart) next.data;
236
			PointList points = getPoints(next);
237
			SetAllBendpointsRequest request = new SetAllBendpointsRequest();
238
			request.setConnectionEditPart(connection);
239
			request.setPoints(points);
240
            org.eclipse.gef.commands.Command cmd = connection.getCommand(request);
241
            if (cmd != null && cmd.canExecute()) {
242
            	cmd.execute();
243
                command.add(cmd);
244
			}
245
		}
246
	}
247
248
	private PointList getPoints(org.eclipse.draw2d.graph.Edge edge) {
249
		PointList result = new PointList();
250
		result.addPoint(((GraphicalEditPart) ((ConnectionEditPart) edge.data).getSource()).getFigure().getBounds().getCenter());
251
        NodeList vnodes = edge.vNodes;
252
        if (vnodes != null) {
253
            for (int i = 0; i < vnodes.size(); i++) {
254
                org.eclipse.draw2d.graph.Node vn = vnodes.getNode(i);
255
                Rectangle nextPosition = getNodePosition(vn);
256
                result.addPoint(nextPosition.getCenter());
257
            }
258
        }
259
		result.addPoint(((GraphicalEditPart) ((ConnectionEditPart) edge.data).getTarget()).getFigure().getBounds().getCenter());
260
		straightenPoints(result);
261
		result.removePoint(0);
262
		result.removePoint(result.size() - 1);
263
		return result;
264
	}
265
266
	private void straightenPoints(PointList points) {
267
		double flatnessTolerance = Math.cos(Math.PI/360);	//angles that are almost flat are treated as flat
268
		removeFlatAngles(points, flatnessTolerance);
269
	}
270
271
	private void removeFlatAngles(PointList points, double flatnessTolerance) {
272
		for(int i = 0; i < points.size() - 2 && points.size() > 3; i++) {
273
			while (i < points.size() - 2 && points.size() > 3 && cos(points.getPoint(i), points.getPoint(i+1), points.getPoint(i+2)) > flatnessTolerance) {
274
				points.removePoint(i+1);
275
			}
276
		}
277
	}
278
279
	/**
280
	 * Returns the cosine of the angle abc.
281
	 * @return
282
	 */
283
	private double cos(Point a, Point b, Point c) {
284
		double ab2 = b.getDistance2(a);
285
		double ac2 = c.getDistance2(a);
286
		double bc2 = b.getDistance2(c);
287
		return (ab2 + ac2 - bc2) / (2 * Math.sqrt(ab2 * ac2));
288
	}
289
}
(-)src/org/eclipse/gmf/runtime/lite/ui/actions/LayoutDiagramAction.java (+53 lines)
Added Link Here
1
/**
2
 * Copyright (c) 2006 Eclipse.org
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    bblajer - initial API and implementation
11
 */
12
package org.eclipse.gmf.runtime.lite.ui.actions;
13
14
import org.eclipse.emf.common.command.Command;
15
import org.eclipse.emf.transaction.TransactionalEditingDomain;
16
import org.eclipse.emf.transaction.util.TransactionUtil;
17
import org.eclipse.gef.GraphicalEditPart;
18
import org.eclipse.gef.GraphicalViewer;
19
import org.eclipse.gef.ui.actions.WorkbenchPartAction;
20
import org.eclipse.gmf.runtime.lite.commands.WrappingCommand;
21
import org.eclipse.gmf.runtime.lite.services.IDiagramLayouter;
22
import org.eclipse.ui.IWorkbenchPart;
23
24
25
public class LayoutDiagramAction extends WorkbenchPartAction {
26
	public LayoutDiagramAction(IWorkbenchPart part) {
27
		super(part);
28
	}
29
30
	@Override
31
	protected void init() {
32
		super.init();
33
		setId(ActionIds.LAYOUT_ALL_ACTION);
34
		setText("&Layout all");
35
		setToolTipText("Layouts the diagram");
36
	}
37
38
	@Override
39
	protected boolean calculateEnabled() {
40
		return getWorkbenchPart().getAdapter(IDiagramLayouter.class) != null && getWorkbenchPart().getAdapter(GraphicalViewer.class) != null;
41
	}
42
43
	@Override
44
	public void run() {
45
		GraphicalViewer viewer = (GraphicalViewer) getWorkbenchPart().getAdapter(GraphicalViewer.class);
46
		IDiagramLayouter layouter = (IDiagramLayouter) getWorkbenchPart().getAdapter(IDiagramLayouter.class);
47
		Command layoutCommand = layouter.layout((GraphicalEditPart) viewer.getContents());
48
		if (layoutCommand != null && layoutCommand.canExecute()) {
49
			TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(viewer.getContents().getModel());
50
			new WrappingCommand(editingDomain, layoutCommand).execute();
51
		}
52
	}
53
}
(-)src/org/eclipse/gmf/runtime/lite/services/IDiagramLayouter.java (+22 lines)
Added Link Here
1
/**
2
 * Copyright (c) 2006 Eclipse.org
3
 * 
4
 * All rights reserved. This program and the accompanying materials
5
 * are made available under the terms of the Eclipse Public License v1.0
6
 * which accompanies this distribution, and is available at
7
 * http://www.eclipse.org/legal/epl-v10.html
8
 *
9
 * Contributors:
10
 *    bblajer - initial API and implementation
11
 */
12
package org.eclipse.gmf.runtime.lite.services;
13
14
import java.util.List;
15
16
import org.eclipse.emf.common.command.Command;
17
import org.eclipse.gef.GraphicalEditPart;
18
19
public interface IDiagramLayouter {
20
	public Command layout(GraphicalEditPart container);
21
	public Command layout(GraphicalEditPart container, List<GraphicalEditPart> selectedElements);
22
}

Return to bug 158023