public class ActionEnabler extends Object implements ElementEnabler
A specialized implementation of the ElementEnabler
interface that can
change the enabled state of actions.
An instance of this class is initialized with the name of the action it
should manipulate. The implementation of the setEnabledState()
method
obtains the action with this name from the BeanContext
managed by the
passed in ComponentBuilderData
object. (This will cause the action to
be searched in the current ActionStore
.) Then the action's enabled
state is set accordingly.
Constructor and Description |
---|
ActionEnabler(String actName)
Creates a new instance of
ActionEnabler and initializes it with
the name of the action to manipulate. |
Modifier and Type | Method and Description |
---|---|
String |
getActionName()
Returns the name of the action that is affected by this enabler.
|
void |
setEnabledState(ComponentBuilderData compData,
boolean state)
Performs the change of the enabled state.
|
public ActionEnabler(String actName)
ActionEnabler
and initializes it with
the name of the action to manipulate.actName
- the name of the action (must not be nullIllegalArgumentException
- if no action name is providedpublic String getActionName()
public void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
FormAction
specified by the name passed to the constructor. On this action setEnabled()
is invoked. If no action with this name can be found, an
exception is thrown.setEnabledState
in interface ElementEnabler
compData
- the ComponentBuilderData
instancestate
- the new enabled stateFormBuilderException
- if the action cannot be resolvedCopyright © 2016 The JGUIraffe Team. All rights reserved.