|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Tree
public class Tree
A container which can be used to hold a tabular or hierarchical set of rows of elements.
Event:
Default HtmlBasedComponent.getSclass(): tree.
| Nested Class Summary | |
|---|---|
protected class |
Tree.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 | |
|---|---|
Tree()
|
|
| Method Summary | |
|---|---|
void |
addItemToSelection(Treeitem item)
Selects the given item, without deselecting any other items that are already selected.. |
void |
clear()
Clears all child tree items ( Treeitem. |
void |
clearSelection()
Clears the selection. |
java.lang.Object |
clone()
|
int |
getItemCount()
Returns the number of child Treeitem. |
java.util.Collection |
getItems()
Returns a readonly list of all descending Treeitem
(children's children and so on). |
java.lang.String |
getName()
Returns the name of this component. |
java.lang.String |
getOuterAttrs()
|
int |
getPageSize()
Returns the page size that is used by all Treechildren
to display a portion of their child Treeitem,
or -1 if no limitation. |
int |
getRows()
Returns the rows. |
int |
getSelectedCount()
Returns the number of items being selected. |
Treeitem |
getSelectedItem()
Returns the selected item. |
java.util.Set |
getSelectedItems()
Returns all selected items. |
java.lang.String |
getSeltype()
Returns the seltype. |
Treechildren |
getTreechildren()
Returns the treechildren that this tree owns (might null). |
Treecols |
getTreecols()
Returns the treecols that this tree owns (might null). |
Treefoot |
getTreefoot()
Returns the treefoot that this tree owns (might null). |
boolean |
insertBefore(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component refChild)
|
boolean |
isCheckmark()
Returns whether the check mark shall be displayed in front of each item. |
boolean |
isMultiple()
Returns whether multiple selections are allowed. |
boolean |
isVflex()
Returns whether to grow and shrink vertical to fit their given space, so called vertial flexibility. |
protected java.lang.Object |
newExtraCtrl()
|
void |
onChildAdded(org.zkoss.zk.ui.Component child)
|
void |
onChildRemoved(org.zkoss.zk.ui.Component child)
|
void |
removeItemFromSelection(Treeitem item)
Deselects the given item without deselecting other items. |
void |
selectAll()
Selects all items. |
void |
selectItem(Treeitem item)
Deselects all of the currently selected items and selects the given item. |
void |
setCheckmark(boolean checkmark)
Sets whether the check mark shall be displayed in front of each item. |
void |
setHeight(java.lang.String height)
|
void |
setMultiple(boolean multiple)
Sets whether multiple selections are allowed. |
void |
setName(java.lang.String name)
Sets the name of this component. |
void |
setPageSize(int size)
Sets the page size that is used by all Treechildren
to display a portion of their child Treeitem. |
void |
setRows(int rows)
Sets the rows. |
void |
setSelectedItem(Treeitem item)
Deselects all of the currently selected items and selects the given item. |
void |
setSeltype(java.lang.String seltype)
Sets the seltype. |
void |
setVflex(boolean vflex)
Sets whether to grow and shrink vertical to fit their given space, so called vertial flexibility. |
void |
smartUpdate(java.lang.String attr,
java.lang.String value)
|
void |
toggleItemSelection(Treeitem item)
If the specified item is selected, it is deselected. |
| 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, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, 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, invalidate, isChildable, isListenerAvailable, isVisible, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, toString, unsetVariable |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tree()
| Method Detail |
|---|
public Treecols getTreecols()
public Treefoot getTreefoot()
public Treechildren getTreechildren()
public int getRows()
Default: 0.
public void setRows(int rows)
throws org.zkoss.zk.ui.WrongValueException
Note: if both setHeight(java.lang.String) is specified with non-empty,
setRows(int) is ignored
org.zkoss.zk.ui.WrongValueExceptionpublic java.lang.String getName()
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.
public void setName(java.lang.String name)
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.
name - the name of this component.public final boolean isCheckmark()
Default: false.
public void setCheckmark(boolean checkmark)
The check mark is a checkbox if isMultiple() returns
true. It is a radio button if isMultiple() returns false.
public final boolean isVflex()
Note: this attribute is ignored if setRows(int) is specified
Default: false.
public void setVflex(boolean vflex)
Note: this attribute is ignored if setRows(int) is specified
public java.lang.String getSeltype()
Default: "single".
public void setSeltype(java.lang.String seltype)
throws org.zkoss.zk.ui.WrongValueException
org.zkoss.zk.ui.WrongValueExceptionpublic boolean isMultiple()
Default: false.
public void setMultiple(boolean multiple)
public java.util.Collection getItems()
Treeitem
(children's children and so on).
Note: the performance of the size method of returned collection is no good.
public int getItemCount()
Treeitem.
The same as getItems().size().
Note: the performance of this method is no good.
public void selectItem(Treeitem item)
It is the same as setSelectedItem(org.zkoss.zul.Treeitem).
item - the item to select. If null, all items are deselected.public void addItemToSelection(Treeitem item)
public void removeItemFromSelection(Treeitem item)
public void toggleItemSelection(Treeitem item)
public void clearSelection()
public void selectAll()
public Treeitem getSelectedItem()
public void setSelectedItem(Treeitem item)
It is the same as selectItem(org.zkoss.zul.Treeitem).
public java.util.Set getSelectedItems()
public int getSelectedCount()
public void clear()
Treeitem.
Note: after clear, getTreechildren() won't be null, but
it has no child
public int getPageSize()
Treechildren
to display a portion of their child Treeitem,
or -1 if no limitation.
Default: 10.
public void setPageSize(int size)
throws org.zkoss.zk.ui.WrongValueException
Treechildren
to display a portion of their child Treeitem.
size - the page size. If non-positive, there won't be
any limitation. In other wordss, all Treeitem are shown.
Notice: since the browser's JavaScript engine is slow to
handle huge trees, it is better not to set a non-positive size
if your tree is huge.
org.zkoss.zk.ui.WrongValueExceptionpublic void setHeight(java.lang.String height)
setHeight in class org.zkoss.zk.ui.HtmlBasedComponent
public void smartUpdate(java.lang.String attr,
java.lang.String value)
smartUpdate in interface org.zkoss.zk.ui.ComponentsmartUpdate in class org.zkoss.zk.ui.AbstractComponent
public boolean insertBefore(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component refChild)
insertBefore in interface org.zkoss.zk.ui.ComponentinsertBefore in class org.zkoss.zk.ui.AbstractComponentpublic void onChildAdded(org.zkoss.zk.ui.Component child)
onChildAdded in interface org.zkoss.zk.ui.ComponentonChildAdded in class org.zkoss.zk.ui.AbstractComponentpublic void onChildRemoved(org.zkoss.zk.ui.Component child)
onChildRemoved in interface org.zkoss.zk.ui.ComponentonChildRemoved in class org.zkoss.zk.ui.AbstractComponentpublic java.lang.String getOuterAttrs()
getOuterAttrs in class XulElementpublic java.lang.Object clone()
clone in interface org.zkoss.zk.ui.Componentclone in class org.zkoss.zk.ui.AbstractComponentprotected java.lang.Object newExtraCtrl()
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||