Package org.eclipse.gef.mvc.fx.ui.parts
Class AbstractFXEditor
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.ui.part.WorkbenchPart
-
- org.eclipse.ui.part.EditorPart
-
- org.eclipse.gef.mvc.fx.ui.parts.AbstractFXEditor
-
- All Implemented Interfaces:
IAdaptable
,IExecutableExtension
,IEditorPart
,ISaveablePart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
public abstract class AbstractFXEditor extends EditorPart
Abstract base class for editors. TheHistoricizingDomain
,IFXCanvasFactory
, andISelectionProvider
are injected into the editor on construction.
-
-
Field Summary
-
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
-
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
-
-
Constructor Summary
Constructors Constructor Description AbstractFXEditor(Injector injector)
Constructs a newAbstractFXEditor
and uses the givenInjector
to inject its members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activate()
Activates the editor by activating itsIDomain
.protected void
createActions()
Creates the actions for this editor and registers them in the editor's site action bar.void
createPartControl(Composite parent)
protected void
deactivate()
Deactivates the editor by deactivating itsIDomain
.void
dispose()
protected void
disposeActions()
Dispose the actions created by this editor.java.lang.Object
getAdapter(java.lang.Class key)
protected javafx.embed.swt.FXCanvas
getCanvas()
Returns theFXCanvas
that was previously created by theIFXCanvasFactory
which was previously injected into this editor.IViewer
getContentViewer()
IDomain
getDomain()
Returns theIDomain
that was previously injected into this editor.protected void
hookViewers()
Hooks all viewers that are part of this editor into theFXCanvas
.void
init(IEditorSite site, IEditorInput input)
boolean
isDirty()
protected void
markNonDirty()
Marks the current state of the editor to be non-dirty.void
setFocus()
protected void
unhookViewers()
Unhooks all viewers that are part of this editor.-
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, doSave, doSaveAs, getEditorInput, getEditorSite, getTitleToolTip, isSaveAsAllowed, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
-
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
-
-
-
Constructor Detail
-
AbstractFXEditor
public AbstractFXEditor(Injector injector)
Constructs a newAbstractFXEditor
and uses the givenInjector
to inject its members.- Parameters:
injector
- TheInjector
that is used to inject the editor's members.
-
-
Method Detail
-
activate
protected void activate()
Activates the editor by activating itsIDomain
.
-
createActions
protected void createActions()
Creates the actions for this editor and registers them in the editor's site action bar.
-
createPartControl
public void createPartControl(Composite parent)
- Specified by:
createPartControl
in interfaceIWorkbenchPart
- Specified by:
createPartControl
in classWorkbenchPart
-
deactivate
protected void deactivate()
Deactivates the editor by deactivating itsIDomain
.
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classWorkbenchPart
-
disposeActions
protected void disposeActions()
Dispose the actions created by this editor.
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class key)
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classWorkbenchPart
-
getCanvas
protected javafx.embed.swt.FXCanvas getCanvas()
Returns theFXCanvas
that was previously created by theIFXCanvasFactory
which was previously injected into this editor.- Returns:
- The
FXCanvas
that was previously created by theIFXCanvasFactory
.
-
getContentViewer
public IViewer getContentViewer()
-
getDomain
public IDomain getDomain()
Returns theIDomain
that was previously injected into this editor.- Returns:
- The
IDomain
that was previously injected into this editor.
-
hookViewers
protected void hookViewers()
Hooks all viewers that are part of this editor into theFXCanvas
.
-
init
public void init(IEditorSite site, IEditorInput input) throws PartInitException
- Specified by:
init
in interfaceIEditorPart
- Specified by:
init
in classEditorPart
- Throws:
PartInitException
-
isDirty
public boolean isDirty()
- Specified by:
isDirty
in interfaceISaveablePart
- Specified by:
isDirty
in classEditorPart
-
markNonDirty
protected void markNonDirty()
Marks the current state of the editor to be non-dirty. Should be called fromEditorPart.doSave(org.eclipse.core.runtime.IProgressMonitor)
andEditorPart.doSaveAs()
in case of successful save.
-
setFocus
public void setFocus()
- Specified by:
setFocus
in interfaceIWorkbenchPart
- Specified by:
setFocus
in classWorkbenchPart
-
unhookViewers
protected void unhookViewers()
Unhooks all viewers that are part of this editor.
-
-