Class ChainElementEnabler
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.enablers.ChainElementEnabler
-
- All Implemented Interfaces:
ElementEnabler
public class ChainElementEnabler extends Object implements ElementEnabler
A specialized implementation of the
ElementEnablerinterface that maintains an arbitrary number of otherElementEnablerobjects.An instance of the class is initialized with a collection of other
ElementEnablerobjects. Its implementation of thesetEnabledState(ComponentBuilderData, boolean)method delegates to all of these enablers. This is a natural way of combiningElementEnablers or building groups of them. For instance, it is possible to create anElementEnablerthat manages a set of actions plus some components.- Version:
- $Id: ChainElementEnabler.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Constructor Summary
Constructors Constructor Description ChainElementEnabler(Collection<ElementEnabler> children)Creates a new instance ofChainElementEnablerand initializes it with the given collection of childElementEnablerobjects.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<ElementEnabler>getChildEnablers()Returns a collection of theElementEnablerobjects maintained by thisChainElementEnabler.voidsetEnabledState(ComponentBuilderData compData, boolean state)Performs the change of the enabled state.
-
-
-
Constructor Detail
-
ChainElementEnabler
public ChainElementEnabler(Collection<ElementEnabler> children)
Creates a new instance ofChainElementEnablerand initializes it with the given collection of childElementEnablerobjects. All child enablers must not be null.- Parameters:
children- a collection with the childElementEnablerobjects (must not be null)- Throws:
IllegalArgumentException- if the collection of child enablers is null or contains a null element
-
-
Method Detail
-
getChildEnablers
public Collection<ElementEnabler> getChildEnablers()
Returns a collection of theElementEnablerobjects maintained by thisChainElementEnabler.- Returns:
- a collection of the child
ElementEnablerobjects
-
setEnabledState
public void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
Performs the change of the enabled state. This implementation calls thesetElementState()method of all childElementEnablerobjects.- Specified by:
setEnabledStatein interfaceElementEnabler- Parameters:
compData- theComponentBuilderDatainstancestate- the new enabled state- Throws:
FormBuilderException- if the wrappedElementEnablerthrows an exception
-
-