org.zkoss.zul
Class Treechildren

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

public class Treechildren
extends XulElement
implements Pageable

A treechildren.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Treechildren.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
Treechildren()
           
 
Method Summary
 int getActivePage()
          Returns the active page (starting from 0).
 int getItemCount()
          Returns the number of child Treeitem including all descendants.
 java.util.Collection getItems()
          Returns a readonly list of all descending Treeitem (children's children and so on).
 Treerow getLinkedTreerow()
          Returns the Treerow that is associated with this treechildren, or null if no such treerow.
 int getPageCount()
          Returns the number of pages.
 int getPageSize()
          Returns the page size which controls the number of visible child Treeitem, or -1 if no limitation.
 Tree getTree()
          Returns the Tree instance containing this element.
 int getVisibleBegin()
          Returns the index of the first visible child.
 int getVisibleEnd()
          Returns the index of the last visible child.
 boolean insertBefore(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
           
 void invalidate()
           
 boolean isVisible()
          Returns whether this is visible.
protected  java.lang.Object newExtraCtrl()
           
 void onChildRemoved(org.zkoss.zk.ui.Component child)
           
 void setActivePage(int pg)
          Sets the active page (starting from 0).
 void setPageSize(int size)
          Sets the page size which controls the number of visible child Treeitem.
 void setParent(org.zkoss.zk.ui.Component parent)
           
 void smartUpdate(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getOuterAttrs, 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, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, 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, isChildable, isListenerAvailable, onChildAdded, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setVariable, setVisible, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Treechildren

public Treechildren()
Method Detail

getTree

public Tree getTree()
Returns the Tree instance containing this element.


getLinkedTreerow

public Treerow getLinkedTreerow()
Returns the Treerow that is associated with this treechildren, or null if no such treerow. In other words, it is Treeitem.getTreerow() of AbstractComponent.getParent().

Since:
2.4.1
See Also:
Treerow.getLinkedTreechildren()

isVisible

public boolean isVisible()
Returns whether this is visible.

Besides depends on AbstractComponent.setVisible(boolean), it also depends on whether all its ancestors is open.

Specified by:
isVisible in interface org.zkoss.zk.ui.Component
Overrides:
isVisible in class org.zkoss.zk.ui.AbstractComponent

getItems

public java.util.Collection getItems()
Returns a readonly list of all descending Treeitem (children's children and so on).

Note: the performance of the size method of returned collection is no good.


getItemCount

public int getItemCount()
Returns the number of child Treeitem including all descendants. The same as getItems().size().

Note: the performance is no good.


getPageSize

public int getPageSize()
Returns the page size which controls the number of visible child Treeitem, or -1 if no limitation.

If setPageSize(int) is called with a non-zero value, this method return the non-zero value. If setPageSize(int) is called with zero, this method returns Tree.getPageSize() of getTree().

Default: the same as getTree()'s Tree.getPageSize().

Specified by:
getPageSize in interface Pageable
Since:
2.4.1
See Also:
Tree.getPageSize(), setPageSize(int)

setPageSize

public void setPageSize(int size)
                 throws org.zkoss.zk.ui.WrongValueException
Sets the page size which controls the number of visible child Treeitem.

Specified by:
setPageSize in interface Pageable
Parameters:
size - the page size. If zero, the page size will be the same as Tree.getPageSize() of getTree(). In other words, zero means the default page size is used. If negative, all Treeitem are shown.
Throws:
org.zkoss.zk.ui.WrongValueException
Since:
2.4.1

getPageCount

public int getPageCount()
Returns the number of pages. Note: there is at least one page even no item at all.

Specified by:
getPageCount in interface Pageable
Since:
2.4.1

getActivePage

public int getActivePage()
Returns the active page (starting from 0).

Specified by:
getActivePage in interface Pageable
Since:
2.4.1

setActivePage

public void setActivePage(int pg)
                   throws org.zkoss.zk.ui.WrongValueException
Sets the active page (starting from 0).

Specified by:
setActivePage in interface Pageable
Throws:
org.zkoss.zk.ui.WrongValueException - if no such page
Since:
2.4.1

getVisibleBegin

public int getVisibleBegin()
Returns the index of the first visible child.

Used only for component development, not for application developers.

Since:
2.4.1

getVisibleEnd

public int getVisibleEnd()
Returns the index of the last visible child.

Used only for component development, not for application developers.

Since:
2.4.1

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

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

invalidate

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

smartUpdate

public void smartUpdate(java.lang.String name,
                        java.lang.String value)
Specified by:
smartUpdate in interface org.zkoss.zk.ui.Component
Overrides:
smartUpdate in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent


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