org.zkoss.zul
Class Checkbox

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.impl.LabelElement
                  extended by org.zkoss.zul.impl.LabelImageElement
                      extended by org.zkoss.zul.Checkbox
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
Radio

public class Checkbox
extends LabelImageElement

A checkbox.

Event:

  1. org.zkoss.zk.ui.event.CheckEvent is sent when a checkbox is checked or unchecked by user.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Checkbox.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
Checkbox()
           
Checkbox(java.lang.String label)
           
Checkbox(java.lang.String label, java.lang.String image)
           
 
Method Summary
 java.lang.String getInnerAttrs()
          Appends interior attributes for generating the HTML checkbox tag (the name, disabled and other attribute).
 java.lang.String getLabelAttrs()
          Returns the attributes used by the embedded HTML LABEL tag.
 java.lang.String getName()
          Returns the name of this component.
 java.lang.String getOuterAttrs()
          Appends exterior attributes for generating the HTML span tag (the event relevant attribute).
 int getTabindex()
          Returns the tab order of this component.
 boolean isChecked()
          Returns whether it is checked.
 boolean isDisabled()
          Returns whether it is disabled.
 boolean isReadonly()
          Deprecated.  
protected  java.lang.Object newExtraCtrl()
           
 void setChecked(boolean checked)
          Sets whether it is checked.
 void setDisabled(boolean disabled)
          Sets whether it is disabled.
 void setName(java.lang.String name)
          Sets the name of this component.
 void setReadonly(boolean readonly)
          Deprecated.  
 void setTabindex(int tabindex)
          Sets the tab order of this component.
 
Methods inherited from class org.zkoss.zul.impl.LabelImageElement
getImage, getImageContent, getImgTag, getSrc, isImageAssigned, setImage, setImageContent, setSrc
 
Methods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabel
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Checkbox

public Checkbox()

Checkbox

public Checkbox(java.lang.String label)

Checkbox

public Checkbox(java.lang.String label,
                java.lang.String image)
Method Detail

isDisabled

public boolean isDisabled()
Returns whether it is disabled.

Default: false.


setDisabled

public void setDisabled(boolean disabled)
Sets whether it is disabled.


isChecked

public boolean isChecked()
Returns whether it is checked.

Default: false.


setChecked

public void setChecked(boolean checked)
Sets whether it is checked.


isReadonly

public boolean isReadonly()
Deprecated. 

Returns whether it is readonly.

Default: false.

It is deprecated since no real effect. See w3.org


setReadonly

public void setReadonly(boolean readonly)
Deprecated. 

Sets whether it is readonly.

It is deprecated since no real effect. See w3.org


getName

public java.lang.String getName()
Returns the name of this component.

Default: null.

Don't use this method if your application is purely based on ZK's event-driven model.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.


setName

public void setName(java.lang.String name)
Sets the name of this component.

Don't use this method if your application is purely based on ZK's event-driven model.

The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.

Parameters:
name - the name of this component.

getTabindex

public int getTabindex()
Returns the tab order of this component.

Default: -1 (means the same as browser's default).


setTabindex

public void setTabindex(int tabindex)
                 throws org.zkoss.zk.ui.WrongValueException
Sets the tab order of this component.

Throws:
org.zkoss.zk.ui.WrongValueException

getLabelAttrs

public java.lang.String getLabelAttrs()
Returns the attributes used by the embedded HTML LABEL tag. It returns text-relevant styles only.

Used only by component developer.


getInnerAttrs

public java.lang.String getInnerAttrs()
Appends interior attributes for generating the HTML checkbox tag (the name, disabled and other attribute).

Used only by component developers.

Overrides:
getInnerAttrs in class XulElement

getOuterAttrs

public java.lang.String getOuterAttrs()
Appends exterior attributes for generating the HTML span tag (the event relevant attribute).

Used only by component developers.

Overrides:
getOuterAttrs in class XulElement

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class LabelImageElement


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.