Class Orgitem

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zkmax.zul.Orgitem
All Implemented Interfaces:
Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Disable, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl

public class Orgitem extends org.zkoss.zul.impl.XulElement implements org.zkoss.zk.ui.ext.Disable
An orgitem.

Event:

  1. onOpen is sent when an Orgitem is opened or closed by user.
Since:
8.6.0
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl

    Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

    org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
  • Field Summary

    Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    _zclass

    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

    AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Orgitem(String label)
     
    Orgitem(String label, Object value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
     
    void
    beforeParentChanged(org.zkoss.zk.ui.Component parent)
     
     
    Returns the image of the Orgnode it contains.
    int
    Return the index of this item.
    Returns the label of the Orgnode it contains, or null if no such node.
    int
    Returns the level this item is.
    Returns the Organigram owning this item.
    Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.
    Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.
    Returns the parent Orgitem, or null if this item is already the top level of the Organigram.
    <T> T
    Returns the value.
    int
    Returns the number of visible descendant Orgchildren.
     
    boolean
    insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild)
     
    boolean
    Returns whether the element is to act as a container which can have child elements.
    boolean
    Returns whether it is disabled, Default: false.
    boolean
    Returns whether this element contains no child elements.
    boolean
    Return true if all children of this Orgitem, if any, is loaded.
    boolean
    Returns whether this container is open.
    boolean
    Returns true if this Orgitem is rendered.
    boolean
    Returns whether it is selectable.
    boolean
    Returns whether this item is selected.
    void
    onChildAdded(org.zkoss.zk.ui.Component child)
     
    void
    onChildRemoved(org.zkoss.zk.ui.Component child)
     
    protected void
    renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
     
    void
    service(org.zkoss.zk.au.AuRequest request, boolean everError)
     
    void
    setDisabled(boolean disabled)
    Sets whether it is disabled.
    void
    Sets the image of the Orgnode it contains.
    void
    Sets the label of the Orgnode it contains.
    void
    setOpen(boolean open)
    Sets whether this container is open.
    void
    setParent(org.zkoss.zk.ui.Component parent)
     
    void
    setSelectable(boolean selectable)
    Sets whether it is selectable.
    void
    setSelected(boolean selected)
    Sets whether this item is selected.
    <T> void
    setValue(T value)
    Sets the value.
    boolean
    setVisible(boolean visible)
     

    Methods inherited from class org.zkoss.zul.impl.XulElement

    getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes

    Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent

    addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly

    Methods inherited from class org.zkoss.zk.ui.AbstractComponent

    addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getStubonlyDescendants, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setStubonly, setStubonly, setStubonlyDescendants, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Orgitem

      public Orgitem()
    • Orgitem

      public Orgitem(String label)
    • Orgitem

      public Orgitem(String label, Object value)
  • Method Details

    • isSelectable

      public boolean isSelectable()
      Returns whether it is selectable. Default: true.
      Returns:
      whether it is selectable.
    • setSelectable

      public void setSelectable(boolean selectable)
      Sets whether it is selectable. When selectable equals true, user can select this item by clicking it.
      Parameters:
      selectable - whether it is selectable.
    • isDisabled

      public boolean isDisabled()
      Returns whether it is disabled, Default: false.
      Specified by:
      isDisabled in interface org.zkoss.zk.ui.ext.Disable
      Returns:
      whether it is disabled.
    • setDisabled

      public void setDisabled(boolean disabled)
      Sets whether it is disabled. When disabled equals true, user can't select this item.
      Specified by:
      setDisabled in interface org.zkoss.zk.ui.ext.Disable
      Parameters:
      disabled - whether it is disabled.
    • isRendered

      public boolean isRendered()
      Returns true if this Orgitem is rendered. Unlike isLoaded() which is used to check whether all children of this Orgitem are loaded. Default: false
      Returns:
      whether this Orgitem is rendered
    • isLoaded

      public boolean isLoaded()
      Return true if all children of this Orgitem, if any, is loaded. Default: false
      Returns:
      whether all children of this Orgitem, if any, is loaded.
    • getIndex

      public int getIndex()
      Return the index of this item.
      Returns:
      index of this item
    • getOrgchildren

      public Orgchildren getOrgchildren()
      Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.
      Returns:
      the Orgchildren
    • getOrgnode

      public Orgnode getOrgnode()
      Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.
      Since:
      10.0.0
    • isContainer

      public boolean isContainer()
      Returns whether the element is to act as a container which can have child elements.
      Returns:
      whether the element is a container
    • isEmpty

      public boolean isEmpty()
      Returns whether this element contains no child elements.
      Returns:
      whether this element contains no child elements
    • getLevel

      public int getLevel()
      Returns the level this item is. The root is level 0.
      Returns:
      the level this item is
    • getValue

      public <T> T getValue()
      Returns the value. It could be anything you want. Default: null. Note: the value is not sent to the browser, so it is OK to be anything.
      Returns:
      the value, It could be anything you want.
    • setValue

      public <T> void setValue(T value)
      Sets the value. Note: the value is not sent to the browser, so it is OK to be anything.
      Parameters:
      value - the value, It could be anything you want.
    • isOpen

      public boolean isOpen()
      Returns whether this container is open. Default: true.
      Returns:
      whether this container is open
    • setOpen

      public void setOpen(boolean open)
      Sets whether this container is open.
      Parameters:
      open - whether this container is open
    • isSelected

      public boolean isSelected()
      Returns whether this item is selected. Note: Organigram only accepts one selected item Default: false.
      Returns:
      whether this item is selected
    • setSelected

      public void setSelected(boolean selected)
      Sets whether this item is selected. Note: Organigram only accepts one selected item
      Parameters:
      selected - whether this item is selected
    • getLabel

      public String getLabel()
      Returns the label of the Orgnode it contains, or null if no such node.
      Returns:
      the label of the Orgnode it contains
    • setLabel

      public void setLabel(String label)
      Sets the label of the Orgnode it contains.

      If Orgnode is not created, we automatically create it.

      Notice that this method will create an Orgnode automatically if it doesn't exist. Thus, you cannot attach a node to it again if set an image or a label.

      Parameters:
      label - the label of the Orgnode it contains
    • getImage

      public String getImage()
      Returns the image of the Orgnode it contains.
      Returns:
      the image of the Orgnode it contains
    • setImage

      public void setImage(String image)
      Sets the image of the Orgnode it contains.

      If Orgnode is not created, we automatically create it.

      Notice that this method will create an Orgnode automatically if it doesn't exist. Thus, you cannot attach a node to it again if set an image or a label.

      Parameters:
      image - the image of the Orgnode it contains
    • getOrganigram

      public Organigram getOrganigram()
      Returns the Organigram owning this item.
      Returns:
      the Organigram
    • getParentItem

      public Orgitem getParentItem()
      Returns the parent Orgitem, or null if this item is already the top level of the Organigram. The parent Orgitem is actually the grandparent if any.
      Returns:
      the parent Orgitem
    • setVisible

      public boolean setVisible(boolean visible)
      Specified by:
      setVisible in interface org.zkoss.zk.ui.Component
      Overrides:
      setVisible in class org.zkoss.zk.ui.AbstractComponent
    • getVisibleItemCount

      public int getVisibleItemCount()
      Returns the number of visible descendant Orgchildren. Descendants include direct children, grand children and so on.
      Returns:
      the number of visible descendant Orgchildren
    • beforeParentChanged

      public void beforeParentChanged(org.zkoss.zk.ui.Component parent)
      Specified by:
      beforeParentChanged in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      beforeParentChanged in class org.zkoss.zk.ui.AbstractComponent
    • 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
    • beforeChildAdded

      public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)
      Specified by:
      beforeChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      beforeChildAdded in class org.zkoss.zk.ui.AbstractComponent
    • insertBefore

      public boolean insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild)
      Specified by:
      insertBefore in interface org.zkoss.zk.ui.Component
      Overrides:
      insertBefore in class org.zkoss.zk.ui.AbstractComponent
    • onChildAdded

      public void onChildAdded(org.zkoss.zk.ui.Component child)
      Specified by:
      onChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      onChildAdded 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.sys.ComponentCtrl
      Overrides:
      onChildRemoved in class org.zkoss.zk.ui.AbstractComponent
    • clone

      public Object clone()
      Specified by:
      clone in interface org.zkoss.zk.ui.Component
      Overrides:
      clone in class org.zkoss.zul.impl.XulElement
    • renderProperties

      protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
      Overrides:
      renderProperties in class org.zkoss.zul.impl.XulElement
      Throws:
      IOException
    • service

      public void service(org.zkoss.zk.au.AuRequest request, boolean everError)
      Specified by:
      service in interface org.zkoss.zk.ui.sys.ComponentCtrl
      Overrides:
      service in class org.zkoss.zk.ui.HtmlBasedComponent
    • getZclass

      public String getZclass()
      Overrides:
      getZclass in class org.zkoss.zk.ui.HtmlBasedComponent