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, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getAdapter, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected DiagnosticCache getDiagnosticCache()
DiagnosticCache
. may be null
public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
doSave
in interface org.eclipse.ui.ISaveablePart
doSave
in class org.eclipse.ui.part.EditorPart
protected 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.ISaveablePart
doSaveAs
in class org.eclipse.ui.part.EditorPart
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input) throws org.eclipse.ui.PartInitException
init
in interface org.eclipse.ui.IEditorPart
init
in class org.eclipse.ui.part.EditorPart
org.eclipse.ui.PartInitException
protected String getContextId()
public boolean isDirty()
isDirty
in interface org.eclipse.ui.ISaveablePart
isDirty
in class org.eclipse.ui.part.EditorPart
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
isSaveAsAllowed
in class org.eclipse.ui.part.EditorPart
public void createPartControl(org.eclipse.swt.widgets.Composite parent)
createPartControl
in interface org.eclipse.ui.IWorkbenchPart
createPartControl
in class org.eclipse.ui.part.WorkbenchPart
protected 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 addTreeMasterDetailComposite
protected 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.IWorkbenchPart
setFocus
in class org.eclipse.ui.part.WorkbenchPart
protected boolean hasShortcuts()
protected String getEditorTitle()
protected CreateElementCallback getCreateElementCallback()
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
getEditingDomain
in interface org.eclipse.emf.edit.domain.IEditingDomainProvider
protected 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.IWorkbenchPart
dispose
in class org.eclipse.ui.part.WorkbenchPart
public void gotoMarker(org.eclipse.core.resources.IMarker marker)
gotoMarker
in interface org.eclipse.ui.ide.IGotoMarker
IGotoMarker.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 Diagnostic
true
if the marker was changed, false
otherwiseorg.eclipse.core.runtime.CoreException
- in case of an errorCopyright © 2016. All rights reserved.