Class SelectableTableModel<T>

java.lang.Object
io.deephaven.multiviewwidget.ui.util.SelectableTableModel<T>
All Implemented Interfaces:
ActiveTableModel<T>, TableModel

public class SelectableTableModel<T> extends Object implements ActiveTableModel<T>
  • Field Details

  • Constructor Details

    • SelectableTableModel

      public SelectableTableModel(List<T> allValues)
  • Method Details

    • hasItem

      public boolean hasItem(T item)
      Check if a specific item exists within our known values
      Parameters:
      item - an item to verify is included in our known values
      Returns:
      true if the item may be added to the selection, else false
    • selectItem

      public void selectItem(T item)
      Add the specified item to the set of selected items.
      Specified by:
      selectItem in interface ActiveTableModel<T>
      Parameters:
      item - the item to mark selected
    • selectItems

      public void selectItems(Collection<T> items)
      Change the set of selected items to reflect the specified items
      Specified by:
      selectItems in interface ActiveTableModel<T>
      Parameters:
      items - the collection of item to mark selected
    • toggleItem

      public void toggleItem(T item)
      Toggle the selection of a particular item.
      Specified by:
      toggleItem in interface ActiveTableModel<T>
      Parameters:
      item - the item to toggle
    • selectAll

      public void selectAll()
      Select every value.
      Specified by:
      selectAll in interface ActiveTableModel<T>
    • clearSelection

      public void clearSelection()
      Deselect all values.
      Specified by:
      clearSelection in interface ActiveTableModel<T>
    • getSelectedValues

      public Collection<T> getSelectedValues()
      Description copied from interface: ActiveTableModel
      Get a collection of items currently selected
      Specified by:
      getSelectedValues in interface ActiveTableModel<T>
      Returns:
      the selected items
    • getRowCount

      public int getRowCount()
      Specified by:
      getRowCount in interface TableModel
    • getColumnCount

      public int getColumnCount()
      Specified by:
      getColumnCount in interface TableModel
    • getColumnName

      public String getColumnName(int columnIndex)
      Specified by:
      getColumnName in interface TableModel
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Specified by:
      getColumnClass in interface TableModel
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Specified by:
      isCellEditable in interface TableModel
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      Specified by:
      getValueAt in interface TableModel
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Specified by:
      setValueAt in interface TableModel
    • addTableModelListener

      public void addTableModelListener(TableModelListener l)
      Specified by:
      addTableModelListener in interface TableModel
    • removeTableModelListener

      public void removeTableModelListener(TableModelListener l)
      Specified by:
      removeTableModelListener in interface TableModel