Package io.guise.framework.model
Class AbstractTableModel
java.lang.Object
com.globalmentor.beans.BoundPropertyObject
io.guise.framework.model.AbstractModel
io.guise.framework.model.AbstractTableModel
- All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable
,com.globalmentor.beans.PropertyConstrainable
,Model
,TableModel
- Direct Known Subclasses:
CalendarMonthTableModel
,DefaultTableModel
An abstract implementation of a table model. The table model is editable by default.
- Author:
- Garret Wilson
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.guise.framework.model.TableModel
TableModel.Cell<C>
-
Field Summary
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addColumn
(TableColumnModel<?> column) Adds a column to the table.protected void
Clears all columns from the table.<C> C
getCellValue
(TableModel.Cell<C> cell) Returns the cell value for the given cell.int
int
getColumnIndex
(TableColumnModel<?> column) Determines the logical index of the given table column.List<TableColumnModel<?>>
<C> void
setCellValue
(TableModel.Cell<C> cell, C newCellValue) Sets the cell value for the given cell.Methods inherited from class io.guise.framework.model.AbstractModel
getEventListenerManager, getPlainText
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from interface com.globalmentor.beans.PropertyConstrainable
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
Methods inherited from interface io.guise.framework.model.TableModel
getCellValue, getRowCount, setCellValue
-
Constructor Details
-
AbstractTableModel
Columns constructor.- Parameters:
columns
- The models representing the table columns.
-
-
Method Details
-
getColumns
- Specified by:
getColumns
in interfaceTableModel
- Returns:
- A read-only list of table columns in physical order.
-
getColumnIndex
Description copied from interface:TableModel
Determines the logical index of the given table column.- Specified by:
getColumnIndex
in interfaceTableModel
- Parameters:
column
- One of the table columns.- Returns:
- The zero-based logical index of the column within the table, or -1 if the column is not one of the model's columns.
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
- Returns:
- The number of columns in this table.
-
addColumn
Adds a column to the table.- Parameters:
column
- The column to add.
-
clearColumns
protected void clearColumns()Clears all columns from the table. -
getCellValue
Description copied from interface:TableModel
Returns the cell value for the given cell. This method delegates toTableModel.getCellValue(int, TableColumnModel)
.- Specified by:
getCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell value.- Parameters:
cell
- The cell containing the row index and column information.- Returns:
- The value in the cell at the given row and column, or
null
if there is no value in that cell.
-
setCellValue
Description copied from interface:TableModel
Sets the cell value for the given cell. This method delegates toTableModel.setCellValue(int, TableColumnModel, Object)
.- Specified by:
setCellValue
in interfaceTableModel
- Type Parameters:
C
- The type of cell value.- Parameters:
cell
- The cell containing the row index and column information.newCellValue
- The value to place in the cell at the given row and column, ornull
if there should be no value in that cell.
-