|
||||||||||
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 |
---|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
HtmlBasedComponent.ExtraCtrl |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_height, _left, _top, _width, _zclass |
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 |
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
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. |
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 |
onChildAdded(Component child)
Default: does nothing. |
void |
onChildRemoved(Component child)
Default: does nothing. |
protected void |
redrawChildren(java.io.Writer out)
Redraws childrens (and then recursively descandants). |
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing tags and children. |
void |
service(AuRequest request,
boolean everError)
Processes an AU request. |
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 |
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, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, newExtraCtrl, setClass, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, 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, 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, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
Methods inherited from interface org.zkoss.zk.ui.ext.Scope |
---|
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute |
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 Treeitem
public void setCheckable(boolean checkable)
Default: true.
setCheckable
in interface Treeitem
public void unload()
To load the tree item, with
Tree.renderItem(Treeitem)
, Tree.renderItem(Treeitem, Object)
, or Tree.renderItems(java.util.Set)
unload
in interface Treeitem
public void setDisabled(boolean disabled)
setDisabled
in interface Disable
setDisabled
in interface Treeitem
public boolean isDisabled()
Default: false.
isDisabled
in interface Disable
isDisabled
in interface Treeitem
public boolean isLoaded()
isLoaded
in interface Treeitem
public int indexOf()
indexOf
in interface Treeitem
public Treerow getTreerow()
public Treerow getTreerowApi()
getTreerowApi
in interface Treeitem
public Treechildren getTreechildren()
public Treechildren getTreechildrenApi()
getTreechildrenApi
in interface Treeitem
public boolean isContainer()
isContainer
in interface Treeitem
public boolean isEmpty()
isEmpty
in interface Treeitem
public 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 Treeitem
public void setValue(java.lang.Object value)
setValue
in interface Treeitem
value
- 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 Treeitem
public void setOpen(boolean open)
setOpen
in interface Treeitem
public boolean isSelected()
isSelected
in interface Treeitem
public void setSelected(boolean selected)
setSelected
in interface Treeitem
public int getLevel()
getLevel
in interface Treeitem
public java.lang.String getLabel()
Treecell
it contains, or null
if no such cell.
getLabel
in interface Treeitem
public void setLabel(java.lang.String label)
Treecell
it contains.
If it is not created, we automatically create it.
setLabel
in interface Treeitem
public 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 Treeitem
public void setImage(java.lang.String image)
Treecell
it contains.
If it is not created, we automatically create it.
setImage
in interface Treeitem
public Treeitem getParentItem()
public Treeitem getParentItemApi()
getParentItemApi
in interface Treeitem
public Tree getTree()
public Tree getTreeApi()
getTreeApi
in interface Treeitem
public void setDraggable(java.lang.String draggable)
HtmlBasedComponent.setDraggable(java.lang.String)
isntead.
setDraggable
in interface HtmlBasedComponent
setDraggable
in class HtmlBasedComponent
draggable
- "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 HtmlBasedComponent
setDroppable
in class HtmlBasedComponent
dropable
- "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 boolean setVisible(boolean visible)
Component
setVisible
in interface Component
setVisible
in class AbstractComponent
public int getVisibleItemCount()
Treechildren
.
Descendants include direct children, grand children and so on.
public void beforeParentChanged(Component parent)
AbstractComponent
beforeParentChanged
in interface ComponentCtrl
beforeParentChanged
in class AbstractComponent
parent
- the new parent. If null, it means detachment.ComponentCtrl.beforeParentChanged(org.zkoss.zk.ui.Component)
public void setParent(Component parent)
Component
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.
setParent
in interface Component
setParent
in class AbstractComponent
public void beforeChildAdded(Component child, Component refChild)
AbstractComponent
beforeChildAdded
in interface ComponentCtrl
beforeChildAdded
in class AbstractComponent
child
- 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)
Component
You 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 Component
insertBefore
in class AbstractComponent
child
- 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 ComponentCtrl
onChildAdded
in class AbstractComponent
ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component)
public void onChildRemoved(Component child)
AbstractComponent
onChildRemoved
in interface ComponentCtrl
onChildRemoved
in class AbstractComponent
ComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)
protected void redrawChildren(java.io.Writer out) throws java.io.IOException
AbstractComponent
Default: it invokes AbstractComponent.redraw(java.io.Writer)
for all its children.
If a derived class renders only a subset of its children
(such as paging/cropping), it could override AbstractComponent.redrawChildren(java.io.Writer)
.
redrawChildren
in class AbstractComponent
java.io.IOException
AbstractComponent.redraw(java.io.Writer)
public java.lang.Object clone()
Component
clone
in interface Component
clone
in class AbstractComponent
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
See also Render Special Properties
renderProperties
in class XulElement
java.io.IOException
public void service(AuRequest request, boolean everError)
Default: in addition to what are handled by HtmlBasedComponent.service(org.zkoss.zk.au.AuRequest, boolean)
,
it also handles onOpen.
service
in interface ComponentCtrl
service
in class HtmlBasedComponent
everError
- whether any error ever occured before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |