org.zkoss.zul
Class Treerow

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.Treerow
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Treerow, XulElement

public class Treerow
extends XulElement
implements Treerow

A treerow.

Default getZclass(): z-tree-row.(since 3.5.0)

Author:
tomyeh
See Also:
Serialized Form

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
_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
Treerow()
           
 
Method Summary
 java.lang.String getContext()
          Returns the same as XulElement.getContext().
 int getLevel()
          Returns the level this cell is.
 Treechildren getLinkedTreechildren()
          Returns the Treechildren associated with this Treerow.
 Treechildren getLinkedTreechildrenApi()
          Returns the Treechildren associated with this Treerow.
 java.lang.String getOuterAttrs()
          Appends attributes for generating the real checkbox HTML tags (name="val"); Used only by component developers.
 java.lang.String getPopup()
          Returns the same as XulElement.getPopup().
protected  java.lang.String getRealSclass()
          Returns the real style class that will be generated to the client (when HtmlBasedComponent.getOuterAttrs() is called).
 java.lang.String getTooltip()
          Returns the same as XulElement.getTooltip().
 java.lang.String getTooltiptext()
          Returns the same as HtmlBasedComponent.getTooltiptext()
 Tree getTree()
          Returns the Tree instance containing this element.
 Tree getTreeApi()
          Returns the Tree instance containing this element.
 java.lang.String getZclass()
          Returns the ZK Cascading Style class(es) for this component.
 boolean insertBefore(Component child, Component insertBefore)
          Inserts a child before the reference child.
protected  boolean isAsapRequired(java.lang.String evtnm)
          Returns if any non-deferrable (ASAP) event listener is registered for the specified event.
 boolean isVisible()
          Returns whether this is visible.
 void setContext(java.lang.String context)
          Alwasys throws UnsupportedOperationException since developers shall use XulElement.setContext(java.lang.String) instead.
 void setParent(Component parent)
          Sets the parent component.
 void setPopup(java.lang.String popup)
          Alwasys throws UnsupportedOperationException since developers shall use XulElement.setPopup(java.lang.String) instead.
 void setTooltip(java.lang.String tooltip)
          Alwasys throws UnsupportedOperationException since developers shall use XulElement.setTooltip(java.lang.String) instead.
 boolean setVisible(boolean visible)
          Sets whether this component is visible.
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getCtrlKeys, getInnerAttrs, setAction, setContext, setCtrlKeys, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTop, getWidth, getZindex, getZIndex, newExtraCtrl, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, hasFellow, invalidate, isChildable, isInvalidated, isListenerAvailable, newChildren, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setVariable, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable
 
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, getCtrlKeys, setAction, setContext, setCtrlKeys, setPopup, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTop, getWidth, 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, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isChildable, isInvalidated, isListenerAvailable, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setVariable, unsetVariable
 

Constructor Detail

Treerow

public Treerow()
Method Detail

getTree

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


getTreeApi

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

Specified by:
getTreeApi in interface Treerow
Since:
3.5.2

getLevel

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

Specified by:
getLevel in interface Treerow

getLinkedTreechildren

public Treechildren getLinkedTreechildren()
Returns the Treechildren associated with this Treerow. In other words, it is Treeitem.getTreechildren() of AbstractComponent.getParent().

Since:
2.4.1
See Also:
Treechildren.getLinkedTreerow()

getLinkedTreechildrenApi

public Treechildren getLinkedTreechildrenApi()
Returns the Treechildren associated with this Treerow. In other words, it is Treeitem.getTreechildren() of AbstractComponent.getParent().

Specified by:
getLinkedTreechildrenApi in interface Treerow
Since:
3.5.2
See Also:
Treechildren.getLinkedTreerow()

getRealSclass

protected java.lang.String getRealSclass()
Description copied from class: HtmlBasedComponent
Returns the real style class that will be generated to the client (when HtmlBasedComponent.getOuterAttrs() is called).

Default: it simply returns the catenation of HtmlBasedComponent.getSclass() and HtmlBasedComponent.getZclass() (since 3.5.0).

Derived classes might override it to provide, say, dual style classes. For example,

final String sclass = getSclass();
return sclass != null ? sclass + " my-addon": "myaddon";

