Interface ViewFactory

All Known Subinterfaces:
AggViewBuilder, FilterItemBuilder, FilterViewFactory, LeafViewBuilder, PivotViewBuilder, PlotViewBuilder, RollupViewBuilder, StaticFilterBuilder, WidgetBuilder
All Known Implementing Classes:
AggComboWidgetBuilder, AggViewBuilderImpl, FilterItemBuilderImpl, LeafViewBuilderImpl, MultiViewBuilder, PivotViewBuilderImpl, PlotViewBuilderImpl, RollupViewBuilderImpl, StaticFilterBuilderImpl

public interface ViewFactory
A Super-factory that will switch to the appropriate context for each requested view type, finalizing and adding any currently in construction items to the current set of views.
  • Method Details

    • getBuilder

      @NotNull @InternalUseOnly @NotNull WidgetBuilder getBuilder()
      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
      Returns:
      the parent builder
    • addPlotView

      @NotNull @ScriptApi @FinalDefault default @NotNull ViewFactory addPlotView(@NotNull @NotNull String name, @NotNull @NotNull Function<Table[],FigureWidget> plotFactory, @Nullable @Nullable Table... inputs)
      Add a plot view.
      Parameters:
      name - The visible name of the view
      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
    • addPlotView

      @NotNull @ScriptApi @FinalDefault default @NotNull ViewFactory addPlotView(@NotNull @NotNull String name, @Nullable @Nullable Color tabColor, @NotNull @NotNull Function<Table[],FigureWidget> plotFactory, @Nullable @Nullable Table... inputs)
      Add a plot view.
      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
    • addPlotView

      @NotNull @ScriptApi @FinalDefault default @NotNull ViewFactory addPlotView(@NotNull @NotNull String name, @NotNull @NotNull Function<Table[],FigureWidget> plotFactory, @NotNull @NotNull List<Table> inputs)
      Add a plot view.
      Parameters:
      name - The visible name of the view
      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
    • addPlotView

      @NotNull @ScriptApi default @NotNull ViewFactory addPlotView(@NotNull @NotNull String name, @Nullable @Nullable Color tabColor, @NotNull @NotNull Function<Table[],FigureWidget> plotFactory, @NotNull @NotNull List<Table> inputs)
      Add a plot view.
      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
    • addAggView

      @NotNull @ScriptApi default @NotNull AggViewBuilder addAggView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor, @NotNull @NotNull String... defaultGroupingCols)
      Add an Aggregation view.
      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.
    • addAggView

      @NotNull @ScriptApi @FinalDefault default @NotNull AggViewBuilder addAggView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull String... defaultGroupingCols)
      Add an Aggregation view. An Aggregation view performs grouping and user defined aggregations on the base table provided.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      defaultGroupingCols - The default set of grouping columns applied.
      Returns:
      an AggViewBuilder to define the view itself.
    • addPivotView

      @NotNull @ScriptApi default @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)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      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.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull Collection<String> defaultRowCols, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol, @Nullable @Nullable AggType aggType)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      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.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @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)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      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
      Returns:
      an PivotViewBuilder to define the view itself.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull Collection<String> defaultRowCols, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      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
      Returns:
      an PivotViewBuilder to define the view itself.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor, @NotNull @NotNull String rowCol, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol, @Nullable @Nullable AggType aggType)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      tabColor - the color of the tab to display
      rowCol - the column 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.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull String rowCol, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol, @Nullable @Nullable AggType aggType)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      rowCol - the column 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.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor, @NotNull @NotNull String rowCol, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      tabColor - the color of the tab to display
      rowCol - the column 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
      Returns:
      an PivotViewBuilder to define the view itself.
    • addPivotView

      @NotNull @ScriptApi @FinalDefault default @NotNull PivotViewBuilder addPivotView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @NotNull @NotNull String rowCol, @NotNull @NotNull String pivotCol, @NotNull @NotNull String aggCol)
      Add a Pivot view. A Pivot view allows the user to do excel-like pivot table analysis on the underlying table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      rowCol - the column 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
      Returns:
      an PivotViewBuilder to define the view itself.
    • addLeafView

      @NotNull @ScriptApi default @NotNull LeafViewBuilder addLeafView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor)
      Add a Leaf view. A leaf view is simply a flat view of the original table.
      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.
    • addLeafView

      @NotNull @ScriptApi @FinalDefault default @NotNull LeafViewBuilder addLeafView(@NotNull @NotNull String name, @NotNull @NotNull Table source)
      Add a Leaf view. A leaf view is simply a flat view of the original table.
      Parameters:
      name - the visible name of the view
      source - the source table it is based on
      Returns:
      an LeafViewBuilder to define the view itself.
    • addRollupView

      @NotNull @ScriptApi @FinalDefault default @NotNull RollupViewBuilder addRollupView(@NotNull @NotNull String name, @NotNull @NotNull Table source)
    • addRollupView

      @NotNull @ScriptApi default @NotNull RollupViewBuilder addRollupView(@NotNull @NotNull String name, @NotNull @NotNull Table source, @Nullable @Nullable Color tabColor)
    • addStaticFilter

      @NotNull @ScriptApi default @NotNull StaticFilterBuilder addStaticFilter(@NotNull @NotNull String name)
      Add a Static (pre-defined) set of selectable global filters to the Global filter set.
      Parameters:
      name - the name of the view.
      Returns:
      a StaticFilterBuilder to define the filter sets
    • addGlobalFilter

      @NotNull @ScriptApi default @NotNull WidgetBuilder addGlobalFilter(@NotNull @NotNull String name, @NotNull @NotNull Table table, @NotNull @NotNull SortOrder order)
      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.
      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
    • addGlobalFilter

      @NotNull @ScriptApi default @NotNull WidgetBuilder addGlobalFilter(@NotNull @NotNull String name, @NotNull @NotNull Table table)
      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.
      Parameters:
      name - the name of the filter group
      table - the table containing the distinct values
      Returns:
      this WidgetBuilder
    • globalFilterBucket

      @NotNull @ScriptApi default @NotNull WidgetBuilder globalFilterBucket(@NotNull @NotNull String name, @NotNull @NotNull Table groupingTable, boolean bucketView)
      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.
      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
    • globalFilterBucket

      @NotNull @ScriptApi default @NotNull WidgetBuilder globalFilterBucket(@NotNull @NotNull String name, @NotNull @NotNull Table groupingTable)
      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.
      Parameters:
      name - the name of the filter to add a bucket for
      groupingTable - the table containing the bucket values.
      Returns:
      this WidgetBuilder
    • collapseGlobalFilter

      @NotNull @ScriptApi default @NotNull WidgetBuilder collapseGlobalFilter(boolean collapse)
      Permits the query-builder to define the default behavior of the Global Filter panel
      Parameters:
      collapse - true if the panel should start collapsed, false if the panel should start expanded
      Returns:
      this WidgetBuilder
    • collapseGlobalFilter

      @NotNull @ScriptApi default @NotNull WidgetBuilder collapseGlobalFilter()
      Permits the query-builder to define the default behavior of the Global Filter panel as collapsed
      Returns:
      this WidgetBuilder
    • build

      @NotNull @ScriptApi default @NotNull MultiViewLiveWidget build()
      Complete definition of the widget and get a real instance of it.
      Returns:
      a realized MultiViewLiveWidget