Package com.illumon.iris.db.tables.utils
Class LayoutHintBuilder
java.lang.Object
com.illumon.iris.db.tables.utils.LayoutHintBuilder
@ScriptApi public class LayoutHintBuilder extends Object
The builder class for use in assembling layout hints suitable for use with
Table.layoutHints(LayoutHintBuilder)
or
Table.layoutHints(String)
.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LayoutHintBuilder.SearchDisplayModes
The display mode for the search bar. -
Method Summary
Modifier and Type Method Description 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.boolean
areSavedLayoutsAllowed()
Check if saved layouts should be allowed.LayoutHintBuilder
atEnd(String... cols)
LayoutHintBuilder
atEnd(Collection<String> cols)
Indicate the specified columns should appear as the last N columns of the table when displayed.LayoutHintBuilder
atFront(String... cols)
LayoutHintBuilder
atFront(Collection<String> cols)
Indicate the specified columns should appear as the first N columns of the table when displayed.LayoutHintBuilder
autoFilter(String... cols)
LayoutHintBuilder
autoFilter(Collection<String> cols)
Indicate the specified columns should be configured as AutoFilter columnsLayoutHintBuilder
autoFilterFetchSize(String col, int size)
Set the default initial number of rows to fetch for columns that have been marked asAutoFilter
columns.String
build()
Create an appropriate parameter string suitable for use withTable.layoutHints(String)
.LayoutHintBuilder
freeze(String... cols)
LayoutHintBuilder
freeze(Collection<String> cols)
Indicate the specified columns should be frozen (displayed as the first N, unmovable columns) upon display.static LayoutHintBuilder
fromString(String attrs)
Create a LayoutHintBuilder from the specified parameter string.static LayoutHintBuilder
get()
Create a new LayoutHintBuilder.Set<String>
getAlwaysSubscribedCols()
Get the set of columns that should always remain subscribed.Set<String>
getAutoFilterCols()
Get the set of columns that should be enabled for AutoFilter.int
getAutoFilterFetchSize(String column)
Get the number of rows to fetch in the initial AutoFilter data fetch.Set<String>
getBackCols()
Get the ordered set of columns that should be displayed as the last N columns.Set<String>
getFreezeCols()
Get the ordered set of columns that should be frozen.Set<String>
getFrontCols()
Get the ordered set of columns that should be displayed up front.Set<String>
getGroupableColumns()
Get the set of columns allowed to participate in UI-driven rollups.Set<String>
getHiddenCols()
Get the set of columns that should be hidden by default.LayoutHintBuilder.SearchDisplayModes
getSearchDisplayMode()
LayoutHintBuilder
groupableColumns(String... columns)
Set the columns which are allowed to be used as UI-driven rollup columns.LayoutHintBuilder
groupableColumns(Collection<String> columns)
Set the columns which are allowed to be used as UI-driven rollup columns.LayoutHintBuilder
hide(String... cols)
LayoutHintBuilder
hide(Collection<String> cols)
Indicate the specified columns should be hidden by default.LayoutHintBuilder
savedLayouts(boolean allowed)
Enable or disable saved layouts for the specified table.LayoutHintBuilder
setSearchBarAccess(LayoutHintBuilder.SearchDisplayModes searchable)
Set the search bar to explicitly be accessible or inaccessible, or use system default.
-
Method Details
-
fromString
Create a LayoutHintBuilder from the specified parameter string.- Parameters:
attrs
- the parameter string- Returns:
- a LayoutHintBuilder for the input parameter string
-
get
Create a new LayoutHintBuilder.- Returns:
- a new LayoutHintBuilder
-
atFront
- See Also:
atFront(Collection)
-
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
-
atEnd
- See Also:
atEnd(Collection)
-
atEnd
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
- See Also:
hide(Collection)
-
hide
Indicate the specified columns should be hidden by default.- Parameters:
cols
- the columns to initially hide- Returns:
- this LayoutHintBuilder
-
autoFilter
- See Also:
autoFilter(Collection)
-
autoFilter
Indicate the specified columns should be configured as AutoFilter columns- Parameters:
cols
- the columns to enable as AutoFilter columns- Returns:
- this LayoutHintBuilder
-
autoFilterFetchSize
Set the default initial number of rows to fetch for columns that have been marked asAutoFilter
columns.- Parameters:
col
- the column to set the fetch size forsize
- the number of rows to fetch initially- Returns:
- this LayoutHintBuilder
-
freeze
- See Also:
freeze(Collection)
-
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
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
Enable or disable saved layouts for the specified table.- Parameters:
allowed
- if layout saving is enabled- Returns:
- this LayoutHintBuilder
-
groupableColumns
Set the columns which are allowed to be used as UI-driven rollup columns.- Parameters:
columns
- the columns.- Returns:
- this LayoutHintBuilder
-
groupableColumns
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
-
build
Create an appropriate parameter string suitable for use withTable.layoutHints(String)
.- Returns:
- this LayoutHintBuilder as a string
-
areSavedLayoutsAllowed
public boolean areSavedLayoutsAllowed()Check if saved layouts should be allowed.- Returns:
- if saved layouts are allowed
-
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
Get the ordered set of columns that should be displayed as the last N columns.- Returns:
- an ordfered set of columns to display at the end.
-
getHiddenCols
Get the set of columns that should be hidden by default.- Returns:
- the set of columns that should be hidden
-
getAutoFilterCols
Get the set of columns that should be enabled for AutoFilter.- Returns:
- the set of columns enabled for AutoFilter
-
getAutoFilterFetchSize
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
Get the ordered set of columns that should be frozen.- Returns:
- the ordered set of columns that should be frozen
-
getAlwaysSubscribedCols
Get the set of columns that should always remain subscribed.- Returns:
- the set of columns to be subscribed.
-
getGroupableColumns
Get the set of columns allowed to participate in UI-driven rollups.- Returns:
- the set of columns
-
getSearchDisplayMode
-