Class GTreeTableModel<T extends GTreeTableNode>

All Implemented Interfaces:
ConfigurableColumnTableModel, DynamicColumnTableModel<T>, RowObjectFilterModel<T>, RowObjectTableModel<T>, SelectionStorage<T>, SortedTableModel, VariableColumnTableModel, Serializable, EventListener, ChangeListener, TableModel

public class GTreeTableModel<T extends GTreeTableNode> extends ThreadedTableModelStub<T>
See Also:
  • Constructor Details

  • Method Details

    • createTableColumnDescriptor

      protected TableColumnDescriptor<T> createTableColumnDescriptor()
      Add the GTreeTableModel<T extends GTreeTableNode>.TreeColumn by default, override to add additional columns

      Specified by:
      createTableColumnDescriptor in class GDynamicColumnTableModel<T extends GTreeTableNode, Object>
    • doFilter

      protected List<T> doFilter(List<T> data, TableSortingContext<T> lastSortingContext, TaskMonitor monitor) throws CancelledException
      Any rows that match the filter have all of their ancestors added to the filtered tree to ensure the tree structure remains intact

      Override this to change how filtering is performed. This implementation will do nothing if a TableFilter has not been set via a call to ThreadedTableModel.setTableFilter(TableFilter).

      Overrides:
      doFilter in class ThreadedTableModel<T extends GTreeTableNode, Object>
      Parameters:
      data - The list of data to be filtered.
      lastSortingContext - the comparator used to sort data. This can be used by overridden filter methods that need to query data about how the table is sorted.
      monitor - the progress monitor to check for cancellation.
      Returns:
      The new filtered list of data. If no filtering takes place, then the original list should be returned.
      Throws:
      CancelledException - If the filter operation is cancelled.
    • doLoad

      protected void doLoad(Accumulator<T> accumulator, TaskMonitor monitor) throws CancelledException
      Description copied from class: ThreadedTableModel
      The basic method that all children must implement. This is where children load their data.
      Specified by:
      doLoad in class ThreadedTableModel<T extends GTreeTableNode, Object>
      Parameters:
      accumulator - the datastructure into which you should incrementally place you table row data
      monitor - the task monitor to check for cancellations and to update progress
      Throws:
      CancelledException - if the task monitor has been cancelled and a call is made to monitor.checkCancelled();.
    • setRootNode

      public boolean setRootNode(GTreeTableNode node)
      Set the root node of this model
      Parameters:
      node - Root node to set
      Returns:
      True if node is different, false otherwise
    • treeColumnName

      protected String treeColumnName()
      Name of the tree column, allows extending classes the ability to change the name
      Returns:
      Tree column name