Package docking.widgets.table
Class AnyObjectTableModel<T>
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- docking.widgets.table.AbstractGTableModel<T>
-
- docking.widgets.table.AbstractSortedTableModel<ROW_TYPE>
-
- docking.widgets.table.GDynamicColumnTableModel<T,java.lang.Object>
-
- docking.widgets.table.AnyObjectTableModel<T>
-
- Type Parameters:
T
- the row object type
- All Implemented Interfaces:
ConfigurableColumnTableModel
,DynamicColumnTableModel<T>
,RowObjectTableModel<T>
,SelectionStorage<T>
,SortedTableModel
,VariableColumnTableModel
,java.io.Serializable
,java.util.EventListener
,javax.swing.event.ChangeListener
,javax.swing.table.TableModel
public class AnyObjectTableModel<T> extends GDynamicColumnTableModel<T,java.lang.Object>
A table that allow users to provide a list of data objects whose method can be used to create columns.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class docking.widgets.table.GDynamicColumnTableModel
columnSettings, serviceProvider, tableColumns
-
Fields inherited from class docking.widgets.table.AbstractSortedTableModel
hasEverSorted
-
Fields inherited from class docking.widgets.table.AbstractGTableModel
WIDTH_UNDEFINED
-
Fields inherited from interface docking.widgets.table.SortedTableModel
ASCENDING_ORDER, DESCENDING_ORDER
-
-
Constructor Summary
Constructors Constructor Description AnyObjectTableModel(java.lang.String modelName, java.lang.Class<T> dataClass, java.lang.String... methodNames)
AnyObjectTableModel(java.lang.String modelName, java.lang.Class<T> dataClass, java.util.List<java.lang.String> methodNames)
AnyObjectTableModel(java.lang.String modelName, java.lang.reflect.Method... methods)
AnyObjectTableModel(java.lang.String modelName, java.util.List<java.lang.reflect.Method> methods)
AnyObjectTableModel(java.lang.String modelName, java.util.List<T> data, java.lang.Class<T> dataClass, java.util.List<java.lang.String> methodNames)
AnyObjectTableModel(java.lang.String modelName, java.util.List<T> data, java.util.List<java.lang.reflect.Method> methods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TableColumnDescriptor<T>
createTableColumnDescriptor()
java.lang.Object
getDataSource()
Returns the table's context for the data.java.util.List<T>
getModelData()
Implementors should return the current data of the model.java.lang.String
getName()
Returns the name of this modelboolean
isSortable(int columnIndex)
Returns true if the specified columnIndex is sortable.void
setModelData(java.util.List<T> data)
-
Methods inherited from class docking.widgets.table.GDynamicColumnTableModel
addTableColumn, addTableColumn, addTableColumns, createSortComparator, createSortComparatorForColumn, getColumn, getColumnClass, getColumnCount, getColumnDescription, getColumnDisplayName, getColumnIndex, getColumnIndex, getColumnName, getColumnSettings, getColumnSettingsDefinitions, getColumnValueForRow, getDefaultColumnCount, getMaxLines, getPreferredColumnWidth, getRenderer, getUniqueIdentifier, isDefaultColumn, isVisibleByDefault, loadDiscoveredTableColumns, removeTableColumn, removeTableColumns, setAllColumnSettings, setColumnSettings, stateChanged
-
Methods inherited from class docking.widgets.table.AbstractSortedTableModel
addSortListener, createSortingContext, fireTableChanged, getIndexForRowObject, getIndexForRowObject, getPendingSortState, getPrimarySortColumnIndex, getRowIndex, getRowObject, getTableSortState, getValueAt, initializeSorting, isSorted, isSortPending, notifyModelSorted, reSort, setDefaultTableSortState, setTableSortState, sort, sortCompleted
-
Methods inherited from class docking.widgets.table.AbstractGTableModel
dispose, getLastSelectedObjects, getRowCount, refresh, setLastSelectedObjects
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface docking.widgets.table.RowObjectTableModel
fireTableDataChanged, getRowIndex, getRowObject
-
-
-
-
Constructor Detail
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.lang.Class<T> dataClass, java.lang.String... methodNames)
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.lang.reflect.Method... methods)
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.util.List<java.lang.reflect.Method> methods)
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.lang.Class<T> dataClass, java.util.List<java.lang.String> methodNames)
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.util.List<T> data, java.lang.Class<T> dataClass, java.util.List<java.lang.String> methodNames)
-
AnyObjectTableModel
public AnyObjectTableModel(java.lang.String modelName, java.util.List<T> data, java.util.List<java.lang.reflect.Method> methods)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:RowObjectTableModel
Returns the name of this model- Returns:
- the name of this model
-
isSortable
public boolean isSortable(int columnIndex)
Description copied from interface:SortedTableModel
Returns true if the specified columnIndex is sortable.- Specified by:
isSortable
in interfaceSortedTableModel
- Overrides:
isSortable
in classGDynamicColumnTableModel<T,java.lang.Object>
- Parameters:
columnIndex
- the column index- Returns:
- true if the specified columnIndex is sortable
-
getModelData
public java.util.List<T> getModelData()
Description copied from interface:RowObjectTableModel
Implementors should return the current data of the model. For models that support filtering, this will be the filtered version of the data. Furthermore, the data should be the underlying data and not a copy, as this method will potentially sort the given data.For those subclasses using an array, you may use the Arrays class to create a list backed by the array (
Arrays.asList(Object...)
).- Returns:
- the model data.
-
setModelData
public void setModelData(java.util.List<T> data)
-
createTableColumnDescriptor
protected TableColumnDescriptor<T> createTableColumnDescriptor()
- Specified by:
createTableColumnDescriptor
in classGDynamicColumnTableModel<T,java.lang.Object>
-
getDataSource
public java.lang.Object getDataSource()
Description copied from class:GDynamicColumnTableModel
Returns the table's context for the data.- Specified by:
getDataSource
in classGDynamicColumnTableModel<T,java.lang.Object>
- Returns:
- the table's context for the data.
-
-