Class FavouriteController

java.lang.Object
org.adempiere.webui.desktop.FavouriteController

public class FavouriteController extends Object
Controller for favourite menu nodes
Author:
hengsin, Logilite Technologies - IDEMPIERE-3340
  • Method Details

    • getInstance

      public static FavouriteController getInstance(org.zkoss.zk.ui.Session currSess)
      Get favourites controller instance for current session
      Parameters:
      currSess -
      Returns:
      FavouriteController session instance
    • addNode

      public boolean addNode(int nodeId)
      Add node (by node id) to favourties
      Parameters:
      nodeId -
      Returns:
      true if successfully added
    • addNode

      public boolean addNode(MTreeNode node)
      Add tree node to favourites
      Parameters:
      node -
      Returns:
      true if successfully added
    • removeNode

      public boolean removeNode(int nodeId)
      Remove node (by node id) from favourites
      Parameters:
      nodeId -
      Returns:
      true if found and remove
    • hasNode

      public boolean hasNode(int nodeId)
      Parameters:
      nodeId -
      Returns:
      true if node id is in the current favourites list
    • getFavourites

      public List<MTreeNode> getFavourites()
      Returns:
      List of favourites node
    • addInsertedCallback

      public void addInsertedCallback(Callback<MTreeNode> callback)
      Add callback for after add node to favourites
      Parameters:
      callback -
    • addDeletedCallback

      public void addDeletedCallback(Callback<Integer> callback)
      Add callback for after remove node from favourites
      Parameters:
      callback -
    • getAD_Tree_Favorite_ID

      public int getAD_Tree_Favorite_ID()
      Returns:
      AD_Tree_Favorite_ID
    • getRootNode

      public MTreeNode getRootNode()
      Returns:
      root MTreeNode
    • setTreeAndModel

      public void setTreeAndModel(FavoriteSimpleTreeModel treeModel, org.zkoss.zul.Tree tree)
      Parameters:
      treeModel - FavoriteSimpleTreeModel
      tree - Tree