org.zkoss.zul.api
Interface Treeitem

All Superinterfaces:
java.lang.Cloneable, Component, Disable, HtmlBasedComponent, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Treeitem

public interface Treeitem
extends XulElement, Disable

A treeitem.

Event:

  1. onOpen is sent when a tree item is opened or closed by user.
  2. onDoubleClick is sent when user double-clicks the treeitem.
  3. onRightClick is sent when user right-clicks the treeitem.

Since:
3.5.2
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 java.lang.String getImage()
          Returns the image of the Treecell it contains.
 java.lang.String getLabel()
          Returns the label of the Treecell it contains, or null if no such cell.
 int getLevel()
          Returns the level this cell is.
 Treeitem getParentItemApi()
          Returns the parent tree item, or null if this item is already the top level of the tree.
 Tree getTreeApi()
          Returns the tree owning this item.
 Treechildren getTreechildrenApi()
          Returns the treechildren that this tree item owns, or null if doesn't have any child.
 Treerow getTreerowApi()
          Returns the treerow that this tree item owns (might null).
 java.lang.Object getValue()
          Returns the value.
 int indexOf()
          return the index of this container
 boolean isCheckable()
          Returns whether it is checkable.
 boolean isContainer()
          Returns whether the element is to act as a container which can have child elements.
 boolean isDisabled()
          Returns whether it is disabled.
 boolean isEmpty()
          Returns whether this element contains no child elements.
 boolean isLoaded()
          Return true whether all children of this tree item, if any, is loaded
 boolean isOpen()
          Returns whether this container is open.
 boolean isSelected()
          Returns whether this item is selected.
 void setCheckable(boolean checkable)
          Sets whether it is checkable.
 void setDisabled(boolean disabled)
          Sets whether it is disabled.
 void setImage(java.lang.String image)
          Sets the image of the Treecell it contains.
 void setLabel(java.lang.String label)
          Sets the label of the Treecell it contains.
 void setOpen(boolean open)
          Sets whether this container is open.
 void setSelected(boolean selected)
          Returns whether this item is selected.
 void setValue(java.lang.Object value)
          Sets the value.
 void unload()
          Unload the tree item To load the tree item, with Tree.renderItemApi(Treeitem), Tree.renderItemApi(Treeitem, Object), or Tree.renderItems(java.util.Set)
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

isCheckable

boolean isCheckable()
Returns whether it is checkable.

Default: true.


setCheckable

void setCheckable(boolean checkable)
Sets whether it is checkable.

Default: true.


unload

void unload()
Unload the tree item

To load the tree item, with Tree.renderItemApi(Treeitem), Tree.renderItemApi(Treeitem, Object), or Tree.renderItems(java.util.Set)


setDisabled

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

Specified by:
setDisabled in interface Disable

isDisabled

boolean isDisabled()
Returns whether it is disabled.

Default: false.

Specified by:
isDisabled in interface Disable

isLoaded

boolean isLoaded()
Return true whether all children of this tree item, if any, is loaded

Returns:
true whether all children of this tree item is loaded

indexOf

int indexOf()
return the index of this container

Returns:
the index of this container

getTreerowApi

Treerow getTreerowApi()
Returns the treerow that this tree item owns (might null). Each tree items has exactly one tree row.


getTreechildrenApi

Treechildren getTreechildrenApi()
Returns the treechildren that this tree item owns, or null if doesn't have any child.


isContainer

boolean isContainer()
Returns whether the element is to act as a container which can have child elements.


isEmpty

boolean isEmpty()
Returns whether this element contains no child elements.


getValue

java.lang.Object getValue()
Returns the value. It could be anything you want.

Default: null.

Note: the value is not sent to the browser, so it is OK to be anything.


setValue

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

Parameters:
value - the value. Note: the value is not sent to the browser, so it is OK to be anything.

isOpen

boolean isOpen()
Returns whether this container is open.

Default: true.


setOpen

void setOpen(boolean open)
Sets whether this container is open.


isSelected

boolean isSelected()
Returns whether this item is selected.


setSelected

void setSelected(boolean selected)
Returns whether this item is selected.


getLevel

int getLevel()
Returns the level this cell is. The root is level 0.


getLabel

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


setLabel

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

If it is not created, we automatically create it.


getImage

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


setImage

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

If it is not created, we automatically create it.


getParentItemApi

Treeitem getParentItemApi()
Returns the parent tree item, or null if this item is already the top level of the tree. The parent tree item is actually the grandparent if any.


getTreeApi

Tree getTreeApi()
Returns the tree owning this item.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo