org.zkoss.zul
Class Listitem

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.Listitem
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl

public class Listitem
extends XulElement

A list item.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
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
Listitem()
           
Listitem(java.lang.String label)
           
Listitem(java.lang.String label, java.lang.Object value)
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getImage()
          Returns the image of the Listcell it contains.
 int getIndex()
          Returns the index of this item (aka., the order in the listbox).
 java.lang.String getLabel()
          Returns the label of the Listcell it contains, or null if no such cell.
 Listbox getListbox()
          Returns the list box that it belongs to.
 int getMaxlength()
          Returns the maximal length of each item's label.
 java.lang.String getOuterAttrs()
           
 java.lang.String getSclass()
          Returns the style class.
 java.lang.String getSrc()
          Returns the src of the Listcell it contains, or null if no such cell.
 java.lang.Object getValue()
          Returns the value.
 boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
           
 void invalidate()
           
 boolean isDisabled()
          Returns whether it is disabled.
 boolean isSelected()
          Returns whether it is selected.
 void onChildAdded(org.zkoss.zk.ui.Component child)
           
 void onChildRemoved(org.zkoss.zk.ui.Component child)
           
 void setDisabled(boolean disabled)
          Sets whether it is disabled.
 void setImage(java.lang.String image)
          Sets the image of the Listcell it contains.
 void setLabel(java.lang.String label)
          Sets the label of the Listcell it contains.
 void setParent(org.zkoss.zk.ui.Component parent)
           
 void setSelected(boolean selected)
          Sets whether it is selected.
 void setSrc(java.lang.String src)
          Sets the src of the Listcell it contains.
 void setValue(java.lang.Object value)
          Sets the value.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, newExtraCtrl, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, appendChild, applyProperties, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDesktop, getExtraCtrl, getFellow, getFellowIfAny, getId, getInitParam, getIntInitParam, getListenerIterator, getMilieu, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, isChildable, isListenerAvailable, isVisible, onDrawNewChild, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setId, setMilieu, setMold, setPage, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Listitem

public Listitem()

Listitem

public Listitem(java.lang.String label)

Listitem

public Listitem(java.lang.String label,
                java.lang.Object value)
Method Detail

getListbox

public Listbox getListbox()
Returns the list box that it belongs to.


getMaxlength

public int getMaxlength()
Returns the maximal length of each item's label. It is a shortcut of getParent().getMaxlength(); Thus, it works only if the listbox's mold is "select".


getValue

public java.lang.Object getValue()
Returns the value.

Default: null.

Note: the value is application dependent, you can place whatever value you want.

If you are using listitem with HTML Form (and with the name attribute), it is better to specify a String-typed value.


setValue

public void setValue(java.lang.Object value)
Sets the value.

Parameters:
value - the value.

Note: the value is application dependent, you can place whatever value you want.

If you are using listitem with HTML Form (and with the name attribute), it is better to specify a String-typed value.


isDisabled

public final boolean isDisabled()
Returns whether it is disabled.

Default: false.


setDisabled

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


isSelected

public boolean isSelected()
Returns whether it is selected.

Default: false.


setSelected

public void setSelected(boolean selected)
Sets whether it is selected.


getLabel

public java.lang.String getLabel()
Returns the label of the Listcell it contains, or null if no such cell.


setLabel

public void setLabel(java.lang.String label)
Sets the label of the Listcell it contains.

If it is not created, we automatically create it.


getSrc

public java.lang.String getSrc()
Returns the src of the Listcell it contains, or null if no such cell.


setSrc

public void setSrc(java.lang.String src)
Sets the src of the Listcell it contains.

If it is not created, we automatically create it.

The same as setImage(java.lang.String).


getImage

public java.lang.String getImage()
Returns the image of the Listcell it contains.

The same as getImage().


setImage

public void setImage(java.lang.String image)
Sets the image of the Listcell it contains.

If it is not created, we automatically create it.

The same as setSrc(java.lang.String).


getIndex

public final int getIndex()
Returns the index of this item (aka., the order in the listbox).


getSclass

public java.lang.String getSclass()
Returns the style class. Note: 1) if not set (or setSclass(null), "item" is assumed; 2) if selected, it appends "sel" to super's getSclass().

Overrides:
getSclass in class org.zkoss.zk.ui.HtmlBasedComponent

setParent

public void setParent(org.zkoss.zk.ui.Component parent)
Specified by:
setParent in interface org.zkoss.zk.ui.Component
Overrides:
setParent in class org.zkoss.zk.ui.AbstractComponent

insertBefore

public boolean insertBefore(org.zkoss.zk.ui.Component child,
                            org.zkoss.zk.ui.Component insertBefore)
Specified by:
insertBefore in interface org.zkoss.zk.ui.Component
Overrides:
insertBefore in class org.zkoss.zk.ui.AbstractComponent

invalidate

public void invalidate()
Specified by:
invalidate in interface org.zkoss.zk.ui.Component
Overrides:
invalidate in class org.zkoss.zk.ui.AbstractComponent

onChildAdded

public void onChildAdded(org.zkoss.zk.ui.Component child)
Specified by:
onChildAdded in interface org.zkoss.zk.ui.Component
Overrides:
onChildAdded in class org.zkoss.zk.ui.AbstractComponent

onChildRemoved

public void onChildRemoved(org.zkoss.zk.ui.Component child)
Specified by:
onChildRemoved in interface org.zkoss.zk.ui.Component
Overrides:
onChildRemoved in class org.zkoss.zk.ui.AbstractComponent

getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class XulElement

clone

public java.lang.Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class org.zkoss.zk.ui.AbstractComponent


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