Class SimpleTreeModel

  • All Implemented Interfaces:
    Serializable, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, org.zkoss.zul.ext.Openable<org.zkoss.zul.TreeNode<Object>>, org.zkoss.zul.ext.Pageable, org.zkoss.zul.ext.Selectable<org.zkoss.zul.TreeNode<Object>>, org.zkoss.zul.ext.Sortable<org.zkoss.zul.TreeNode<Object>>, org.zkoss.zul.ext.TreeOpenableModel, org.zkoss.zul.ext.TreeSelectableModel, org.zkoss.zul.PageableModel, org.zkoss.zul.TreeitemRenderer<Object>, org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<Object>>
    Direct Known Subclasses:
    FavoriteSimpleTreeModel

    public class SimpleTreeModel
    extends org.zkoss.zul.DefaultTreeModel<Object>
    implements org.zkoss.zul.TreeitemRenderer<Object>, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
    Author:
    Low Heng Sin
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.zkoss.zul.AbstractTreeModel

        org.zkoss.zul.AbstractTreeModel.DefaultSelectionControl<E extends Object>, org.zkoss.zul.AbstractTreeModel.Path
    • Field Summary

      • Fields inherited from class org.zkoss.zul.AbstractTreeModel

        _opens, _selection
      • Fields inherited from interface org.zkoss.zul.PageableModel

        INTERNAL_EVENT
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleTreeModel​(org.zkoss.zul.DefaultTreeNode<Object> root)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addNode​(org.zkoss.zul.DefaultTreeNode<Object> newNode)
      Add to root
      org.zkoss.zul.DefaultTreeNode<Object> addNode​(org.zkoss.zul.DefaultTreeNode<Object> newParent, org.zkoss.zul.DefaultTreeNode<Object> newNode, int index)  
      void addOnDropEventListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)  
      static SimpleTreeModel createFrom​(MTreeNode root)  
      org.zkoss.zul.DefaultTreeNode<Object> find​(org.zkoss.zul.DefaultTreeNode<Object> fromNode, int recordId)  
      org.zkoss.zul.DefaultTreeNode<Object> getParent​(org.zkoss.zul.DefaultTreeNode<Object> treeNode)  
      org.zkoss.zul.DefaultTreeNode<Object> getRoot()  
      static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree, int AD_Tree_ID, int windowNo)  
      static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree, int AD_Tree_ID, int windowNo, boolean editable, String trxName)  
      static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree, int AD_Tree_ID, int windowNo, boolean editable, String trxName, String linkColName, int linkID)  
      static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree, int AD_Tree_ID, int windowNo, String linkColName, int linkID)  
      boolean isItemDraggable()  
      boolean isTreeDrivenByValue()  
      boolean isValueDisplayed()  
      void nodeUpdated​(org.zkoss.zul.DefaultTreeNode<Object> node)  
      void onEvent​(org.zkoss.zk.ui.event.Event event)  
      void removeNode​(org.zkoss.zul.DefaultTreeNode<Object> treeNode)  
      void render​(org.zkoss.zul.Treeitem ti, Object node, int index)  
      void setIsValueDisplayed​(boolean isValueDisplayed)  
      void setItemDraggable​(boolean b)  
      void setTreeDrivenByValue​(boolean isTreeDrivenByValue)  
      • Methods inherited from class org.zkoss.zul.DefaultTreeModel

        addSelection, clone, getChild, getChildCount, getIndexOfChild, getPath, getSortDirection, isLeaf, isObjectOpened, isOpen, isSelected, removeFromSelection, removeOpenObject, removeSelection, setOpen, sort, sort
      • Methods inherited from class org.zkoss.zul.AbstractTreeModel

        addOpenObject, addOpenPath, addOpenPaths, addPagingEventListener, addSelectionPath, addSelectionPaths, addToSelection, addTreeDataListener, afterSort, beforeSort, clearOpen, clearSelection, fireEvent, fireEvent, fireEvent, fireOpenChanged, fireSelectionChanged, getActivePage, getChild, getOpenCount, getOpenObjects, getOpenPath, getOpenPaths, getPageCount, getPageSize, getSelection, getSelectionControl, getSelectionCount, getSelectionPath, getSelectionPaths, isMultiple, isOpenEmpty, isPathOpened, isPathSelected, isSelectionEmpty, removeOpenPath, removeOpenPaths, removePagingEventListener, removeSelectionPath, removeSelectionPaths, removeTreeDataListener, setActivePage, setMultiple, setOpenObjects, setPageSize, setSelection, setSelectionControl
    • Constructor Detail

      • SimpleTreeModel

        public SimpleTreeModel​(org.zkoss.zul.DefaultTreeNode<Object> root)
    • Method Detail

      • initADTree

        public static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree,
                                                 int AD_Tree_ID,
                                                 int windowNo)
        Parameters:
        tree -
        AD_Tree_ID -
        windowNo -
        Returns:
        SimpleTreeModel
      • initADTree

        public static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree,
                                                 int AD_Tree_ID,
                                                 int windowNo,
                                                 String linkColName,
                                                 int linkID)
      • initADTree

        public static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree,
                                                 int AD_Tree_ID,
                                                 int windowNo,
                                                 boolean editable,
                                                 String trxName)
        Parameters:
        tree -
        AD_Tree_ID -
        windowNo -
        editable -
        trxName -
        Returns:
        SimpleTreeModel
      • initADTree

        public static SimpleTreeModel initADTree​(org.zkoss.zul.Tree tree,
                                                 int AD_Tree_ID,
                                                 int windowNo,
                                                 boolean editable,
                                                 String trxName,
                                                 String linkColName,
                                                 int linkID)
      • isTreeDrivenByValue

        public boolean isTreeDrivenByValue()
      • setTreeDrivenByValue

        public void setTreeDrivenByValue​(boolean isTreeDrivenByValue)
      • isValueDisplayed

        public boolean isValueDisplayed()
      • setIsValueDisplayed

        public void setIsValueDisplayed​(boolean isValueDisplayed)
      • render

        public void render​(org.zkoss.zul.Treeitem ti,
                           Object node,
                           int index)
        Specified by:
        render in interface org.zkoss.zul.TreeitemRenderer<Object>
        Parameters:
        ti -
        node -
      • addNode

        public void addNode​(org.zkoss.zul.DefaultTreeNode<Object> newNode)
        Add to root
        Parameters:
        newNode -
      • getRoot

        public org.zkoss.zul.DefaultTreeNode<Object> getRoot()
        Specified by:
        getRoot in interface org.zkoss.zul.TreeModel<org.zkoss.zul.TreeNode<Object>>
        Overrides:
        getRoot in class org.zkoss.zul.AbstractTreeModel<org.zkoss.zul.TreeNode<Object>>
      • removeNode

        public void removeNode​(org.zkoss.zul.DefaultTreeNode<Object> treeNode)
        Parameters:
        treeNode -
      • setItemDraggable

        public void setItemDraggable​(boolean b)
        Parameters:
        b -
      • isItemDraggable

        public boolean isItemDraggable()
        Returns:
        boolean
      • addOnDropEventListener

        public void addOnDropEventListener​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
        Parameters:
        listener -
      • onEvent

        public void onEvent​(org.zkoss.zk.ui.event.Event event)
                     throws Exception
        Specified by:
        onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
        Parameters:
        event -
        Throws:
        Exception
        See Also:
        EventListener.onEvent(Event)
      • getParent

        public org.zkoss.zul.DefaultTreeNode<Object> getParent​(org.zkoss.zul.DefaultTreeNode<Object> treeNode)
        Parameters:
        treeNode -
        Returns:
        DefaultTreeNode
      • addNode

        public org.zkoss.zul.DefaultTreeNode<Object> addNode​(org.zkoss.zul.DefaultTreeNode<Object> newParent,
                                                             org.zkoss.zul.DefaultTreeNode<Object> newNode,
                                                             int index)
        Parameters:
        newParent -
        newNode -
        index -
        Returns:
        parent node. this could be a new instance created to replace the newParent node param
      • find

        public org.zkoss.zul.DefaultTreeNode<Object> find​(org.zkoss.zul.DefaultTreeNode<Object> fromNode,
                                                          int recordId)
        Parameters:
        fromNode -
        recordId -
        Returns:
        DefaultTreeNode
      • nodeUpdated

        public void nodeUpdated​(org.zkoss.zul.DefaultTreeNode<Object> node)
        Parameters:
        node -