Class DefaultTristateTreeModel<E>

java.lang.Object
org.zkoss.zul.AbstractTreeModel<TreeNode<E>>
org.zkoss.zul.DefaultTreeModel<E>
org.zkoss.zkmax.zul.DefaultTristateTreeModel<E>
All Implemented Interfaces:
Serializable, Openable<TreeNode<E>>, Pageable, Selectable<TreeNode<E>>, Sortable<TreeNode<E>>, TreeOpenableModel, TreeSelectableModel, TristateModel<E>, PageableModel, TreeModel<TreeNode<E>>

public class DefaultTristateTreeModel<E> extends DefaultTreeModel<E> implements TristateModel<E>
A simple tristate tree data model that uses TreeNode to represent a tree. Thus the whole tree of data must be loaded into memory, and each node must be represented by TreeNode.

If you want to implement a huge tristate tree that only a visible part shall be loaded, it is better to implement it by extending from AbstractTreeModel, TristateModel.

This Model is dependent on DefaultTreeModel, for more information please refer it.

Since:
10.0.0
Author:
Jamson Chan
See Also:
  • Field Details

  • Constructor Details

    • DefaultTristateTreeModel

      public DefaultTristateTreeModel(TreeNode<E> root)
      Creates a tristate tree with the specified note as the root.
      Parameters:
      root - the root (cannot be null).
    • DefaultTristateTreeModel

      public DefaultTristateTreeModel(TreeNode<E> root, boolean emptyChildAsLeaf)
      Creates a tristate tree with the specified note as the root.
      Parameters:
      root - the root (cannot be null).
      emptyChildAsLeaf - whether to treat the zero size of children node as a leaf node.
  • Method Details

    • fireSelectionChanged

      protected void fireSelectionChanged(int[] path)
      Description copied from class: AbstractTreeModel
      Fires a TreeDataEvent for all registered listener when selection status has changed.
      Overrides:
      fireSelectionChanged in class AbstractTreeModel<TreeNode<E>>
    • fireTristateSelectionChanged

      protected void fireTristateSelectionChanged(int[] path)
    • clone

      public Object clone()
      Overrides:
      clone in class DefaultTreeModel<E>
    • setMultiple

      public void setMultiple(boolean multiple)
      Description copied from interface: TreeSelectableModel
      Sets the selection mode to be multiple.
      Specified by:
      setMultiple in interface Selectable<E>
      Specified by:
      setMultiple in interface TreeSelectableModel
      Overrides:
      setMultiple in class AbstractTreeModel<TreeNode<E>>
    • addPartialPath

      public boolean addPartialPath(int[] path)
    • addPartialPaths

      public boolean addPartialPaths(int[][] paths)
    • removePartialPath

      public boolean removePartialPath(int[] path)
    • removePartialPaths

      public boolean removePartialPaths(int[][] paths)
    • isPathPartial

      public boolean isPathPartial(int[] path)
    • getPartialPath

      public int[] getPartialPath()
    • getPartialPaths

      public int[][] getPartialPaths()
    • clearPartial

      public void clearPartial()
    • getPartials

      public Set<E> getPartials()
      Description copied from interface: TristateModel
      Returns the current partial selection.
      Specified by:
      getPartials in interface TristateModel<E>
    • isPartial

      public boolean isPartial(Object child)
      Description copied from interface: TristateModel
      Returns whether the item is partially selected.
      Specified by:
      isPartial in interface TristateModel<E>
      Parameters:
      child - a data item
    • addToPartial

      public boolean addToPartial(E child)
    • removeFromPartial

      public boolean removeFromPartial(Object child)