Class LayoutHintBuilder

java.lang.Object
io.deephaven.engine.util.LayoutHintBuilder

@ScriptApi public class LayoutHintBuilder extends Object
The builder class for use in assembling layout hints suitable for use with applyToTable(Table) or GridAttributes.setLayoutHints(String).
  • Method Details

    • fromString

      @ScriptApi @NotNull public static @NotNull LayoutHintBuilder fromString(String attrs)
      Create a LayoutHintBuilder from the specified parameter string.
      Parameters:
      attrs - the parameter string
      Returns:
      a LayoutHintBuilder for the input parameter string
    • get

      @ScriptApi @NotNull public static @NotNull LayoutHintBuilder get()
      Create a new LayoutHintBuilder.
      Returns:
      a new LayoutHintBuilder
    • atFront

      @ScriptApi public LayoutHintBuilder atFront(String... cols)
      See Also:
    • atFront

      Indicate the specified columns should appear as the first N columns of the table when displayed.
      Parameters:
      cols - the columns to show at front
      Returns:
      this LayoutHintBuilder
    • atBack

      @ScriptApi public LayoutHintBuilder atBack(String... cols)
      See Also:
    • atBack

      Indicate the specified columns should appear as the last N columns of the table when displayed.
      Parameters:
      cols - the columns to show at the back
      Returns:
      this LayoutHintBuilder
    • hide

      @ScriptApi public LayoutHintBuilder hide(String... cols)
      See Also:
    • hide

      Indicate the specified columns should be hidden by default.
      Parameters:
      cols - the columns to initially hide
      Returns:
      this LayoutHintBuilder
    • columnGroup

      @ScriptApi public LayoutHintBuilder columnGroup(String name, List<String> children)
      See Also:
    • columnGroup

      @ScriptApi public LayoutHintBuilder columnGroup(String name, List<String> children, String color)
      See Also:
    • columnGroup

      @ScriptApi public LayoutHintBuilder columnGroup(String name, List<String> children, Color color)
      Create a named group of columns in the UI
      Parameters:
      name - the column group name. Must be a valid Deephaven column name
      children - the columns and other groups belonging to this group
      color - the background color for the group in the UI
      Returns:
      this LayoutHintBuilder
    • autoFilter

      @ScriptApi public LayoutHintBuilder autoFilter(String... cols)
      See Also:
    • autoFilter

      @ScriptApi public LayoutHintBuilder autoFilter(Collection<String> cols)
      Indicate the specified columns should be configured as AutoFilter columns
      Parameters:
      cols - the columns to enable as AutoFilter columns
      Returns:
      this LayoutHintBuilder
    • autoFilterFetchSize

      @ScriptApi public LayoutHintBuilder autoFilterFetchSize(String col, int size)
      Set the default initial number of rows to fetch for columns that have been marked as AutoFilter columns.
      Parameters:
      col - the column to set the fetch size for
      size - the number of rows to fetch initially
      Returns:
      this LayoutHintBuilder
    • freeze

      @ScriptApi public LayoutHintBuilder freeze(String... cols)
      See Also:
    • freeze

      Indicate the specified columns should be frozen (displayed as the first N, unmovable columns) upon display.
      Parameters:
      cols - the columns to freeze
      Returns:
      this LayoutHintBuilder
    • alwaysSubscribed

      @ScriptApi public LayoutHintBuilder alwaysSubscribed(String... columns)
      Indicate that the UI should maintain a subscription to the specified columns within viewports, even if they are out of view.
      Parameters:
      columns - the columns to keep subscribed
      Returns:
      this LayoutHintBuilder
    • savedLayouts

      @ScriptApi public LayoutHintBuilder savedLayouts(boolean allowed)
      Enable or disable saved layouts for the specified table.
      Parameters:
      allowed - if layout saving is enabled
      Returns:
      this LayoutHintBuilder
    • groupableColumns

      @ScriptApi public LayoutHintBuilder groupableColumns(String... columns)
      Set the columns which are allowed to be used as UI-driven rollup columns.
      Parameters:
      columns - the columns.
      Returns:
      this LayoutHintBuilder
    • groupableColumns

      @ScriptApi public LayoutHintBuilder groupableColumns(Collection<String> columns)
      Set the columns which are allowed to be used as UI-driven rollup columns.
      Parameters:
      columns - the columns.
      Returns:
      this LayoutHintBuilder
    • setSearchBarAccess

      @ScriptApi public LayoutHintBuilder setSearchBarAccess(LayoutHintBuilder.SearchDisplayModes searchable)
      Set the search bar to explicitly be accessible or inaccessible, or use system default.
      Parameters:
      searchable - The display mode to use
      Returns:
      This LayoutHintBuilder
    • setSearchBarAccess

      @ScriptApi public LayoutHintBuilder setSearchBarAccess(String searchable)
      Set the search bar to explicitly be accessible or inaccessible, or use system default.
      Parameters:
      searchable - The display mode to use
      Returns:
      This LayoutHintBuilder
    • build

      @ScriptApi public String build()
      Create an appropriate parameter string suitable for use with GridAttributes.setLayoutHints(String).
      Returns:
      this LayoutHintBuilder as a string
    • applyToTable

      @ScriptApi public Table applyToTable(@NotNull @NotNull Table table)
      Helper method for building and applying layout hints to a Table.
      Parameters:
      table - The source Table
      Returns:
      table.setLayoutHints(build())
    • areSavedLayoutsAllowed

      public boolean areSavedLayoutsAllowed()
      Check if saved layouts should be allowed.
      Returns:
      if saved layouts are allowed
    • getFrontCols

      @NotNull public @NotNull Set<String> getFrontCols()
      Get the ordered set of columns that should be displayed up front.
      Returns:
      an ordered set of columns to display up as the first N columns
    • getBackCols

      @NotNull public @NotNull Set<String> getBackCols()
      Get the ordered set of columns that should be displayed as the last N columns.
      Returns:
      an ordered set of columns to display at the end.
    • getHiddenCols

      @NotNull public @NotNull Set<String> getHiddenCols()
      Get the set of columns that should be hidden by default.
      Returns:
      the set of columns that should be hidden
    • getAutoFilterCols

      @NotNull public @NotNull Set<String> getAutoFilterCols()
      Get the set of columns that should be enabled for AutoFilter.
      Returns:
      the set of columns enabled for AutoFilter
    • getAutoFilterFetchSize

      public int getAutoFilterFetchSize(String column)
      Get the number of rows to fetch in the initial AutoFilter data fetch.
      Parameters:
      column - the column to set the fetch size for
      Returns:
      the number of rows to fetch initially
    • getFreezeCols

      @NotNull public @NotNull Set<String> getFreezeCols()
      Get the ordered set of columns that should be frozen.
      Returns:
      the ordered set of columns that should be frozen
    • getAlwaysSubscribedCols

      @NotNull public @NotNull Set<String> getAlwaysSubscribedCols()
      Get the set of columns that should always remain subscribed.
      Returns:
      the set of columns to be subscribed.
    • getGroupableColumns

      @NotNull public @NotNull Set<String> getGroupableColumns()
      Get the set of columns allowed to participate in UI-driven rollups.
      Returns:
      the set of columns
    • getSearchDisplayMode

      @NotNull public @NotNull LayoutHintBuilder.SearchDisplayModes getSearchDisplayMode()
    • getColumnGroups

      @NotNull public @NotNull Map<String,io.deephaven.engine.util.LayoutHintBuilder.ColumnGroup> getColumnGroups()
      Get the map of column groups for the UI.
      Returns:
      the map of column groups
    • getColumnGroup

      @NotNull public @NotNull io.deephaven.engine.util.LayoutHintBuilder.ColumnGroup getColumnGroup(String name)
      Get the column group for the specified name.
      Parameters:
      name - the name of the column group
      Returns:
      the column group if it exists