Package swingtree.api.model
Interface BasicTableModel
- All Superinterfaces:
TableModel
This interface defines a basic table model which can be used to create a table model using lambda expressions.
Implementations of this are typically created declarative like so:
UI.table( conf -> conf
.colNames("A", "B")
.colCount(()->2)
.rowCount(()->3)
.getsEntryAt((int row, int col)->
vm.getDataAt(row, col)
)
)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe class below is a functional builder for creating a lambda based implementation of theBasicTableModel.static interfaceImplementations of this functional interface translate to theTableModel.isCellEditable(int, int)method.static interfaceImplementations of this functional interface translate to theTableModel.getColumnClass(int)method.static interfaceImplementations of this functional interface translate to theTableModel.getColumnCount()method.static interfaceImplementations of this functional interface translate to theTableModel.getColumnName(int)method.static interfaceImplementations of this functional interface translate to theTableModel.getValueAt(int, int)method.static interfaceImplementations of this functional interface translate to theTableModel.setValueAt(Object, int, int)method.static interfaceImplementations of this functional interface translate to theTableModel.getRowCount()method. -
Method Summary
Modifier and TypeMethodDescriptiondefault voiddefault Class<?> getColumnClass(int columnIndex) intdefault StringgetColumnName(int columnIndex) intgetValueAt(int rowIndex, int columnIndex) default booleanisCellEditable(int rowIndex, int columnIndex) default voidvoidsetValueAt(Object aValue, int rowIndex, int columnIndex)
-
Method Details
-
getRowCount
int getRowCount()- Specified by:
getRowCountin interfaceTableModel
-
getColumnCount
int getColumnCount()- Specified by:
getColumnCountin interfaceTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel
-
isCellEditable
default boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditablein interfaceTableModel
-
addTableModelListener
- Specified by:
addTableModelListenerin interfaceTableModel
-
removeTableModelListener
- Specified by:
removeTableModelListenerin interfaceTableModel
-