Package org.zkoss.stateless.sul

## Interface IOrgitem

- All Superinterfaces:
    `IComponent<IOrgitem>`, `IComposite<IOrgitem,​IOrgitemComposite>`, `IDisable<IOrgitem>`, `IHtmlBasedComponent<IOrgitem>`, `IXulElement<IOrgitem>`

      public interface IOrgitem
      extends IXulElement<IOrgitem>, IDisable<IOrgitem>, IComposite<IOrgitem,​IOrgitemComposite>

  Immutable `Orgitem` component

  Orgitem contains a node (Orgnode), and an optional Orgchildren. If the component doesn't contain an Orgchildren, it is a leaf node that doesn't accept any child items. If it contains an Orgchildren, it is a branch node that might contain other items.

  For a branch node, an +/- button will appear at the bottom right of the node, such that user could open and close the item by clicking on the +/- button.

  ### Support @Action

  Name | Action Type
  --- | ---
  onOpen | ActionData: `OpenData` Denotes user has opened or closed a component. It is useful to implement load-on-demand by listening to the onOpen action, and creating components when the first time the component is opened.

  Author:
    katherine
  See Also:
    `Orgitem`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface | Description
    --- | --- | ---
    `static class` | `IOrgitem.Builder` | Builds instances of type `IOrgitem`.
    `static class` | `IOrgitem.Updater` | Builds an updater of type `IOrgitem` for `UiAgent.smartUpdate(Locator, SmartUpdater)`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static IOrgitem` | `DEFAULT` | Constant for default attributes of this immutable component.

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `default java.lang.String` | `getImage()` | Returns the image of the first `IOrgnode` it contains.
    `default java.lang.String` | `getLabel()` | Returns the label of the `IOrgnode` it contains, or null if no such node.
    `IOrgchildren` | `getOrgchildren()` | Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.
    `IOrgnode<IAnyGroup>` | `getOrgnode()` | Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.
    `default java.lang.String` | `getWidgetClass()` | Returns the client widget class.
    `default boolean` | `isContainer()` | Returns whether the component is to act as a container which can have sublevel items.
    `default boolean` | `isDisabled()` | Returns whether it is disabled, Default: `false`.
    `default boolean` | `isEmpty()` | Returns whether to contain any sublevel items or not.
    `default boolean` | `isLoaded()` | Return true whether all children of this tree item, if any, is loaded at client
    `default boolean` | `isOpen()` | Returns whether this container is open.
    `default boolean` | `isRendered()` | Returns true whether this Orgitem is rendered at client.
    `default boolean` | `isSelectable()` | Returns whether it is selectable.
    `default boolean` | `isSelected()` | Returns whether this item is selected.
    `static IOrgitem` | `of​(java.lang.String label)` | Returns the instance with the given label.
    `static IOrgitem` | `ofId​(java.lang.String id)` | Returns the instance with the given id.
    `static IOrgitem` | `ofImage​(java.lang.String image)` | Returns the instance with the given image.
    `default IOrgitem` | `withAllComponents​(java.lang.Iterable<? extends IOrgitemComposite> elements)` | Copy the current immutable object with elements that replace the content of `children`.
    `IOrgitem` | `withDisabled​(boolean disabled)` | Returns a copy of `this` immutable component with the specified `disabled`.
    `IOrgitem` | `withImage​(java.lang.String image)` | Returns a copy of `this` immutable component with the specified `image`.
    `IOrgitem` | `withLabel​(java.lang.String label)` | Returns a copy of `this` immutable component with the specified `label`.
    `IOrgitem` | `withOpen​(boolean open)` | Returns a copy of `this` immutable component with the specified `open`.
    `IOrgitem` | `withOrgchildren​(IOrgchildren children)` | Returns a copy of `this` immutable component with the specified `treechildren`.
    `IOrgitem` | `withOrgnode​(IOrgnode<IAnyGroup> orgnode)` | Returns a copy of `this` immutable component with the specified `orgnode`.
    `IOrgitem` | `withSelectable​(boolean selectable)` | Returns a copy of `this` immutable component with the specified `selectable`.
    `IOrgitem` | `withSelected​(boolean selected)` | Returns a copy of `this` immutable component with the specified `selected`.

    - ### Methods inherited from interface org.zkoss.stateless.sul.IComponent

      `getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent

      `getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex`

    - ### Methods inherited from interface org.zkoss.stateless.sul.IXulElement

      `getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip`

