Class FIXGRIDTreeItem

java.lang.Object
org.eclnt.jsfserver.elements.impl.FIXGRIDItem
org.eclnt.jsfserver.elements.impl.FIXGRIDTreeItem
All Implemented Interfaces:
Serializable, Comparable, IFIXGRIDItem
Direct Known Subclasses:
DynBeanTreeUI.TreeNode, ServerFileBrowser.TreeNode, StreamStoreTreeUI.TreeNode, WorkplaceFunctionTree.FunctionNode

public class FIXGRIDTreeItem extends FIXGRIDItem implements Serializable, Comparable
Base class for all items that are managed within a FIXGRIDTreeBinding scenario. The FIXGRIDTreeItem internally provides the following functions:

(A) It may hold one ore more children.
(B) It has a certain status - this is the either open/closed for "folder nodes" or endnode for "leaf nodes"
(C) If has a certain level - this is the hierarchy level starting with "0" for top nodes.
See Also:
  • Field Details

  • Constructor Details

    • FIXGRIDTreeItem

      public FIXGRIDTreeItem(FIXGRIDTreeItem parentNode)
      Creates an item that is added as child to the parentNode item.
    • FIXGRIDTreeItem

      public FIXGRIDTreeItem(FIXGRIDTreeItem parentNode, boolean asFirst)
      Creates an item that is added as child to the parentNode item. Dependent on "asFirst" the new node is added either as last child ot as first child into the parent node.
  • Method Details

    • setLevel

      public void setLevel(int value)
      Internal use only.
    • getLevelInt

      public int getLevelInt()
      Hierarchy level the item has within the tree hierarchy. Highest level of root node is -1, so that top level of contained nodes is level 0.
    • getLevel

      public String getLevel()
    • setText

      public void setText(String value)
      Sets the text of the node.
    • getText

      public String getText()
    • getTextForExport

      public String getTextForExport()
      Text that is used when exporting the corresponding tree - e.g. to PDF. In this text the level of the tree node is reflected by prepenging a corresponding number of non-breakable spaces.
    • setImage

      public void setImage(String value)
      Sets the image that is rendered for the node. Setting the image is optional.
    • getImage

      public String getImage()
    • setStatus

      public void setStatus(int value)
      Sets the status of the current node. The status either is STATUS_CLOSED, STATUS_OPENED or STATUS_ENDNODE.
    • getStatusInt

      public int getStatusInt()
      Status of node, one of the STATUS_* constants defined for this class. Use the status to open/close folders from your logic.
    • getStatus

      public String getStatus()
    • getRequestfocus

      public String getRequestfocus()
      Internal use only.
    • requestFocus

      public void requestFocus()
      Request the focus for the current tree node.
      Specified by:
      requestFocus in interface IFIXGRIDItem
      Overrides:
      requestFocus in class FIXGRIDItem
    • getParentNode

      public FIXGRIDTreeItem getParentNode()
    • getChildNodes

      public List<FIXGRIDTreeItem> getChildNodes()
    • getAllContainedNodes

      public Set<FIXGRIDTreeItem> getAllContainedNodes()
      Returns:
      All the nodes that are children of this node - with drilling down recursively - # and the node itself.
    • appendVisibleSubNodes

      public void appendVisibleSubNodes(List<FIXGRIDTreeItem> list, int counter, int maxCounter)
    • processTREENDOEAction

      public void processTREENDOEAction(javax.faces.event.ActionEvent event)
      This is the central method that is called by default by client side TREENODE events. It automatically handles the event "toggle". In case of enhancing a TREENODE (e.g. adding drag & drop onto TREENODE level) you need to override this method and add the behavior for the specific event. In any case you need to call this super-implementation within your implementation!
    • removeAllChildNodes

      public void removeAllChildNodes()
      Removes all children of a certain node - without drill down.

      Please pay attention: the selection of grid items is automatically affected with the removal of items - you have to explicitly call it (e.g. by callind FIXGRIDBinding.deselectCurrentSelection().
    • removeAllChildNodes

      public void removeAllChildNodes(boolean withDrillDown)
      Parameters:
      withDrillDown - If true then the removing is also done for all children which are contained below the node. Otherwise, if false, then only the children below the node are removed - the removing is not drilled down to all child node levels.

      Please pay attention: the selection of grid items is automatically affected with the removal of items - you have to explicitly call it (e.g. by callind FIXGRIDBinding.deselectCurrentSelection().
    • removeNode

      public void removeNode()
    • addSubNode

      public void addSubNode(FIXGRIDTreeItem subNode, boolean asFirst)
    • addSubNode

      public void addSubNode(FIXGRIDTreeItem subNode, int index)
    • closeAllNodes

      public void closeAllNodes()
      Recursively closes this node and all nodes below.
    • openAllParentNodes

      public void openAllParentNodes()
      Opens all nodes that are parent nodes of this node. This function is required if you want to ensure that one node is visible. The node can only be visible if all parent nodes have the status STATUS_OPENED.
    • moveSubNodeToFirst

      public void moveSubNodeToFirst(FIXGRIDTreeItem subNode)
      Moves on subNode within its parent to the first child position.
    • moveSubNodeToLast

      public void moveSubNodeToLast(FIXGRIDTreeItem subNode)
      Moves on subNode within its parent to the last child position.
    • moveSubNodeOneUp

      public void moveSubNodeOneUp(FIXGRIDTreeItem subNode)
      Moves one child node up within its parent. This means that if the parent node holds the children N1,N2,N3,N4 then after calling N3.moveSubNodeOneUp() the child sequence will be N1,N3,N2,N4.
    • moveSubNodesOneUp

      public void moveSubNodesOneUp(Set<FIXGRIDTreeItem> subNodes)
      Move operation with a set of subNodes. See moveSubNodeOneUp(FIXGRIDTreeItem) for more information.
    • moveSubNodeOneDown

      public void moveSubNodeOneDown(FIXGRIDTreeItem subNode)
      See moveSubNodeOneUp(FIXGRIDTreeItem) - this is just the opposite direction of moving...
    • moveSubNodesOneDown

      public void moveSubNodesOneDown(Set<FIXGRIDTreeItem> subNodes)
      Move a set of nodes within its parent.
    • moveSubNodeInFront

      public void moveSubNodeInFront(FIXGRIDTreeItem subNode, FIXGRIDTreeItem refSubNode)
      Change sequence of nodes within the parent node.
    • moveSubNodeBehind

      public void moveSubNodeBehind(FIXGRIDTreeItem subNode, FIXGRIDTreeItem refSubNode)
      Change sequence of nodes within the parent node.
    • checkIfNodeHasAsParent

      public boolean checkIfNodeHasAsParent(FIXGRIDTreeItem potentialParent)
      Checks if the node that is passed as paramter is a parent of this node.
    • expandNodeAndSubNodes

      public void expandNodeAndSubNodes()
      Expands all sub nodes for this tree item. This method simulates the normal toggle processing, i.e. corresponding calls "onToggle" are made to the application. It exactly simulated the user opening one tree item after the other, recursively.
    • expandNode

      public void expandNode()
      Expands this node. The normal onToggle() method will be called as result.
    • collapseNode

      public void collapseNode()
      Collapses this node. The normal onToggle() method will be called as result.
    • collapseNodeAndSubNodes

      public void collapseNodeAndSubNodes()
      Collapses all sub nodes for this tree item. Counterpart of the expandNodeAndSubNodes() method.
    • onToggle

      public void onToggle()
      Event that is passed from the client when the user open/close a folder node. You may read sub-items into the tree as reaction. OVerride this method in your implementation.
    • compareTo

      public int compareTo(Object o)
      Compare operation for sorting.
      Specified by:
      compareTo in interface Comparable
    • getLineDrawing

      public String getLineDrawing()
    • toggleNodeAndScroll

      protected void toggleNodeAndScroll(javax.faces.event.ActionEvent event)
    • toggleNode

      public void toggleNode()