to.etc.domui.dom.html
Class Checkbox

java.lang.Object
  extended by to.etc.domui.dom.css.CssBase
      extended by to.etc.domui.dom.html.NodeBase
          extended by to.etc.domui.dom.html.Checkbox
All Implemented Interfaces:
IModelBinding, IBindable, INodeErrorDelegate, IActionControl, IControl<java.lang.Boolean>, IDisplayControl<java.lang.Boolean>, IHasChangeListener, IHasModifiedIndication, IInputNode<java.lang.Boolean>

public class Checkbox
extends NodeBase
implements IInputNode<java.lang.Boolean>, IHasModifiedIndication


Constructor Summary
Checkbox()
           
 
Method Summary
 boolean acceptRequestParameter(java.lang.String[] values)
           
 IBinder bind()
          Return the binder for this control.
 IValueChanged<?> getOnValueChanged()
           
 java.lang.Boolean getValue()
          Returns the current value of this input component.
 java.lang.Boolean getValueSafe()
          Like IDisplayControl.getValue() this returns the value of the component, but this returns null if the value was invalid.
 boolean hasError()
          Return T if this node currently has an error associated with it.
 boolean isBound()
          Returns T if this control is bound to some data value.
 boolean isChecked()
           
 boolean isDisabled()
          Returns T if the control is currently in disabled.
 boolean isMandatory()
          Returns T if this control is a mandatory input.
 boolean isModified()
          Returns the modified-by-user flag.
 boolean isReadOnly()
          Checkboxes cannot be readonly; we make them disabled instead.
 void setChecked(boolean checked)
           
 void setDisabled(boolean disabled)
          Set the input to disabled mode.
 void setMandatory(boolean mandatory)
          Make the control mandatory.
 void setModified(boolean as)
          Set or clear the modified by user flag.
 void setOnValueChanged(IValueChanged<?> onValueChanged)
           
 void setReadOnly(boolean readOnly)
          Sets the input to readonly-mode.
 void setValue(java.lang.Boolean v)
          Set a new value into this control.
 void visit(INodeVisitor v)
          This must visit the appropriate method in the node visitor.
 
Methods inherited from class to.etc.domui.dom.html.NodeBase
$, addCssClass, addGlobalMessage, afterCreateContent, appendAfterMe, appendBeforeMe, appendCreateJS, appendJavascript, build, changed, clearFocusRequested, clearGlobalMessage, clearGlobalMessage, clearGlobalMessage, clearMessage, componentHandleWebAction, createContent, findComponentBundle, forceRebuild, getActualID, getClicked, getComponentBundle, getCreateJS, getCssClass, getErrorDelegate, getErrorLocation, getMessage, getOnClickJS, getOnMouseDownJS, getPage, getParent, getParent, getParent, getSharedContext, getSpecialAttribute, getSpecialAttributeList, getTag, getTestID, getTitle, getUserObject, handleDrop, hasCssClass, internalClearDelta, internalClearDeltaFully, internalGetOldParent, internalHasChangedAttributes, internalNeedClickHandler, internalOnClicked, internalSetHasChangedAttributes, internalSetHasChangedAttributes, internalSetTag, internalShelve, internalUnshelve, isBuilt, isFocusRequested, moveControlToModel, moveModelToControl, onAddedToPage, onBeforeFullRender, onForceRebuild, onHeaderContributors, onRefresh, onRemoveFromPage, onShelve, onUnshelve, refresh, remove, removeCssClass, renderJavascriptState, replaceWith, setClicked, setComponentBundle, setControlsEnabled, setCssClass, setErrorDelegate, setErrorLocation, setFocus, setMessage, setOnClickJS, setOnMouseDownJS, setSpecialAttribute, setTestID, setTitle, setUserObject, stretchHeight, toString
 
Methods inherited from class to.etc.domui.dom.css.CssBase
getBackgroundAttachment, getBackgroundColor, getBackgroundImage, getBackgroundPosition, getBackgroundRepeat, getBorderBottomColor, getBorderBottomStyle, getBorderBottomWidth, getBorderLeftColor, getBorderLeftStyle, getBorderLeftWidth, getBorderRightColor, getBorderRightStyle, getBorderRightWidth, getBorderTopColor, getBorderTopStyle, getBorderTopWidth, getBottom, getCachedStyle, getClear, getColor, getDisplay, getFloat, getFontFamily, getFontSize, getFontSizeAdjust, getFontStyle, getFontVariant, getFontWeight, getHeight, getLeft, getLineHeight, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOverflow, getPosition, getRight, getTextAlign, getTop, getTransform, getVerticalAlign, getVisibility, getWidth, getZIndex, internalSetDisplay, setBackgroundAttachment, setBackgroundColor, setBackgroundImage, setBackgroundPosition, setBackgroundRepeat, setBorder, setBorder, setBorderBottomColor, setBorderBottomStyle, setBorderBottomWidth, setBorderColor, setBorderLeftColor, setBorderLeftStyle, setBorderLeftWidth, setBorderRightColor, setBorderRightStyle, setBorderRightWidth, setBorderStyle, setBorderTopColor, setBorderTopStyle, setBorderTopWidth, setBorderWidth, setBottom, setBottom, setCachedStyle, setClear, setColor, setDisplay, setFloat, setFontFamily, setFontSize, setFontSizeAdjust, setFontStyle, setFontVariant, setFontWeight, setHeight, setLeft, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPosition, setRight, setRight, setTextAlign, setTop, setTop, setTransform, setVerticalAlign, setVisibility, setWidth, setZIndex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface to.etc.domui.dom.html.IControl
getErrorLocation, setErrorLocation
 
