Class TreeUtils

java.lang.Object
org.adempiere.webui.util.TreeUtils

public class TreeUtils extends Object
Helper methods for working with tree nodes
Author:
hengsin
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    collapseAll(org.zkoss.zul.Tree tree)
    Collapse all nodes
    static void
    collapseTree(org.zkoss.zk.ui.Component treeObject, boolean isOpen)
    travel all node of tree, at selected node, call callback function
    protected static <T> void
    collapseTreeModel(org.zkoss.zul.ext.TreeOpenableModel treeModelOpenable, boolean isOpen, T treeNode)
    Collapse or expand tree nodes
    static void
    expandAll(org.zkoss.zul.Tree tree)
    Expand all nodes
    static boolean
    isOnInitRenderPosted(org.zkoss.zul.Tree tree)
     
    static void
    traverse(org.zkoss.zul.Treechildren treechildren, TreeItemAction action)
    Traverse treechildren and execution action on Treeitem
    static void
    traverse(org.zkoss.zul.TreeModel<Object> model, Object parent, TreeNodeAction action)
    Traverse tree model from parent and execution action on tree node
    static void
    traverse(org.zkoss.zul.TreeModel<Object> model, TreeNodeAction action)
    Traverse tree model and execution action on tree node
    static void
    traverse(org.zkoss.zul.Tree tree, TreeItemAction action)
    Traverse tree and execution action on Treeitem

    Methods inherited from class java.lang.Object

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

    • TreeUtils

      public TreeUtils()
  • Method Details

    • collapseAll

      public static void collapseAll(org.zkoss.zul.Tree tree)
      Collapse all nodes
      Parameters:
      tree -
    • expandAll

      public static void expandAll(org.zkoss.zul.Tree tree)
      Expand all nodes
      Parameters:
      tree -
    • traverse

      public static void traverse(org.zkoss.zul.Tree tree, TreeItemAction action)
      Traverse tree and execution action on Treeitem
      Parameters:
      tree -
      action -
    • traverse

      public static void traverse(org.zkoss.zul.Treechildren treechildren, TreeItemAction action)
      Traverse treechildren and execution action on Treeitem
      Parameters:
      treechildren -
      action -
    • traverse

      public static void traverse(org.zkoss.zul.TreeModel<Object> model, TreeNodeAction action)
      Traverse tree model and execution action on tree node
      Parameters:
      model -
      action -
    • traverse

      public static void traverse(org.zkoss.zul.TreeModel<Object> model, Object parent, TreeNodeAction action)
      Traverse tree model from parent and execution action on tree node
      Parameters:
      model -
      parent -
      action -
    • isOnInitRenderPosted

      public static boolean isOnInitRenderPosted(org.zkoss.zul.Tree tree)
      Parameters:
      tree -
      Returns:
      true if onInitRender event have been posted
    • collapseTree

      public static void collapseTree(org.zkoss.zk.ui.Component treeObject, boolean isOpen)
      travel all node of tree, at selected node, call callback function
      Parameters:
      treeObject - Tree or parent of Tree
      isOpen -
    • collapseTreeModel

      protected static <T> void collapseTreeModel(org.zkoss.zul.ext.TreeOpenableModel treeModelOpenable, boolean isOpen, T treeNode)
      Collapse or expand tree nodes
      Type Parameters:
      T -
      Parameters:
      treeModelOpenable -
      isOpen - true to expand, false to collapse
      treeNode - node to expand from, null to expand from root node