java.lang.Object
org.tentackle.fx.table.DefaultTableColumnConfiguration<S,T>
- Type Parameters:
S- type of the objects contained within the table's items 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.
- 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.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 the "blankzero" attribute of the column.booleanReturns whether column is editable.booleanDetermines whether the column is summable.Returns whether a numeric field is unsigned or signed.voidsetAlignment(javafx.geometry.Pos alignment) Sets the alignment within the cell.voidsetAutoSelect(Boolean autoSelect) Sets the autoselect feature.voidsetBinding(FxTableBinding<S, T> binding) Sets the binding.voidsetBlankZero(Boolean blankZero) Sets whether to blank out numeric zero values.voidsetCaseConversion(Boolean caseConversion) Sets the case conversion.voidsetCellType(TableCellType<T> cellType) Sets the specific table cell type.voidsetDisplayedName(String displayedName) Sets the column name displayed in the column header.voidsetEditable(Boolean editable) Sets whether the column is editable.voidsetEditor(FxComponent editor) Sets the editor component.voidsetGenericType(Type genericType) Sets the generic type.voidsetInvalidChars(String invalidChars) Sets invalid characters.voidsetMaxColumns(Integer maxColumns) Sets the max columns.voidsetPattern(String pattern) Sets the formatting string.voidSets the numeric scale.voidsetSummable(Boolean summable) Sets whether the column is summable.voidSets the column type.voidsetUnsigned(Boolean unsigned) Sets whether a numeric field is unsigned or signed.voidsetValidChars(String validChars) Sets allowed characters.toString()
-
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
-
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 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 column type
-
setPattern
Description copied from interface:TableColumnConfigurationSets the formatting string.- Specified by:
setPatternin interfaceTableColumnConfiguration<S,T> - Parameters:
pattern- the format pattern
-
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
public void setAlignment(javafx.geometry.Pos alignment) Description copied from interface:TableColumnConfigurationSets the alignment within the cell.- Specified by:
setAlignmentin interfaceTableColumnConfiguration<S,T> - Parameters:
alignment- the alignment
-
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 if use default from editor
-
isBlankZero
Description copied from interface:TableColumnConfigurationDefines the "blankzero" attribute of the column.- Specified by:
isBlankZeroin interfaceTableColumnConfiguration<S,T> - Returns:
- true if blank zeros, false if not, null if use default from 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 if use default from 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 if use default from editor
-
getValidChars
Description copied from interface:TableColumnConfigurationGets allowed characters.- Specified by:
getValidCharsin interfaceTableColumnConfiguration<S,T> - Returns:
- the valid characters, null to use default from 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 editor
-
getInvalidChars
Description copied from interface:TableColumnConfigurationGets invalid characters.- Specified by:
getInvalidCharsin interfaceTableColumnConfiguration<S,T> - Returns:
- the invalid characters, null to use default from 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 editor
-
setAutoSelect
Description copied from interface:TableColumnConfigurationSets the autoselect feature.- Specified by:
setAutoSelectin interfaceTableColumnConfiguration<S,T> - Parameters:
autoSelect- true if autoselect, false if not, null if use default from editor
-
isAutoSelect
Description copied from interface:TableColumnConfigurationGets the autoselect flag.- Specified by:
isAutoSelectin interfaceTableColumnConfiguration<S,T> - Returns:
- true if autoselect, false if not, null if use default from 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
-
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
-
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)
-
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 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 if numeric type
-
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 if numeric type
-
isEditable
public boolean isEditable()Description copied from interface:TableColumnConfigurationReturns whether 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
-
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()
-
setBinding
Description copied from interface:TableColumnConfigurationSets the binding.- Specified by:
setBindingin interfaceTableColumnConfiguration<S,T> - Parameters:
binding- the binding
-
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
protected javafx.beans.value.ObservableValue<T> createTableCellValue(javafx.scene.control.TableColumn.CellDataFeatures<S, T> cdf) Creates the cell value for a given row object.- Parameters:
cdf- the cell data features- Returns:
- the cell value to display
-
createTableCellValueFactory
protected javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S,T>, createTableCellValueFactory()javafx.beans.value.ObservableValue<T>> Creates the cell value factory.- Returns:
- the value factory
-
createTableCell
protected javafx.scene.control.TableCell<S,T> createTableCell(javafx.scene.control.TableColumn<S, T> column) Creates a table cell.
The method reference can directly be used as a cell factory.- Parameters:
column- the table column- Returns:
- the table cell
-
getTableCellFactory
protected javafx.util.Callback<javafx.scene.control.TableColumn<S,T>, getTableCellFactory()javafx.scene.control.TableCell<S, T>> Gets the cell factory.- Returns:
- the cell factory
-
createTableColumn
Creates the table column.- Returns:
- the table column
-
createTreeTableCellValue
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.- Parameters:
cdf- the cell data features- Returns:
- the cell value to display
-
createTreeTableCellValueFactory
protected javafx.util.Callback<javafx.scene.control.TreeTableColumn.CellDataFeatures<S,T>, createTreeTableCellValueFactory()javafx.beans.value.ObservableValue<T>> Creates the tree table cell value factory.- Returns:
- the value factory
-
createTreeTableCell
protected javafx.scene.control.TreeTableCell<S,T> createTreeTableCell(javafx.scene.control.TreeTableColumn<S, T> column) Creates a treetable cell.
The method reference can directly be used as a cell factory.- Parameters:
column- the table column- Returns:
- the table cell
-
createTreeTableCellFactory
protected javafx.util.Callback<javafx.scene.control.TreeTableColumn<S,T>, createTreeTableCellFactory()javafx.scene.control.TreeTableCell<S, T>> Creates the treetable cell factory.- Returns:
- the cell factory
-
createTreeTableColumn
Creates the tree table column.- Returns:
- the tree table column
-