Interface ITreecol<I extends IAnyGroup>

All Superinterfaces:
IChildable<ITreecol<I>,I>, IChildrenOfInputgroup<ITreecol<I>>, IComponent<ITreecol<I>>, IHeaderElement<ITreecol<I>>, IHtmlBasedComponent<ITreecol<I>>, ILabelElement<ITreecol<I>>, ILabelImageElement<ITreecol<I>>, IXulElement<ITreecol<I>>

public interface ITreecol<I extends IAnyGroup> extends IHeaderElement<ITreecol<I>>, IChildable<ITreecol<I>,I>
Immutable Treecol component

Support @Action

Name Action Type
onSort ActionData: SortData
Denotes user has sorted the treeitem of this treecol.
Author:
jumperchen
See Also:
  • Treecol
  • Field Details

    • DEFAULT

      static final ITreecol<IAnyGroup> DEFAULT
      Constant for default attributes of this immutable component.
  • Method Details

    • getWidgetClass

      default String getWidgetClass()
      Returns the client widget class.

      Default: "zul.sel.Treecol"

      Specified by:
      getWidgetClass in interface IComponent<I extends IAnyGroup>
    • getSortDirection

      default String getSortDirection()
      Returns the sort direction.

      Default: "natural".

    • withSortDirection

      ITreecol<I> withSortDirection(String sortDirection)
      Returns a copy of this immutable component with the specified sortDirection.

      Sets the sort direction. This does not sort the data, it only serves as an indicator as to how the tree is sorted. (unless the tree has ITree.isAutosort() attribute for model case)

      Parameters:
      sortDirection - One of "ascending", "descending" and "natural"

      Default: "natural".

      Returns:
      A modified copy of the this object
    • withSortDirection

      default ITreecol<I> withSortDirection(ITreecol.SortDirection sortDirection)
      Returns a copy of this immutable component with the specified sortDirection.

      Sets the sort direction. This does not sort the data, it only serves as an indicator as to how the tree is sorted. (unless the tree has ITree.isAutosort() attribute for model case)

      Parameters:
      sortDirection - One of ITreecol.SortDirection

      Default: ITreecol.SortDirection.NATURAL.

      Returns:
      A modified copy of the this object
    • getMaxlength

      default int getMaxlength()
      Returns the maximal length of each item's label.

      Default: 0 (no limit).

    • withMaxlength

      ITreecol<I> withMaxlength(int maxlength)
      Returns a copy of this immutable component with the specified maxlength.

      Sets the maximal length of each item's label.

      Default: 0 (no limit).

      Notice that maxlength will be applied to this header and all listcell of the same column.

      Parameters:
      maxlength - One of ITreecol.SortDirection

      Default: 0.

      Returns:
      A modified copy of the this object
    • getSortAscending

      @Nullable Comparator<?> getSortAscending()
      Returns the ascending sorter, or null if not available.

      Default: null

    • withSortAscending

      ITreecol<I> withSortAscending(@Nullable Comparator<?> sortAscending)
      Returns a copy of this immutable component with the specified sortAscending.

      Sets the ascending sorter, or null for no sorter for the ascending order.

      Parameters:
      sortAscending - The comparator used to sort the ascending order.

      Default: null.

      Returns:
      A modified copy of the this object
    • withSortAscending

      default ITreecol<I> withSortAscending(String sortAscending) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Returns a copy of this immutable component with the specified sortAscending class name.

      Sets the ascending sorter with the class name, or null for no sorter for the ascending order.

      Parameters:
      sortAscending - The comparator used to sort the ascending order.

      Default: null.

      Returns:
      A modified copy of the this object
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • getSortDescending

      @Nullable Comparator<?> getSortDescending()
      Returns the descending sorter, or null if not available.

      Default: null

    • withSortDescending

      ITreecol<I> withSortDescending(@Nullable Comparator<?> sortDescending)
      Returns a copy of this immutable component with the specified sortDescending.

      Sets the descending sorter, or null for no sorter for the descending order.

      Parameters:
      sortDescending - The comparator used to sort the descending order.

      Default: null.

      Returns:
      A modified copy of the this object
    • withSortDescending

      default ITreecol<I> withSortDescending(String sortDescending) throws ClassNotFoundException, InstantiationException, IllegalAccessException
      Returns a copy of this immutable component with the specified sortDescending class name.

      Sets the descending sorter with the class name, or null for no sorter for the descending order.

      Parameters:
      sortDescending - The comparator used to sort the descending order.

      Default: null.

      Returns:
      A modified copy of the this object
      Throws:
      ClassNotFoundException
      InstantiationException
      IllegalAccessException
    • of

      static <I extends IAnyGroup> ITreecol<I> of(String label)
      Returns the instance with the given label.
      Parameters:
      label - The label belongs to this column.
    • of

      static <I extends IAnyGroup> ITreecol<I> of(String label, String image)
      Returns the instance with the given label and image.
      Parameters:
      label - The label that the column holds.
      image - The image that the column holds.
    • of

      static <I extends IAnyGroup> ITreecol<I> of(Iterable<? extends I> children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • of

      static <I extends IAnyGroup> ITreecol<I> of(I... children)
      Returns the instance with the given any group children.
      Parameters:
      children - The children belong to any group
      See Also:
    • ofImage

      static <I extends IAnyGroup> ITreecol<I> ofImage(String image)
      Returns the instance with the given image.
      Parameters:
      image - The image that the column holds.
    • ofId

      static <I extends IAnyGroup> ITreecol<I> ofId(String id)
      Returns the instance with the given id.
      Parameters:
      id - The id to identify this component