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().withModel(
UI.tableModel()
.colNames("A", "B")
.colCount(()->2)
.rowCount(()->3)
.getsEntryAt((int row, int col)->
vm.getData(row, col)
)
)
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
The class below is a functional builder for creating a lambda based implementation of theBasicTableModel
.static interface
Implementations of this functional interface translate to theTableModel.isCellEditable(int, int)
method.static interface
Implementations of this functional interface translate to theTableModel.getColumnClass(int)
method.static interface
Implementations of this functional interface translate to theTableModel.getColumnCount()
method.static interface
Implementations of this functional interface translate to theTableModel.getColumnName(int)
method.static interface
Implementations of this functional interface translate to theTableModel.getValueAt(int, int)
method.static interface
Implementations of this functional interface translate to theTableModel.setValueAt(Object, int, int)
method.static interface
Implementations of this functional interface translate to theTableModel.getRowCount()
method. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
default Class<?>
getColumnClass
(int columnIndex) int
default String
getColumnName
(int columnIndex) int
getValueAt
(int rowIndex, int columnIndex) default boolean
isCellEditable
(int rowIndex, int columnIndex) default void
void
setValueAt
(Object aValue, int rowIndex, int columnIndex)
-
Method Details
-
getRowCount
int getRowCount()- Specified by:
getRowCount
in interfaceTableModel
-
getColumnCount
int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
-
isCellEditable
default boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditable
in interfaceTableModel
-
addTableModelListener
- Specified by:
addTableModelListener
in interfaceTableModel
-
removeTableModelListener
- Specified by:
removeTableModelListener
in interfaceTableModel
-