Methods inherited from interface to.etc.domui.dom.html.IDisplayControl
setTestID
 
Methods inherited from interface to.etc.domui.dom.html.IActionControl
setTestID
 
Methods inherited from interface to.etc.domui.dom.errors.INodeErrorDelegate
clearMessage, getMessage, setMessage
 

Constructor Detail

Checkbox

public Checkbox()
Method Detail

visit

public void visit(INodeVisitor v)
           throws java.lang.Exception
Description copied from class: NodeBase
This must visit the appropriate method in the node visitor. It should NOT recurse it's children.

Specified by:
visit in class NodeBase
Throws:
java.lang.Exception

isChecked

public boolean isChecked()

setChecked

public void setChecked(boolean checked)

isDisabled

public boolean isDisabled()
Description copied from interface: IControl
Returns T if the control is currently in disabled. Controls that do not have a readonly ability (comboboxes) will use disabled as the readonly state. For those controls the readonly state mirrors the disabled state.

Specified by:
isDisabled in interface IControl<java.lang.Boolean>
Returns:

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: IActionControl
Set the input to disabled mode.

Specified by:
setDisabled in interface IActionControl

isReadOnly

public boolean isReadOnly()
Checkboxes cannot be readonly; we make them disabled instead.

Specified by:
isReadOnly in interface IControl<java.lang.Boolean>
Returns:
See Also:
IControl.isReadOnly()

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: IControl
Sets the input to readonly-mode. Components that do not implement readonly mode (comboboxes) will usually set themselves to disabled which works much the same.

Specified by:
setReadOnly in interface IControl<java.lang.Boolean>

acceptRequestParameter

public boolean acceptRequestParameter(java.lang.String[] values)
Overrides:
acceptRequestParameter in class NodeBase

getValue

public java.lang.Boolean getValue()
Description copied from interface: IDisplayControl
Returns the current value of this input component. If the component contains no value this returns null. All text input components will return null when their value is the empty string! If the component, during conversion or validation of the input value, discovers that the input is invalid it will set itself in "error" mode, post an error message up the form, and throw a ValidationException. This means that this call either delivers correct input (as defined by it's converter and validators), null (when empty) or throws an exception. When a ValidationException occurs the framework mostly ignores it - it does not produce a stacktrace or error in the client. Instead the resulting error as posted by the error handling framework gets displayed on the form when the request completes.

To get the value of a component while ignoring exceptions call #getValueSafe().

Specified by:
getValue in interface IDisplayControl<java.lang.Boolean>
Returns:
See Also:
IDisplayControl.getValue()

setValue

public void setValue(java.lang.Boolean v)
Description copied from interface: IDisplayControl
Set a new value into this control. Setting a value to null means the control holds no value. This value is converted to a presentable form using any (implicitly) defined converters; it will not be validated though! This means that if you set an invalid value for a validator this will not be seen until the value is gotten from the control again.

Specified by:
setValue in interface IDisplayControl<java.lang.Boolean>
See Also:
IDisplayControl.setValue(java.lang.Object)

getValueSafe

public java.lang.Boolean getValueSafe()
Description copied from interface: IControl
Like IDisplayControl.getValue() this returns the value of the component, but this returns null if the value was invalid. For this method NULL either means the value was invalid OR it's content was empty. To distinguish between the two call IControl.hasError() or use IDisplayControl.getValue() instead of this call.

Specified by:
getValueSafe in interface IControl<java.lang.Boolean>
Returns:
See Also:
IControl.getValueSafe()

hasError

public boolean hasError()
Description copied from class: NodeBase
Return T if this node currently has an error associated with it.

Specified by:
hasError in interface IControl<java.lang.Boolean>
Overrides:
hasError in class NodeBase
Returns:
See Also:
IControl.hasError()

isMandatory

public boolean isMandatory()
Description copied from interface: IControl
Returns T if this control is a mandatory input.

Specified by:
isMandatory in interface IControl<java.lang.Boolean>
Returns:

setMandatory

public void setMandatory(boolean mandatory)
Description copied from interface: IControl
Make the control mandatory.

Specified by:
setMandatory in interface IControl<java.lang.Boolean>

getOnValueChanged

public IValueChanged<?> getOnValueChanged()
Specified by:
getOnValueChanged in interface IHasChangeListener
See Also:
IHasChangeListener.getOnValueChanged()

setOnValueChanged

public void setOnValueChanged(IValueChanged<?> onValueChanged)
Specified by:
setOnValueChanged in interface IHasChangeListener
See Also:
IHasChangeListener.setOnValueChanged(to.etc.domui.dom.html.IValueChanged)

isModified

public boolean isModified()
Returns the modified-by-user flag.

Specified by:
isModified in interface IHasModifiedIndication
See Also:
IHasModifiedIndication.isModified()

setModified

public void setModified(boolean as)
Set or clear the modified by user flag.

Specified by:
setModified in interface IHasModifiedIndication
See Also:
IHasModifiedIndication.setModified(boolean)

bind

public IBinder bind()
Return the binder for this control.

Specified by:
bind in interface IBindable
Returns:
See Also:
IBindable.bind()

isBound

public boolean isBound()
Returns T if this control is bound to some data value.

Specified by:
isBound in interface IBindable
Returns:
See Also:
IBindable.isBound()