Interface ITreeitem

    • Field Detail

      • DEFAULT

        static final ITreeitem DEFAULT
        Constant for default attributes of this immutable component.
    • Method Detail

      • getWidgetClass

        default java.lang.String getWidgetClass()
        Returns the client widget class.

        Default: "zul.sel.Treeitem"

        Specified by:
        getWidgetClass in interface IComponent<ITreeitem>
      • getWidth

        @Derived
        @Nullable
        default java.lang.String getWidth()
        Description copied from interface: IHtmlBasedComponent
        Returns the width of the component. If not specified, null is assumed.

        Default: null

        Specified by:
        getWidth in interface IHtmlBasedComponent<ITreeitem>
      • withWidth

        default ITreeitem withWidth​(@Nullable
                                    java.lang.String width)
        To control the size of Treeitem related components, please refer to ITree and ITreecol instead.
        Specified by:
        withWidth in interface IHtmlBasedComponent<ITreeitem>
        Parameters:
        width - The width of the component.

        Default: null

        Returns:
        A modified copy of the this object
      • withHflex

        default ITreeitem withHflex​(@Nullable
                                    java.lang.String hflex)
        To control the size of Treeitem related components, please refer to ITree and ITreecol instead.
        Specified by:
        withHflex in interface IHtmlBasedComponent<ITreeitem>
        Parameters:
        hflex - The horizontal flex hint.

        Default: null

        Returns:
        A modified copy of the this object
      • withAllComponents

        default ITreeitem withAllComponents​(java.lang.Iterable<? extends ITreeitemComposite> 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<ITreeitem,​ITreeitemComposite>
        Parameters:
        elements - An iterable of children elements to set
        Returns:
        A modified copy of this object
      • getTreerow

        @Nullable
        ITreerow getTreerow()
        Returns the treerow that this tree item owns (might null). Each tree items has exactly one tree row.
      • withTreerow

        ITreeitem withTreerow​(@Nullable
                              ITreerow treerow)
        Returns a copy of this immutable component with the specified treerow.

        Sets the treerow as a child to this component

        Parameters:
        treerow - The treerow child.

        Default: null.

        Returns:
        A modified copy of the this object
      • getTreechildren

        @Nullable
        ITreechildren getTreechildren()
        Returns the treechildren that this tree item owns, or null if doesn't have any child.
      • withTreechildren

        ITreeitem withTreechildren​(@Nullable
                                   ITreechildren treechildren)
        Returns a copy of this immutable component with the specified treechildren.

        Sets the treechildren as a child to this component

        Parameters:
        treechildren - The treechildren child.

        Default: null.

        Returns:
        A modified copy of the this object
      • getIndex

        default int getIndex()
        Return the index of this item

        Default: -1, meaning not set

      • withIndex

        ITreeitem withIndex​(int index)
        Returns a copy of this immutable component with the specified index.

        Sets the index of this component.

        Parameters:
        index - The index of the child from its parent component.

        Default: -1, meaning not set.

        Returns:
        A modified copy of the this object
      • getImage

        @Nullable
        default java.lang.String getImage()
        Returns the image of the first ITreecell it contains.

        Default: null

      • withImage

        ITreeitem withImage​(@Nullable
                            java.lang.String image)
        Returns a copy of this immutable component with the specified image.

        Sets the image of the first ITreecell it contains.

        If treerow and treecell are not created, this method create them automatically.

        Parameters:
        image - The image of the first ITreecell it contains.

        Default: null.

        Returns:
        A modified copy of the this object
      • getLabel

        @Nullable
        default java.lang.String getLabel()
        Returns the label of the first ITreecell it contains.

        Default: null

      • withLabel

        ITreeitem withLabel​(@Nullable
                            java.lang.String label)
        Returns a copy of this immutable component with the specified label.

        Sets the label of the first ITreecell it contains.

        If treerow and treecell are not created, this method create them automatically.

        Parameters:
        label - The label of the first ITreecell it contains.

        Default: null.

        Returns:
        A modified copy of the this object
      • isOpen

        default boolean isOpen()
        Returns whether this container is open.

        Default: true.

      • withOpen

        ITreeitem 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

        ITreeitem 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
      • isLoaded

        default boolean isLoaded()
        Return true whether all children of this tree item, if any, is loaded at client

        Default: false

      • isSelectable

        default boolean isSelectable()
        Returns whether it is selectable.

        Default: true.

      • 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 tree items or not.
      • withSelectable

        ITreeitem withSelectable​(boolean selectable)
        Returns a copy of this immutable component with the specified selectable.

        If the tree is in a checkmark mode, the selectable state will affect the checkable icon to display or not.

        Parameters:
        selectable - false to indicate the checkable icon is not displayed.

        Default: true.

        Returns:
        A modified copy of the this object
      • isRendered

        default boolean isRendered()
        Returns true whether this tree item is rendered at client. Unlike isLoaded() which is used to check whether all children of this tree item are loaded.

        Default: true

      • of

        static ITreeitem of​(java.lang.String label)
        Returns the instance with the given label.
        Parameters:
        label - The label that the first tree cell holds.
      • ofId

        static ITreeitem ofId​(java.lang.String id)
        Returns the instance with the given id.
        Parameters:
        id - The id to identify this component
      • of

        static ITreeitem of​(java.lang.String label,
                            ITreeitem... items)
        Returns the instance with the given label and all sublevel items.
        Parameters:
        label - The label that the first tree cell holds.
        items - All sublevel items belong to this item
      • of

        static ITreeitem of​(java.lang.String label,
                            java.lang.Iterable<? extends ITreeitem> items)
        Returns the instance with the given label and all sublevel items.
        Parameters:
        label - The label that the first tree cell holds.
        items - All sublevel items belong to this item
      • ofTreerow

        static ITreeitem ofTreerow​(ITreerow treerow)
        Returns the instance with the given treerow.
        Parameters:
        treerow - The treerow belongs to this component.
      • ofTreecells

        static ITreeitem ofTreecells​(ITreecell<IAnyGroup>... treecells)
        Returns the instance with the given tree cells.
        Parameters:
        treecells - All tree cells belong to this component.
      • ofTreecells

        static ITreeitem ofTreecells​(java.lang.Iterable<? extends ITreecell<IAnyGroup>> treecells)
        Returns the instance with the given tree cells.
        Parameters:
        treecells - All tree cells belong to this component.