Class TableAndTotalsPanel
java.lang.Object
io.deephaven.multiviewwidget.ui.panels.components.TableAndTotalsPanel
A panel that groups together two tables, one representing the main table, and another single row table representing
the totals.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTableAndTotalsPanel(@NotNull WidgetContext context, @NotNull Function<com.fishlib.io.log.LogLevel, com.fishlib.io.log.LogEntry> log) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a listener for table filtering events.voidAdd a mouseListener to the main table.voidapplyFilter(@NotNull String column, @NotNull Collection<Object> items, boolean doClear) voidapplyFilters(@NotNull Map<String, Object> filtersToApply) Apply the specified filters to the underling tables.voidapplySorts(@NotNull List<SortDefinition> sorts) voidClear all filters applied to the table.voidfreezeColumns(@Nullable Collection<String> columns) Freeze all of the specified columns.getColumnNameFromTable(Point point, IrisTable table) Get the column at the current point.Get the current order of columns.Get a list of DB filters (suitable for use withTable.where(String...).Get the GUITable for the main panel.@Nullable ObjectgetObjectFromTable(Point point, String columnName) Get the value at the specified point and column?Get the GUITable for the totals panel.@NotNull Map<String,List<FilterData>> Get the set of user filters by column.booleanReturn if this component has been initialized with a table and possibly a totals table.booleanisReady()voidRefresh and redraw all valid viewports.voidRemove a filter listener.voidRemove the specified listener.voidMark this panel as busy.voidsetColumnOrder(@NotNull List<String> columnOrder) voidsetColumnRenderer(@NotNull String colName, @NotNull Function<GuiColumn, ColumnRenderer> renderer) voidDisplay the supplied error in the panel overlay.voidsetHeaderRenderer(TableCellRenderer renderer) voidsetMainPopupProviders(PopupProvider... popupProviders) voidsetNameForLinking(String newName) voidsetReady()Mark this panel ready to display.voidsetStatusMessage(String message) Set the current status message overlay.voidsetTotalsComputing(String message) Mark the totals panel as computing.voidMark the totals panel as ready to display.voidsetViewportBorder(Border border) voidsetViewShowing(boolean showing) Sets showing-status for each table within this instance so that viewports may be refreshed or paused as requiredvoidupdateMainTable(@NotNull BaseDBTableModel newMainModel, @NotNull Map<String, List<FilterData>> userFilters, @NotNull List<SortDefinition> sorts) Update the main table with the specified table.voidupdateTableModels(@NotNull BaseDBTableModel newMainModel, @Nullable BaseDBTableModel newTotalsModel) Replace the Primary and Total table models with new ones based on the input tables.voidupdateTotalsTable(@Nullable BaseDBTableModel newTotalsModel) Update the totals table with the specified one.
-
Constructor Details
-
TableAndTotalsPanel
public TableAndTotalsPanel(@NotNull @NotNull WidgetContext context, @NotNull @NotNull Function<com.fishlib.io.log.LogLevel, com.fishlib.io.log.LogEntry> log)
-
-
Method Details
-
setViewShowing
public void setViewShowing(boolean showing) Sets showing-status for each table within this instance so that viewports may be refreshed or paused as required- Parameters:
showing- indicates if this view is now showing
-
hasInitialized
public boolean hasInitialized()Return if this component has been initialized with a table and possibly a totals table.- Returns:
- true if both the main table has been created, along with the totals table (if required)
-
isReady
public boolean isReady() -
setReady
public void setReady()Mark this panel ready to display. This disables the panel message overlays for the main and totals panels. -
setBusy
Mark this panel as busy. The supplied message will be placed in the table overlay.- Parameters:
message- the message to display
-
setStatusMessage
Set the current status message overlay.- Parameters:
message- the message
-
setError
Display the supplied error in the panel overlay.- Parameters:
text- error texte- the error itself
-
setTotalsComputing
Mark the totals panel as computing. Display the specified message in the overlay.- Parameters:
message- the message to display.
-
setTotalsReady
public void setTotalsReady()Mark the totals panel as ready to display. Hide the overlay and show the actual table. -
refreshViewports
public void refreshViewports()Refresh and redraw all valid viewports. -
updateTableModels
public void updateTableModels(@NotNull @NotNull BaseDBTableModel newMainModel, @Nullable @Nullable BaseDBTableModel newTotalsModel) Replace the Primary and Total table models with new ones based on the input tables.- Parameters:
newMainModel- The new main tablenewTotalsModel- the new totals table.
-
updateMainTable
public void updateMainTable(@NotNull @NotNull BaseDBTableModel newMainModel, @NotNull @NotNull Map<String, List<FilterData>> userFilters, @NotNull @NotNull List<SortDefinition> sorts) Update the main table with the specified table.- Parameters:
newMainModel- the new tableuserFilters- the user filters to apply
-
updateTotalsTable
Update the totals table with the specified one.- Parameters:
newTotalsModel- the new table.
-
addTableMouseListener
Add a mouseListener to the main table.- Parameters:
l- the listener
-
removeTableMouseListener
Remove the specified listener.- Parameters:
l- the listener
-
addTableFilterListener
Add a listener for table filtering events.- Parameters:
l- the listener
-
removeTableFilterListener
Remove a filter listener.- Parameters:
l- the listener to remove
-
setMainPopupProviders
-
getMainPopupProviders
-
setNameForLinking
-
getNameForLinking
-
setColumnRenderer
public void setColumnRenderer(@NotNull @NotNull String colName, @NotNull @NotNull Function<GuiColumn, ColumnRenderer> renderer) -
getColumnOrder
Get the current order of columns.- Returns:
- a list of columns in order.
-
getObjectFromTable
@Nullable public @Nullable Object getObjectFromTable(Point point, String columnName) throws IllegalArgumentException Get the value at the specified point and column?TODO (AB): This seems bad to use a point.
- Parameters:
point- OW!columnName- the name of the column- Returns:
- the value at that point.
- Throws:
IllegalArgumentException- if the column didn't exist for some reason.
-
getColumnNameFromTable
Get the column at the current point.- Parameters:
point- the pointtable- the table? what?- Returns:
- the name of the column at the specified point.
-
getUserFilters
Get the set of user filters by column.- Returns:
- the set of filters.
-
getDbFilters
Get a list of DB filters (suitable for use withTable.where(String...).- Returns:
- the filters
-
getMainGuiTable
Get the GUITable for the main panel.- Returns:
- the main table, or null if there was none.
-
getTotalsGuiTable
Get the GUITable for the totals panel.- Returns:
- the totals table, or null if there was none.
-
applyFilters
Apply the specified filters to the underling tables.- Parameters:
filtersToApply- the filters by column
-
applyFilter
public void applyFilter(@NotNull @NotNull String column, @NotNull @NotNull Collection<Object> items, boolean doClear) -
clearFilters
public void clearFilters()Clear all filters applied to the table. -
applySorts
-
setColumnOrder
-
setHeaderRenderer
-
setViewportBorder
-
freezeColumns
Freeze all of the specified columns.- Parameters:
columns- the columns to freeze
-
$$$getRootComponent$$$
- Noinspection:
- ALL
-