Class DefaultGTrableRowModel<T extends GTrableRow<T>>

java.lang.Object
docking.widgets.trable.AbstractGTrableRowModel<T>
docking.widgets.trable.DefaultGTrableRowModel<T>
Type Parameters:
T - the row object type
All Implemented Interfaces:
GTrableRowModel<T>

public class DefaultGTrableRowModel<T extends GTrableRow<T>> extends AbstractGTrableRowModel<T>
Default implementation for a simple GTrable row data model.
  • Field Details

  • Constructor Details

    • DefaultGTrableRowModel

      public DefaultGTrableRowModel(List<T> roots)
  • Method Details

    • getRowCount

      public int getRowCount()
      Description copied from interface: GTrableRowModel
      Returns the total number of rows include open child rows..
      Returns:
      the total number of rows include open child rows.
    • getRow

      public T getRow(int index)
      Description copied from interface: GTrableRowModel
      Returns the row object for the given index..
      Parameters:
      index - the index of the row to retrieve
      Returns:
      the row object for the given index.
    • getIndentLevel

      public int getIndentLevel(int rowIndex)
      Description copied from interface: GTrableRowModel
      Returns the indent level of the row at the given index..
      Parameters:
      rowIndex - the index of the row to get its indent level
      Returns:
      the indent level of the row at the given index.
    • isExpanded

      public boolean isExpanded(int rowIndex)
      Description copied from interface: GTrableRowModel
      Returns true if the row at the given index is expanded..
      Parameters:
      rowIndex - the index of the row to test for expanded
      Returns:
      true if the row at the given index is expanded.
    • isExpandable

      public boolean isExpandable(int rowIndex)
      Description copied from interface: GTrableRowModel
      Returns true if the row at the given index can be expanded.
      Parameters:
      rowIndex - the row to test if expandable
      Returns:
      true if the row at the given index can be expanded
    • collapseRow

      public int collapseRow(int lineIndex)
      Description copied from interface: GTrableRowModel
      Collapse the row at the given row index.
      Parameters:
      lineIndex - the index of the row to collapse
      Returns:
      the total number of rows removed due to collapsing the row
    • removeIndentedRows

      protected int removeIndentedRows(int startIndex, int indentLevel)
    • findNextIndexAtLowerIndentLevel

      protected int findNextIndexAtLowerIndentLevel(int startIndex, int indentLevel)
    • expandRow

      public int expandRow(int lineIndex)
      Description copied from interface: GTrableRowModel
      Expand the row at the given row index.
      Parameters:
      lineIndex - the index of the row to expand
      Returns:
      the total number of rows added due to the expand