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, andISelectionProviderare 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 newAbstractFXEditorand uses the givenInjectorto inject its members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidactivate()Activates the editor by activating itsIDomain.protected voidcreateActions()Creates the actions for this editor and registers them in the editor's site action bar.voidcreatePartControl(Composite parent)protected voiddeactivate()Deactivates the editor by deactivating itsIDomain.voiddispose()protected voiddisposeActions()Dispose the actions created by this editor.java.lang.ObjectgetAdapter(java.lang.Class key)protected javafx.embed.swt.FXCanvasgetCanvas()Returns theFXCanvasthat was previously created by theIFXCanvasFactorywhich was previously injected into this editor.IViewergetContentViewer()IDomaingetDomain()Returns theIDomainthat was previously injected into this editor.protected voidhookViewers()Hooks all viewers that are part of this editor into theFXCanvas.voidinit(IEditorSite site, IEditorInput input)booleanisDirty()protected voidmarkNonDirty()Marks the current state of the editor to be non-dirty.voidsetFocus()protected voidunhookViewers()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 newAbstractFXEditorand uses the givenInjectorto inject its members.- Parameters:
injector- TheInjectorthat 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:
createPartControlin interfaceIWorkbenchPart- Specified by:
createPartControlin classWorkbenchPart
-
deactivate
protected void deactivate()
Deactivates the editor by deactivating itsIDomain.
-
dispose
public void dispose()
- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classWorkbenchPart
-
disposeActions
protected void disposeActions()
Dispose the actions created by this editor.
-
getAdapter
public java.lang.Object getAdapter(java.lang.Class key)
- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classWorkbenchPart
-
getCanvas
protected javafx.embed.swt.FXCanvas getCanvas()
Returns theFXCanvasthat was previously created by theIFXCanvasFactorywhich was previously injected into this editor.- Returns:
- The
FXCanvasthat was previously created by theIFXCanvasFactory.
-
getContentViewer
public IViewer getContentViewer()
-
getDomain
public IDomain getDomain()
Returns theIDomainthat was previously injected into this editor.- Returns:
- The
IDomainthat 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:
initin interfaceIEditorPart- Specified by:
initin classEditorPart- Throws:
PartInitException
-
isDirty
public boolean isDirty()
- Specified by:
isDirtyin interfaceISaveablePart- Specified by:
isDirtyin 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:
setFocusin interfaceIWorkbenchPart- Specified by:
setFocusin classWorkbenchPart
-
unhookViewers
protected void unhookViewers()
Unhooks all viewers that are part of this editor.
-
-