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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.gui.table.ExtendableTableInterface
ExtendableTableInterface.Entry, ExtendableTableInterface.PartialResultNested classes/interfaces inherited from interface com.illumon.iris.gui.table.ToolTipGeneratingTableModel
ToolTipGeneratingTableModel.GeneratedToolTip -
Field Summary
FieldsFields inherited from class com.illumon.iris.gui.table.GuiTableMap
model_, originalTableModel_Fields inherited from class com.illumon.iris.gui.table.IrisTableModel
columnSet_, nonViewColumnSet_Fields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionFilteredTableModel(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 TypeMethodDescriptionvoidNotify the implementation that the set of underlying filters have changed.voidfinishAddColumns(ExtendableTableInterface.PartialResult partialResult) Incorporate the new DBTable and columns into tables and models.generateToolTip(int col, GuiColumn column) Get theFilterStrategyImplin use.intgetMappedRowIndex(int index) intorg.jdom2.Element[]Get all of the saved strategy workspaceElementsorg.jdom2.ElementSerialize the class into an element to be stored in the workspacebooleanbooleanisFilterable(String column) Check if the specified column is filterable.booleanCheck if the model is currently being filtered.voidremoveStrategy(String name) Remove the globally saved filter of the specified name.voidsaveStrategy(String name) Save the current set of filters to the global set of filters by name.voidsetToolTipDialog(int col, GuiColumn column, JDialog dialog, JLabel label) voidsetWorkspaceInfo(org.jdom2.Element workspaceInfo) Restore the class to the state defined by the data persisted in workspaceInfovoidshowStatistics(JTable table, int col, GuiColumn column) voidMethods 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, supportsColumnChangeMethods inherited from class com.illumon.iris.gui.table.IrisTableModel
dispose, getColumnIndex, getColumnSet, getNonViewColumnSet, getTableModelName, processUpdate, registerAsUpdateListenerMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.gui.table.FilteredModel
getColumnSetMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getValueAt, isCellEditable, removeTableModelListener, setValueAtMethods inherited from interface com.illumon.iris.gui.workspace.Workspace
isGlobalSetting
-
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:FilteredModelGet theFilterStrategyImplin use.- Specified by:
getFilterStrategyin interfaceFilteredModel- Returns:
- the FilterStrategy
-
filterChanged
public void filterChanged()Description copied from interface:FilteredModelNotify the implementation that the set of underlying filters have changed.- Specified by:
filterChangedin interfaceFilteredModel
-
getMappedRowIndex
public int getMappedRowIndex(int index) - Specified by:
getMappedRowIndexin classGuiTableMap
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceTableModel- Overrides:
getRowCountin classGuiTableMap
-
tableChanged
- Specified by:
tableChangedin interfaceTableModelListener
-
finishAddColumns
Description copied from interface:ExtendableTableInterfaceIncorporate the new DBTable and columns into tables and models. This must not be called on the Swing event thread.- Specified by:
finishAddColumnsin interfaceExtendableTableInterface- Overrides:
finishAddColumnsin classGuiTableMap- Parameters:
partialResult- intermediate results from beginAddColumns
-
getSavedStrategies
@NotNull public org.jdom2.Element[] getSavedStrategies()Description copied from interface:FilteredModelGet all of the saved strategy workspaceElements- Specified by:
getSavedStrategiesin interfaceFilteredModel- Returns:
- an array of saved filter strategy elements.
-
saveStrategy
Description copied from interface:FilteredModelSave the current set of filters to the global set of filters by name.- Specified by:
saveStrategyin interfaceFilteredModel- Parameters:
name- the name of the filter
-
removeStrategy
Description copied from interface:FilteredModelRemove the globally saved filter of the specified name.- Specified by:
removeStrategyin interfaceFilteredModel- Parameters:
name- the name of the filter to remove
-
getWorkspaceInfo
public org.jdom2.Element getWorkspaceInfo()Description copied from interface:WorkspaceSerialize the class into an element to be stored in the workspace- Specified by:
getWorkspaceInfoin interfaceWorkspace- Overrides:
getWorkspaceInfoin classGuiTableMap- Returns:
- An
Elementcontaining the data to persist.
-
setWorkspaceInfo
public void setWorkspaceInfo(org.jdom2.Element workspaceInfo) Description copied from interface:WorkspaceRestore the class to the state defined by the data persisted in workspaceInfo- Specified by:
setWorkspaceInfoin interfaceWorkspace- Overrides:
setWorkspaceInfoin classGuiTableMap- Parameters:
workspaceInfo- AnElementcontaining the persisted state.
-
generateToolTip
- Specified by:
generateToolTipin interfaceToolTipGeneratingTableModel
-
hasShowStatistics
public boolean hasShowStatistics()- Specified by:
hasShowStatisticsin interfaceToolTipGeneratingTableModel
-
showStatistics
- Specified by:
showStatisticsin interfaceToolTipGeneratingTableModel
-
setToolTipDialog
- Specified by:
setToolTipDialogin interfaceToolTipGeneratingTableModel
-
isFilteringOn
public boolean isFilteringOn()Description copied from interface:FilteredModelCheck if the model is currently being filtered.- Specified by:
isFilteringOnin interfaceFilteredModel- Returns:
- true if filters are currently applied
-
isFilterable
Description copied from interface:FilteredModelCheck if the specified column is filterable.- Specified by:
isFilterablein interfaceFilteredModel- Parameters:
column- the column name.- Returns:
- true if the column is filterable.
-