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 an ElementEnabler
is optional.
Modifier and Type | Field and Description |
---|---|
static NullEnabler |
INSTANCE
A constant for a default instance of this class.
|
Constructor and Description |
---|
NullEnabler() |
Modifier and Type | Method and Description |
---|---|
void |
setEnabledState(ComponentBuilderData compData,
boolean state)
Changes the enabled state of the element this
ElementEnabler is
responsible for. |
public static final NullEnabler INSTANCE
public void setEnabledState(ComponentBuilderData compData, boolean state) throws FormBuilderException
ElementEnabler
is
responsible for. This method is always called when the enabled state of
elements has to be changed. The passed in ComponentBuilderData
object can be used for accessing relevant elements; especially the
BeanContext
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 a FormBuilderException
. An empty dummy implementation of this interface method. It
does literally nothing.setEnabledState
in interface ElementEnabler
compData
- a reference to the current ComponentBuilderData
objectstate
- the new enabled state of the associated element: true
if the element is to be enabled, false if it should be
disabledFormBuilderException
- if the state of the element cannot be
changedCopyright © 2016 The JGUIraffe Team. All rights reserved.