Class IrisTreeTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
com.illumon.iris.gui.table.IrisTableModel
com.illumon.iris.console.db.BaseDBTableModel
com.illumon.iris.console.events.treetable.IrisTreeTableModel
- All Implemented Interfaces:
DBTableFetcher,LayoutHintingModel,TableFormatProvider,ViewportAdjuster,AbstractDataTableModel,AutoFilterModel,FilteredModel,MultiModelTable,QuickFilterable,SortableModel,ToolTipGeneratingTableModel,UpdateListener,Workspace,AdjustmentListener,ComponentListener,Serializable,EventListener,TableModel
public class IrisTreeTableModel
extends BaseDBTableModel
implements ViewportAdjuster, AbstractDataTableModel, AdjustmentListener, ComponentListener, MultiModelTable, FilteredModel, SortableModel, TableFormatProvider, Workspace, QuickFilterable, LayoutHintingModel, ToolTipGeneratingTableModel, AutoFilterModel, DBTableFetcher
A
TableModel that supports the display of tables created via Table.treeTable(String, String) or Table.rollup(ComboAggregateFactory, Collection).
The model supports expanding and contracting rows within the tree.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enumNested classes/interfaces inherited from interface com.illumon.iris.gui.table.AutoFilterModel
AutoFilterModel.AutoFilterListener, AutoFilterModel.AutoFilterRequestHandlerNested classes/interfaces inherited from interface com.illumon.iris.gui.table.SortableModel
SortableModel.SortingDirectiveNested classes/interfaces inherited from interface com.illumon.iris.console.db.TableFormatProvider
TableFormatProvider.FormatTypeNested classes/interfaces inherited from interface com.illumon.iris.gui.table.ToolTipGeneratingTableModel
ToolTipGeneratingTableModel.GeneratedToolTip -
Field Summary
Fields inherited from class com.illumon.iris.gui.table.IrisTableModel
columnSet_, nonViewColumnSet_Fields inherited from class javax.swing.table.AbstractTableModel
listenerListFields inherited from interface com.illumon.iris.gui.table.QuickFilterable
DEFAULT_MAX_QUICKFILTER_LENGTH -
Constructor Summary
ConstructorsConstructorDescriptionIrisTreeTableModel(com.fishlib.io.logger.Logger log, String name, Table table) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanareSelectedColumnsInViewport(BitSet columns) booleanvoidClear sorting on all columns.voidClose the existing viewport and clean up all table resources.voidvoidvoidvoidvoidcomputeNewViewport(boolean forceUpdate) Compute a new viewport.voidcontractNode(int row) Request contraction for a particular row.voidDisconnect the current adjuster from the viewport, but do not clean up table resourcesvoidexpandNode(int row) Request expansion for a particular row.voidNotify the implementation that the set of underlying filters have changed.generateToolTip(int col, GuiColumn column) getCellFormat(String columnName, int row, TableFormatProvider.FormatType type) longgetColumnColor(String columnName, int row) Get theFilterStrategyImplin use.getHeaderRendererIcon(int columnIndex, int size) Get the sort icon for the specified column and size.intgetInitialFetchSize(String column) Get the number of unique values to initially fetch for the specified column.getModel()return the single child model, or null if none<T extends TableModel>
Treturn a model of type modelType, or null if noneint[]getOriginalRowIndices(int[] selectedRows) int[]getOriginalRowIndices(int[] selectedRows, boolean sorted) Get the current quick filter stringGet the current quick filter mode.com.fishlib.dataobjects.WAbstractDataObjectgetRow(int index) longgetRowColor(int row) intgetRowProperties(int row) Get all of the properties for a row in one synchronized step.org.jdom2.Element[]Get all of the saved strategy workspaceElementsGet the set of sortable columns.getSortingDirective(int columnIndex) Get the sorting status of a single column.getTable()Gets the unrolled version of this table model.getValueAt(int rowIndex, int columnIndex) org.jdom2.ElementSerialize the class into an element to be stored in the workspacebooleanhasCellFormat(String columnName, TableFormatProvider.FormatType type) booleanhasColumnColor(String columnName) booleanhasRowColor(String columnName) booleanvoidCalled when sorting should be changed based on a header click.booleanisFilterable(String column) Check if the specified column is filterable.booleanCheck if the model is currently being filtered.booleandetermine whether there are any sorting directives - similar to empty()voidmarkColumnColorUnchanged(String columnName) voidremoveStrategy(String name) Remove the globally saved filter of the specified name.requestAutoFilterData(String columnName, int maxUniqueValues, AutoFilterModel.AutoFilterListener listener) Requests auto filter data for a given column name.requestMoreAutoFilterData(String columnName, AutoFilterModel.AutoFilterListener listener) Requests more data for the given column.voidsaveStrategy(String name) Save the current set of filters to the global set of filters by name.voidsetEmbeddedDbConsole(EmbeddedDbConsole console) Set the EmbeddedDBConsole for issuing queries, if available.voidsetFreezeTable(IrisTable freezeTable) voidSet the PQ client to issue remote queries to.voidsetQuickFilter(String filter, QuickFilterMode mode) Set the quick filter to apply.voidsetScrollPane(JScrollPane pane) Set the scroll pane to listen to events from.voidsetSortingStatus(int columnIndex, int status, boolean isAbsolute, boolean clearSorting) Set the sorting status of a single column.voidsetToolTipDialog(int col, GuiColumn column, JDialog dialog, JLabel label) voidsetTreeTable(IrisTable treeTable) voidsetUnrolledModel(UnrolledModelInfo unrolledModelInfo) Sets the table model that was used to create this model via a rollup.voidSet the IrisView underneath which this adjuster resides.voidsetWorkspaceInfo(org.jdom2.Element workspaceInfo) Restore the class to the state defined by the data persisted in workspaceInfovoidshowStatistics(JTable table, int col, GuiColumn column) voidSuspend processing of events generated by the underlying model.updateTelemetryInfo(TelemetryLogger.TelemetryInfo telemetryInfo) updateTelemetryInfo(String tableName, long pqSerial, QueryProcessorConnection qpc) booleanwasColumnColorChanged(String columnName) Methods inherited from class com.illumon.iris.console.db.BaseDBTableModel
columnSet, columnSet, columnSet, columnSet, columnSet, doneProcessing, generateThrowableHtmlMessage, getIrisTablePanel, getName, getViewportForTable, removeStatusMessage, setIrisTablePanel, setProcessingMessage, setStatusMessage, setStatusMessageButton, setTabColor, setWarningAndTableSize, showProcessingErrorPopup, showProcessingErrorPopupMethods inherited from class com.illumon.iris.gui.table.IrisTableModel
dispose, getColumnClass, getColumnCount, getColumnIndex, getColumnName, getColumnSet, getNonViewColumnSet, getTableModelName, isStale, processUpdate, registerAsUpdateListener, setColumnSetMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAtMethods 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.AbstractDataTableModel
getDataMethods inherited from interface com.illumon.iris.gui.table.AutoFilterModel
getColumnSetMethods inherited from interface com.illumon.iris.gui.table.FilteredModel
getColumnSetMethods inherited from interface com.illumon.iris.gui.table.QuickFilterable
getMaxQuickfilterLengthMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, isCellEditable, removeTableModelListener, setValueAtMethods inherited from interface com.illumon.iris.gui.workspace.Workspace
isGlobalSetting
-
Constructor Details
-
IrisTreeTableModel
-
-
Method Details
-
areSelectedRowsInViewport
public boolean areSelectedRowsInViewport() -
areSelectedColumnsInViewport
-
updateTelemetryInfo
public IrisTreeTableModel updateTelemetryInfo(@Nullable TelemetryLogger.TelemetryInfo telemetryInfo) -
updateTelemetryInfo
public IrisTreeTableModel updateTelemetryInfo(@Nullable String tableName, long pqSerial, @Nullable QueryProcessorConnection qpc) -
getLayoutHints
- Specified by:
getLayoutHintsin interfaceLayoutHintingModel- Returns:
- A LayoutHintBuilder defining the layout hints for this model, or null if none were present.
-
setTreeTable
-
setFreezeTable
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
getData
- Specified by:
getDatain interfaceAbstractDataTableModel
-
getRowProperties
Get all of the properties for a row in one synchronized step.- Parameters:
row- The row to get.- Returns:
- A
IrisTreeTableModel.RowPropertiesobject defining the row.
-
getRow
public com.fishlib.dataobjects.WAbstractDataObject getRow(int index) - Specified by:
getRowin interfaceAbstractDataTableModel
-
expandNode
public void expandNode(int row) Request expansion for a particular row. This method has no effect if the row is already expanded. The expansion itself will occur on the server side and generate a new viewport.- Parameters:
row- The row to expand
-
contractNode
public void contractNode(int row) Request contraction for a particular row. This method has no effect if the row is already contracted.- Parameters:
row- The row to contract.
-
computeNewViewport
public void computeNewViewport(boolean forceUpdate) Description copied from interface:ViewportAdjusterCompute a new viewport.- Specified by:
computeNewViewportin interfaceViewportAdjuster- Parameters:
forceUpdate- force an update, even if no changes were detected.
-
closeViewPort
public void closeViewPort()Description copied from interface:ViewportAdjusterClose the existing viewport and clean up all table resources.- Specified by:
closeViewPortin interfaceViewportAdjuster
-
disconnectViewport
public void disconnectViewport()Description copied from interface:ViewportAdjusterDisconnect the current adjuster from the viewport, but do not clean up table resources- Specified by:
disconnectViewportin interfaceViewportAdjuster
-
suspendViewport
public void suspendViewport()Description copied from interface:ViewportAdjusterSuspend processing of events generated by the underlying model.- Specified by:
suspendViewportin interfaceViewportAdjuster
-
setView
Description copied from interface:ViewportAdjusterSet the IrisView underneath which this adjuster resides.- Specified by:
setViewin interfaceViewportAdjuster- Parameters:
view- the IrisView.
-
setPersistentQueryClient
Description copied from interface:ViewportAdjusterSet the PQ client to issue remote queries to.- Specified by:
setPersistentQueryClientin interfaceViewportAdjuster- Parameters:
client- the PQ Client
-
setEmbeddedDbConsole
Description copied from interface:ViewportAdjusterSet the EmbeddedDBConsole for issuing queries, if available. Note that onlyViewportAdjuster.setPersistentQueryClient(PersistentQueryClient)or this should be called, not both.- Specified by:
setEmbeddedDbConsolein interfaceViewportAdjuster- Parameters:
console- the Console
-
setScrollPane
Description copied from interface:ViewportAdjusterSet the scroll pane to listen to events from.- Specified by:
setScrollPanein interfaceViewportAdjuster- Parameters:
pane- The scrollpane
-
componentResized
- Specified by:
componentResizedin interfaceComponentListener
-
componentMoved
- Specified by:
componentMovedin interfaceComponentListener
-
componentShown
- Specified by:
componentShownin interfaceComponentListener
-
componentHidden
- Specified by:
componentHiddenin interfaceComponentListener
-
adjustmentValueChanged
- Specified by:
adjustmentValueChangedin interfaceAdjustmentListener
-
getModel
Description copied from interface:MultiModelTablereturn a model of type modelType, or null if none- Specified by:
getModelin interfaceMultiModelTable
-
getModel
Description copied from interface:MultiModelTablereturn the single child model, or null if none- Specified by:
getModelin interfaceMultiModelTable
-
getOriginalModel
- Specified by:
getOriginalModelin interfaceMultiModelTable
-
getOriginalRowIndices
public int[] getOriginalRowIndices(int[] selectedRows) - Specified by:
getOriginalRowIndicesin interfaceMultiModelTable
-
getOriginalRowIndices
public int[] getOriginalRowIndices(int[] selectedRows, boolean sorted) - Specified by:
getOriginalRowIndicesin interfaceMultiModelTable
-
filterChanged
public void filterChanged()Description copied from interface:FilteredModelNotify the implementation that the set of underlying filters have changed.- Specified by:
filterChangedin interfaceFilteredModel
-
getFilterStrategy
Description copied from interface:FilteredModelGet theFilterStrategyImplin use.- Specified by:
getFilterStrategyin interfaceAutoFilterModel- Specified by:
getFilterStrategyin interfaceFilteredModel- Returns:
- the FilterStrategy
-
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
-
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
-
setQuickFilter
Description copied from interface:QuickFilterableSet the quick filter to apply.- Specified by:
setQuickFilterin interfaceQuickFilterable- Parameters:
filter- the filter textmode- theQuickFilterModeto apply with
-
getQuickFilter
Description copied from interface:QuickFilterableGet the current quick filter string- Specified by:
getQuickFilterin interfaceQuickFilterable- Returns:
- the current filter
-
getQuickFilterMode
Description copied from interface:QuickFilterableGet the current quick filter mode.- Specified by:
getQuickFilterModein interfaceQuickFilterable- Returns:
- the quickfilter mode
-
isFilterable
Description copied from interface:FilteredModelCheck if the specified column is filterable.- Specified by:
isFilterablein interfaceAutoFilterModel- Specified by:
isFilterablein interfaceFilteredModel- Parameters:
column- the column name.- Returns:
- true if the column is filterable.
-
cancelSorting
public void cancelSorting()Description copied from interface:SortableModelClear sorting on all columns.- Specified by:
cancelSortingin interfaceSortableModel
-
setSortingStatus
public void setSortingStatus(int columnIndex, int status, boolean isAbsolute, boolean clearSorting) Description copied from interface:SortableModelSet the sorting status of a single column. Adds to existing sort definition.- Specified by:
setSortingStatusin interfaceSortableModel
-
getSortingDirective
Description copied from interface:SortableModelGet the sorting status of a single column.- Specified by:
getSortingDirectivein interfaceSortableModel
-
isSorting
public boolean isSorting()Description copied from interface:SortableModeldetermine whether there are any sorting directives - similar to empty()- Specified by:
isSortingin interfaceSortableModel
-
headerClicked
Description copied from interface:SortableModelCalled when sorting should be changed based on a header click.- Specified by:
headerClickedin interfaceSortableModel- Parameters:
e- the drivingMouseEvent
-
getHeaderRendererIcon
Description copied from interface:SortableModelGet the sort icon for the specified column and size. May return null, for no icon.- Specified by:
getHeaderRendererIconin interfaceSortableModel- Parameters:
columnIndex- the columnsize- the icon size- Returns:
- an icon to render for sorting.
-
getSortableColumns
Description copied from interface:SortableModelGet the set of sortable columns.- Specified by:
getSortableColumnsin interfaceSortableModel- Overrides:
getSortableColumnsin classIrisTableModel- Returns:
- the set of sortable columns
-
getColumnColor
- Specified by:
getColumnColorin interfaceTableFormatProvider
-
getRowColor
public long getRowColor(int row) - Specified by:
getRowColorin interfaceTableFormatProvider
-
getCellFormat
- Specified by:
getCellFormatin interfaceTableFormatProvider
-
hasColumnColor
- Specified by:
hasColumnColorin interfaceTableFormatProvider
-
hasRowColor
- Specified by:
hasRowColorin interfaceTableFormatProvider
-
hasCellFormat
- Specified by:
hasCellFormatin interfaceTableFormatProvider
-
wasColumnColorChanged
- Specified by:
wasColumnColorChangedin interfaceTableFormatProvider
-
markColumnColorUnchanged
- Specified by:
markColumnColorUnchangedin interfaceTableFormatProvider
-
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 classIrisTableModel- 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 classIrisTableModel- Parameters:
workspaceInfo- AnElementcontaining the persisted state.
-
setUnrolledModel
Sets the table model that was used to create this model via a rollup.- Parameters:
unrolledModelInfo- the unrolled version of this model
-
getUnrolledModel
Gets the unrolled version of this table model. Null if it was not create from another table model.- Returns:
- the unrolled table model or null
-
generateToolTip
- Specified by:
generateToolTipin interfaceToolTipGeneratingTableModel
-
hasShowStatistics
public boolean hasShowStatistics()- Specified by:
hasShowStatisticsin interfaceToolTipGeneratingTableModel
-
showStatistics
- Specified by:
showStatisticsin interfaceToolTipGeneratingTableModel
-
setToolTipDialog
- Specified by:
setToolTipDialogin interfaceToolTipGeneratingTableModel
-
requestAutoFilterData
public AutoFilterModel.AutoFilterRequestHandler requestAutoFilterData(String columnName, int maxUniqueValues, AutoFilterModel.AutoFilterListener listener) Description copied from interface:AutoFilterModelRequests auto filter data for a given column name.- Specified by:
requestAutoFilterDatain interfaceAutoFilterModel- Parameters:
columnName- the name of the columnmaxUniqueValues- the maximum number of unique values to returnlistener- a listener for the data- Returns:
- a handler for the request
-
requestMoreAutoFilterData
public AutoFilterModel.AutoFilterRequestHandler requestMoreAutoFilterData(String columnName, AutoFilterModel.AutoFilterListener listener) Description copied from interface:AutoFilterModelRequests more data for the given column.- Specified by:
requestMoreAutoFilterDatain interfaceAutoFilterModel- Parameters:
columnName- the name of the columnlistener- a listener for the data- Returns:
- a handler for the request
-
getInitialFetchSize
Description copied from interface:AutoFilterModelGet the number of unique values to initially fetch for the specified column.- Specified by:
getInitialFetchSizein interfaceAutoFilterModel- Parameters:
column- The column to get the fetch size for- Returns:
- The number of unique values to fetch
-
getTable
- Specified by:
getTablein interfaceDBTableFetcher
-
getHierarchicalTableInfo
-