Module is.codion.swing.common.ui
Interface FilterTable.Builder<R,C>
- Type Parameters:
R- the type representing rowsC- the type used to identify columns
- All Superinterfaces:
ComponentBuilder<FilterTable<R,,C>, FilterTable.Builder<R, C>> Supplier<FilterTable<R,C>>
- Enclosing class:
FilterTable<R,C>
public static interface FilterTable.Builder<R,C>
extends ComponentBuilder<FilterTable<R,C>,FilterTable.Builder<R,C>>
A builder for a
FilterTable-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvides aFilterTable.Builderinstance based on a given table model -
Method Summary
Modifier and TypeMethodDescriptionautoResizeMode(int autoResizeMode) autoStartsEdit(boolean autoStartsEdit) cellEditable(BiPredicate<R, C> cellEditable) <T> FilterTable.Builder<R, C> cellEditor(C identifier, FilterTableCellEditor<?, T> cellEditor) the cell renderer for the given column, overridescellEditors(FilterTableCellEditor.Factory).cellEditors(FilterTableCellEditor.Factory<R, C> cellEditors) Note that this factory is only used to create cell editors for columns which do not already have a cell editor and is overridden by any editor set viacellEditor(Object, FilterTableCellEditor).<T> FilterTable.Builder<R, C> cellRenderer(C identifier, Class<T> columnClass, Consumer<FilterTableCellRenderer.Builder<R, C, T>> renderer) The cell renderer for the given column, overridescellRenderers(FilterTableCellRenderer.Factory).cellRenderers(FilterTableCellRenderer.Factory<R, C> cellRenderers) Note that this factory is only used to create cell renderers for columns which do not already have a cell renderer and is overridden by any renderer set viacellRenderer(Object, Class, Consumer).cellSelection(boolean cellSelection) centerOnScroll(FilterTable.CenterOnScroll centerOnScroll) columnReordering(boolean columnReordering) columnResizing(boolean columnResizing) columns(Consumer<FilterTableColumn.Builder<C>> columns) columnSelection(boolean columnSelection) columnToolTips(boolean columnToolTips) Specifies whether the table should display the column tooltips when the mouse hovers over the table headerdoubleClick(Action doubleClick) dragEnabled(boolean dragEnabled) fillsViewportHeight(boolean fillsViewportHeight) Specifies whether the table fills the viewport height, default true.filterComponents(C identifier, ColumnConditionPanel.ConditionComponents filterComponents) filterPanel(TableConditionPanel.Factory<C> filterPanel) filterView(ConditionPanel.ConditionView filterView) headerless(boolean headerless) headerRenderers(FilterTableHeaderRenderer.Factory<R, C> headerRenderers) Note that this factory is only used to create header renderers for columns which do not already have a header rendererhideColumns(C... columns) intercellSpacing(Dimension intercellSpacing) keyStroke(ControlKey<?> controlKey, KeyStroke keyStroke) resizeRowToFitEditor(boolean resizeRowToFitEditor) Only applicable toFilterTableCellEditorrowHeight(int rowHeight) rowMargin(int rowMargin) rowSelection(boolean rowSelection) rowsFillViewport(boolean rowsFillViewport) Specifies whether the remaining rows below the ones available in the table model are painted.scrollToAddedItem(boolean scrollToAddedItem) Specifies whether the table should scroll when items are added, so that the topmost added item appears at the top of the table view.scrollToSelectedItem(boolean scrollToSelectedItem) selectionMode(int selectionMode) showGrid(boolean showGrid) showHorizontalLines(boolean showHorizontalLines) showVerticalLines(boolean showVerticalLines) sortable(boolean sortable) startEditing(KeyStroke keyStroke) Associates the given keyStroke with the action associated with the 'startEditing' key in the table action map.stopEditOnFocusLost(boolean stopEditOnFocusLost) summaryValues(SummaryModel.SummaryValues.Factory<C> summaryValues) surrendersFocusOnKeystroke(boolean surrendersFocusOnKeystroke) visibleRows(int visibleRows) Specifies the preferred number of rows to display in a scrollable viewport.Methods inherited from interface is.codion.swing.common.ui.component.builder.ComponentBuilder
ancestorListener, background, border, build, build, clientProperty, componentListener, componentOrientation, enabled, enabled, focusable, focusable, focusCycleRoot, focusListener, font, font, foreground, get, hierarchyListener, keyEvent, keyListener, label, label, maximumHeight, maximumSize, maximumWidth, minimumHeight, minimumSize, minimumWidth, mouseListener, mouseMotionListener, mouseWheelListener, name, onBuild, onSetVisible, opaque, popupControl, popupControls, popupControls, popupMenu, preferredHeight, preferredSize, preferredWidth, propertyChangeListener, propertyChangeListener, scrollPane, toolTipText, toolTipText, transferFocusOnEnter, transferFocusOnEnter, transferHandler, visible, visible
-
Method Details
-
columns
- Parameters:
columns- called to configure each column builder- Returns:
- this builder instance
-
hideColumns
- Parameters:
columns- the columns to hide initially- Returns:
- this builder instance
-
summaryValues
- Parameters:
summaryValues- the column summary values factory- Returns:
- this builder instance
-
filterPanel
- Parameters:
filterPanel- the table filter condition panel factory- Returns:
- this builder instance
-
filterComponents
FilterTable.Builder<R,C> filterComponents(C identifier, ColumnConditionPanel.ConditionComponents filterComponents) - Parameters:
identifier- the column identifierfilterComponents- the column filter component factory for the given column- Returns:
- this builder instance
- See Also:
-
cellRenderer
<T> FilterTable.Builder<R,C> cellRenderer(C identifier, Class<T> columnClass, Consumer<FilterTableCellRenderer.Builder<R, C, T>> renderer) The cell renderer for the given column, overridescellRenderers(FilterTableCellRenderer.Factory).- Type Parameters:
T- the column type- Parameters:
identifier- the column identifiercolumnClass- the column classrenderer- provided with the cell renderer to for the given column- Returns:
- this builder instance
-
cellRenderers
Note that this factory is only used to create cell renderers for columns which do not already have a cell renderer and is overridden by any renderer set viacellRenderer(Object, Class, Consumer).- Parameters:
cellRenderers- the table cell renderer factory- Returns:
- this builder instance
-
headerRenderers
Note that this factory is only used to create header renderers for columns which do not already have a header renderer- Parameters:
headerRenderers- the header renderer factory- Returns:
- this builder instance
-
cellEditor
the cell renderer for the given column, overridescellEditors(FilterTableCellEditor.Factory).- Type Parameters:
T- the column type- Parameters:
identifier- the column identifiercellEditor- the cell editor to use for the given column- Returns:
- this builder instance
-
cellEditors
Note that this factory is only used to create cell editors for columns which do not already have a cell editor and is overridden by any editor set viacellEditor(Object, FilterTableCellEditor).- Parameters:
cellEditors- the table cell editor factory- Returns:
- this builder instance
-
cellEditable
- Parameters:
cellEditable- called to see if the given cell in the given row is editable, after the model has been queried- Returns:
- this builder instance
- See Also:
-
startEditing
Associates the given keyStroke with the action associated with the 'startEditing' key in the table action map.- Parameters:
keyStroke- a keyStroke for triggering the 'startEditing' action- Returns:
- this builder instance
-
autoStartsEdit
- Parameters:
autoStartsEdit- true if editing should start automatically- Returns:
- this builder instance
-
surrendersFocusOnKeystroke
- Parameters:
surrendersFocusOnKeystroke- true if the table should surrenders focus on keystroke- Returns:
- this builder instance
- See Also:
-
stopEditOnFocusLost
- Parameters:
stopEditOnFocusLost- whether the table should stop and commit editing when it loses focus- Returns:
- this builder instance
- See Also:
-
centerOnScroll
- Parameters:
centerOnScroll- the center on scroll behavious- Returns:
- this builder instance
-
doubleClick
- Parameters:
doubleClick- the action to perform on a double-click- Returns:
- this builder instance
-
scrollToSelectedItem
- Parameters:
scrollToSelectedItem- true if this table should scroll to the selected item- Returns:
- this builder instance
-
scrollToAddedItem
Specifies whether the table should scroll when items are added, so that the topmost added item appears at the top of the table view.
Default: false.
- Parameters:
scrollToAddedItem- true if this table should scroll to the topmost added item- Returns:
- this builder instance
-
columnToolTips
Specifies whether the table should display the column tooltips when the mouse hovers over the table header
Default: true.
- Parameters:
columnToolTips- true if column tool tips should be shown- Returns:
- this builder instance
- See Also:
-
fillsViewportHeight
Specifies whether the table fills the viewport height, default true.- Parameters:
fillsViewportHeight- whether this table is always made large enough to fill the height of an enclosing viewport- Returns:
- this builder instance
- See Also:
-
rowsFillViewport
Specifies whether the remaining rows below the ones available in the table model are painted.Note that this requires
JTable.setFillsViewportHeight(boolean)to be enabled, and relies on that remaining so. This is true by default, seefillsViewportHeight(boolean).- Parameters:
rowsFillViewport- true if the remaining rows should be painted to fill the viewport- Returns:
- this builder instance
- See Also:
-
visibleRows
Specifies the preferred number of rows to display in a scrollable viewport.- Parameters:
visibleRows- the preferred number of visible rows to display- Returns:
- this builder instance
- See Also:
-
headerless
- Parameters:
headerless- true if the table should be headerless- Returns:
- this builder instance
-
sortable
- Parameters:
sortable- true if sorting via clicking the header should be enbled- Returns:
- this builder instance
-
selectionMode
- Parameters:
selectionMode- the table selection mode- Returns:
- this builder instance
- See Also:
-
rowSelection
- Parameters:
rowSelection- true if row selection should be enabled- Returns:
- this builder instance
- See Also:
-
columnSelection
- Parameters:
columnSelection- true if column selection should be enabled- Returns:
- this builder instance
- See Also:
-
cellSelection
- Parameters:
cellSelection- true if cell selection should be enabled- Returns:
- this builder instance
- See Also:
-
columnReordering
- Parameters:
columnReordering- true if column reordering should be allowed- Returns:
- this builder instance
-
columnResizing
- Parameters:
columnResizing- true if column resizing should be allowed- Returns:
- this builder instance
-
autoResizeMode
- Parameters:
autoResizeMode- the table auto column resizing mode- Returns:
- this builder instance
-
resizeRowToFitEditor
Only applicable toFilterTableCellEditor- Parameters:
resizeRowToFitEditor- true if the row should be resized to fit the editor- Returns:
- this builder instance
-
filterView
- Parameters:
filterView- the initial filter condition view- Returns:
- this builder instance
-
keyStroke
- Parameters:
controlKey- the control keykeyStroke- the keyStroke to assign to the given control- Returns:
- this builder instance
-
rowHeight
- Parameters:
rowHeight- the row height- Returns:
- this builder instance
- See Also:
-
rowMargin
- Parameters:
rowMargin- the row margin- Returns:
- this builder instance
- See Also:
-
intercellSpacing
- Parameters:
intercellSpacing- the intercell spacing- Returns:
- this builder instance
- See Also:
-
gridColor
- Parameters:
gridColor- the grid color- Returns:
- this builder instance
- See Also:
-
showGrid
- Parameters:
showGrid- the show grid value- Returns:
- this builder instance
- See Also:
-
showHorizontalLines
- Parameters:
showHorizontalLines- the show horizontal lines value- Returns:
- this builder instance
- See Also:
-
showVerticalLines
- Parameters:
showVerticalLines- the show vertical lines value- Returns:
- this builder instance
- See Also:
-
dragEnabled
- Parameters:
dragEnabled- the drag enabled value- Returns:
- this builder instance
- See Also:
-
dropMode
- Parameters:
dropMode- the drop mode- Returns:
- this builder instance
- See Also:
-