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
ConstructorDescriptionDefaultTableColumnConfiguration
(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.Pos
Defines 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.boolean
Returns whether column is editable.boolean
Determines whether the column is summable.Returns whether a numeric field is unsigned or signed.void
setAlignment
(javafx.geometry.Pos alignment) Sets the alignment within the cell.void
setAutoSelect
(Boolean autoSelect) Sets the autoselect feature.void
setBinding
(FxTableBinding<S, T> binding) Sets the binding.void
setBlankZero
(Boolean blankZero) Sets whether to blank out numeric zero values.void
setCaseConversion
(Boolean caseConversion) Sets the case conversion.void
setCellType
(TableCellType<T> cellType) Sets the specific table cell type.void
setDisplayedName
(String displayedName) Sets the column name displayed in the column header.void
setEditable
(Boolean editable) Sets whether the column is editable.void
setEditor
(FxComponent editor) Sets the editor component.void
setGenericType
(Type genericType) Sets the generic type.void
setInvalidChars
(String invalidChars) Sets invalid characters.void
setMaxColumns
(Integer maxColumns) Sets the max columns.void
setPattern
(String pattern) Sets the formatting string.void
Sets the numeric scale.void
setSummable
(Boolean summable) Sets whether the column is summable.void
Sets the column type.void
setUnsigned
(Boolean unsigned) Sets whether a numeric field is unsigned or signed.void
setValidChars
(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:TableColumnConfiguration
Gets the table configuration.- Specified by:
getTableConfiguration
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the table configuration
-
getName
Description copied from interface:TableColumnConfiguration
Gets the column name.
This is usually the binding path.
The name is also used as a key to the table preferences.- Specified by:
getName
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the name of the column
-
getDisplayedName
Description copied from interface:TableColumnConfiguration
Gets the column name displayed in the column header.- Specified by:
getDisplayedName
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the display name of the column
-
setDisplayedName
Description copied from interface:TableColumnConfiguration
Sets the column name displayed in the column header.- Specified by:
setDisplayedName
in interfaceTableColumnConfiguration<S,
T> - Parameters:
displayedName
- the display name of the column
-
setType
Description copied from interface:TableColumnConfiguration
Sets the column type.- Specified by:
setType
in interfaceTableColumnConfiguration<S,
T> - Parameters:
type
- the type
-
getType
Description copied from interface:TableColumnConfiguration
Determines the class for a given column.- Specified by:
getType
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the column class
-
setGenericType
Description copied from interface:TableColumnConfiguration
Sets the generic type.- Specified by:
setGenericType
in interfaceTableColumnConfiguration<S,
T> - Parameters:
genericType
- the generic type
-
getGenericType
Description copied from interface:TableColumnConfiguration
Gets the generic type.- Specified by:
getGenericType
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the generic type
-
getCellType
Description copied from interface:TableColumnConfiguration
Gets the specific table cell type.- Specified by:
getCellType
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the cell type, null to determine from column type
- See Also:
-
setCellType
Description copied from interface:TableColumnConfiguration
Sets the specific table cell type.- Specified by:
setCellType
in interfaceTableColumnConfiguration<S,
T> - Parameters:
cellType
- the cell type, null to determine from column type
-
setPattern
Description copied from interface:TableColumnConfiguration
Sets the formatting string.- Specified by:
setPattern
in interfaceTableColumnConfiguration<S,
T> - Parameters:
pattern
- the format pattern
-
getPattern
Description copied from interface:TableColumnConfiguration
Defines 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:
getPattern
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the format pattern or null if default
-
getNumberFormat
Description copied from interface:TableColumnConfiguration
Gets the number format.- Specified by:
getNumberFormat
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the number format, null if default
-
getDateTimeFormatter
Description copied from interface:TableColumnConfiguration
Gets the date or time formatter.- Specified by:
getDateTimeFormatter
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the formatter, null if default
-
setAlignment
public void setAlignment(javafx.geometry.Pos alignment) Description copied from interface:TableColumnConfiguration
Sets the alignment within the cell.- Specified by:
setAlignment
in interfaceTableColumnConfiguration<S,
T> - Parameters:
alignment
- the alignment
-
getAlignment
public javafx.geometry.Pos getAlignment()Description copied from interface:TableColumnConfiguration
Defines the alignment of the column.- Specified by:
getAlignment
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the alignment or null if default
-
setBlankZero
Description copied from interface:TableColumnConfiguration
Sets whether to blank out numeric zero values.- Specified by:
setBlankZero
in interfaceTableColumnConfiguration<S,
T> - Parameters:
blankZero
- true if blank zeros, false if not, null if use default from editor
-
isBlankZero
Description copied from interface:TableColumnConfiguration
Defines the "blankzero" attribute of the column.- Specified by:
isBlankZero
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true if blank zeros, false if not, null if use default from editor
-
isUnsigned
Description copied from interface:TableColumnConfiguration
Returns whether a numeric field is unsigned or signed.- Specified by:
isUnsigned
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true if unsigned, null if use default from editor
-
setUnsigned
Description copied from interface:TableColumnConfiguration
Sets whether a numeric field is unsigned or signed.- Specified by:
setUnsigned
in interfaceTableColumnConfiguration<S,
T> - Parameters:
unsigned
- true if unsigned, null if use default from editor
-
getValidChars
Description copied from interface:TableColumnConfiguration
Gets allowed characters.- Specified by:
getValidChars
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the valid characters, null to use default from editor
-
setValidChars
Description copied from interface:TableColumnConfiguration
Sets allowed characters.- Specified by:
setValidChars
in interfaceTableColumnConfiguration<S,
T> - Parameters:
validChars
- the valid characters, null to use default from editor
-
getInvalidChars
Description copied from interface:TableColumnConfiguration
Gets invalid characters.- Specified by:
getInvalidChars
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the invalid characters, null to use default from editor
-
setInvalidChars
Description copied from interface:TableColumnConfiguration
Sets invalid characters.- Specified by:
setInvalidChars
in interfaceTableColumnConfiguration<S,
T> - Parameters:
invalidChars
- the invalid characters, null to use default from editor
-
setAutoSelect
Description copied from interface:TableColumnConfiguration
Sets the autoselect feature.- Specified by:
setAutoSelect
in interfaceTableColumnConfiguration<S,
T> - Parameters:
autoSelect
- true if autoselect, false if not, null if use default from editor
-
isAutoSelect
Description copied from interface:TableColumnConfiguration
Gets the autoselect flag.- Specified by:
isAutoSelect
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true if autoselect, false if not, null if use default from editor
-
setMaxColumns
Description copied from interface:TableColumnConfiguration
Sets the max columns.- Specified by:
setMaxColumns
in interfaceTableColumnConfiguration<S,
T> - Parameters:
maxColumns
- the max columns, null if not defined
-
getMaxColumns
Description copied from interface:TableColumnConfiguration
Gets the maximum columns for text cell editors.- Specified by:
getMaxColumns
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the max columns, null if not defined
-
setScale
Description copied from interface:TableColumnConfiguration
Sets the numeric scale.- Specified by:
setScale
in interfaceTableColumnConfiguration<S,
T> - Parameters:
scale
- the scale, null if not defined
-
getScale
Description copied from interface:TableColumnConfiguration
Gets the scale for fractional numeric cell editors.- Specified by:
getScale
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the scale, null if not defined
-
setCaseConversion
Description copied from interface:TableColumnConfiguration
Sets the case conversion.- Specified by:
setCaseConversion
in interfaceTableColumnConfiguration<S,
T> - Parameters:
caseConversion
- true = convert to uppercase, false = lowercase, null = no conversion (default)
-
getCaseConversion
Description copied from interface:TableColumnConfiguration
Gets the case conversion.- Specified by:
getCaseConversion
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true = convert to uppercase, false = lowercase, null = no conversion (default)
-
isSummable
public boolean isSummable()Description copied from interface:TableColumnConfiguration
Determines whether the column is summable.- Specified by:
isSummable
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true if column is summable
-
setSummable
Description copied from interface:TableColumnConfiguration
Sets whether the column is summable.- Specified by:
setSummable
in interfaceTableColumnConfiguration<S,
T> - Parameters:
summable
-Boolean.TRUE
if summable,Boolean.FALSE
if not, NULL if numeric type
-
getSummable
Description copied from interface:TableColumnConfiguration
Returns whether the column is summable.- Specified by:
getSummable
in interfaceTableColumnConfiguration<S,
T> - Returns:
Boolean.TRUE
if summable,Boolean.FALSE
if not, NULL if numeric type
-
isEditable
public boolean isEditable()Description copied from interface:TableColumnConfiguration
Returns whether column is editable.- Specified by:
isEditable
in interfaceTableColumnConfiguration<S,
T> - Returns:
- true if editable, the default is false
-
getEditable
Description copied from interface:TableColumnConfiguration
Returns whether the column is editable.- Specified by:
getEditable
in interfaceTableColumnConfiguration<S,
T> - Returns:
Boolean.TRUE
if editable,Boolean.FALSE
if not, NULL if depends on table configuration
-
setEditable
Description copied from interface:TableColumnConfiguration
Sets whether the column is editable.- Specified by:
setEditable
in interfaceTableColumnConfiguration<S,
T> - Parameters:
editable
-Boolean.TRUE
if editable,Boolean.FALSE
if not, NULL if depends on table configuration
-
getEditor
Description copied from interface:TableColumnConfiguration
Gets the editor component.- Specified by:
getEditor
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the editor, null to use default from
TableCellType.getEditor()
-
setEditor
Description copied from interface:TableColumnConfiguration
Sets the editor component.- Specified by:
setEditor
in interfaceTableColumnConfiguration<S,
T> - Parameters:
editor
- the editor, null to use default fromTableCellType.getEditor()
-
setBinding
Description copied from interface:TableColumnConfiguration
Sets the binding.- Specified by:
setBinding
in interfaceTableColumnConfiguration<S,
T> - Parameters:
binding
- the binding
-
getBinding
Description copied from interface:TableColumnConfiguration
Gets the binding for this column.- Specified by:
getBinding
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the binding, null if none
-
getTableColumn
Description copied from interface:TableColumnConfiguration
Gets or creates the table column.
Used if configuration applies to aTableView
.- Specified by:
getTableColumn
in interfaceTableColumnConfiguration<S,
T> - Returns:
- the table column, never null
-
getTreeTableColumn
Description copied from interface:TableColumnConfiguration
Gets or creates the tree table column.
Used if configuration applies to aTreeTableView
.- Specified by:
getTreeTableColumn
in 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
-