Lines 14-20
Link Here
|
14 |
return result; |
14 |
return result; |
15 |
} |
15 |
} |
16 |
|
16 |
|
17 |
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; |
17 |
protected final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl; |
18 |
protected final String TEXT_1 = ""; |
18 |
protected final String TEXT_1 = ""; |
19 |
protected final String TEXT_2 = "/**"; |
19 |
protected final String TEXT_2 = "/**"; |
20 |
protected final String TEXT_3 = NL + " * "; |
20 |
protected final String TEXT_3 = NL + " * "; |
Lines 26-32
Link Here
|
26 |
protected final String TEXT_9 = NL + NL + "import org.eclipse.core.resources.IFile;" + NL + "import org.eclipse.core.resources.IMarker;" + NL + "import org.eclipse.core.resources.IResource;" + NL + "import org.eclipse.core.resources.IResourceChangeEvent;" + NL + "import org.eclipse.core.resources.IResourceChangeListener;" + NL + "import org.eclipse.core.resources.IResourceDelta;" + NL + "import org.eclipse.core.resources.IResourceDeltaVisitor;" + NL + "import org.eclipse.core.resources.ResourcesPlugin;"; |
26 |
protected final String TEXT_9 = NL + NL + "import org.eclipse.core.resources.IFile;" + NL + "import org.eclipse.core.resources.IMarker;" + NL + "import org.eclipse.core.resources.IResource;" + NL + "import org.eclipse.core.resources.IResourceChangeEvent;" + NL + "import org.eclipse.core.resources.IResourceChangeListener;" + NL + "import org.eclipse.core.resources.IResourceDelta;" + NL + "import org.eclipse.core.resources.IResourceDeltaVisitor;" + NL + "import org.eclipse.core.resources.ResourcesPlugin;"; |
27 |
protected final String TEXT_10 = NL; |
27 |
protected final String TEXT_10 = NL; |
28 |
protected final String TEXT_11 = NL + "import org.eclipse.core.runtime.CoreException;" + NL + "import org.eclipse.core.runtime.IPath;"; |
28 |
protected final String TEXT_11 = NL + "import org.eclipse.core.runtime.CoreException;" + NL + "import org.eclipse.core.runtime.IPath;"; |
29 |
protected final String TEXT_12 = NL + "import org.eclipse.core.runtime.IProgressMonitor;" + NL + "import org.eclipse.core.runtime.NullProgressMonitor;" + NL + "" + NL + "import org.eclipse.jface.action.IMenuListener;" + NL + "import org.eclipse.jface.action.IMenuManager;" + NL + "import org.eclipse.jface.action.IStatusLineManager;" + NL + "import org.eclipse.jface.action.IToolBarManager;" + NL + "import org.eclipse.jface.action.MenuManager;" + NL + "import org.eclipse.jface.action.Separator;" + NL + "" + NL + "import org.eclipse.jface.dialogs.MessageDialog;" + NL + "import org.eclipse.jface.dialogs.ProgressMonitorDialog;" + NL; |
29 |
protected final String TEXT_12 = NL + "import org.eclipse.core.runtime.IProgressMonitor;" + NL + "import org.eclipse.core.runtime.NullProgressMonitor;" + NL + "" + NL + "import org.eclipse.jface.action.IMenuListener;" + NL + "import org.eclipse.jface.action.IMenuManager;" + NL + "import org.eclipse.jface.action.IStatusLineManager;" + NL + "import org.eclipse.jface.action.IToolBarManager;" + NL + "import org.eclipse.jface.action.MenuManager;" + NL + "import org.eclipse.jface.action.Separator;" + NL + "" + NL + "import org.eclipse.jface.dialogs.MessageDialog;" + NL + "import org.eclipse.jface.dialogs.ProgressMonitorDialog;" + NL + "" + NL + "import org.eclipse.jface.preference.IPreferenceStore;" + NL; |
30 |
protected final String TEXT_13 = NL + "import org.eclipse.jface.viewers.ColumnWeightData;"; |
30 |
protected final String TEXT_13 = NL + "import org.eclipse.jface.viewers.ColumnWeightData;"; |
31 |
protected final String TEXT_14 = NL + "import org.eclipse.jface.viewers.ISelection;" + NL + "import org.eclipse.jface.viewers.ISelectionChangedListener;" + NL + "import org.eclipse.jface.viewers.ISelectionProvider;" + NL + "import org.eclipse.jface.viewers.IStructuredSelection;"; |
31 |
protected final String TEXT_14 = NL + "import org.eclipse.jface.viewers.ISelection;" + NL + "import org.eclipse.jface.viewers.ISelectionChangedListener;" + NL + "import org.eclipse.jface.viewers.ISelectionProvider;" + NL + "import org.eclipse.jface.viewers.IStructuredSelection;"; |
32 |
protected final String TEXT_15 = NL + "import org.eclipse.jface.viewers.ListViewer;"; |
32 |
protected final String TEXT_15 = NL + "import org.eclipse.jface.viewers.ListViewer;"; |
Lines 40-46
Link Here
|
40 |
protected final String TEXT_23 = NL + "import org.eclipse.swt.widgets.TreeColumn;"; |
40 |
protected final String TEXT_23 = NL + "import org.eclipse.swt.widgets.TreeColumn;"; |
41 |
protected final String TEXT_24 = NL + NL + "import org.eclipse.ui.IActionBars;" + NL + "import org.eclipse.ui.IEditorInput;" + NL + "import org.eclipse.ui.IEditorPart;" + NL + "import org.eclipse.ui.IEditorSite;"; |
41 |
protected final String TEXT_24 = NL + NL + "import org.eclipse.ui.IActionBars;" + NL + "import org.eclipse.ui.IEditorInput;" + NL + "import org.eclipse.ui.IEditorPart;" + NL + "import org.eclipse.ui.IEditorSite;"; |
42 |
protected final String TEXT_25 = NL + "import org.eclipse.ui.IFileEditorInput;"; |
42 |
protected final String TEXT_25 = NL + "import org.eclipse.ui.IFileEditorInput;"; |
43 |
protected final String TEXT_26 = NL + "import org.eclipse.ui.IPartListener;" + NL + "import org.eclipse.ui.IWorkbenchPart;" + NL + "import org.eclipse.ui.PartInitException;"; |
43 |
protected final String TEXT_26 = NL + "import org.eclipse.ui.IPartListener;" + NL + "import org.eclipse.ui.IWorkbenchPart;" + NL + "import org.eclipse.ui.PartInitException;" + NL + "import org.eclipse.ui.PlatformUI;"; |
44 |
protected final String TEXT_27 = NL + NL + "import org.eclipse.ui.dialogs.SaveAsDialog;" + NL + "" + NL + "import org.eclipse.ui.ide.IGotoMarker;"; |
44 |
protected final String TEXT_27 = NL + NL + "import org.eclipse.ui.dialogs.SaveAsDialog;" + NL + "" + NL + "import org.eclipse.ui.ide.IGotoMarker;"; |
45 |
protected final String TEXT_28 = NL; |
45 |
protected final String TEXT_28 = NL; |
46 |
protected final String TEXT_29 = NL + "import org.eclipse.ui.part.FileEditorInput;"; |
46 |
protected final String TEXT_29 = NL + "import org.eclipse.ui.part.FileEditorInput;"; |
Lines 51-57
Link Here
|
51 |
protected final String TEXT_34 = NL + "import org.eclipse.emf.ecore.EObject;" + NL + "import org.eclipse.emf.ecore.EValidator;"; |
51 |
protected final String TEXT_34 = NL + "import org.eclipse.emf.ecore.EObject;" + NL + "import org.eclipse.emf.ecore.EValidator;"; |
52 |
protected final String TEXT_35 = NL + NL + "import org.eclipse.emf.ecore.resource.Resource;"; |
52 |
protected final String TEXT_35 = NL + NL + "import org.eclipse.emf.ecore.resource.Resource;"; |
53 |
protected final String TEXT_36 = NL + "import org.eclipse.emf.ecore.resource.ResourceSet;"; |
53 |
protected final String TEXT_36 = NL + "import org.eclipse.emf.ecore.resource.ResourceSet;"; |
54 |
protected final String TEXT_37 = NL + NL + "import org.eclipse.emf.ecore.util.EContentAdapter;" + NL + "import org.eclipse.emf.ecore.util.EcoreUtil;" + NL + "" + NL + "import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;" + NL + "import org.eclipse.emf.edit.domain.EditingDomain;" + NL + "import org.eclipse.emf.edit.domain.IEditingDomainProvider;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;" + NL + "import org.eclipse.emf.edit.provider.ComposedAdapterFactory;" + NL + "import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;" + NL + "import org.eclipse.emf.edit.ui.dnd.LocalTransfer;" + NL + "import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;"; |
54 |
protected final String TEXT_37 = NL + NL + "import org.eclipse.emf.ecore.util.EContentAdapter;" + NL + "import org.eclipse.emf.ecore.util.EcoreUtil;" + NL + "" + NL + "import org.eclipse.emf.ecore.xmi.XMLResource;" + NL + "" + NL + "import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;" + NL + "import org.eclipse.emf.edit.domain.EditingDomain;" + NL + "import org.eclipse.emf.edit.domain.IEditingDomainProvider;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator;" + NL + "import org.eclipse.emf.edit.provider.ComposedAdapterFactory;" + NL + "import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter;" + NL + "import org.eclipse.emf.edit.ui.dnd.LocalTransfer;" + NL + "import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter;" + NL + "" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;" + NL + "import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider;"; |
55 |
protected final String TEXT_38 = NL + NL + "import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;"; |
55 |
protected final String TEXT_38 = NL + NL + "import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper;"; |
56 |
protected final String TEXT_39 = NL + NL + "import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;" + NL + "" + NL + "import "; |
56 |
protected final String TEXT_39 = NL + NL + "import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage;" + NL + "" + NL + "import "; |
57 |
protected final String TEXT_40 = ";" + NL; |
57 |
protected final String TEXT_40 = ";" + NL; |
Lines 243-309
Link Here
|
243 |
protected final String TEXT_226 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
243 |
protected final String TEXT_226 = NL + "\tpublic boolean isDirty()" + NL + "\t{" + NL + "\t\treturn ((BasicCommandStack)editingDomain.getCommandStack()).isSaveNeeded();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This is for implementing {@link IEditorPart} and simply saves the model file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
244 |
protected final String TEXT_227 = NL + "\t@Override"; |
244 |
protected final String TEXT_227 = NL + "\t@Override"; |
245 |
protected final String TEXT_228 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal "; |
245 |
protected final String TEXT_228 = NL + "\tpublic void doSave(IProgressMonitor progressMonitor)" + NL + "\t{" + NL + "\t\t// Save only resources that have actually changed." + NL + "\t\t//" + NL + "\t\tfinal "; |
246 |
protected final String TEXT_229 = " saveOptions = new "; |
246 |
protected final String TEXT_229 = " saveOptions = getPreferences();" + NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);" + NL + "\t\t;" + NL + "" + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t"; |
247 |
protected final String TEXT_230 = "();" + NL + "\t\tsaveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);" + NL + "" + NL + "\t\t// Do the work within an operation because this is a long running activity that modifies the workbench." + NL + "\t\t//" + NL + "\t\t"; |
247 |
protected final String TEXT_230 = " operation =" + NL + "\t\t\tnew "; |
248 |
protected final String TEXT_231 = " operation =" + NL + "\t\t\tnew "; |
248 |
protected final String TEXT_231 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//"; |
249 |
protected final String TEXT_232 = "()" + NL + "\t\t\t{" + NL + "\t\t\t\t// This is the method that gets invoked when the operation runs." + NL + "\t\t\t\t//"; |
249 |
protected final String TEXT_232 = NL + "\t\t\t\t@Override"; |
250 |
protected final String TEXT_233 = NL + "\t\t\t\t@Override"; |
250 |
protected final String TEXT_233 = NL + "\t\t\t\tpublic void "; |
251 |
protected final String TEXT_234 = NL + "\t\t\t\tpublic void "; |
251 |
protected final String TEXT_234 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;"; |
252 |
protected final String TEXT_235 = "(IProgressMonitor monitor)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\t// Save the resources to the file system." + NL + "\t\t\t\t\t//" + NL + "\t\t\t\t\tboolean first = true;"; |
252 |
protected final String TEXT_235 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())"; |
253 |
protected final String TEXT_236 = NL + "\t\t\t\t\tfor (Resource resource : editingDomain.getResourceSet().getResources())"; |
253 |
protected final String TEXT_236 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )"; |
254 |
protected final String TEXT_237 = NL + "\t\t\t\t\tfor (Iterator i = editingDomain.getResourceSet().getResources().iterator(); i.hasNext(); )"; |
254 |
protected final String TEXT_237 = NL + "\t\t\t\t\t{"; |
255 |
protected final String TEXT_238 = NL + "\t\t\t\t\t{"; |
255 |
protected final String TEXT_238 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();"; |
256 |
protected final String TEXT_239 = NL + "\t\t\t\t\t\tResource resource = (Resource)i.next();"; |
256 |
protected final String TEXT_239 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t"; |
257 |
protected final String TEXT_240 = NL + "\t\t\t\t\t\tif ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource))" + NL + "\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\ttry" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tsavedResources.add(resource);" + NL + "\t\t\t\t\t\t\t\tresource.save(saveOptions);" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tcatch (Exception exception)" + NL + "\t\t\t\t\t\t\t{" + NL + "\t\t\t\t\t\t\t\tresourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));" + NL + "\t\t\t\t\t\t\t}" + NL + "\t\t\t\t\t\t\tfirst = false;" + NL + "\t\t\t\t\t\t}" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t};" + NL + "" + NL + "\t\tupdateProblemIndication = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\t// This runs the options, and shows progress." + NL + "\t\t\t//" + NL + "\t\t\tnew ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);" + NL + "" + NL + "\t\t\t// Refresh the necessary state." + NL + "\t\t\t//" + NL + "\t\t\t((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();" + NL + "\t\t\tfirePropertyChange(IEditorPart.PROP_DIRTY);" + NL + "\t\t}" + NL + "\t\tcatch (Exception exception)" + NL + "\t\t{" + NL + "\t\t\t// Something went wrong that shouldn't." + NL + "\t\t\t//" + NL + "\t\t\t"; |
257 |
protected final String TEXT_240 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Determine save options from properties and set them in map. Options already set in map will" + NL + "\t * be overwritten it they are specified in preferences." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate "; |
258 |
protected final String TEXT_241 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t\tupdateProblemIndication = true;" + NL + "\t\tupdateProblemIndication();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns wether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream. " + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
258 |
protected final String TEXT_241 = " getPreferences() {" + NL + "\t\t"; |
259 |
protected final String TEXT_242 = NL + "\t@Override"; |
259 |
protected final String TEXT_242 = " options = new "; |
260 |
protected final String TEXT_243 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
260 |
protected final String TEXT_243 = "();" + NL + "\t\tIPreferenceStore defaultsStore = PlatformUI.getPreferenceStore();" + NL + "\t\tIPreferenceStore store = "; |
261 |
protected final String TEXT_244 = NL + "\t@Override"; |
261 |
protected final String TEXT_244 = ".getPlugin().getPreferenceStore();" + NL + "\t\t\t\t" + NL + "\t\tString key = XMLResource.OPTION_SAVE_TYPE_INFORMATION;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t\t\t" + NL + "\t\tkey = XMLResource.OPTION_SAVE_DOCTYPE;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t\t\t" + NL + "\t\tkey = XMLResource.OPTION_FORMATTED;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getBoolean(key));" + NL + "\t\t" + NL + "\t\tkey = XMLResource.OPTION_LINE_WIDTH;" + NL + "\t\toptions.put(key, getStore(store, defaultsStore, key).getInt(key));" + NL + "\t\t" + NL + "\t\treturn options;" + NL + "\t}" + NL + "\t\t\t\t" + NL + "\t/**" + NL + "\t * Returns first store that contains given key" + NL + "\t */" + NL + "\tprivate IPreferenceStore getStore(IPreferenceStore primary, IPreferenceStore secondary, String key) {" + NL + "\t\treturn (primary.contains(key)) ? primary : secondary;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This returns wether something has been persisted to the URI of the specified resource." + NL + "\t * The implementation uses the URI converter from the editor's resource set to try to open an input stream. " + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean isPersisted(Resource resource)" + NL + "\t{" + NL + "\t\tboolean result = false;" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tInputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());" + NL + "\t\t\tif (stream != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tresult = true;" + NL + "\t\t\t\tstream.close();" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (IOException e)" + NL + "\t\t{" + NL + "\t\t\t// Ignore" + NL + "\t\t}" + NL + "\t\treturn result;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This always returns true because it is not currently supported." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
262 |
protected final String TEXT_245 = NL + "\tpublic void doSaveAs()" + NL + "\t{"; |
262 |
protected final String TEXT_245 = NL + "\t@Override"; |
263 |
protected final String TEXT_246 = NL + "\t\tString fileExtension = getString(\"_UI_"; |
263 |
protected final String TEXT_246 = NL + "\tpublic boolean isSaveAsAllowed()" + NL + "\t{" + NL + "\t\treturn true;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This also changes the editor's input." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
264 |
protected final String TEXT_247 = "FilenameExtension\");"; |
264 |
protected final String TEXT_247 = NL + "\t@Override"; |
265 |
protected final String TEXT_248 = NL + "\t\tString file = "; |
265 |
protected final String TEXT_248 = NL + "\tpublic void doSaveAs()" + NL + "\t{"; |
266 |
protected final String TEXT_249 = ".openFilePathDialog(getSite().getShell(), \"*.\" + fileExtension, "; |
266 |
protected final String TEXT_249 = NL + "\t\tString fileExtension = getString(\"_UI_"; |
267 |
protected final String TEXT_250 = ".SAVE);"; |
267 |
protected final String TEXT_250 = "FilenameExtension\");"; |
268 |
protected final String TEXT_251 = NL + "\t\tif (file != null)" + NL + "\t\t{" + NL + "\t\t\tif (!file.endsWith(\".\" + fileExtension))"; |
268 |
protected final String TEXT_251 = NL + "\t\tString file = "; |
269 |
protected final String TEXT_252 = NL + "\t\t\t{" + NL + "\t\t\t\tfile = file + \".\" + fileExtension;"; |
269 |
protected final String TEXT_252 = ".openFilePathDialog(getSite().getShell(), \"*.\" + fileExtension, "; |
270 |
protected final String TEXT_253 = NL + "\t\t\t}" + NL + "\t\t\tURI uri = URI.createFileURI(file);" + NL + "\t\t\tdoSaveAs(uri, new "; |
270 |
protected final String TEXT_253 = ".SAVE);"; |
271 |
protected final String TEXT_254 = "(uri));" + NL + "\t\t}"; |
271 |
protected final String TEXT_254 = NL + "\t\tif (file != null)" + NL + "\t\t{" + NL + "\t\t\tif (!file.endsWith(\".\" + fileExtension))"; |
272 |
protected final String TEXT_255 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}"; |
272 |
protected final String TEXT_255 = NL + "\t\t\t{" + NL + "\t\t\t\tfile = file + \".\" + fileExtension;"; |
273 |
protected final String TEXT_256 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t("; |
273 |
protected final String TEXT_256 = NL + "\t\t\t}" + NL + "\t\t\tURI uri = URI.createFileURI(file);" + NL + "\t\t\tdoSaveAs(uri, new "; |
274 |
protected final String TEXT_257 = "(Resource)"; |
274 |
protected final String TEXT_257 = "(uri));" + NL + "\t\t}"; |
275 |
protected final String TEXT_258 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew "; |
275 |
protected final String TEXT_258 = NL + "\t\tSaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell());" + NL + "\t\tsaveAsDialog.open();" + NL + "\t\tIPath path = saveAsDialog.getResult();" + NL + "\t\tif (path != null)" + NL + "\t\t{" + NL + "\t\t\tIFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);" + NL + "\t\t\tif (file != null)" + NL + "\t\t\t{" + NL + "\t\t\t\tdoSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file));" + NL + "\t\t\t}" + NL + "\t\t}"; |
276 |
protected final String TEXT_259 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}"; |
276 |
protected final String TEXT_259 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected void doSaveAs(URI uri, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\t("; |
277 |
protected final String TEXT_260 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.getType().equals(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t"; |
277 |
protected final String TEXT_260 = "(Resource)"; |
278 |
protected final String TEXT_261 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t}"; |
278 |
protected final String TEXT_261 = "editingDomain.getResourceSet().getResources().get(0)).setURI(uri);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tIProgressMonitor progressMonitor =" + NL + "\t\t\tgetActionBars().getStatusLineManager() != null ?" + NL + "\t\t\t\tgetActionBars().getStatusLineManager().getProgressMonitor() :" + NL + "\t\t\t\tnew "; |
279 |
protected final String TEXT_262 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
279 |
protected final String TEXT_262 = "();" + NL + "\t\tdoSave(progressMonitor);" + NL + "\t}"; |
280 |
protected final String TEXT_263 = NL + "\t@Override"; |
280 |
protected final String TEXT_263 = NL + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void gotoMarker(IMarker marker)" + NL + "\t{" + NL + "\t\ttry" + NL + "\t\t{" + NL + "\t\t\tif (marker.getType().equals(EValidator.MARKER))" + NL + "\t\t\t{" + NL + "\t\t\t\tString uriAttribute = marker.getAttribute(EValidator.URI_ATTRIBUTE, null);" + NL + "\t\t\t\tif (uriAttribute != null)" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tURI uri = URI.createURI(uriAttribute);" + NL + "\t\t\t\t\tEObject eObject = editingDomain.getResourceSet().getEObject(uri, true);" + NL + "\t\t\t\t\tif (eObject != null)" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t setSelectionToViewer(Collections.singleton(editingDomain.getWrapper(eObject)));" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t\tcatch (CoreException exception)" + NL + "\t\t{" + NL + "\t\t\t"; |
281 |
protected final String TEXT_264 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);"; |
281 |
protected final String TEXT_264 = ".INSTANCE.log(exception);" + NL + "\t\t}" + NL + "\t}"; |
282 |
protected final String TEXT_265 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);"; |
282 |
protected final String TEXT_265 = NL + NL + "\t/**" + NL + "\t * This is called during startup." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
283 |
protected final String TEXT_266 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
283 |
protected final String TEXT_266 = NL + "\t@Override"; |
284 |
protected final String TEXT_267 = NL + "\t@Override"; |
284 |
protected final String TEXT_267 = NL + "\tpublic void init(IEditorSite site, IEditorInput editorInput)" + NL + "\t{" + NL + "\t\tsetSite(site);" + NL + "\t\tsetInputWithNotify(editorInput);" + NL + "\t\tsetPartName(editorInput.getName());" + NL + "\t\tsite.setSelectionProvider(this);" + NL + "\t\tsite.getPage().addPartListener(partListener);"; |
285 |
protected final String TEXT_268 = NL + "\tpublic void setFocus()" + NL + "\t{"; |
285 |
protected final String TEXT_268 = NL + "\t\tResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, IResourceChangeEvent.POST_CHANGE);"; |
286 |
protected final String TEXT_269 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}"; |
286 |
protected final String TEXT_269 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
287 |
protected final String TEXT_270 = NL + "\t\tgetControl(getActivePage()).setFocus();"; |
287 |
protected final String TEXT_270 = NL + "\t@Override"; |
288 |
protected final String TEXT_271 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL; |
288 |
protected final String TEXT_271 = NL + "\tpublic void setFocus()" + NL + "\t{"; |
289 |
protected final String TEXT_272 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)"; |
289 |
protected final String TEXT_272 = NL + "\t\tif (currentViewerPane != null)" + NL + "\t\t{" + NL + "\t\t\tcurrentViewerPane.setFocus();" + NL + "\t\t}" + NL + "\t\telse" + NL + "\t\t{" + NL + "\t\t\tgetControl(getActivePage()).setFocus();" + NL + "\t\t}"; |
290 |
protected final String TEXT_273 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )"; |
290 |
protected final String TEXT_273 = NL + "\t\tgetControl(getActivePage()).setFocus();"; |
291 |
protected final String TEXT_274 = NL + "\t\t{"; |
291 |
protected final String TEXT_274 = NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void addSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.add(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void removeSelectionChangedListener(ISelectionChangedListener listener)" + NL + "\t{" + NL + "\t\tselectionChangedListeners.remove(listener);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic ISelection getSelection()" + NL + "\t{" + NL + "\t\treturn editorSelection;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection." + NL + "\t * Calling this result will notify the listeners." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setSelection(ISelection selection)" + NL + "\t{" + NL + "\t\teditorSelection = selection;" + NL; |
292 |
protected final String TEXT_275 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();"; |
292 |
protected final String TEXT_275 = NL + "\t\tfor (ISelectionChangedListener listener : selectionChangedListeners)"; |
293 |
protected final String TEXT_276 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t"; |
293 |
protected final String TEXT_276 = NL + "\t\tfor (Iterator listeners = selectionChangedListeners.iterator(); listeners.hasNext(); )"; |
294 |
protected final String TEXT_277 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));"; |
294 |
protected final String TEXT_277 = NL + "\t\t{"; |
295 |
protected final String TEXT_278 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));"; |
295 |
protected final String TEXT_278 = NL + "\t\t\tISelectionChangedListener listener = (ISelectionChangedListener)listeners.next();"; |
296 |
protected final String TEXT_279 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));"; |
296 |
protected final String TEXT_279 = NL + "\t\t\tlistener.selectionChanged(new SelectionChangedEvent(this, selection));" + NL + "\t\t}" + NL + "\t\tsetStatusLineManager(selection);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void setStatusLineManager(ISelection selection)" + NL + "\t{" + NL + "\t\tIStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer ?" + NL + "\t\t\tcontentOutlineStatusLineManager : getActionBars().getStatusLineManager();" + NL + "" + NL + "\t\tif (statusLineManager != null)" + NL + "\t\t{" + NL + "\t\t\tif (selection instanceof IStructuredSelection)" + NL + "\t\t\t{" + NL + "\t\t\t\t"; |
297 |
protected final String TEXT_280 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");"; |
297 |
protected final String TEXT_280 = " collection = ((IStructuredSelection)selection).toList();" + NL + "\t\t\t\tswitch (collection.size())" + NL + "\t\t\t\t{" + NL + "\t\t\t\t\tcase 0:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_NoObjectSelected\"));"; |
298 |
protected final String TEXT_281 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn "; |
298 |
protected final String TEXT_281 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tcase 1:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tString text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next());" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_SingleObjectSelected\", text));"; |
299 |
protected final String TEXT_282 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn "; |
299 |
protected final String TEXT_282 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t\tdefault:" + NL + "\t\t\t\t\t{" + NL + "\t\t\t\t\t\tstatusLineManager.setMessage(getString(\"_UI_MultiObjectSelected\", Integer.toString(collection.size())));"; |
300 |
protected final String TEXT_283 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
300 |
protected final String TEXT_283 = NL + "\t\t\t\t\t\tbreak;" + NL + "\t\t\t\t\t}" + NL + "\t\t\t\t}" + NL + "\t\t\t}" + NL + "\t\t\telse" + NL + "\t\t\t{" + NL + "\t\t\t\tstatusLineManager.setMessage(\"\");"; |
301 |
protected final String TEXT_284 = NL + "\t@Override"; |
301 |
protected final String TEXT_284 = NL + "\t\t\t}" + NL + "\t\t}" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in the plugin's plugin.properties file." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key)" + NL + "\t{" + NL + "\t\treturn "; |
302 |
protected final String TEXT_285 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL; |
302 |
protected final String TEXT_285 = ".INSTANCE.getString(key);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This looks up a string in plugin.properties, making a substitution." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprivate static String getString(String key, Object s1)" + NL + "\t{" + NL + "\t\treturn "; |
303 |
protected final String TEXT_286 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL; |
303 |
protected final String TEXT_286 = ".INSTANCE.getString(key, new Object [] { s1 });" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic void menuAboutToShow(IMenuManager menuManager)" + NL + "\t{" + NL + "\t\t((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic EditingDomainActionBarContributor getActionBarContributor()" + NL + "\t{" + NL + "\t\treturn (EditingDomainActionBarContributor)getEditorSite().getActionBarContributor();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic IActionBars getActionBars()" + NL + "\t{" + NL + "\t\treturn getActionBarContributor().getActionBars();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tpublic AdapterFactory getAdapterFactory()" + NL + "\t{" + NL + "\t\treturn adapterFactory;" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */"; |
304 |
protected final String TEXT_287 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL + "" + NL + "\t\tif (propertySheetPage != null)" + NL + "\t\t{" + NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn "; |
304 |
protected final String TEXT_287 = NL + "\t@Override"; |
305 |
protected final String TEXT_288 = ";" + NL + "\t}" + NL + "}"; |
305 |
protected final String TEXT_288 = NL + "\tpublic void dispose()" + NL + "\t{" + NL + "\t\tupdateProblemIndication = false;" + NL; |
306 |
protected final String TEXT_289 = NL; |
306 |
protected final String TEXT_289 = NL + "\t\tResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener);" + NL; |
|
|
307 |
protected final String TEXT_290 = NL + "\t\tgetSite().getPage().removePartListener(partListener);" + NL + "" + NL + "\t\tadapterFactory.dispose();" + NL + "" + NL + "\t\tif (getActionBarContributor().getActiveEditor() == this)" + NL + "\t\t{" + NL + "\t\t\tgetActionBarContributor().setActiveEditor(null);" + NL + "\t\t}" + NL + "" + NL + "\t\tif (propertySheetPage != null)" + NL + "\t\t{" + NL + "\t\t\tpropertySheetPage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tif (contentOutlinePage != null)" + NL + "\t\t{" + NL + "\t\t\tcontentOutlinePage.dispose();" + NL + "\t\t}" + NL + "" + NL + "\t\tsuper.dispose();" + NL + "\t}" + NL + "" + NL + "\t/**" + NL + "\t * Returns whether the outline view should be presented to the user." + NL + "\t * <!-- begin-user-doc -->" + NL + "\t * <!-- end-user-doc -->" + NL + "\t * @generated" + NL + "\t */" + NL + "\tprotected boolean showOutlineView()" + NL + "\t{" + NL + "\t\treturn "; |
308 |
protected final String TEXT_291 = ";" + NL + "\t}" + NL + "}"; |
309 |
protected final String TEXT_292 = NL; |
307 |
|
310 |
|
308 |
public String generate(Object argument) |
311 |
public String generate(Object argument) |
309 |
{ |
312 |
{ |
Lines 809-934
Link Here
|
809 |
stringBuffer.append(TEXT_228); |
812 |
stringBuffer.append(TEXT_228); |
810 |
stringBuffer.append(_MapOfObjectToObject); |
813 |
stringBuffer.append(_MapOfObjectToObject); |
811 |
stringBuffer.append(TEXT_229); |
814 |
stringBuffer.append(TEXT_229); |
812 |
stringBuffer.append(_HashMapOfObjectToObject); |
815 |
stringBuffer.append(importedOperationClassName); |
813 |
stringBuffer.append(TEXT_230); |
816 |
stringBuffer.append(TEXT_230); |
814 |
stringBuffer.append(importedOperationClassName); |
817 |
stringBuffer.append(importedOperationClassName); |
815 |
stringBuffer.append(TEXT_231); |
818 |
stringBuffer.append(TEXT_231); |
816 |
stringBuffer.append(importedOperationClassName); |
|
|
817 |
stringBuffer.append(TEXT_232); |
818 |
if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) { |
819 |
if (!genModel.isRichClientPlatform() && genModel.useClassOverrideAnnotation()) { |
819 |
stringBuffer.append(TEXT_233); |
820 |
stringBuffer.append(TEXT_232); |
820 |
} |
821 |
} |
821 |
stringBuffer.append(TEXT_234); |
822 |
stringBuffer.append(TEXT_233); |
822 |
stringBuffer.append(operationMethodName); |
823 |
stringBuffer.append(operationMethodName); |
823 |
stringBuffer.append(TEXT_235); |
824 |
stringBuffer.append(TEXT_234); |
824 |
if (genModel.useGenerics()) { |
825 |
if (genModel.useGenerics()) { |
825 |
stringBuffer.append(TEXT_236); |
826 |
stringBuffer.append(TEXT_235); |
826 |
} else { |
827 |
} else { |
827 |
stringBuffer.append(TEXT_237); |
828 |
stringBuffer.append(TEXT_236); |
828 |
} |
829 |
} |
829 |
stringBuffer.append(TEXT_238); |
830 |
stringBuffer.append(TEXT_237); |
830 |
if (!genModel.useGenerics()) { |
831 |
if (!genModel.useGenerics()) { |
831 |
stringBuffer.append(TEXT_239); |
832 |
stringBuffer.append(TEXT_238); |
832 |
} |
833 |
} |
833 |
stringBuffer.append(TEXT_240); |
834 |
stringBuffer.append(TEXT_239); |
834 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
835 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
|
|
836 |
stringBuffer.append(TEXT_240); |
837 |
stringBuffer.append(_MapOfObjectToObject); |
835 |
stringBuffer.append(TEXT_241); |
838 |
stringBuffer.append(TEXT_241); |
836 |
if (genModel.useClassOverrideAnnotation()) { |
839 |
stringBuffer.append(_MapOfObjectToObject); |
837 |
stringBuffer.append(TEXT_242); |
840 |
stringBuffer.append(TEXT_242); |
838 |
} |
841 |
stringBuffer.append(_HashMapOfObjectToObject); |
839 |
stringBuffer.append(TEXT_243); |
842 |
stringBuffer.append(TEXT_243); |
840 |
if (genModel.useClassOverrideAnnotation()) { |
843 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
841 |
stringBuffer.append(TEXT_244); |
844 |
stringBuffer.append(TEXT_244); |
842 |
} |
845 |
if (genModel.useClassOverrideAnnotation()) { |
843 |
stringBuffer.append(TEXT_245); |
846 |
stringBuffer.append(TEXT_245); |
844 |
if (genModel.isRichClientPlatform()) { |
847 |
} |
845 |
stringBuffer.append(TEXT_246); |
848 |
stringBuffer.append(TEXT_246); |
846 |
stringBuffer.append(genPackage.getEditorClassName()); |
849 |
if (genModel.useClassOverrideAnnotation()) { |
847 |
stringBuffer.append(TEXT_247); |
850 |
stringBuffer.append(TEXT_247); |
848 |
stringBuffer.append(genModel.getNonNLS()); |
851 |
} |
849 |
stringBuffer.append(TEXT_248); |
852 |
stringBuffer.append(TEXT_248); |
850 |
stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())); |
853 |
if (genModel.isRichClientPlatform()) { |
851 |
stringBuffer.append(TEXT_249); |
854 |
stringBuffer.append(TEXT_249); |
852 |
stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT")); |
855 |
stringBuffer.append(genPackage.getEditorClassName()); |
853 |
stringBuffer.append(TEXT_250); |
856 |
stringBuffer.append(TEXT_250); |
854 |
stringBuffer.append(genModel.getNonNLS()); |
857 |
stringBuffer.append(genModel.getNonNLS()); |
855 |
stringBuffer.append(TEXT_251); |
858 |
stringBuffer.append(TEXT_251); |
856 |
stringBuffer.append(genModel.getNonNLS()); |
859 |
stringBuffer.append(genModel.getImportedName(genModel.getQualifiedEditorAdvisorClassName())); |
857 |
stringBuffer.append(TEXT_252); |
860 |
stringBuffer.append(TEXT_252); |
858 |
stringBuffer.append(genModel.getNonNLS()); |
861 |
stringBuffer.append(genModel.getImportedName("org.eclipse.swt.SWT")); |
859 |
stringBuffer.append(TEXT_253); |
862 |
stringBuffer.append(TEXT_253); |
860 |
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); |
863 |
stringBuffer.append(genModel.getNonNLS()); |
861 |
stringBuffer.append(TEXT_254); |
864 |
stringBuffer.append(TEXT_254); |
862 |
} else { |
865 |
stringBuffer.append(genModel.getNonNLS()); |
863 |
stringBuffer.append(TEXT_255); |
866 |
stringBuffer.append(TEXT_255); |
864 |
} |
867 |
stringBuffer.append(genModel.getNonNLS()); |
865 |
stringBuffer.append(TEXT_256); |
868 |
stringBuffer.append(TEXT_256); |
866 |
if (!genModel.useGenerics()) { |
869 |
stringBuffer.append(genModel.getImportedName("org.eclipse.emf.common.ui.URIEditorInput")); |
867 |
stringBuffer.append(TEXT_257); |
870 |
stringBuffer.append(TEXT_257); |
868 |
} |
871 |
} else { |
869 |
stringBuffer.append(TEXT_258); |
872 |
stringBuffer.append(TEXT_258); |
870 |
stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")); |
873 |
} |
871 |
stringBuffer.append(TEXT_259); |
874 |
stringBuffer.append(TEXT_259); |
872 |
if (!genModel.isRichClientPlatform()) { |
875 |
if (!genModel.useGenerics()) { |
873 |
stringBuffer.append(TEXT_260); |
876 |
stringBuffer.append(TEXT_260); |
874 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
|
|
875 |
stringBuffer.append(TEXT_261); |
876 |
} |
877 |
} |
|
|
878 |
stringBuffer.append(TEXT_261); |
879 |
stringBuffer.append(genModel.getImportedName("org.eclipse.core.runtime.NullProgressMonitor")); |
877 |
stringBuffer.append(TEXT_262); |
880 |
stringBuffer.append(TEXT_262); |
878 |
if (genModel.useClassOverrideAnnotation()) { |
881 |
if (!genModel.isRichClientPlatform()) { |
879 |
stringBuffer.append(TEXT_263); |
882 |
stringBuffer.append(TEXT_263); |
880 |
} |
883 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
881 |
stringBuffer.append(TEXT_264); |
884 |
stringBuffer.append(TEXT_264); |
882 |
if (!genModel.isRichClientPlatform()) { |
|
|
883 |
stringBuffer.append(TEXT_265); |
884 |
} |
885 |
} |
885 |
stringBuffer.append(TEXT_266); |
886 |
stringBuffer.append(TEXT_265); |
886 |
if (genModel.useClassOverrideAnnotation()) { |
887 |
if (genModel.useClassOverrideAnnotation()) { |
887 |
stringBuffer.append(TEXT_267); |
888 |
stringBuffer.append(TEXT_266); |
888 |
} |
889 |
} |
|
|
890 |
stringBuffer.append(TEXT_267); |
891 |
if (!genModel.isRichClientPlatform()) { |
889 |
stringBuffer.append(TEXT_268); |
892 |
stringBuffer.append(TEXT_268); |
890 |
if (genPackage.isMultipleEditorPages()) { |
893 |
} |
891 |
stringBuffer.append(TEXT_269); |
894 |
stringBuffer.append(TEXT_269); |
892 |
} else { |
895 |
if (genModel.useClassOverrideAnnotation()) { |
893 |
stringBuffer.append(TEXT_270); |
896 |
stringBuffer.append(TEXT_270); |
894 |
} |
897 |
} |
895 |
stringBuffer.append(TEXT_271); |
898 |
stringBuffer.append(TEXT_271); |
896 |
if (genModel.useGenerics()) { |
899 |
if (genPackage.isMultipleEditorPages()) { |
897 |
stringBuffer.append(TEXT_272); |
900 |
stringBuffer.append(TEXT_272); |
898 |
} else { |
901 |
} else { |
899 |
stringBuffer.append(TEXT_273); |
902 |
stringBuffer.append(TEXT_273); |
900 |
} |
903 |
} |
901 |
stringBuffer.append(TEXT_274); |
904 |
stringBuffer.append(TEXT_274); |
902 |
if (!genModel.useGenerics()) { |
905 |
if (genModel.useGenerics()) { |
903 |
stringBuffer.append(TEXT_275); |
906 |
stringBuffer.append(TEXT_275); |
904 |
} |
907 |
} else { |
905 |
stringBuffer.append(TEXT_276); |
908 |
stringBuffer.append(TEXT_276); |
906 |
stringBuffer.append(_CollectionOfAnything); |
909 |
} |
907 |
stringBuffer.append(TEXT_277); |
910 |
stringBuffer.append(TEXT_277); |
908 |
stringBuffer.append(genModel.getNonNLS()); |
911 |
if (!genModel.useGenerics()) { |
909 |
stringBuffer.append(TEXT_278); |
912 |
stringBuffer.append(TEXT_278); |
910 |
stringBuffer.append(genModel.getNonNLS()); |
913 |
} |
911 |
stringBuffer.append(TEXT_279); |
914 |
stringBuffer.append(TEXT_279); |
912 |
stringBuffer.append(genModel.getNonNLS()); |
915 |
stringBuffer.append(_CollectionOfAnything); |
913 |
stringBuffer.append(TEXT_280); |
916 |
stringBuffer.append(TEXT_280); |
914 |
stringBuffer.append(genModel.getNonNLS()); |
917 |
stringBuffer.append(genModel.getNonNLS()); |
915 |
stringBuffer.append(TEXT_281); |
918 |
stringBuffer.append(TEXT_281); |
916 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
919 |
stringBuffer.append(genModel.getNonNLS()); |
917 |
stringBuffer.append(TEXT_282); |
920 |
stringBuffer.append(TEXT_282); |
918 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
921 |
stringBuffer.append(genModel.getNonNLS()); |
919 |
stringBuffer.append(TEXT_283); |
922 |
stringBuffer.append(TEXT_283); |
920 |
if (genModel.useClassOverrideAnnotation()) { |
923 |
stringBuffer.append(genModel.getNonNLS()); |
921 |
stringBuffer.append(TEXT_284); |
924 |
stringBuffer.append(TEXT_284); |
922 |
} |
925 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
923 |
stringBuffer.append(TEXT_285); |
926 |
stringBuffer.append(TEXT_285); |
924 |
if (!genModel.isRichClientPlatform()) { |
927 |
stringBuffer.append(genPackage.getImportedEditorPluginClassName()); |
925 |
stringBuffer.append(TEXT_286); |
928 |
stringBuffer.append(TEXT_286); |
926 |
} |
929 |
if (genModel.useClassOverrideAnnotation()) { |
927 |
stringBuffer.append(TEXT_287); |
930 |
stringBuffer.append(TEXT_287); |
928 |
stringBuffer.append(genPackage.isMultipleEditorPages()); |
931 |
} |
929 |
stringBuffer.append(TEXT_288); |
932 |
stringBuffer.append(TEXT_288); |
930 |
genModel.emitSortedImports(); |
933 |
if (!genModel.isRichClientPlatform()) { |
931 |
stringBuffer.append(TEXT_289); |
934 |
stringBuffer.append(TEXT_289); |
|
|
935 |
} |
936 |
stringBuffer.append(TEXT_290); |
937 |
stringBuffer.append(genPackage.isMultipleEditorPages()); |
938 |
stringBuffer.append(TEXT_291); |
939 |
genModel.emitSortedImports(); |
940 |
stringBuffer.append(TEXT_292); |
932 |
return stringBuffer.toString(); |
941 |
return stringBuffer.toString(); |
933 |
} |
942 |
} |
934 |
} |
943 |
} |