Package org.eclipse.gef.mvc.fx.ui.parts

# Class AbstractFXView

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.ViewPart
org.eclipse.gef.mvc.fx.ui.parts.AbstractFXView

All Implemented Interfaces:
  `IAdaptable`, `IExecutableExtension`, `IPersistable`, `IViewPart`, `IWorkbenchPart`, `IWorkbenchPart2`, `IWorkbenchPart3`, `IWorkbenchPartOrientation`

public abstract class AbstractFXView extends ViewPart
Abstract base class for views.

## Field Summary

### Fields inherited from interface org.eclipse.ui.IWorkbenchPart

`PROP_TITLE`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`protected void`
`activate()`
Activates this `AbstractFXView` by activating the `IDomain` that was previously injected.
`protected void`
`createActions()`
Create actions for this view and registers at the action bars of the view's site.
`void`
`createPartControl(Composite parent)`
`protected void`
`deactivate()`
Deactivates this `AbstractFXView` by deactivating its `IDomain` that was previously injected.
`void`
`dispose()`
`protected void`
`disposeActions()`
Dispose the actions created by this view.
`Object`
`getAdapter(Class key)`
`protected javafx.embed.swt.FXCanvas`
`getCanvas()`
Returns the `FXCanvas` that was previously created by the injected `IFXCanvasFactory`.
`IViewer`
`getContentViewer()`
Returns the `IViewer` of the `IDomain` that was previously injected.
`IDomain`
`getDomain()`
Returns the `IDomain` that was previously injected.
`protected org.eclipse.gef.mvc.fx.ui.actions.FitToViewportActionGroup`
`getFitToViewportActionGroup()`
Returns the `ActionGroup` that manages the fit-to-viewport actions.
`protected void`
`hookViewers()`
Hooks all viewers that are part of this `AbstractFXView` into the `FXCanvas` that was previously created by the injected `IFXCanvasFactory`.
`void`
`init(IViewSite site)`
`void`
`setFocus()`
`protected void`
`unhookViewers()`
Unhooks all viewers that are part of this `AbstractFXView`.

### Methods inherited from class org.eclipse.ui.part.ViewPart

`checkSite, getViewSite, init, saveState, setContentDescription, setInitializationData, setPartName`

### Methods inherited from class org.eclipse.ui.part.WorkbenchPart

`addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, getTitleToolTip, 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, getTitleToolTip, removePropertyListener`

## Constructor Details

### AbstractFXView

public AbstractFXView(Injector injector)
Constructs a new `AbstractFXView` that uses the given `Injector` to inject its members.

Parameters:
  `injector` - The `Injector` that is used to inject the members of this `AbstractFXView`.

## Method Details

### activate

protected void activate()
Activates this `AbstractFXView` by activating the `IDomain` that was previously injected.

### createActions

protected void createActions()
Create actions for this view and registers at the action bars of the view's site.

### createPartControl

public void createPartControl(Composite parent)

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

### deactivate

protected void deactivate()
Deactivates this `AbstractFXView` by deactivating its `IDomain` that was previously injected.

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

### getAdapter

public Object getAdapter(Class key)

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

### getCanvas

protected javafx.embed.swt.FXCanvas getCanvas()
Returns the `FXCanvas` that was previously created by the injected `IFXCanvasFactory`.

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

### getContentViewer

public IViewer getContentViewer()
Returns the `IViewer` of the `IDomain` that was previously injected.

Returns:
  The `IViewer` of the `IDomain` that was previously injected.

### getDomain

public IDomain getDomain()
Returns the `IDomain` that was previously injected.

Returns:
  The `IDomain` that was previously injected.

### getFitToViewportActionGroup

protected org.eclipse.gef.mvc.fx.ui.actions.FitToViewportActionGroup getFitToViewportActionGroup()
Returns the `ActionGroup` that manages the fit-to-viewport actions.

Returns:
  the `ActionGroup` that manages the fit-to-viewport actions.
Since:
  5.1

### hookViewers

protected void hookViewers()
Hooks all viewers that are part of this `AbstractFXView` into the `FXCanvas` that was previously created by the injected `IFXCanvasFactory`.

### init

public void init(IViewSite site) throws PartInitException

Specified by:
  `init` in interface `IViewPart`
Overrides:
  `init` in class `ViewPart`
Throws:
  `PartInitException`

### 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 `AbstractFXView`.