Interface BeanTableModel<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T getBean​(int index)
      Get the bean at the specified index.
      int getBeanCount()
      Get the number of beans in the model.
      java.awt.Cursor getCursor​(java.awt.event.MouseEvent event, javax.swing.JTable table, int rowIndex, int columnIndex)
      Get the mouse cursor to display for a cell.
      java.lang.Object getValue​(T bean, int columnIndex)
      Get a column cell value for a bean.
      void handleClick​(java.awt.event.MouseEvent event, javax.swing.JTable table, int rowIndex, int columnIndex)
      Handle a mouse click on a cell.
      void setBeans​(java.util.Collection<T> beans)
      Replace all rows of the table model.
      void updateBeans​(java.util.Collection<T> beans, java.util.function.BiPredicate<T,​T> isEqual)
      Update existing rows and add missing rows to the table model.
      • Methods inherited from interface javax.swing.table.TableModel

        addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
    • Method Detail

      • getBeanCount

        int getBeanCount()
        Get the number of beans in the model. Need not be the same as the number of the rows in the table.
      • getBean

        T getBean​(int index)
        Get the bean at the specified index.
        Parameters:
        index - the index of the bean.
      • getValue

        java.lang.Object getValue​(T bean,
                                  int columnIndex)
        Get a column cell value for a bean.
      • setBeans

        void setBeans​(java.util.Collection<T> beans)
        Replace all rows of the table model.
        Parameters:
        beans - the new rows
      • updateBeans

        void updateBeans​(java.util.Collection<T> beans,
                         java.util.function.BiPredicate<T,​T> isEqual)
        Update existing rows and add missing rows to the table model.
        Parameters:
        beans - beans to update/append
        isEqual - used to determine if a row is already in the model
      • getCursor

        java.awt.Cursor getCursor​(java.awt.event.MouseEvent event,
                                  javax.swing.JTable table,
                                  int rowIndex,
                                  int columnIndex)
        Get the mouse cursor to display for a cell.
        Parameters:
        rowIndex - the row index of the cell
        columnIndex - the column index of the cell
        Returns:
        the mouse cursor to use for the cell or null to use the default cursor.
      • handleClick

        void handleClick​(java.awt.event.MouseEvent event,
                         javax.swing.JTable table,
                         int rowIndex,
                         int columnIndex)
        Handle a mouse click on a cell.
        Parameters:
        event - the click event
        rowIndex - the row containing the cell
        columnIndex - the column index of the cell