|
||||||||||
| 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.Treeitem
public class Treeitem
A treeitem.
Event:
| Nested Class Summary | |
|---|---|
protected class |
Treeitem.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl(). |
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
AbstractComponent.Children |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
_zclass, RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
|---|
_visible |
| 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 | |
|---|---|
Treeitem()
|
|
Treeitem(java.lang.String label)
|
|
Treeitem(java.lang.String label,
java.lang.Object value)
|
|
| Method Summary | |
|---|---|
void |
beforeChildAdded(Component child,
Component refChild)
Default: does nothing. |
void |
beforeParentChanged(Component parent)
Default: does nothing. |
java.lang.Object |
clone()
Clones the component. |
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 |
getParentItem()
Returns the parent tree item, or null if this item is already the top level of the tree. |
Treeitem |
getParentItemApi()
Returns the parent tree item, or null if this item is already the top level of the tree. |
java.lang.String |
getSrc()
Deprecated. As of release 3.5.0, it is redundant since it the same as getImage(). |
Tree |
getTree()
Returns the tree owning this item. |
Tree |
getTreeApi()
Returns the tree owning this item. |
Treechildren |
getTreechildren()
Returns the treechildren that this tree item owns, or null if doesn't have any child. |
Treechildren |
getTreechildrenApi()
Returns the treechildren that this tree item owns, or null if |
Treerow |
getTreerow()
Returns the treerow that this tree item owns (might null). |
Treerow |
getTreerowApi()
Returns the treerow that this tree item owns (might null). |
java.lang.Object |
getValue()
Returns the value. |
int |
getVisibleItemCount()
Returns the number of visible descendant Treechildren. |
int |
indexOf()
return the index of this container |
boolean |
insertBefore(Component child,
Component refChild)
Inserts a child before the reference child. |
void |
invalidate()
Invalidates this component by setting the dirty flag such that it will be redraw the whole content later. |
protected boolean |
isAsapRequired(java.lang.String evtnm)
Returns if any non-deferrable (ASAP) event listener is registered for the specified event. |
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. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create a client control. |
void |
onChildAdded(Component child)
Default: does nothing. |
void |
onChildRemoved(Component child)
Default: does nothing. |
void |
setAction(java.lang.String action)
Not callable. |
void |
setCheckable(boolean checkable)
Sets whether it is checkable. |
void |
setDisabled(boolean disabled)
Sets whether it is disabled. |
void |
setDraggable(java.lang.String draggable)
No callable. |
void |
setDroppable(java.lang.String dropable)
No callable. |
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 |
setParent(Component parent)
Sets the parent component. |
void |
setSelected(boolean selected)
Returns whether this item is selected. |
void |
setSrc(java.lang.String src)
Deprecated. As of release 3.5.0, it is redundant since it the same as setImage(java.lang.String). |
void |
setValue(java.lang.Object value)
Sets the value. |
boolean |
setVisible(boolean visible)
Sets whether this component is visible. |
void |
smartUpdate(java.lang.String attr,
java.lang.String value)
Smart-updates a property with the specified value. |
void |
unload()
Unload the tree item To load the tree item, with Tree.renderItem(Treeitem), Tree.renderItem(Treeitem, Object), or Tree.renderItems(java.util.Set) |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
|---|
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getInnerAttrs, getOuterAttrs, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, redraw, setClass, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.impl.api.XulElement |
|---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, 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, 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, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, isChildable, isInvalidated, isListenerAvailable, isVisible, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setVariable, unsetVariable |
| Constructor Detail |
|---|
public Treeitem()
public Treeitem(java.lang.String label)
public Treeitem(java.lang.String label,
java.lang.Object value)
| Method Detail |
|---|
public boolean isCheckable()
Default: true.
isCheckable in interface Treeitempublic void setCheckable(boolean checkable)
Default: true.
setCheckable in interface Treeitempublic void unload()
To load the tree item, with
Tree.renderItem(Treeitem), Tree.renderItem(Treeitem, Object), or Tree.renderItems(java.util.Set)
unload in interface Treeitempublic void setDisabled(boolean disabled)
setDisabled in interface Treeitempublic boolean isDisabled()
Default: false.
isDisabled in interface Treeitempublic boolean isLoaded()
isLoaded in interface Treeitempublic int indexOf()
indexOf in interface Treeitempublic Treerow getTreerow()
public Treerow getTreerowApi()
getTreerowApi in interface Treeitempublic Treechildren getTreechildren()
public Treechildren getTreechildrenApi()
getTreechildrenApi in interface Treeitempublic boolean isContainer()
isContainer in interface Treeitempublic boolean isEmpty()
isEmpty in interface Treeitempublic java.lang.Object getValue()
Default: null.
Note: the value is not sent to the browser, so it is OK to be anything.
getValue in interface Treeitempublic void setValue(java.lang.Object value)
setValue in interface Treeitemvalue - the value.
Note: the value is not sent to the browser, so it is OK to be
anything.public boolean isOpen()
Default: true.
isOpen in interface Treeitempublic void setOpen(boolean open)
setOpen in interface Treeitempublic boolean isSelected()
isSelected in interface Treeitempublic void setSelected(boolean selected)
setSelected in interface Treeitempublic int getLevel()
getLevel in interface Treeitempublic java.lang.String getLabel()
Treecell it contains, or null
if no such cell.
getLabel in interface Treeitempublic void setLabel(java.lang.String label)
Treecell it contains.
If it is not created, we automatically create it.
setLabel in interface Treeitempublic java.lang.String getSrc()
getImage().
public void setSrc(java.lang.String src)
setImage(java.lang.String).
public java.lang.String getImage()
Treecell it contains.
getImage in interface Treeitempublic void setImage(java.lang.String image)
Treecell it contains.
If it is not created, we automatically create it.
setImage in interface Treeitempublic Treeitem getParentItem()
public Treeitem getParentItemApi()
getParentItemApi in interface Treeitempublic Tree getTree()
public Tree getTreeApi()
getTreeApi in interface Treeitemprotected boolean isAsapRequired(java.lang.String evtnm)
AbstractComponentDefault: return true if any non-deferable event listener of
the specified event is found. In other words, it returns
Events.isListened(org.zkoss.zk.ui.Component, java.lang.String, boolean) with asap = true.
This method is moved from HtmlBasedComponent to
AbstractComponent since 3.0.0.
isAsapRequired in class AbstractComponentevtnm - the event name, such as onClick
public void smartUpdate(java.lang.String attr,
java.lang.String value)
ComponentCtrlThe second invocation with the same property will replace the previous call. In other words, the same property will be set only once in each execution.
This method has no effect if Component.invalidate() is ever invoked
(in the same execution), since Component.invalidate() assumes
the whole content shall be redrawn and all smart updates to
this components can be ignored,
Once this method is called, all invocations to ComponentCtrl.smartUpdate(java.lang.String, java.lang.String)
will then be ignored, and Component.redraw(java.io.Writer) will be invoked later.
It can be called only in the request-processing and event-processing phases; excluding the redrawing phase.
There are two ways to draw a component, one is to invoke
Component.invalidate(), and the other is ComponentCtrl.smartUpdate(java.lang.String, java.lang.String).
While Component.invalidate() causes the whole content to redraw,
ComponentCtrl.smartUpdate(java.lang.String, java.lang.String) let component developer control which part
to redraw.
smartUpdate in interface ComponentCtrlsmartUpdate in class AbstractComponentvalue - the new value. If null, it means removing the property.ComponentCtrl.smartUpdateDeferred(java.lang.String, org.zkoss.zk.ui.util.DeferredValue),
ComponentCtrl.smartUpdateValues(java.lang.String, java.lang.Object[])public void setDraggable(java.lang.String draggable)
HtmlBasedComponent.setDraggable(java.lang.String) isntead.
setDraggable in interface HtmlBasedComponentsetDraggable in class HtmlBasedComponentdraggable - "false", null or "" to denote non-draggable; "true" for draggable
with anonymous identifier; others for an identifier of draggable.public void setDroppable(java.lang.String dropable)
HtmlBasedComponent.setDroppable(java.lang.String) isntead.
setDroppable in interface HtmlBasedComponentsetDroppable in class HtmlBasedComponentdropable - "false", null or "" to denote not-droppable;
"true" for accepting any draggable types; a list of identifiers,
separated by comma for identifiers of draggables this component
accept (to be dropped in).public void setAction(java.lang.String action)
XulElement.setAction(java.lang.String) instead.
setAction in interface XulElementsetAction in class XulElementpublic boolean setVisible(boolean visible)
Component
setVisible in interface ComponentsetVisible in class AbstractComponentpublic int getVisibleItemCount()
Treechildren.
Descendants include direct children, grand children and so on.
public void beforeParentChanged(Component parent)
AbstractComponent
beforeParentChanged in interface ComponentCtrlbeforeParentChanged in class AbstractComponentparent - the new parent. If null, it means detachment.ComponentCtrl.beforeParentChanged(org.zkoss.zk.ui.Component)public void setParent(Component parent)
ComponentNote: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
setParent in interface ComponentsetParent in class AbstractComponent
public void beforeChildAdded(Component child,
Component refChild)
AbstractComponent
beforeChildAdded in interface ComponentCtrlbeforeChildAdded in class AbstractComponentchild - the child to be added (never null).refChild - another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
public boolean insertBefore(Component child,
Component refChild)
ComponentYou could use Component.setParent(org.zkoss.zk.ui.Component) or Component.appendChild(org.zkoss.zk.ui.Component)
instead of this method, unless
you want to control where to put the child.
Note: Component.setParent(org.zkoss.zk.ui.Component) always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component),
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component),
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component) and Component.setParent(org.zkoss.zk.ui.Component), if you want
to customize the behavior.
insertBefore in interface ComponentinsertBefore in class AbstractComponentchild - the new child to be inserted.refChild - the child before which you want the new child
being inserted. If null, the new child is append to the end.
public void onChildAdded(Component child)
AbstractComponent
onChildAdded in interface ComponentCtrlonChildAdded in class AbstractComponentComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component)public void onChildRemoved(Component child)
AbstractComponent
onChildRemoved in interface ComponentCtrlonChildRemoved in class AbstractComponentComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)public void invalidate()
ComponentIt can be called only in the request-processing and event-processing phases; excluding the redrawing phase.
invalidate in interface Componentinvalidate in class AbstractComponentpublic java.lang.Object clone()
Component
clone in interface Componentclone in class AbstractComponentprotected java.lang.Object newExtraCtrl()
HtmlBasedComponentAbstractComponent.getExtraCtrl() to create a client control.
It is used only by component developers.
Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl.
newExtraCtrl in class HtmlBasedComponent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||