Class TableAndTotalsPanel

java.lang.Object
io.deephaven.multiviewwidget.ui.panels.components.TableAndTotalsPanel

public class TableAndTotalsPanel extends Object
A panel that groups together two tables, one representing the main table, and another single row table representing the totals.
  • 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

      public void setBusy(String message)
      Mark this panel as busy. The supplied message will be placed in the table overlay.
      Parameters:
      message - the message to display
    • setStatusMessage

      public void setStatusMessage(String message)
      Set the current status message overlay.
      Parameters:
      message - the message
    • setError

      public void setError(String text, Throwable e)
      Display the supplied error in the panel overlay.
      Parameters:
      text - error text
      e - the error itself
    • setTotalsComputing

      public void setTotalsComputing(String message)
      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 table
      newTotalsModel - 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 table
      userFilters - the user filters to apply
    • updateTotalsTable

      public void updateTotalsTable(@Nullable @Nullable BaseDBTableModel newTotalsModel)
      Update the totals table with the specified one.
      Parameters:
      newTotalsModel - the new table.
    • addTableMouseListener

      public void addTableMouseListener(MouseListener l)
      Add a mouseListener to the main table.
      Parameters:
      l - the listener
    • removeTableMouseListener

      public void removeTableMouseListener(MouseListener l)
      Remove the specified listener.
      Parameters:
      l - the listener
    • addTableFilterListener

      public void addTableFilterListener(TableAndTotalsPanel.TableFilterListener l)
      Add a listener for table filtering events.
      Parameters:
      l - the listener
    • removeTableFilterListener

      public void removeTableFilterListener(TableAndTotalsPanel.TableFilterListener l)
      Remove a filter listener.
      Parameters:
      l - the listener to remove
    • setMainPopupProviders

      public void setMainPopupProviders(PopupProvider... popupProviders)
    • getMainPopupProviders

      public PopupProvider[] getMainPopupProviders()
    • setNameForLinking

      public void setNameForLinking(String newName)
    • getNameForLinking

      public String getNameForLinking()
    • setColumnRenderer

      public void setColumnRenderer(@NotNull @NotNull String colName, @NotNull @NotNull Function<GuiColumn,ColumnRenderer> renderer)
    • getColumnOrder

      @NotNull public @NotNull List<String> 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

      public String getColumnNameFromTable(Point point, IrisTable table)
      Get the column at the current point.
      Parameters:
      point - the point
      table - the table? what?
      Returns:
      the name of the column at the specified point.
    • getUserFilters

      @NotNull public @NotNull Map<String,List<FilterData>> getUserFilters()
      Get the set of user filters by column.
      Returns:
      the set of filters.
    • getDbFilters

      @NotNull public @NotNull List<String> getDbFilters()
      Get a list of DB filters (suitable for use with Table.where(String...).
      Returns:
      the filters
    • getMainGuiTable

      public GuiTable getMainGuiTable()
      Get the GUITable for the main panel.
      Returns:
      the main table, or null if there was none.
    • getTotalsGuiTable

      public GuiTable getTotalsGuiTable()
      Get the GUITable for the totals panel.
      Returns:
      the totals table, or null if there was none.
    • applyFilters

      public void applyFilters(@NotNull @NotNull Map<String,Object> filtersToApply)
      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

      public void applySorts(@NotNull @NotNull List<SortDefinition> sorts)
    • setColumnOrder

      public void setColumnOrder(@NotNull @NotNull List<String> columnOrder)
    • setHeaderRenderer

      public void setHeaderRenderer(TableCellRenderer renderer)
    • setViewportBorder

      public void setViewportBorder(Border border)
    • freezeColumns

      public void freezeColumns(@Nullable @Nullable Collection<String> columns)
      Freeze all of the specified columns.
      Parameters:
      columns - the columns to freeze
    • $$$getRootComponent$$$

      public JComponent $$$getRootComponent$$$()
      Noinspection:
      ALL