Overrides:
getRealSclass in class HtmlBasedComponent
See Also:
HtmlBasedComponent.getZclass()

getZclass

public java.lang.String getZclass()
Description copied from class: HtmlBasedComponent
Returns the ZK Cascading Style class(es) for this component. It usually depends on the implementation of the mold (@{link #getMold}).

Default: null (the default value depends on element).

HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style of a component. In other words, the default style of a component is associated with the default value of HtmlBasedComponent.getZclass(). Once it is changed, the default style won't be applied at all. If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String) instead.

Specified by:
getZclass in interface HtmlBasedComponent
Overrides:
getZclass in class HtmlBasedComponent
See Also:
HtmlBasedComponent.getSclass(), HtmlBasedComponent.getRealSclass()

setContext

public void setContext(java.lang.String context)
Alwasys throws UnsupportedOperationException since developers shall use XulElement.setContext(java.lang.String) instead.

Specified by:
setContext in interface XulElement
Overrides:
setContext in class XulElement
See Also:
XulElement.setContext(Popup)

setPopup

public void setPopup(java.lang.String popup)
Alwasys throws UnsupportedOperationException since developers shall use XulElement.setPopup(java.lang.String) instead.

Specified by:
setPopup in interface XulElement
Overrides:
setPopup in class XulElement
See Also:
XulElement.setPopup(Popup)

setTooltip

public void setTooltip(java.lang.String tooltip)
Alwasys throws UnsupportedOperationException since developers shall use XulElement.setTooltip(java.lang.String) instead.

Specified by:
setTooltip in interface XulElement
Overrides:
setTooltip in class XulElement
See Also:
XulElement.setTooltip(Popup)

getContext

public java.lang.String getContext()
Returns the same as XulElement.getContext().

Specified by:
getContext in interface XulElement
Overrides:
getContext in class XulElement

getPopup

public java.lang.String getPopup()
Returns the same as XulElement.getPopup().

Specified by:
getPopup in interface XulElement
Overrides:
getPopup in class XulElement

getTooltip

public java.lang.String getTooltip()
Returns the same as XulElement.getTooltip().

Specified by:
getTooltip in interface XulElement
Overrides:
getTooltip in class XulElement

getTooltiptext

public java.lang.String getTooltiptext()
Returns the same as HtmlBasedComponent.getTooltiptext()

Specified by:
getTooltiptext in interface HtmlBasedComponent
Overrides:
getTooltiptext in class HtmlBasedComponent

isAsapRequired

protected boolean isAsapRequired(java.lang.String evtnm)
Description copied from class: AbstractComponent
Returns if any non-deferrable (ASAP) event listener is registered for the specified event. Returns true if you want the component (on the server) to process the event immediately.

Default: 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.

Overrides:
isAsapRequired in class AbstractComponent
Parameters:
evtnm - the event name, such as onClick

getOuterAttrs

public java.lang.String getOuterAttrs()
Appends attributes for generating the real checkbox HTML tags (name="val"); Used only by component developers.

Overrides:
getOuterAttrs in class XulElement

isVisible

public boolean isVisible()
Returns whether this is visible. whether all its ancestors is open.

Specified by:
isVisible in interface Component
Overrides:
isVisible in class AbstractComponent
See Also:
Components.isRealVisible(org.zkoss.zk.ui.Component)

setVisible

public boolean setVisible(boolean visible)
Description copied from interface: Component
Sets whether this component is visible.

Specified by:
setVisible in interface Component
Overrides:
setVisible in class AbstractComponent
Returns:
the previous visibility

setParent

public void setParent(Component parent)
Description copied from interface: Component
Sets the 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.

Specified by:
setParent in interface Component
Overrides:
setParent in class AbstractComponent

insertBefore

public boolean insertBefore(Component child,
                            Component insertBefore)
Description copied from interface: Component
Inserts a child before the reference child.

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.

Specified by:
insertBefore in interface Component
Overrides:
insertBefore in class AbstractComponent
Parameters:
child - the new child to be inserted.
insertBefore - the child before which you want the new child being inserted. If null, the new child is append to the end.
Returns:
true if newChild is added successfully or moved; false if it already has the specified child and the order doesn't change.


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