Class TableModelWrapper<ROW_OBJECT>
- Type Parameters:
ROW_OBJECT- the row object type
- All Implemented Interfaces:
RowObjectFilterModel<ROW_OBJECT>,RowObjectTableModel<ROW_OBJECT>,SelectionStorage<ROW_OBJECT>,WrappingTableModel,TableModel
-
Field Summary
FieldsFields inherited from interface docking.widgets.table.RowObjectFilterModel
SUB_FILTERING_DISABLED_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidfireTableChanged(TableModelEvent event) This method allows us to call the delegate model with a translated eventvoidSends an event to all listeners that all the data inside of this model may have changed.Class<?> getColumnClass(int columnIndex) intgetColumnName(int columnIndex) getColumnValueForRow(ROW_OBJECT t, int columnIndex) Implementors are expected to return a value at the given column index for the specified row object.Implementors should return the current data of the model.intReturns the model index of the given item.intgetModelRow(int viewRow) Returns the unwrapped model's row for the given view row.getName()Returns the name of this modelintintReturns the row number for the given object.getRowObject(int viewRow) Returns the row object for the given row.intgetValueAt(int rowIndex, int columnIndex) intReturns the view index of the given item.intgetViewRow(int modelRow) Returns the wrapped modelbooleanisCellEditable(int rowIndex, int columnIndex) booleanvoidvoidsetLastSelectedObjects(List<ROW_OBJECT> lastSelectedObjects) voidsetTableFilter(TableFilter<ROW_OBJECT> tableFilter) voidsetValueAt(Object value, int rowIndex, int columnIndex) voidAllows this wrapping model to get update notifications directly from the filtering framework
-
Field Details
-
filteredIndexList
-
-
Constructor Details
-
TableModelWrapper
-
-
Method Details
-
getName
Description copied from interface:RowObjectTableModelReturns the name of this model- Specified by:
getNamein interfaceRowObjectTableModel<ROW_OBJECT>- Returns:
- the name of this model
-
getLastSelectedObjects
- Specified by:
getLastSelectedObjectsin interfaceSelectionStorage<ROW_OBJECT>
-
setLastSelectedObjects
- Specified by:
setLastSelectedObjectsin interfaceSelectionStorage<ROW_OBJECT>
-
setTableFilter
- Specified by:
setTableFilterin interfaceRowObjectFilterModel<ROW_OBJECT>
-
getTableFilter
- Specified by:
getTableFilterin interfaceRowObjectFilterModel<ROW_OBJECT>
-
getModelRow
public int getModelRow(int viewRow) Description copied from interface:WrappingTableModelReturns the unwrapped model's row for the given view row.- Specified by:
getModelRowin interfaceRowObjectFilterModel<ROW_OBJECT>- Specified by:
getModelRowin interfaceWrappingTableModel- Parameters:
viewRow- the row in the GUI- Returns:
- the row in the wrapped model's indexing
-
getViewRow
public int getViewRow(int modelRow) - Specified by:
getViewRowin interfaceRowObjectFilterModel<ROW_OBJECT>
-
wrappedModelChangedFromTableChangedEvent
public void wrappedModelChangedFromTableChangedEvent()Description copied from interface:WrappingTableModelAllows this wrapping model to get update notifications directly from the filtering framework- Specified by:
wrappedModelChangedFromTableChangedEventin interfaceWrappingTableModel
-
fireTableChanged
Description copied from interface:WrappingTableModelThis method allows us to call the delegate model with a translated event- Specified by:
fireTableChangedin interfaceWrappingTableModel- Parameters:
event- the event
-
fireTableDataChanged
public void fireTableDataChanged()Description copied from interface:RowObjectTableModelSends an event to all listeners that all the data inside of this model may have changed.- Specified by:
fireTableDataChangedin interfaceRowObjectTableModel<ROW_OBJECT>
-
isFiltered
public boolean isFiltered()- Specified by:
isFilteredin interfaceRowObjectFilterModel<ROW_OBJECT>
-
addTableModelListener
- Specified by:
addTableModelListenerin interfaceTableModel
-
removeTableModelListener
- Specified by:
removeTableModelListenerin interfaceTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceTableModel
-
getUnfilteredRowCount
public int getUnfilteredRowCount()- Specified by:
getUnfilteredRowCountin interfaceRowObjectFilterModel<ROW_OBJECT>
-
getUnfilteredData
- Specified by:
getUnfilteredDatain interfaceRowObjectFilterModel<ROW_OBJECT>
-
getModelData
Description copied from interface:RowObjectTableModelImplementors 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
Arraysclass to create a list backed by the array (Arrays.asList(Object...)).- Specified by:
getModelDatain interfaceRowObjectTableModel<ROW_OBJECT>- Returns:
- the model data.
-
getModelIndex
Description copied from interface:RowObjectFilterModelReturns the model index of the given item. When filtered, this is the index is the larger, set of data; when unfiltered, this index is the same as that returned byRowObjectFilterModel.getModelIndex(Object).This operation will be O(n) unless the implementation is sorted, in which case the operation is O(log n), as it uses a binary search.
- Specified by:
getModelIndexin interfaceRowObjectFilterModel<ROW_OBJECT>- Parameters:
t- the item- Returns:
- the model index
-
getViewIndex
Description copied from interface:RowObjectFilterModelReturns the view index of the given item. When filtered, this is the index is the smaller, visible set of data; when unfiltered, this index is the same as that returned byRowObjectFilterModel.getModelIndex(Object).This operation will be O(n) unless the implementation is sorted, in which case the operation is O(log n), as it uses a binary search.
- Specified by:
getViewIndexin interfaceRowObjectFilterModel<ROW_OBJECT>- Parameters:
t- the item- Returns:
- the view index
-
getRowIndex
Description copied from interface:RowObjectTableModelReturns the row number for the given object.Note: the index returned is always the 'view' index. For non-filtering table models, the 'view' and the 'model' index are the same. However, for filtering table models, the 'view' may be a subset of the 'model' index. Thus, it is possible, if this model is a filtering model, that the given
tmay not have a row value for the current state of the model (i.e., when the model is filtered in the view. If you really need to get the model index in such a situation, seeRowObjectFilterModel.- Specified by:
getRowIndexin interfaceRowObjectTableModel<ROW_OBJECT>- Parameters:
t- the object- Returns:
- the row number
-
getRowObject
Description copied from interface:RowObjectTableModelReturns the row object for the given row. This is the row in the UI. For models that know how to filter, the model row value will not match the view row value. For non-filtering models the view and model rows will always be the same.- Specified by:
getRowObjectin interfaceRowObjectTableModel<ROW_OBJECT>- Parameters:
viewRow- the row for which to return a row object.- Returns:
- the row object
-
getColumnValueForRow
Description copied from interface:RowObjectTableModelImplementors are expected to return a value at the given column index for the specified row object. This is essentially a more specific version of theTableModel.getValueAt(int, int)that allows this class's comparator objects to work.- Specified by:
getColumnValueForRowin interfaceRowObjectTableModel<ROW_OBJECT>- Parameters:
t- The object that represents a given row.columnIndex- The column index for which a value is requested.- Returns:
- a value at the given column index for the specified row object.
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) - Specified by:
isCellEditablein interfaceTableModel
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel
-
getWrappedModel
Description copied from interface:WrappingTableModelReturns the wrapped model- Specified by:
getWrappedModelin interfaceWrappingTableModel- Returns:
- the model
-