Package org.eclipse.gef.common.activate
Class ActivatableSupport
java.lang.Object
org.eclipse.gef.common.activate.ActivatableSupport
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
TypePropertyDescriptionReturns aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
. -
Constructor Summary
ConstructorDescriptionActivatableSupport
(IActivatable source) Creates a newActivatableSupport
for the given sourceIActivatable
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Activates thisActivatableSupport
if it is not yet active.Returns aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
.void
deactivate
(Runnable preDeactivationCallback, Runnable postDeactivationCallback) Deactivates thisActivatableSupport
if it is not yet inactive.boolean
isActive()
Reports whether thisActivatableSupport
is activeProperty or inactive.
-
Property Details
-
active
Returns aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
.- See Also:
-
-
Constructor Details
-
ActivatableSupport
Creates a newActivatableSupport
for the given sourceIActivatable
.- Parameters:
source
- TheIActivatable
that encloses the to be createdActivatableSupport
, delegating calls to it. May not benull
-
-
Method Details
-
activate
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:
-
activeProperty
Returns aReadOnlyBooleanProperty
that reflects the activeProperty state of thisActivatableSupport
.- See Also:
-
deactivate
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:
-
isActive
public boolean isActive()Reports whether thisActivatableSupport
is activeProperty or inactive.- Returns:
true
in case theActivatableSupport
is activeProperty,false
otherwise.- See Also:
-