public class ChainElementEnabler extends Object implements ElementEnabler
A specialized implementation of the ElementEnabler interface that
maintains an arbitrary number of other ElementEnabler objects.
An instance of the class is initialized with a collection of other ElementEnabler objects. Its implementation of the
setEnabledState(ComponentBuilderData, boolean) method delegates to
all of these enablers. This is a natural way of combining ElementEnablers or building groups of them. For instance, it is possible to
create an ElementEnabler that manages a set of actions plus some
components.
| Constructor and Description |
|---|
ChainElementEnabler(Collection<ElementEnabler> children)
Creates a new instance of
ChainElementEnabler and initializes it
with the given collection of child ElementEnabler objects. |
| Modifier and Type | Method and Description |
|---|---|
Collection<ElementEnabler> |
getChildEnablers()
Returns a collection of the
ElementEnabler objects maintained by
this ChainElementEnabler. |
void |
setEnabledState(ComponentBuilderData compData,
boolean state)
Performs the change of the enabled state.
|
public ChainElementEnabler(Collection<ElementEnabler> children)
ChainElementEnabler and initializes it
with the given collection of child ElementEnabler objects. All
child enablers must not be null.children - a collection with the child ElementEnabler
objects (must not be null)IllegalArgumentException - if the collection of child enablers is
null or contains a null elementpublic Collection<ElementEnabler> getChildEnablers()
ElementEnabler objects maintained by
this ChainElementEnabler.ElementEnabler objectspublic void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
setElementState() method of all child ElementEnabler
objects.setEnabledState in interface ElementEnablercompData - the ComponentBuilderData instancestate - the new enabled stateFormBuilderException - if the wrapped ElementEnabler throws
an exceptionCopyright © 2016 The JGUIraffe Team. All rights reserved.