Class DefaultTableColumnConfiguration<S,T>
java.lang.Object
org.tentackle.fx.table.DefaultTableColumnConfiguration<S,T>
- Type Parameters:
S- type of the objects contained within the table's item listT- type of the content in all cells in this column
- All Implemented Interfaces:
TableColumnConfiguration<S,T>
- Direct Known Subclasses:
RdcTableColumnConfiguration
public class DefaultTableColumnConfiguration<S,T>
extends Object
implements TableColumnConfiguration<S,T>
Default configuration for a table column.
The setters follow a fluent API style, i.e., they return the current instance.
The setters follow a fluent API style, i.e., they return the current instance.
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultTableColumnConfiguration(DefaultTableConfiguration<S> tableConfiguration, String name, String displayedName) Create a column config. -
Method Summary
Modifier and TypeMethodDescriptioncreateTableCell(javafx.scene.control.TableColumn<S, T> column) Creates a table cell.
The method reference can directly be used as a cell factory.protected javafx.beans.value.ObservableValue<T> createTableCellValue(javafx.scene.control.TableColumn.CellDataFeatures<S, T> cdf) Creates the cell value for a given row object.protected javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S, T>, javafx.beans.value.ObservableValue<T>> Creates the cell value factory.protected FxTableColumn<S, T> Creates the table column.createTreeTableCell(javafx.scene.control.TreeTableColumn<S, T> column) Creates a treetable cell.
The method reference can directly be used as a cell factory.protected javafx.util.Callback<javafx.scene.control.TreeTableColumn<S, T>, javafx.scene.control.TreeTableCell<S, T>> Creates the treetable cell factory.protected javafx.beans.value.ObservableValue<T> createTreeTableCellValue(javafx.scene.control.TreeTableColumn.CellDataFeatures<S, T> cdf) Creates the treetable cell value for a given row object.protected javafx.util.Callback<javafx.scene.control.TreeTableColumn.CellDataFeatures<S, T>, javafx.beans.value.ObservableValue<T>> Creates the tree table cell value factory.protected FxTreeTableColumn<S, T> Creates the tree table column.javafx.geometry.PosDefines the alignment of the column.Gets the binding for this column.Gets the case conversion.Gets the specific table cell type.Gets the date or time formatter.Gets the column name displayed in the column header.Returns whether the column is editable.Gets the editor component.Returns whether the column provides a filter UI in its header.Gets the generic type.Gets invalid characters.Gets the maximum columns for text cell editors.getName()Gets the column name.
This is usually the binding path.
The name is also used as a key to the table preferences.Gets the number format.Defines the format for numeric or date/time-types.
If null is returned, a default format will be used according to the column class.getScale()Gets the scale for fractional numeric cell editors.Returns whether the column is summable.protected javafx.util.Callback<javafx.scene.control.TableColumn<S, T>, javafx.scene.control.TableCell<S, T>> Gets the cell factory.Gets or creates the table column.
Used if configuration applies to aTableView.Gets the table configuration.Gets or creates the tree table column.
Used if configuration applies to aTreeTableView.getType()Determines the class for a given column.Gets allowed characters.Gets the autoselect flag.Defines theblankzeroattribute of the column.booleanReturns whether the column is editable.booleanDetermines whether the column is summable.Returns whether a numeric field is unsigned or signed.setAlignment(javafx.geometry.Pos alignment) Sets the alignment within the cell.setAutoSelect(Boolean autoSelect) Sets the autoselect feature.setBinding(FxTableBinding<S, T> binding) Sets the binding.setBlankZero(Boolean blankZero) Sets whether to blank out numeric zero values.setCaseConversion(Boolean caseConversion) Sets the case conversion.setCellType(TableCellType<T> cellType) Sets the specific table cell type.setDisplayedName(String displayedName) Sets the column name displayed in the column header.setEditable(Boolean editable) Sets whether the column is editable.setEditor(FxComponent editor) Sets the editor component.setFilterable(Boolean filterable) Sets whether the column provides a filter UI in its header.voidsetGenericType(Type genericType) Sets the generic type.setInvalidChars(String invalidChars) Sets invalid characters.setMaxColumns(Integer maxColumns) Sets the max columns.setPattern(String pattern) Sets the formatting string.Sets the numeric scale.setSummable(Boolean summable) Sets whether the column is summable.voidSets the column type.setUnsigned(Boolean unsigned) Sets whether a numeric field is unsigned or signed.setValidChars(String validChars) Sets allowed characters.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface TableColumnConfiguration
getEffectiveCellType, getGraphic, getText, isFilterable
-
Constructor Details
-
DefaultTableColumnConfiguration
public DefaultTableColumnConfiguration(DefaultTableConfiguration<S> tableConfiguration, String name, String displayedName) Create a column config.- Parameters:
tableConfiguration- the table configname- the column's binding pathdisplayedName- the displayed column name
-
-
Method Details
-
toString
-
getTableConfiguration
Description copied from interface:TableColumnConfigurationGets the table configuration.- Specified by:
getTableConfigurationin interfaceTableColumnConfiguration<S,T> - Returns:
- the table configuration
-
getName
Description copied from interface:TableColumnConfigurationGets the column name.
This is usually the binding path.
The name is also used as a key to the table preferences.- Specified by:
getNamein interfaceTableColumnConfiguration<S,T> - Returns:
- the name of the column
-
getDisplayedName
Description copied from interface:TableColumnConfigurationGets the column name displayed in the column header.- Specified by:
getDisplayedNamein interfaceTableColumnConfiguration<S,T> - Returns:
- the display name of the column
-
setDisplayedName
Description copied from interface:TableColumnConfigurationSets the column name displayed in the column header.- Specified by:
setDisplayedNamein interfaceTableColumnConfiguration<S,T> - Parameters:
displayedName- the display name of the column- Returns:
- this configuration
-
setType
Description copied from interface:TableColumnConfigurationSets the column type.- Specified by:
setTypein interfaceTableColumnConfiguration<S,T> - Parameters:
type- the type
-
getType
Description copied from interface:TableColumnConfigurationDetermines the class for a given column.- Specified by:
getTypein interfaceTableColumnConfiguration<S,T> - Returns:
- the column class
-
setGenericType
Description copied from interface:TableColumnConfigurationSets the generic type.- Specified by:
setGenericTypein interfaceTableColumnConfiguration<S,T> - Parameters:
genericType- the generic type
-
getGenericType
Description copied from interface:TableColumnConfigurationGets the generic type.- Specified by:
getGenericTypein interfaceTableColumnConfiguration<S,T> - Returns:
- the generic type
-
getCellType
Description copied from interface:TableColumnConfigurationGets the specific table cell type.- Specified by:
getCellTypein interfaceTableColumnConfiguration<S,T> - Returns:
- the cell type, null to determine from the column type
- See Also:
-
setCellType
Description copied from interface:TableColumnConfigurationSets the specific table cell type.- Specified by:
setCellTypein interfaceTableColumnConfiguration<S,T> - Parameters:
cellType- the cell type, null to determine from the column type- Returns:
- this configuration
-
setPattern
Description copied from interface:TableColumnConfigurationSets the formatting string.- Specified by:
setPatternin interfaceTableColumnConfiguration<S,T> - Parameters:
pattern- the format pattern- Returns:
- this configuration
-
getPattern
Description copied from interface:TableColumnConfigurationDefines the format for numeric or date/time-types.
If null is returned, a default format will be used according to the column class.- Specified by:
getPatternin interfaceTableColumnConfiguration<S,T> - Returns:
- the format pattern or null if default
-
getNumberFormat
Description copied from interface:TableColumnConfigurationGets the number format.- Specified by:
getNumberFormatin interfaceTableColumnConfiguration<S,T> - Returns:
- the number format, null if default
-
getDateTimeFormatter
Description copied from interface:TableColumnConfigurationGets the date or time formatter.- Specified by:
getDateTimeFormatterin interfaceTableColumnConfiguration<S,T> - Returns:
- the formatter, null if default
-
setAlignment
Description copied from interface:TableColumnConfigurationSets the alignment within the cell.- Specified by:
setAlignmentin interfaceTableColumnConfiguration<S,T> - Parameters:
alignment- the alignment- Returns:
- this configuration
-
getAlignment
public javafx.geometry.Pos getAlignment()Description copied from interface:TableColumnConfigurationDefines the alignment of the column.- Specified by:
getAlignmentin interfaceTableColumnConfiguration<S,T> - Returns:
- the alignment or null if default
-
setBlankZero
Description copied from interface:TableColumnConfigurationSets whether to blank out numeric zero values.- Specified by:
setBlankZeroin interfaceTableColumnConfiguration<S,T> - Parameters:
blankZero- true if blank zeros, false if not, null to use default from the editor- Returns:
- this configuration
-
isBlankZero
Description copied from interface:TableColumnConfigurationDefines theblankzeroattribute of the column.- Specified by:
isBlankZeroin interfaceTableColumnConfiguration<S,T> - Returns:
- true if blank zeros, false if not, null to use default from the editor
-
isUnsigned
Description copied from interface:TableColumnConfigurationReturns whether a numeric field is unsigned or signed.- Specified by:
isUnsignedin interfaceTableColumnConfiguration<S,T> - Returns:
- true if unsigned, null to use default from the editor
-
setUnsigned
Description copied from interface:TableColumnConfigurationSets whether a numeric field is unsigned or signed.- Specified by:
setUnsignedin interfaceTableColumnConfiguration<S,T> - Parameters:
unsigned- true if unsigned, null to use default from the editor- Returns:
- this configuration
-
getValidChars
Description copied from interface:TableColumnConfigurationGets allowed characters.- Specified by:
getValidCharsin interfaceTableColumnConfiguration<S,T> - Returns:
- the valid characters, null to use default from the editor
-
setValidChars
Description copied from interface:TableColumnConfigurationSets allowed characters.- Specified by:
setValidCharsin interfaceTableColumnConfiguration<S,T> - Parameters:
validChars- the valid characters, null to use default from the editor- Returns:
- this configuration
-
getInvalidChars
Description copied from interface:TableColumnConfigurationGets invalid characters.- Specified by:
getInvalidCharsin interfaceTableColumnConfiguration<S,T> - Returns:
- the invalid characters, null to use default from the editor
-
setInvalidChars
Description copied from interface:TableColumnConfigurationSets invalid characters.- Specified by:
setInvalidCharsin interfaceTableColumnConfiguration<S,T> - Parameters:
invalidChars- the invalid characters, null to use default from the editor- Returns:
- this configuration
-
setAutoSelect
Description copied from interface:TableColumnConfigurationSets the autoselect feature.- Specified by:
setAutoSelectin interfaceTableColumnConfiguration<S,T> - Parameters:
autoSelect- true if autoselect, false if not, null to use default from the editor- Returns:
- this configuration
-
isAutoSelect
Description copied from interface:TableColumnConfigurationGets the autoselect flag.- Specified by:
isAutoSelectin interfaceTableColumnConfiguration<S,T> - Returns:
- true if autoselect, false if not, null to use default from the editor
-
setMaxColumns
Description copied from interface:TableColumnConfigurationSets the max columns.- Specified by:
setMaxColumnsin interfaceTableColumnConfiguration<S,T> - Parameters:
maxColumns- the max columns, null if not defined- Returns:
- this configuration
-
getMaxColumns
Description copied from interface:TableColumnConfigurationGets the maximum columns for text cell editors.- Specified by:
getMaxColumnsin interfaceTableColumnConfiguration<S,T> - Returns:
- the max columns, null if not defined
-
setScale
Description copied from interface:TableColumnConfigurationSets the numeric scale.- Specified by:
setScalein interfaceTableColumnConfiguration<S,T> - Parameters:
scale- the scale, null if not defined- Returns:
- this configuration
-
getScale
Description copied from interface:TableColumnConfigurationGets the scale for fractional numeric cell editors.- Specified by:
getScalein interfaceTableColumnConfiguration<S,T> - Returns:
- the scale, null if not defined
-
setCaseConversion
Description copied from interface:TableColumnConfigurationSets the case conversion.- Specified by:
setCaseConversionin interfaceTableColumnConfiguration<S,T> - Parameters:
caseConversion- true = convert to uppercase, false = lowercase, null = no conversion (default)- Returns:
- this configuration
-
getCaseConversion
Description copied from interface:TableColumnConfigurationGets the case conversion.- Specified by:
getCaseConversionin interfaceTableColumnConfiguration<S,T> - Returns:
- true = convert to uppercase, false = lowercase, null = no conversion (default)
-
isSummable
public boolean isSummable()Description copied from interface:TableColumnConfigurationDetermines whether the column is summable.- Specified by:
isSummablein interfaceTableColumnConfiguration<S,T> - Returns:
- true if the column is summable
-
setSummable
Description copied from interface:TableColumnConfigurationSets whether the column is summable.- Specified by:
setSummablein interfaceTableColumnConfiguration<S,T> - Parameters:
summable-Boolean.TRUEif summable,Boolean.FALSEif not, NULL to derive from type- Returns:
- this configuration
-
getSummable
Description copied from interface:TableColumnConfigurationReturns whether the column is summable.- Specified by:
getSummablein interfaceTableColumnConfiguration<S,T> - Returns:
Boolean.TRUEif summable,Boolean.FALSEif not, NULL to derive from type
-
setFilterable
Description copied from interface:TableColumnConfigurationSets whether the column provides a filter UI in its header.- Specified by:
setFilterablein interfaceTableColumnConfiguration<S,T> - Parameters:
filterable-Boolean.FALSEto suppress the filter for this column, else null orBoolean.TRUE- Returns:
- this configuration
-
getFilterable
Description copied from interface:TableColumnConfigurationReturns whether the column provides a filter UI in its header.- Specified by:
getFilterablein interfaceTableColumnConfiguration<S,T> - Returns:
Boolean.FALSEif the filter is suppressed for this column, else null orBoolean.TRUE
-
isEditable
public boolean isEditable()Description copied from interface:TableColumnConfigurationReturns whether the column is editable.- Specified by:
isEditablein interfaceTableColumnConfiguration<S,T> - Returns:
- true if editable, the default is false
-
getEditable
Description copied from interface:TableColumnConfigurationReturns whether the column is editable.- Specified by:
getEditablein interfaceTableColumnConfiguration<S,T> - Returns:
Boolean.TRUEif editable,Boolean.FALSEif not, NULL if depends on table configuration
-
setEditable
Description copied from interface:TableColumnConfigurationSets whether the column is editable.- Specified by:
setEditablein interfaceTableColumnConfiguration<S,T> - Parameters:
editable-Boolean.TRUEif editable,Boolean.FALSEif not, NULL if depends on table configuration- Returns:
- this configuration
-
getEditor
Description copied from interface:TableColumnConfigurationGets the editor component.- Specified by:
getEditorin interfaceTableColumnConfiguration<S,T> - Returns:
- the editor; null to use default from
TableCellType.getEditor()
-
setEditor
Description copied from interface:TableColumnConfigurationSets the editor component.- Specified by:
setEditorin interfaceTableColumnConfiguration<S,T> - Parameters:
editor- the editor; null to use default fromTableCellType.getEditor()- Returns:
- this configuration
-
setBinding
Description copied from interface:TableColumnConfigurationSets the binding.- Specified by:
setBindingin interfaceTableColumnConfiguration<S,T> - Parameters:
binding- the binding- Returns:
- this configuration
-
getBinding
Description copied from interface:TableColumnConfigurationGets the binding for this column.- Specified by:
getBindingin interfaceTableColumnConfiguration<S,T> - Returns:
- the binding, null if none
-
getTableColumn
Description copied from interface:TableColumnConfigurationGets or creates the table column.
Used if configuration applies to aTableView.- Specified by:
getTableColumnin interfaceTableColumnConfiguration<S,T> - Returns:
- the table column, never null
-
getTreeTableColumn
Description copied from interface:TableColumnConfigurationGets or creates the tree table column.
Used if configuration applies to aTreeTableView.- Specified by:
getTreeTableColumnin interfaceTableColumnConfiguration<S,T> - Returns:
- the tree table column, never null
-
createTableCellValue
-
createTableCellValueFactory
-
createTableCell
-
getTableCellFactory
-
createTableColumn
Creates the table column.- Returns:
- the table column
-
createTreeTableCellValue
-
createTreeTableCellValueFactory
-
createTreeTableCell
-
createTreeTableCellFactory
-
createTreeTableColumn
Creates the tree table column.- Returns:
- the tree table column
-