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. 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

Constructors
Constructor and Description
`AbstractFXEditor(Injector injector)` Constructs a new `AbstractFXEditor` and uses the given `Injector` to inject its members.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `activate()` Activates the editor by activating its `IDomain`.
`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 its `IDomain`.
`void` `dispose()`
`protected void` `disposeActions()` Dispose the actions created by this editor.
`Object` `getAdapter(Class key)`
`protected FXCanvas` `getCanvas()` Returns the `FXCanvas` that was previously created by the `IFXCanvasFactory` which was previously injected into this editor.
`IViewer` `getContentViewer()` Returns the `IViewer` of the `IDomain` which was previously injected into this editor.
`IDomain` `getDomain()` Returns the `IDomain` that was previously injected into this editor.
`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` `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 new `AbstractFXEditor` and uses the given `Injector` to inject its members.

Parameters:
  `injector` - The `Injector` that is used to inject the editor's members.

### Method Detail

#### activate

    protected void activate()

Activates the editor by activating its `IDomain`.

#### 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 interface `IWorkbenchPart`
Specified by:
  `createPartControl` in class `WorkbenchPart`

#### deactivate

    protected void deactivate()

Deactivates the editor by deactivating its `IDomain`.

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `IWorkbenchPart`
Overrides:
  `dispose` in class `WorkbenchPart`

#### disposeActions

    protected void disposeActions()

Dispose the actions created by this editor.

#### getAdapter

    public Object getAdapter(Class key)

Specified by:
  `getAdapter` in interface `IAdaptable`
Overrides:
  `getAdapter` in class `WorkbenchPart`

#### getCanvas

    protected FXCanvas getCanvas()

Returns the `FXCanvas` that was previously created by the `IFXCanvasFactory` which was previously injected into this editor.

Returns:
  The `FXCanvas` that was previously created by the `IFXCanvasFactory`.

#### getContentViewer

    public IViewer getContentViewer()

Returns the `IViewer` of the `IDomain` which was previously injected into this editor.

Returns:
  The `IViewer` of the `IDomain` which was previously injected into this editor.

#### getDomain

    public IDomain getDomain()

Returns the `IDomain` 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 the `FXCanvas`.

#### init

    public void init(IEditorSite site,
                     IEditorInput input)
              throws PartInitException

Specified by:
  `init` in interface `IEditorPart`
Specified by:
  `init` in class `EditorPart`
Throws:
  `PartInitException`

#### isDirty

    public boolean isDirty()

Specified by:
  `isDirty` in interface `ISaveablePart`
Specified by:
  `isDirty` in class `EditorPart`

#### markNonDirty

    protected void markNonDirty()

Marks the current state of the editor to be non-dirty. Should be called from `EditorPart.doSave(org.eclipse.core.runtime.IProgressMonitor)` and `EditorPart.doSaveAs()` in case of successful save.

#### setFocus

    public void setFocus()

Specified by:
  `setFocus` in interface `IWorkbenchPart`
Specified by:
  `setFocus` in class `WorkbenchPart`

#### unhookViewers

    protected void unhookViewers()

Unhooks all viewers that are part of this editor.