Module is.codion.swing.common.ui
Class DefaultFilteredTableCellRendererBuilder<R,C>
java.lang.Object
is.codion.swing.common.ui.component.table.DefaultFilteredTableCellRendererBuilder<R,C>
- Type Parameters:
R
- the row typeC
- the column identifier type
- All Implemented Interfaces:
FilteredTableCellRenderer.Builder<R,
C>
public class DefaultFilteredTableCellRendererBuilder<R,C>
extends Object
implements FilteredTableCellRenderer.Builder<R,C>
A default
FilteredTableCellRenderer.Builder
implementation.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultFilteredTableCellRendererBuilder
(FilteredTableModel<R, C> tableModel, C columnIdentifier, Class<?> columnClass) Instantiates a new builderprotected
DefaultFilteredTableCellRendererBuilder
(FilteredTableModel<R, C> tableModel, C columnIdentifier, Class<?> columnClass, boolean useBooleanRenderer) Instantiates a new builder -
Method Summary
Modifier and TypeMethodDescriptionfinal FilteredTableCellRenderer.Builder<R,
C> alternateRowColoring
(boolean alternateRowColoring) build()
final FilteredTableCellRenderer.Builder<R,
C> cellColorProvider
(FilteredTableCellRenderer.CellColorProvider<C> cellColorProvider) final FilteredTableCellRenderer.Builder<R,
C> columnShadingEnabled
(boolean columnShadingEnabled) final FilteredTableCellRenderer.Builder<R,
C> displayValueProvider
(Function<Object, Object> displayValueProvider) final FilteredTableCellRenderer.Builder<R,
C> horizontalAlignment
(int horizontalAlignment) final FilteredTableCellRenderer.Builder<R,
C> leftPadding
(int leftPadding) final FilteredTableCellRenderer.Builder<R,
C> rightPadding
(int rightPadding) protected FilteredTableCellRenderer.Settings<C>
settings
(int leftPadding, int rightPadding, boolean alternateRowColoring) final FilteredTableCellRenderer.Builder<R,
C> toolTipData
(boolean toolTipData)
-
Constructor Details
-
DefaultFilteredTableCellRendererBuilder
protected DefaultFilteredTableCellRendererBuilder(FilteredTableModel<R, C> tableModel, C columnIdentifier, Class<?> columnClass) Instantiates a new builder- Parameters:
tableModel
- the table modelcolumnIdentifier
- the column identifiercolumnClass
- the column class
-
DefaultFilteredTableCellRendererBuilder
protected DefaultFilteredTableCellRendererBuilder(FilteredTableModel<R, C> tableModel, C columnIdentifier, Class<?> columnClass, boolean useBooleanRenderer) Instantiates a new builder- Parameters:
tableModel
- the table modelcolumnIdentifier
- the column identifiercolumnClass
- the column classuseBooleanRenderer
- true if the boolean renderer should be used
-
-
Method Details
-
horizontalAlignment
- Specified by:
horizontalAlignment
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
horizontalAlignment
- the horizontal alignment- Returns:
- this builder instance
-
toolTipData
- Specified by:
toolTipData
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
toolTipData
- true if the cell should display its contents in a tool tip- Returns:
- this builder instance
-
columnShadingEnabled
public final FilteredTableCellRenderer.Builder<R,C> columnShadingEnabled(boolean columnShadingEnabled) - Specified by:
columnShadingEnabled
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
columnShadingEnabled
- true if column specific shading should be enabled, for example to indicated that the column is involved in a search/filter- Returns:
- this builder instance
-
alternateRowColoring
public final FilteredTableCellRenderer.Builder<R,C> alternateRowColoring(boolean alternateRowColoring) - Specified by:
alternateRowColoring
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
alternateRowColoring
- true if alternate row coloring should be enabled- Returns:
- this builder instance
-
leftPadding
- Specified by:
leftPadding
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
leftPadding
- the left cell padding- Returns:
- this builder instance
-
rightPadding
- Specified by:
rightPadding
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
rightPadding
- the right cell padding- Returns:
- this builder instance
-
displayValueProvider
public final FilteredTableCellRenderer.Builder<R,C> displayValueProvider(Function<Object, Object> displayValueProvider) - Specified by:
displayValueProvider
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
displayValueProvider
- provides the value to display in the cell, formatted or otherwise- Returns:
- this builder instance
-
cellColorProvider
public final FilteredTableCellRenderer.Builder<R,C> cellColorProvider(FilteredTableCellRenderer.CellColorProvider<C> cellColorProvider) - Specified by:
cellColorProvider
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Parameters:
cellColorProvider
- provides cell/row background and foreground color- Returns:
- this builder instance
-
build
- Specified by:
build
in interfaceFilteredTableCellRenderer.Builder<R,
C> - Returns:
- a new
FilteredTableCellRenderer
instance based on this builder
-
settings
protected FilteredTableCellRenderer.Settings<C> settings(int leftPadding, int rightPadding, boolean alternateRowColoring) - Parameters:
leftPadding
- the left paddingrightPadding
- the right paddingalternateRowColoring
- true if alternate row coloring is enabled- Returns:
- the
FilteredTableCellRenderer.Settings
instance for this renderer
-