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
ElementEnablerinterface 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 anElementEnableris 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 NullEnablerINSTANCEA 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 voidsetEnabledState(ComponentBuilderData compData, boolean state)Changes the enabled state of the element thisElementEnableris 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 thisElementEnableris responsible for. This method is always called when the enabled state of elements has to be changed. The passed inComponentBuilderDataobject can be used for accessing relevant elements; especially theBeanContextmaintained 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:
setEnabledStatein interfaceElementEnabler- Parameters:
compData- a reference to the currentComponentBuilderDataobjectstate- 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
-
-