Package org.eclipse.gef.common.activate

# Class ActivatableSupport

java.lang.Object
org.eclipse.gef.common.activate.ActivatableSupport

public class ActivatableSupport extends Object
A support class to manage the activeProperty state for a source `IActivatable`. It offers all methods defined by `IActivatable`, while not formally implementing the interface, and can thus be used by a source `IActivatable` as a delegate.

## Property Summary

Properties
Type
Property
Description
`javafx.beans.property.ReadOnlyBooleanProperty`
`active`
Returns a `ReadOnlyBooleanProperty` that reflects the activeProperty state of this `ActivatableSupport`.

## Constructor Summary

Constructors
Constructor
Description
`ActivatableSupport(IActivatable source)`
Creates a new `ActivatableSupport` for the given source `IActivatable`.

## Method Summary

Modifier and Type
Method
Description
`void`
`activate(Runnable preActivationCallback, Runnable postActivationCallback)`
Activates this `ActivatableSupport` if it is not yet active.
`javafx.beans.property.ReadOnlyBooleanProperty`
`activeProperty()`
Returns a `ReadOnlyBooleanProperty` that reflects the activeProperty state of this `ActivatableSupport`.
`void`
`deactivate(Runnable preDeactivationCallback, Runnable postDeactivationCallback)`
Deactivates this `ActivatableSupport` if it is not yet inactive.
`boolean`
`isActive()`
Reports whether this `ActivatableSupport` is activeProperty or inactive.

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

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

## Property Details

### active

public javafx.beans.property.ReadOnlyBooleanProperty activeProperty
Returns a `ReadOnlyBooleanProperty` that reflects the activeProperty state of this `ActivatableSupport`.

See Also:
  - `isActive()`

## Constructor Details

### ActivatableSupport

public ActivatableSupport(IActivatable source)
Creates a new `ActivatableSupport` for the given source `IActivatable`.

Parameters:
  `source` - The `IActivatable` that encloses the to be created `ActivatableSupport`, delegating calls to it. May not be `null`

## Method Details

### activate

public void activate(Runnable preActivationCallback, Runnable postActivationCallback)
Activates this `ActivatableSupport` if it is not yet active.

Parameters:
  `preActivationCallback` - An optional callback that is executed before the active state is set.
  `postActivationCallback` - An optional callback that is executed after the active state has been set.
See Also:
  - `IActivatable.activate()`

### activeProperty

public javafx.beans.property.ReadOnlyBooleanProperty activeProperty()
Returns a `ReadOnlyBooleanProperty` that reflects the activeProperty state of this `ActivatableSupport`.

See Also:
  - `isActive()`

### deactivate

public void deactivate(Runnable preDeactivationCallback, Runnable postDeactivationCallback)
Deactivates this `ActivatableSupport` if it is not yet inactive.

Parameters:
  `preDeactivationCallback` - An optional callback that is executed before the active state is unset.
  `postDeactivationCallback` - An optional callback that is executed after the active state has been unset.
See Also:
  - `IActivatable.deactivate()`

### isActive

public boolean isActive()
Reports whether this `ActivatableSupport` is activeProperty or inactive.

Returns:
  `true` in case the `ActivatableSupport` is activeProperty, `false` otherwise.
See Also:
  - `IActivatable.isActive()`