Package org.eclipse.gef.mvc.fx.models

# Class FocusModel

java.lang.Object
org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl<IViewer>
org.eclipse.gef.mvc.fx.models.FocusModel

All Implemented Interfaces:
  `IAdaptable.Bound<IViewer>`, `IDisposable`

public class FocusModel extends IAdaptable.Bound.Impl<IViewer> implements IDisposable
The `FocusModel` stores the `IContentPart` which has keyboard focus. Note that you are responsible for synchronizing keyboard focus with the model.

## Property Summary

Properties
Type
Property
Description
`javafx.beans.property.ObjectProperty<IContentPart<? extends javafx.scene.Node>>`
`focus`
Returns an object property providing the currently focused `IContentPart`.

### Properties inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

`adaptable`

## Nested Class Summary

## Nested classes/interfaces inherited from interface org.eclipse.gef.common.adapt.IAdaptable.Bound

`IAdaptable.Bound.Impl<T extends IAdaptable>`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`FOCUS_PROPERTY`
The `FocusModel` fires `PropertyChangeEvent`s when the focused part changes.

## Constructor Summary

Constructors
Constructor
Description
`FocusModel()`
Constructs a new `FocusModel`.

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
`javafx.beans.property.ObjectProperty<IContentPart<? extends javafx.scene.Node>>`
`focusProperty()`
Returns an object property providing the currently focused `IContentPart`.
`IContentPart<? extends javafx.scene.Node>`
`getFocus()`
Returns the `IContentPart` which has keyboard focus, or `null` if no `IContentPart` currently has keyboard focus.
`void`
`setAdaptable(IViewer adaptable)`
`void`
`setFocus(IContentPart<? extends javafx.scene.Node> focusPart)`
Selects the given IContentPart as the focus part.

### Methods inherited from class org.eclipse.gef.common.adapt.IAdaptable.Bound.Impl

`adaptableProperty, getAdaptable`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Property Details

### focus

public javafx.beans.property.ObjectProperty<IContentPart<? extends javafx.scene.Node>> focusProperty
Returns an object property providing the currently focused `IContentPart`.

See Also:
  - `getFocus()`
  - `setFocus(IContentPart)`

## Field Details

### FOCUS_PROPERTY

public static final String FOCUS_PROPERTY
The `FocusModel` fires `PropertyChangeEvent`s when the focused part changes. This is the name of the property that is delivered with the event.

See Also:
  - `setFocus(IContentPart)`
  - Constant Field Values

## Constructor Details

### FocusModel

public FocusModel()
Constructs a new `FocusModel`. The `focused` `IContentPart` is set to `null`.

## Method Details

### dispose

public void dispose()

Specified by:
  `dispose` in interface `IDisposable`
Since:
  1.1

### focusProperty

public javafx.beans.property.ObjectProperty<IContentPart<? extends javafx.scene.Node>> focusProperty()
Returns an object property providing the currently focused `IContentPart`.

See Also:
  - `getFocus()`
  - `setFocus(IContentPart)`

### getFocus

public IContentPart<? extends javafx.scene.Node> getFocus()
Returns the `IContentPart` which has keyboard focus, or `null` if no `IContentPart` currently has keyboard focus.

Returns:
  the IContentPart which has keyboard focus, or `null`

### setAdaptable

public void setAdaptable(IViewer adaptable)

Specified by:
  `setAdaptable` in interface `IAdaptable.Bound<IViewer>`
Overrides:
  `setAdaptable` in class `IAdaptable.Bound.Impl<IViewer>`

### setFocus

public void setFocus(IContentPart<? extends javafx.scene.Node> focusPart)
Selects the given IContentPart as the focus part. Note that setting the focus part does not assign keyboard focus to the part.

Parameters:
  `focusPart` - The `IContentPart` which should become the new focus part.