public class GenericEditor
extends org.eclipse.ui.part.EditorPart
implements org.eclipse.emf.edit.domain.IEditingDomainProvider, org.eclipse.ui.ide.IGotoMarker
| Constructor and Description |
|---|
GenericEditor() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
adjustErrorMarker(org.eclipse.core.resources.IMarker marker,
org.eclipse.emf.common.util.Diagnostic diagnostic)
Override this method to set additional attributes on the given
IMarker, e.g. |
protected DiagnosticCache |
createDiangosticCache(org.eclipse.emf.common.notify.Notifier input)
Creates the diagnostic cache.
|
void |
createPartControl(org.eclipse.swt.widgets.Composite parent) |
protected TreeMasterDetailComposite |
createTreeMasterDetail(org.eclipse.swt.widgets.Composite composite,
Object editorInput,
CreateElementCallback createElementCallback)
This method creates a tree master detail.
|
protected void |
deleteMarkers()
Deletes the problem markers created by this Editor.
|
void |
dispose() |
void |
doSave(org.eclipse.core.runtime.IProgressMonitor monitor) |
void |
doSaveAs() |
protected boolean |
enableValidation() |
protected org.eclipse.emf.common.command.BasicCommandStack |
getCommandStack() |
protected String |
getContextId()
Returns the context id set for this editor.
|
protected CreateElementCallback |
getCreateElementCallback()
Returns the createElementCallback for this editor.
|
protected DiagnosticCache |
getDiagnosticCache() |
org.eclipse.emf.edit.domain.EditingDomain |
getEditingDomain() |
protected String |
getEditorTitle()
Returns the title for the currently displayed editor.
|
org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
Returns the ResouceSet of this Editor.
|
protected List<org.eclipse.jface.action.Action> |
getToolbarActions()
Returns the toolbar actions for this editor.
|
void |
gotoMarker(org.eclipse.core.resources.IMarker marker) |
protected void |
handleResourceChange(Collection<org.eclipse.emf.ecore.resource.Resource> changedResources,
Collection<org.eclipse.emf.ecore.resource.Resource> removedResources)
Handles filesystem changes.
|
protected boolean |
hasShortcuts()
Returns true, if the editor should have shortcuts.
|
void |
init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput input) |
boolean |
isDirty() |
boolean |
isSaveAsAllowed() |
protected org.eclipse.emf.ecore.resource.ResourceSet |
loadResource(org.eclipse.ui.IEditorInput editorInput)
Creates a resource set and loads all required resources for the editor input.
|
protected Object |
modifyEditorInput(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
Allows to modify the input object for the editor.
|
protected void |
postSave()
Executes the code which needs to be executed after a save, e.g.
|
protected void |
preSave()
Executes the code which needs to be executed before a save, e.g.
|
protected List<org.eclipse.jface.action.Action> |
readToolbarActions()
Read toolbar actions from all extensions.
|
void |
reveal(org.eclipse.emf.ecore.EObject objectToReveal)
The given element will be revealed in the tree of the editor.
|
void |
setFocus() |
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartNameaddPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyaddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitprotected DiagnosticCache getDiagnosticCache()
DiagnosticCache. may be nullpublic void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
doSave in interface org.eclipse.ui.ISaveablePartdoSave in class org.eclipse.ui.part.EditorPartprotected void preSave()
protected void postSave()
protected void handleResourceChange(Collection<org.eclipse.emf.ecore.resource.Resource> changedResources, Collection<org.eclipse.emf.ecore.resource.Resource> removedResources)
changedResources - A List of changed ResourcesremovedResources - A List of removed Resourcespublic void doSaveAs()
doSaveAs in interface org.eclipse.ui.ISaveablePartdoSaveAs in class org.eclipse.ui.part.EditorPartpublic void init(org.eclipse.ui.IEditorSite site,
org.eclipse.ui.IEditorInput input)
throws org.eclipse.ui.PartInitException
init in interface org.eclipse.ui.IEditorPartinit in class org.eclipse.ui.part.EditorPartorg.eclipse.ui.PartInitExceptionprotected String getContextId()
public boolean isDirty()
isDirty in interface org.eclipse.ui.ISaveablePartisDirty in class org.eclipse.ui.part.EditorPartpublic boolean isSaveAsAllowed()
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePartisSaveAsAllowed in class org.eclipse.ui.part.EditorPartpublic void createPartControl(org.eclipse.swt.widgets.Composite parent)
createPartControl in interface org.eclipse.ui.IWorkbenchPartcreatePartControl in class org.eclipse.ui.part.WorkbenchPartprotected void deleteMarkers()
throws org.eclipse.core.runtime.CoreException
Job to avoid problems with a locked index.org.eclipse.core.runtime.CoreException - if the method failsprotected DiagnosticCache createDiangosticCache(org.eclipse.emf.common.notify.Notifier input)
input - the inputprotected boolean enableValidation()
protected TreeMasterDetailComposite createTreeMasterDetail(org.eclipse.swt.widgets.Composite composite, Object editorInput, CreateElementCallback createElementCallback)
composite - the parent compositeeditorInput - the editor inputcreateElementCallback - the create element callback to addTreeMasterDetailCompositeprotected Object modifyEditorInput(org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
resourceSet - the resourceSet which is the default editor inputprotected org.eclipse.emf.ecore.resource.ResourceSet loadResource(org.eclipse.ui.IEditorInput editorInput)
editorInput - the editor inputpublic void setFocus()
setFocus in interface org.eclipse.ui.IWorkbenchPartsetFocus in class org.eclipse.ui.part.WorkbenchPartprotected boolean hasShortcuts()
protected String getEditorTitle()
protected CreateElementCallback getCreateElementCallback()
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
getEditingDomain in interface org.eclipse.emf.edit.domain.IEditingDomainProviderprotected List<org.eclipse.jface.action.Action> getToolbarActions()
protected List<org.eclipse.jface.action.Action> readToolbarActions()
public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
public void dispose()
dispose in interface org.eclipse.ui.IWorkbenchPartdispose in class org.eclipse.ui.part.WorkbenchPartpublic void gotoMarker(org.eclipse.core.resources.IMarker marker)
gotoMarker in interface org.eclipse.ui.ide.IGotoMarkerIGotoMarker.gotoMarker(org.eclipse.core.resources.IMarker)public void reveal(org.eclipse.emf.ecore.EObject objectToReveal)
objectToReveal - the object to revealprotected org.eclipse.emf.common.command.BasicCommandStack getCommandStack()
org.eclipse.emf.common.command.CommandStack;protected boolean adjustErrorMarker(org.eclipse.core.resources.IMarker marker,
org.eclipse.emf.common.util.Diagnostic diagnostic)
throws org.eclipse.core.runtime.CoreException
IMarker, e.g. location information.marker - the IMarker to adjustdiagnostic - the Diagnostictrue if the marker was changed, false otherwiseorg.eclipse.core.runtime.CoreException - in case of an errorCopyright © 2016. All rights reserved.