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_INPUTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFXEditor(Injector injector) Constructs a newAbstractFXEditorand uses the givenInjectorto inject its members. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactivate()Activates the editor by activating itsIDomain.protected voidCreates the actions for this editor and registers them in the editor's site action bar.voidcreatePartControl(Composite parent) protected voidDeactivates the editor by deactivating itsIDomain.voiddispose()protected voidDispose the actions created by this editor.getAdapter(Class key) protected javafx.embed.swt.FXCanvasReturns theFXCanvasthat was previously created by theIFXCanvasFactorywhich was previously injected into this editor.Returns theIDomainthat was previously injected into this editor.protected voidHooks all viewers that are part of this editor into theFXCanvas.voidinit(IEditorSite site, IEditorInput input) booleanisDirty()protected voidMarks the current state of the editor to be non-dirty.voidsetFocus()protected voidUnhooks 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, setPartNameMethods 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, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
-
Constructor Details
-
AbstractFXEditor
Constructs a newAbstractFXEditorand uses the givenInjectorto inject its members.- Parameters:
injector- TheInjectorthat 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:
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
- 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
-
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
- 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.
-