- - ### Field Detail

    - #### DEFAULT

          static final IOrgitem DEFAULT

      Constant for default attributes of this immutable component.

  - ### Method Detail

    - #### getWidgetClass

          default java.lang.String getWidgetClass()

      Returns the client widget class.

      Default: `"zkmax.layout.Orgitem"`

      Specified by:
        `getWidgetClass` in interface `IComponent<IOrgitem>`
      Returns:

    - #### getLabel

          @Nullable
          default java.lang.String getLabel()

      Returns the label of the `IOrgnode` it contains, or null if no such node.
      Returns:
        the label of the `IOrgnode` it contains

    - #### withLabel

          IOrgitem withLabel​(@Nullable
                             java.lang.String label)

      Returns a copy of `this` immutable component with the specified `label`.

      Sets the label of the `IOrgnode` 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 `IOrgnode` it contains.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getImage

          @Nullable
          default java.lang.String getImage()

      Returns the image of the first `IOrgnode` it contains.

      Default: `null`

    - #### withImage

          IOrgitem withImage​(@Nullable
                             java.lang.String image)

      Returns a copy of `this` immutable component with the specified `image`.

      Sets the image of the `IOrgnode` 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 `IOrgnode` it contains.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### isSelectable

          default boolean isSelectable()

      Returns whether it is selectable. Default: `true`.

    - #### withSelectable

          IOrgitem withSelectable​(boolean selectable)

      Returns a copy of `this` immutable component with the specified `selectable`.

      Sets whether it is selectable.

      When selectable equals true, user can select this item by clicking it.

      Parameters:
        `selectable` - Whether it is selectable.

        Default: `true`.

      Returns:
        A modified copy of the `this` object

    - #### isDisabled

          default boolean isDisabled()

      Returns whether it is disabled, Default: `false`.
      Specified by:
        `isDisabled` in interface `IDisable<IOrgitem>`

    - #### withDisabled

          IOrgitem withDisabled​(boolean disabled)

      Returns a copy of `this` immutable component with the specified `disabled`.

      Sets whether it is disabled.

      When disabled equals true, user can't select this item.

      Specified by:
        `withDisabled` in interface `IDisable<IOrgitem>`
      Parameters:
        `disabled` - Whether it is disabled.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### isRendered

          default boolean isRendered()

      Returns true whether this Orgitem is rendered at client. Unlike `isLoaded()` which is used to check whether all children of this Orgitem are loaded.

      Default: `true`

    - #### isLoaded

          default boolean isLoaded()

      Return true whether all children of this tree item, if any, is loaded at client

      Default: `false`

    - #### isOpen

          default boolean isOpen()

      Returns whether this container is open.

      Default: `true`.

    - #### withOpen

          IOrgitem withOpen​(boolean open)

      Returns a copy of `this` immutable component with the specified `open`.

      Sets whether this container is open.

      Parameters:
        `open` - `false` to hide all sublevel items.

        Default: `true`.

      Returns:
        A modified copy of the `this` object

    - #### isSelected

          default boolean isSelected()

      Returns whether this item is selected.

      Default: `false`

    - #### withSelected

          IOrgitem withSelected​(boolean selected)

      Returns a copy of `this` immutable component with the specified `selected`.

      Sets whether the component is selected.

      Parameters:
        `selected` - `true` to select this component.

        Default: `false`.

      Returns:
        A modified copy of the `this` object

    - #### getOrgchildren

          @Nullable
          IOrgchildren getOrgchildren()

      Returns the Orgchildren that this Orgitem owns, or null if doesn't have any child.

    - #### withOrgchildren

          IOrgitem withOrgchildren​(@Nullable
                                   IOrgchildren children)

      Returns a copy of `this` immutable component with the specified `treechildren`.

      Sets the Orgchildren as a child to this component

      Parameters:
        `children` - The Orgchildren child.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### getOrgnode

          @Nullable
          IOrgnode<IAnyGroup> getOrgnode()

      Returns the Orgnode that this Orgitem owns, or null if doesn't have any child.

    - #### withOrgnode

          IOrgitem withOrgnode​(@Nullable
                               IOrgnode<IAnyGroup> orgnode)

      Returns a copy of `this` immutable component with the specified `orgnode`.

      Sets the Orgnode as a child to this component

      Parameters:
        `orgnode` - The Orgnode child.

        Default: `null`.

      Returns:
        A modified copy of the `this` object

    - #### isContainer

          @Lazy
          default boolean isContainer()

      Returns whether the component is to act as a container which can have sublevel items.

    - #### isEmpty

          @Lazy
          default boolean isEmpty()

      Returns whether to contain any sublevel items or not.

    - #### withAllComponents

          default IOrgitem withAllComponents​(java.lang.Iterable<? extends IOrgitemComposite> elements)

      Description copied from interface: `IComposite`
      Copy the current immutable object with elements that replace the content of `children`. A shallow reference equality check is used to prevent copying of the same value by returning `this`.
      Specified by:
        `withAllComponents` in interface `IComposite<IOrgitem,​IOrgitemComposite>`
      Parameters:
        `elements` - An iterable of children elements to set
      Returns:
        A modified copy of `this` object

    - #### of

          static IOrgitem of​(java.lang.String label)

      Returns the instance with the given label.
      Parameters:
        `label` - The label that the node holds.

    - #### ofImage

          static IOrgitem ofImage​(java.lang.String image)

      Returns the instance with the given image.
      Parameters:
        `image` - The image that the node holds.

    - #### ofId

          static IOrgitem ofId​(java.lang.String id)

      Returns the instance with the given id.
      Parameters:
        `id` - The id to identify this component