public abstract class ActionsProviderSupport extends ActionsProvider
ActionsProvider
implementation. You should implement
ActionsProviderSupport.doAction(java.lang.Object)
and ActionsProvider.getActions()
only, and call ActionsProviderSupport.setEnabled(java.lang.Object, boolean)
when the action state is changed.ActionsProvider.Registration, ActionsProvider.Registrations
Constructor and Description |
---|
ActionsProviderSupport() |
Modifier and Type | Method and Description |
---|---|
void |
addActionsProviderListener(ActionsProviderListener l)
Adds property change listener.
|
abstract void |
doAction(Object action)
Called when the action is called (action button is pressed).
|
protected void |
fireActionStateChanged(Object action,
boolean enabled)
Fires a change of action state.
|
boolean |
isEnabled(Object action)
Returns a state of given action defined by
ActionsProviderSupport.setEnabled(java.lang.Object, boolean)
method call. |
void |
removeActionsProviderListener(ActionsProviderListener l)
Removes property change listener.
|
protected void |
setEnabled(Object action,
boolean enabled)
Sets state of enabled property.
|
getActions, postAction
public abstract void doAction(Object action)
doAction
in class ActionsProvider
action
- an action which has been calledpublic boolean isEnabled(Object action)
ActionsProviderSupport.setEnabled(java.lang.Object, boolean)
method call.
Do not override. Should be final - the enabled state is cached,
therefore this method is not consulted unless the state change
is fired.isEnabled
in class ActionsProvider
action
- actionprotected final void setEnabled(Object action, boolean enabled)
action
- action whose state should be changedenabled
- the new stateprotected void fireActionStateChanged(Object action, boolean enabled)
action
- action whose state has been changedenabled
- the new statepublic final void addActionsProviderListener(ActionsProviderListener l)
addActionsProviderListener
in class ActionsProvider
l
- new listener.public final void removeActionsProviderListener(ActionsProviderListener l)
removeActionsProviderListener
in class ActionsProvider
l
- removed listener.