Class DynamicTreeTableModel

java.lang.Object
com.portal.pfc.ui.AbstractTreeTableModel
com.portal.app.cc.DynamicTreeTableModel
All Implemented Interfaces:
TreeTableModel, TreeModel
Direct Known Subclasses:
ItemChargesModel, PendingItemChargesModel

public class DynamicTreeTableModel extends AbstractTreeTableModel
  • Constructor Details

    • DynamicTreeTableModel

      public DynamicTreeTableModel(TreeNode root, String[] columnNames, String[] getterMethodNames, String[] setterMethodNames, Class[] cTypes)
      Constructor for creating a DynamicTreeTableModel.
  • Method Details

    • getChildCount

      public int getChildCount(Object node)
      TreeModel method to return the number of children of a particular node. Since node is a TreeNode, this can be answered via the TreeNode method getChildCount.
    • getChild

      public Object getChild(Object node, int i)
      TreeModel method to locate a particular child of the specified node. Since node is a TreeNode, this can be answered via the TreeNode method getChild.
    • isLeaf

      public boolean isLeaf(Object node)
      TreeModel method to determine if a node is a leaf. Since node is a TreeNode, this can be answered via the TreeNode method isLeaf.
      Specified by:
      isLeaf in interface TreeModel
      Overrides:
      isLeaf in class AbstractTreeTableModel
    • getColumnCount

      public int getColumnCount()
      Returns the number of column names passed into the constructor.
    • getColumnName

      public String getColumnName(int column)
      Returns the column name passed into the constructor.
    • getColumnClass

      public Class getColumnClass(int column)
      Returns the column class for column column. This is set in the constructor.
      Specified by:
      getColumnClass in interface TreeTableModel
      Overrides:
      getColumnClass in class AbstractTreeTableModel
    • getValueAt

      public Object getValueAt(Object node, int column)
      Returns the value for the column column and object node. The return value is determined by invoking the method specified in constructor for the passed in column.
    • isCellEditable

      public boolean isCellEditable(Object node, int column)
      Returns true if there is a setter method name for column column. This is set in the constructor.
      Specified by:
      isCellEditable in interface TreeTableModel
      Overrides:
      isCellEditable in class AbstractTreeTableModel
    • setValueAt

      public void setValueAt(Object aValue, Object node, int column)
      Sets the value to aValue for the object node in column column. This is done by using the setter method name, and coercing the passed in value to the specified type.
    • getPathToRoot

      public TreeNode[] getPathToRoot(TreeNode aNode)
      Builds the parents of the node up to and including the root node, where the original node is the last element in the returned array. The length of the returned array gives the node's depth in the tree.
      Parameters:
      aNode - the TreeNode to get the path for
      an - array of TreeNodes giving the path from the root to the specified node.