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
Abstract base class for editors. The
HistoricizingDomain
,
IFXCanvasFactory
, and ISelectionProvider
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
ConstructorsConstructorDescriptionAbstractFXEditor
(Injector injector) Constructs a newAbstractFXEditor
and uses the givenInjector
to inject its members. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
activate()
Activates the editor by activating itsIDomain
.protected void
Creates the actions for this editor and registers them in the editor's site action bar.void
createPartControl
(Composite parent) protected void
Deactivates the editor by deactivating itsIDomain
.void
dispose()
protected void
Dispose the actions created by this editor.getAdapter
(Class key) protected FXCanvas
Returns theFXCanvas
that was previously created by theIFXCanvasFactory
which was previously injected into this editor.Returns theIDomain
that was previously injected into this editor.protected void
Hooks all viewers that are part of this editor into theFXCanvas
.void
init
(IEditorSite site, IEditorInput input) boolean
isDirty()
protected void
Marks the current state of the editor to be non-dirty.void
setFocus()
protected void
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 Details
-
AbstractFXEditor
Constructs a newAbstractFXEditor
and uses the givenInjector
to inject its members.- Parameters:
injector
- TheInjector
that is used to inject the editor's members.
-
-
Method Details
-
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
- 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
- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classWorkbenchPart
-
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
-
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
- 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.
-