public interface IActivatable extends IPropertyChangeNotifier
IActivatable represents an entity that can be activated (
activate()) and deactivated (deactivate()) as required.
The current activation state of an IActivatable (whether the entity
is active or not) can be queried by clients (isActive()), and it is
expected that an IActivatable notifies registered
PropertyChangeListeners about changes of its activation state by
means of PropertyChangeEvents, using the property name
"active".
Any client implementing this interface may internally use an
ActivatableSupport as a delegate to easily realize the required
functionality.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTIVE_PROPERTY
A key used as
PropertyChangeEvent.getPropertyName() when
notifying about changes of the activation state. |
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activates the
IActivatable. |
void |
deactivate()
Deactivates the
IActivatable. |
boolean |
isActive()
Reports whether this
IActivatable is active or inactive. |
addPropertyChangeListener, removePropertyChangeListenerstatic final java.lang.String ACTIVE_PROPERTY
PropertyChangeEvent.getPropertyName() when
notifying about changes of the activation state.void activate()
IActivatable. It is expected that a call to
isActive() returns true after this method
has been called (unless deactivate() is called to deactivate the
IActivatable), and that a PropertyChangeEvent notifying
about an activation change is send to all registered
PropertyChangeListeners, if the activation state actually
changed, i.e. the IActivatable was not active before.void deactivate()
IActivatable. It is expected that a call to
isActive() return false after this method
has been called (unless {activate() is called to re-activate the
IAdaptable, and that a PropertyChangeEvent notifying
about an activation change is send to all registered
PropertyChangeListeners, if the activation state actually
changed, i.e. the IActivatable was active before.boolean isActive()
IActivatable is active or inactive.true in case the IActivatable is active,
false otherwise.Copyright (c) 2014 itemis AG and others. All rights reserved.