Package com.illumon.iris.gui.table
Class FilteredTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.illumon.iris.gui.table.IrisTableModel
com.illumon.iris.gui.table.GuiTableMap
com.illumon.iris.gui.table.FilteredTableModel
- All Implemented Interfaces:
ExtendableTableInterface
,FilteredModel
,MultiModelTable
,ToolTipGeneratingTableModel
,UpdateListener
,Workspace
,Serializable
,EventListener
,TableModelListener
,TableModel
public class FilteredTableModel extends GuiTableMap implements TableModelListener, FilteredModel, ToolTipGeneratingTableModel
A basic extension of
GuiTableMap
that enables filtering based on the provided FilterStrategy
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ExtendableTableInterface
ExtendableTableInterface.Entry, ExtendableTableInterface.PartialResult
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ToolTipGeneratingTableModel
ToolTipGeneratingTableModel.GeneratedToolTip
-
Field Summary
Fields Modifier and Type Field Description protected com.fishlib.io.logger.Logger
log
-
Constructor Summary
Constructors Constructor Description FilteredTableModel(com.fishlib.io.logger.Logger log, IrisTableModel tableModel, FilterStrategyImpl filterStrategy)
FilteredTableModel(com.fishlib.io.logger.Logger log, IrisTableModel tableModel, FilterStrategyImpl filterStrategy, boolean isAddOnly)
-
Method Summary
Modifier and Type Method Description void
filterChanged()
Notify the implementation that the set of underlying filters have changed.void
finishAddColumns(ExtendableTableInterface.PartialResult partialResult)
Incorporate the new DBTable and columns into tables and models.ToolTipGeneratingTableModel.GeneratedToolTip
generateToolTip(int col, GuiColumn column)
FilterStrategyImpl
getFilterStrategy()
Get theFilterStrategyImpl
in use.int
getMappedRowIndex(int index)
int
getRowCount()
org.jdom2.Element[]
getSavedStrategies()
Get all of the saved strategy workspaceElement
sorg.jdom2.Element
getWorkspaceInfo()
Serialize the class into an element to be stored in the workspaceboolean
hasShowStatistics()
boolean
isFilterable(String column)
Check if the specified column is filterable.boolean
isFilteringOn()
Check if the model is currently being filtered.void
removeStrategy(String name)
Remove the globally saved filter of the specified name.void
saveStrategy(String name)
Save the current set of filters to the global set of filters by name.void
setToolTipDialog(int col, GuiColumn column, JDialog dialog, JLabel label)
void
setWorkspaceInfo(org.jdom2.Element workspaceInfo)
Restore the class to the state defined by the data persisted in workspaceInfovoid
showStatistics(JTable table, int col, GuiColumn column)
void
tableChanged(TableModelEvent e)
Methods inherited from class com.illumon.iris.gui.table.GuiTableMap
beginAddColumns, getColumnClass, getColumnCount, getColumnName, getExtendedColumns, getModel, getModel, getOriginalModel, getOriginalRowIndex, getOriginalRowIndices, getOriginalRowIndices, getSortableColumns, getValueAt, isCellEditable, isStale, popFinishedCallback, setColumnSet, setFinishedCallback, setValueAt, supportsColumnChange
Methods inherited from class com.illumon.iris.gui.table.IrisTableModel
dispose, getColumnIndex, getColumnSet, getNonViewColumnSet, getTableModelName, processUpdate, registerAsUpdateListener
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getValueAt, isCellEditable, removeTableModelListener, setValueAt
-
Field Details
-
log
protected final com.fishlib.io.logger.Logger log
-
-
Constructor Details
-
FilteredTableModel
public FilteredTableModel(com.fishlib.io.logger.Logger log, IrisTableModel tableModel, FilterStrategyImpl filterStrategy) -
FilteredTableModel
public FilteredTableModel(com.fishlib.io.logger.Logger log, IrisTableModel tableModel, FilterStrategyImpl filterStrategy, boolean isAddOnly)
-
-
Method Details
-
getFilterStrategy
Description copied from interface:FilteredModel
Get theFilterStrategyImpl
in use.- Specified by:
getFilterStrategy
in interfaceFilteredModel
- Returns:
- the FilterStrategy
-
filterChanged
public void filterChanged()Description copied from interface:FilteredModel
Notify the implementation that the set of underlying filters have changed.- Specified by:
filterChanged
in interfaceFilteredModel
-
getMappedRowIndex
public int getMappedRowIndex(int index)- Specified by:
getMappedRowIndex
in classGuiTableMap
-
getRowCount
public int getRowCount()- Specified by:
getRowCount
in interfaceTableModel
- Overrides:
getRowCount
in classGuiTableMap
-
tableChanged
- Specified by:
tableChanged
in interfaceTableModelListener
-
finishAddColumns
Description copied from interface:ExtendableTableInterface
Incorporate the new DBTable and columns into tables and models. This must not be called on the Swing event thread.- Specified by:
finishAddColumns
in interfaceExtendableTableInterface
- Overrides:
finishAddColumns
in classGuiTableMap
- Parameters:
partialResult
- intermediate results from beginAddColumns
-
getSavedStrategies
@NotNull public org.jdom2.Element[] getSavedStrategies()Description copied from interface:FilteredModel
Get all of the saved strategy workspaceElement
s- Specified by:
getSavedStrategies
in interfaceFilteredModel
- Returns:
- an array of saved filter strategy elements.
-
saveStrategy
Description copied from interface:FilteredModel
Save the current set of filters to the global set of filters by name.- Specified by:
saveStrategy
in interfaceFilteredModel
- Parameters:
name
- the name of the filter
-
removeStrategy
Description copied from interface:FilteredModel
Remove the globally saved filter of the specified name.- Specified by:
removeStrategy
in interfaceFilteredModel
- Parameters:
name
- the name of the filter to remove
-
getWorkspaceInfo
public org.jdom2.Element getWorkspaceInfo()Description copied from interface:Workspace
Serialize the class into an element to be stored in the workspace- Specified by:
getWorkspaceInfo
in interfaceWorkspace
- Overrides:
getWorkspaceInfo
in classGuiTableMap
- Returns:
- An
Element
containing the data to persist.
-
setWorkspaceInfo
public void setWorkspaceInfo(org.jdom2.Element workspaceInfo)Description copied from interface:Workspace
Restore the class to the state defined by the data persisted in workspaceInfo- Specified by:
setWorkspaceInfo
in interfaceWorkspace
- Overrides:
setWorkspaceInfo
in classGuiTableMap
- Parameters:
workspaceInfo
- AnElement
containing the persisted state.
-
generateToolTip
- Specified by:
generateToolTip
in interfaceToolTipGeneratingTableModel
-
hasShowStatistics
public boolean hasShowStatistics()- Specified by:
hasShowStatistics
in interfaceToolTipGeneratingTableModel
-
showStatistics
- Specified by:
showStatistics
in interfaceToolTipGeneratingTableModel
-
setToolTipDialog
- Specified by:
setToolTipDialog
in interfaceToolTipGeneratingTableModel
-
isFilteringOn
public boolean isFilteringOn()Description copied from interface:FilteredModel
Check if the model is currently being filtered.- Specified by:
isFilteringOn
in interfaceFilteredModel
- Returns:
- true if filters are currently applied
-
isFilterable
Description copied from interface:FilteredModel
Check if the specified column is filterable.- Specified by:
isFilterable
in interfaceFilteredModel
- Parameters:
column
- the column name.- Returns:
- true if the column is filterable.
-