public class ComponentEnabler extends Object implements ElementEnabler
A specialized implementation of the ElementEnabler interface that can
change the enabled state of components.
An instance of this class is initialized with the name of the component it is
associated with. The implementation of the setEnabledState() method
obtains the ComponentHandler object for this component from the
ComponentBuilderData instance and changes its enabled state.
| Constructor and Description |
|---|
ComponentEnabler(String compName)
Creates a new instance of
ComponentEnabler and initializes it
with the name of the component whose state is to be changed by this
enabler. |
| Modifier and Type | Method and Description |
|---|---|
String |
getComponentName()
Returns the name of the component whose state is changed by this enabler.
|
void |
setEnabledState(ComponentBuilderData compData,
boolean state)
Performs the change of the enabled state.
|
public ComponentEnabler(String compName)
ComponentEnabler and initializes it
with the name of the component whose state is to be changed by this
enabler.compName - the name of the component (must not be null)IllegalArgumentException - if no component name is specifiedpublic String getComponentName()
public void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
ComponentHandler. If no ComponentHandler can be found in the specified ComponentBuilderData object, a FormBuilderException is thrown.setEnabledState in interface ElementEnablercompData - the ComponentBuilderData instancestate - the new enabled stateFormBuilderException - if the ComponentHandler cannot be
obtainedCopyright © 2016 The JGUIraffe Team. All rights reserved.