Class MultiViewBuilder

java.lang.Object
io.deephaven.multiviewwidget.MultiViewBuilder
All Implemented Interfaces:
ViewFactory, WidgetBuilder
Direct Known Subclasses:
AggComboWidgetBuilder

public class MultiViewBuilder extends Object implements WidgetBuilder
  • Constructor Details

    • MultiViewBuilder

      public MultiViewBuilder()
  • Method Details

    • addView

      @NotNull public @NotNull WidgetBuilder addView(@NotNull @NotNull String tabName, @NotNull @NotNull ViewTab viewTab)
      Description copied from interface: WidgetBuilder
      Add a defined view to the set of views. NOTE: Internal use only!
      Specified by:
      addView in interface WidgetBuilder
      Parameters:
      tabName - the name of the tab
      viewTab - the actual tab
      Returns:
      this WidgetBuilder
    • addFilter

      @NotNull public @NotNull WidgetBuilder addFilter(@NotNull @NotNull FilterDescriptor<?> descriptor)
      Description copied from interface: WidgetBuilder
      Add a defined global filter to the set of filters. NOTE: Internal use only!
      Specified by:
      addFilter in interface WidgetBuilder
      Parameters:
      descriptor - the actual filter.
      Returns:
      this WidgetBuilder
    • getBuilder

      @NotNull public @NotNull WidgetBuilder getBuilder()
      Description copied from interface: ViewFactory
      Get the parent builder in its current state. May be used to store intermediary states of the builder in order to separate widget-creation into multiple distinct sections
      Specified by:
      getBuilder in interface ViewFactory
      Returns:
      the parent builder
    • addAggView

      @NotNull public @NotNull AggViewBuilder addAggView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor, @NotNull @NotNull String... defaultGroupingCols)
      Description copied from interface: ViewFactory
      Add an Aggregation view.
      Specified by:
      addAggView in interface ViewFactory
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      tabColor - the color of the tab to display
      defaultGroupingCols - The default set of grouping columns applied.
      Returns:
      an AggViewBuilder to define the view itself.
    • addPivotView

      @NotNull public @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor, @NotNull @NotNull Collection<String> defaultRowCols, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol, @Nullable @Nullable AggType aggType)
      Description copied from interface: ViewFactory
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Specified by:
      addPivotView in interface ViewFactory
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      tabColor - the color of the tab to display
      defaultRowCols - a collection of columns whose distinct values will define the rows in the resultant pivot-table
      pivotCol - the column whose distinct values will define the columns in the resultant pivot-table
      aggCol - the column whose values will be aggregated
      aggType - the aggregation to apply to aggCol
      Returns:
      an PivotViewBuilder to define the view itself.
    • addLeafView

      @NotNull public @NotNull LeafViewBuilder addLeafView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor)
      Description copied from interface: ViewFactory
      Add a Leaf view. A leaf view is simply a flat view of the original table.
      Specified by:
      addLeafView in interface ViewFactory
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      tabColor - the color of the tab to display
      Returns:
      an LeafViewBuilder to define the view itself.
    • addRollupView

      @NotNull public @NotNull RollupViewBuilder addRollupView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor)
      Specified by:
      addRollupView in interface ViewFactory
    • addPlotView

      @NotNull public @NotNull ViewFactory addPlotView(@NotNull @NotNull String name, @Nullable @Nullable Color tabColor, @NotNull @NotNull Function<Table[],FigureWidget> plotFactory, @NotNull @NotNull List<Table> inputs)
      Description copied from interface: ViewFactory
      Add a plot view.
      Specified by:
      addPlotView in interface ViewFactory
      Parameters:
      name - The visible name of the view
      tabColor - the color of the tab
      plotFactory - A Function<Table[], FigureWidget> that will produce a plot given a set of tables.
      inputs - the ordered set of tables to be provided to the plotFactory after filtering has been applied.
      Returns:
      a PlotViewBuilder
    • addStaticFilter

      @NotNull public @NotNull StaticFilterBuilder addStaticFilter(@NotNull @NotNull String name)
      Description copied from interface: ViewFactory
      Add a Static (pre-defined) set of selectable global filters to the Global filter set.
      Specified by:
      addStaticFilter in interface ViewFactory
      Parameters:
      name - the name of the view.
      Returns:
      a StaticFilterBuilder to define the filter sets
    • addGlobalFilter

      @NotNull public @NotNull WidgetBuilder addGlobalFilter(@NotNull @NotNull String name, @NotNull @NotNull Table table, @NotNull @NotNull SortOrder order)
      Description copied from interface: ViewFactory
      Add a Table backed global filter. This filter will allow users to apply filters to the specified column from a set of distinct values found within that column.
      Specified by:
      addGlobalFilter in interface ViewFactory
      Parameters:
      name - the name of the filter group
      table - the table containing the distinct values
      order - default ordering of values within the filter
      Returns:
      this WidgetBuilder
    • globalFilterBucket

      @NotNull public @NotNull WidgetBuilder globalFilterBucket(@NotNull @NotNull String name, @NotNull @NotNull Table groupingTable, boolean bucketView)
      Description copied from interface: ViewFactory
      Add a 'bucket' of filters for the specified global filter. A bucket will provide a drop-down menu item that will select all of the items in the specified table for the user.
      Specified by:
      globalFilterBucket in interface ViewFactory
      Parameters:
      name - the name of the filter to add a bucket for
      groupingTable - the table containing the bucket values.
      bucketView - indicates that filter should be initialized in bucket-view
      Returns:
      this WidgetBuilder
    • collapseGlobalFilter

      @NotNull public @NotNull WidgetBuilder collapseGlobalFilter(boolean collapse)
      Description copied from interface: ViewFactory
      Permits the query-builder to define the default behavior of the Global Filter panel
      Specified by:
      collapseGlobalFilter in interface ViewFactory
      Parameters:
      collapse - true if the panel should start collapsed, false if the panel should start expanded
      Returns:
      this WidgetBuilder
    • build

      @NotNull public @NotNull MultiViewLiveWidget build()
      Description copied from interface: ViewFactory
      Complete definition of the widget and get a real instance of it.
      Specified by:
      build in interface ViewFactory
      Returns:
      a realized MultiViewLiveWidget
    • assertNotNull

      public static void assertNotNull(@Nullable @Nullable Object o, String message)
      Requires the input object o to be non-null. Though we have annotated methods as @NotNull, we cannot enforce scripts to follow said annotations. We'd prefer to fail now rather than later
      Parameters:
      o - object
      message - error message
      Throws:
      IllegalArgumentException - o is null
    • assertNotEmpty

      public static void assertNotEmpty(@Nullable @Nullable Collection<?> c, String message)
      Requires the input collection c to be non-empty. Though we have annotated methods as @NotNull, we cannot enforce scripts to follow said annotations. We'd prefer to fail now rather than later
      Parameters:
      c - collection
      message - error message
      Throws:
      IllegalArgumentException - c is null or empty