Package org.eclipse.gef.common.activate
Class ActivatableSupport
- java.lang.Object
-
- org.eclipse.gef.common.activate.ActivatableSupport
-
public class ActivatableSupport extends java.lang.Object
A support class to manage the activeProperty state for a sourceIActivatable
. It offers all methods defined byIActivatable
, while not formally implementing the interface, and can thus be used by a sourceIActivatable
as a delegate.
-
-
Constructor Summary
Constructors Constructor Description ActivatableSupport(IActivatable source)
Creates a newActivatableSupport
for the given sourceIActivatable
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(java.lang.Runnable preActivationCallback, java.lang.Runnable postActivationCallback)
Activates thisActivatableSupport
if it is not yet active.javafx.beans.property.ReadOnlyBooleanProperty
activeProperty()
Returns aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
.void
deactivate(java.lang.Runnable preDeactivationCallback, java.lang.Runnable postDeactivationCallback)
Deactivates thisActivatableSupport
if it is not yet inactive.boolean
isActive()
Reports whether thisActivatableSupport
is activeProperty or inactive.
-
-
-
Constructor Detail
-
ActivatableSupport
public ActivatableSupport(IActivatable source)
Creates a newActivatableSupport
for the given sourceIActivatable
.- Parameters:
source
- TheIActivatable
that encloses the to be createdActivatableSupport
, delegating calls to it. May not benull
-
-
Method Detail
-
activate
public void activate(java.lang.Runnable preActivationCallback, java.lang.Runnable postActivationCallback)
Activates thisActivatableSupport
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 aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
.- Returns:
- A read-only boolean
Property
representing the activeProperty state.
-
deactivate
public void deactivate(java.lang.Runnable preDeactivationCallback, java.lang.Runnable postDeactivationCallback)
Deactivates thisActivatableSupport
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 thisActivatableSupport
is activeProperty or inactive.- Returns:
true
in case theActivatableSupport
is activeProperty,false
otherwise.- See Also:
IActivatable.isActive()
-
-