public abstract class AbstractFXEditor extends EditorPart
FXDomain
,
IFXCanvasFactory
, and ISelectionProvider
are injected into
the editor on construction.PROP_DIRTY, PROP_INPUT
PROP_TITLE
Constructor and Description |
---|
AbstractFXEditor(com.google.inject.Injector injector)
Constructs a new
AbstractFXEditor and uses the given
Injector to inject its members. |
Modifier and Type | Method and Description |
---|---|
protected void |
activate()
Activates the editor by activating its
FXDomain . |
protected javafx.embed.swt.FXCanvas |
createCanvas(Composite parent)
Uses the
IFXCanvasFactory to create the FXCanvas that
allows the interoperability between SWT and JavaFX. |
void |
createPartControl(Composite parent) |
protected IPropertySheetPage |
createPropertySheetPage()
Creates an
IPropertySheetPage using the injected
IPropertySheetPageFactory , if present. |
protected void |
deactivate()
Deactivates the editor by deactivating its
FXDomain . |
void |
dispose() |
java.lang.Object |
getAdapter(java.lang.Class key) |
protected javafx.embed.swt.FXCanvas |
getCanvas()
Returns the
FXCanvas that was previously created by the
IFXCanvasFactory which was previously injected into this editor. |
protected FXViewer |
getContentViewer()
|
FXDomain |
getDomain()
Returns the
FXDomain that was previously injected into this
editor. |
ISelectionProvider |
getSelectionProvider()
Returns the
ISelectionProvider used by this
AbstractFXEditor . |
protected void |
hookViewers()
Hooks all viewers that are part of this editor into the
FXCanvas . |
void |
init(IEditorSite site,
IEditorInput input) |
boolean |
isDirty() |
protected void |
setDirty(boolean isDirty)
Sets the dirty flag of this editor to the given value.
|
void |
setFocus() |
protected void |
unhookViewers()
Unhooks all viewers that are part of this editor.
|
checkSite, doSave, doSaveAs, getEditorInput, getEditorSite, getTitleToolTip, isSaveAsAllowed, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, 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
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
public AbstractFXEditor(com.google.inject.Injector injector)
AbstractFXEditor
and uses the given
Injector
to inject its members.injector
- The Injector
that is used to inject the editor's
members.protected void activate()
FXDomain
.protected javafx.embed.swt.FXCanvas createCanvas(Composite parent)
IFXCanvasFactory
to create the FXCanvas
that
allows the interoperability between SWT and JavaFX.parent
- The parent Composite
in which the FXCanvas
is
created.FXCanvas
created by the IFXCanvasFactory
.public void createPartControl(Composite parent)
createPartControl
in interface IWorkbenchPart
createPartControl
in class WorkbenchPart
protected IPropertySheetPage createPropertySheetPage()
IPropertySheetPage
using the injected
IPropertySheetPageFactory
, if present.IPropertySheetPage
, or null
in case no
factory was injected.protected void deactivate()
FXDomain
.public void dispose()
dispose
in interface IWorkbenchPart
dispose
in class WorkbenchPart
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter
in interface IAdaptable
getAdapter
in class WorkbenchPart
protected javafx.embed.swt.FXCanvas getCanvas()
FXCanvas
that was previously created by the
IFXCanvasFactory
which was previously injected into this editor.FXCanvas
that was previously created by the
IFXCanvasFactory
.protected FXViewer getContentViewer()
public FXDomain getDomain()
FXDomain
that was previously injected into this
editor.FXDomain
that was previously injected into this
editor.public ISelectionProvider getSelectionProvider()
ISelectionProvider
used by this
AbstractFXEditor
. May be null
in case no injection
provider is used.ISelectionProvider
protected void hookViewers()
FXCanvas
.public void init(IEditorSite site, IEditorInput input) throws PartInitException
init
in interface IEditorPart
init
in class EditorPart
PartInitException
public boolean isDirty()
isDirty
in interface ISaveablePart
isDirty
in class EditorPart
protected void setDirty(boolean isDirty)
isDirty
- true
to indicate that the editor's contents
changed, otherwise false
.public void setFocus()
setFocus
in interface IWorkbenchPart
setFocus
in class WorkbenchPart
protected void unhookViewers()
Copyright (c) 2014 itemis AG and others. All rights reserved.