Class FIXGRIDTreeBinding<ItemClass extends FIXGRIDTreeItem>

java.lang.Object
org.eclnt.jsfserver.elements.impl.FIXGRIDBinding<ItemClass>
org.eclnt.jsfserver.elements.impl.FIXGRIDTreeBinding<ItemClass>
All Implemented Interfaces:
Serializable, IConfiguredByLayout, IFIXGRIDBinding<ItemClass>, IDynamicContentBindingObject

public class FIXGRIDTreeBinding<ItemClass extends FIXGRIDTreeItem> extends FIXGRIDBinding<ItemClass> implements Serializable, IFIXGRIDBinding<ItemClass>
Binding class for FIXGRID component when being used as tree. The FIXGRIDTreeBinding has a root node which is by default created internally, but which can also be passed explicitly. All tree operations (e.g. adding items) are then done on node level.
See Also:
  • Field Details

    • s_supportAutoScrollOnToggle

      public static boolean s_supportAutoScrollOnToggle
      When set to true (default) then toggling activities an tree node level are couple with a corresponding scrolling: if e.g. the user opens up a tree node item on the bottom of a grid, then the grid automatically is scrolled so that the child items become visible.
    • m_rootNode

      protected FIXGRIDTreeItem m_rootNode
  • Constructor Details

    • FIXGRIDTreeBinding

      public FIXGRIDTreeBinding()
    • FIXGRIDTreeBinding

      public FIXGRIDTreeBinding(boolean changeIndexIsSupported)
      Constructor which allows to switch on performance optimized data management. See FIXGRIDBinding(boolean).
    • FIXGRIDTreeBinding

      public FIXGRIDTreeBinding(FIXGRIDTreeItem rootNode)
      Constructor with explicit passing of root node. The root node is an invisible node, i.e. the first level of visible tree nodes are the nodes below the root node.
    • FIXGRIDTreeBinding

      public FIXGRIDTreeBinding(FIXGRIDTreeItem rootNode, boolean changeIndexIsSupported)
  • Method Details

    • removeNode

      public void removeNode(FIXGRIDTreeItem node)
      Removes node from tree - together with all of its subnodes. If the node or one of its contained subnodes is currently selected then the selection is removed automatically.
    • setSbvalue

      public void setSbvalue(int value)
      Description copied from class: FIXGRIDBinding
      Sets the top index of the grid. Using this method you can scroll the grid to any top position. Please make sure that the value passed is a correct index into your grid.
      Overrides:
      setSbvalue in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • getFoldersAlwaysSortedToTop

      public boolean getFoldersAlwaysSortedToTop()
    • setFoldersAlwaysSortedToTop

      public void setFoldersAlwaysSortedToTop(boolean foldersAlwaysSortedToTop)
      If property is set to true then during sorting folder nodes are always arranged on top of leave nodes.
      Default is "false".
    • getRows

      public List getRows()
      Passes back the currently visible nodes to the client.
      Specified by:
      getRows in interface IFIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • getSbmaximum

      public int getSbmaximum()
      Size of nodes that determine the scroll bar size.
      Specified by:
      getSbmaximum in interface IFIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • setRootNode

      public void setRootNode(FIXGRIDTreeItem value)
      Sets the root node - this method needs to be called with great care: setting a new root node will remove the current tree and replace it by another. Normally the root node is created or passed at construction point of time - and not changed during the life cycle of the object.
    • getRootNode

      public FIXGRIDTreeItem getRootNode()
      Gets the root node. The root node is not visible to the user (the first visible hierarchy layer is the one below the root node.
    • ensureItemToBeDisplayed

      public void ensureItemToBeDisplayed(ItemClass item)
      Ensures that the passed item is displayed within the tree. Two consequences: the tree will get opened correspondingly, and the tree may be scrolled.
      Specified by:
      ensureItemToBeDisplayed in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • sortGrid

      protected void sortGrid(String sortReference, String objectBindingString, boolean ascending)
      Description copied from class: FIXGRIDBinding
      Actual sorting of grid. This method needs to be overridden by grid implementations.
      Specified by:
      sortGrid in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • sortGridByOriginalIndex

      protected void sortGridByOriginalIndex()
      Description copied from class: FIXGRIDBinding
      In case the grid is supporting "triplesort": this is the method to sort the grid by its original index
      Specified by:
      sortGridByOriginalIndex in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • sortNodes

      protected void sortNodes(FIXGRIDTreeItem node, String sortReference, String objectBindingString, boolean ascending)
    • sortNodesByOriginalIndex

      protected void sortNodesByOriginalIndex(FIXGRIDTreeItem node)
    • applyOriginalIndexToCurrentContent

      public void applyOriginalIndexToCurrentContent()
      Description copied from interface: IFIXGRIDBinding
      When using triple state sorting then the original index of the items needs to be stored in the items. This method assigns this original index.
      Specified by:
      applyOriginalIndexToCurrentContent in interface IFIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • applyOriginalIndexToCurrentNode

      protected void applyOriginalIndexToCurrentNode(FIXGRIDTreeItem node)
    • setSbvisibleamount

      public void setSbvisibleamount(int value)
      Description copied from class: FIXGRIDBinding
      Internal use only.
      Specified by:
      setSbvisibleamount in interface IFIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
      Overrides:
      setSbvisibleamount in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • renderingBegins

      public void renderingBegins()
      Description copied from class: FIXGRIDBinding
      This method is called with each request processing - at the beginning of the processing.
      Specified by:
      renderingBegins in interface IFIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
      Overrides:
      renderingBegins in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • expandAll

      public void expandAll(javax.faces.event.ActionEvent event)
      Same method as expandAll without parameters - but directly usable as action listener. This method directly calls expandAll().
    • collapseAll

      public void collapseAll(javax.faces.event.ActionEvent event)
      Same method as collapseAll() without parameters - but directly usable as action listener. This method directly calls collapseAll().
    • expandTopNodes

      public void expandTopNodes(javax.faces.event.ActionEvent event)
      Same method as expandTopNodes() without parameter - but directly usable as action listener.
    • collapseTopNodes

      public void collapseTopNodes(javax.faces.event.ActionEvent event)
      Same method as collapseTopNodes() without parameter - but directly usable as action listener.
    • expandAll

      public void expandAll()
      Expands the whole tree, so that all items are shown. In case the tree is not fully loaded then the corresponding toggle events are passed to the tree processing. The method simulates the normal toggle-processing that is normally executed by the user.
    • collapseAll

      public void collapseAll()
      Collapses all nodes which are currently loaded.
    • expandTopNodes

      public void expandTopNodes()
      Expands top nodes.
    • collapseTopNodes

      public void collapseTopNodes()
      Collapses top nodes.
    • getNodeTextsFromTop

      public List<String> getNodeTextsFromTop(FIXGRIDTreeItem item)
      Passes back a list of texts representing the texts from the top node down to the node that is passed as parameter. The list can be used afterwards to select an item by text.
    • getItemByText

      public ItemClass getItemByText(List<String> itemTexts)
      Passes back a node that is represented by the passed text list. The text list contains all texts of the node: from the top node down to the node that you want to retrieve.
    • getSelectedItemsAsSequence

      public Collection<ItemClass> getSelectedItemsAsSequence()
      Returns all selected items in the sequence they occur within the grid. Use getSelectedItems() returning a Set for normal operations - it is much faster. Only use this method when really requiring the order of items.
    • fillShiftSelection

      protected void fillShiftSelection()
      Description copied from class: FIXGRIDBinding
      Default implementation: no shift selection, but just normal selection
      Overrides:
      fillShiftSelection in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • getListOfItems

      protected List<ItemClass> getListOfItems()
      Description copied from class: FIXGRIDBinding
      Returns all items of the current grid in the sequence of their visual appearance. This is the central method that is accessed by generic grid functions, e.g. export functions.

      You may override this function when you load your grid data step by step - the caller of this function expects all items to be available.
      Specified by:
      getListOfItems in class FIXGRIDBinding<ItemClass extends FIXGRIDTreeItem>
    • triggerRowsUpdate

      protected void triggerRowsUpdate()
      This method is called every time something happens in the tree that requires a rebuild of buffers that are required within the building up of visible items in the method getRows().