Class NullEnabler
- java.lang.Object
-
- net.sf.jguiraffe.gui.builder.enablers.NullEnabler
-
- All Implemented Interfaces:
ElementEnabler
public class NullEnabler extends Object implements ElementEnabler
A trivial implementation of the
ElementEnabler
interface that does nothing.This class provides an empty dummy implementation of the
setEnabledState()
method. It can be used as an application of the null object pattern where anElementEnabler
is optional.- Version:
- $Id: NullEnabler.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Field Summary
Fields Modifier and Type Field Description static NullEnabler
INSTANCE
A constant for a default instance of this class.
-
Constructor Summary
Constructors Constructor Description NullEnabler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setEnabledState(ComponentBuilderData compData, boolean state)
Changes the enabled state of the element thisElementEnabler
is responsible for.
-
-
-
Field Detail
-
INSTANCE
public static final NullEnabler INSTANCE
A constant for a default instance of this class.
-
-
Method Detail
-
setEnabledState
public void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
Changes the enabled state of the element thisElementEnabler
is responsible for. This method is always called when the enabled state of elements has to be changed. The passed inComponentBuilderData
object can be used for accessing relevant elements; especially theBeanContext
maintained by this object can be used for retrieving all objects available in the current builder context. The boolean argument determines whether the associated element should be enabled or disabled. If the state of the element cannot be changed - for whatever reason -, an implementation should throw aFormBuilderException
. An empty dummy implementation of this interface method. It does literally nothing.- Specified by:
setEnabledState
in interfaceElementEnabler
- Parameters:
compData
- a reference to the currentComponentBuilderData
objectstate
- the new enabled state of the associated element: true if the element is to be enabled, false if it should be disabled- Throws:
FormBuilderException
- if the state of the element cannot be changed
-
-