- 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>
public class DefaultTableColumnConfiguration<S,T> extends java.lang.Object implements TableColumnConfiguration<S,T>
Default configuration for a table column.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description DefaultTableColumnConfiguration(DefaultTableConfiguration<S> tableConfiguration, java.lang.String name, java.lang.String displayedName)Create a column config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javafx.util.Callback<javafx.scene.control.TableColumn<S,T>,javafx.scene.control.TableCell<S,T>>createCellFactory()Creates the cell factory.protected javafx.beans.value.ObservableValue<T>createCellValue(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>>createCellValueFactory()Creates the cell value factory.protected javafx.scene.control.TableCell<S,T>createTableCell(javafx.scene.control.TableColumn<S,T> column)Creates a table cell.protected FxTableColumn<S,T>createTableColumn()Creates the table column.javafx.geometry.PosgetAlignment()Defines the alignment of the column.FxTableBinding<S,T>getBinding()Gets the binding for this column.java.lang.BooleangetCaseConversion()Gets the case conversion.java.text.DateFormatgetDateFormat()Gets the date format.java.time.format.DateTimeFormattergetDateTimeFormatter()Gets the date or time formatter.java.lang.StringgetDisplayedName()Gets the column name displayed in the column header.java.lang.BooleangetEditable()Returns whether the column is editable.FxComponentgetEditor()Gets the editor component.java.lang.reflect.TypegetGenericType()Gets the generic type.java.lang.StringgetInvalidChars()Gets invalid characters.java.lang.IntegergetMaxColumns()Gets the maximum columns for text cell editors.java.lang.StringgetName()Gets the column name.
This is usually the binding path.
The name is also used as a key to the table preferences.java.text.DecimalFormatgetNumberFormat()Gets the number format.java.lang.StringgetPattern()Defines the format for numeric or date/time-types.
If null is returned a default format will be used according to the column class.java.lang.IntegergetScale()Gets the scale for fractional numeric cell editors.java.lang.BooleangetSummable()Returns whether the column is summable.FxTableColumn<S,T>getTableColumn()Gets the table column.DefaultTableConfiguration<S>getTableConfiguration()Gets the table configuration.java.lang.Class<T>getType()Determines the class for a given column.java.lang.StringgetValidChars()Gets allowed characters.java.lang.BooleanisAutoSelect()Gets the autoselect flag.java.lang.BooleanisBlankZero()Defines the "blankzero" attribute of the column.booleanisEditable()Returns whether column is editable.booleanisSummable()Determines whether the column is summable.java.lang.BooleanisUnsigned()Returns whether a numeric field is unsigned or signed.voidsetAlignment(javafx.geometry.Pos alignment)Sets the alignment within the cell.voidsetAutoSelect(java.lang.Boolean autoSelect)Sets the autoselect feature.voidsetBinding(FxTableBinding<S,T> binding)Sets the binding.voidsetBlankZero(java.lang.Boolean blankZero)Sets whether to blank out numeric zero values.voidsetCaseConversion(java.lang.Boolean caseConversion)Sets the case conversion.voidsetEditable(java.lang.Boolean editable)Sets whether the column is editable.voidsetEditor(FxComponent editor)Sets the editor component.voidsetGenericType(java.lang.reflect.Type genericType)Sets the generic type.voidsetInvalidChars(java.lang.String invalidChars)Sets invalid characters.voidsetMaxColumns(java.lang.Integer maxColumns)Sets the max columns.voidsetPattern(java.lang.String pattern)Sets the formatting string.voidsetScale(java.lang.Integer scale)Sets the numeric scale.voidsetSummable(java.lang.Boolean summable)Sets whether the column is summable.voidsetType(java.lang.Class<T> type)Sets the column type.voidsetUnsigned(java.lang.Boolean unsigned)Sets whether a numeric field is unsigned or signed.voidsetValidChars(java.lang.String validChars)Sets allowed characters.java.lang.StringtoString()
-
-
-
Constructor Detail
-
DefaultTableColumnConfiguration
public DefaultTableColumnConfiguration(DefaultTableConfiguration<S> tableConfiguration, java.lang.String name, java.lang.String displayedName)
Create a column config.- Parameters:
tableConfiguration- the table configname- the column's binding pathdisplayedName- the displayed column name
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTableConfiguration
public DefaultTableConfiguration<S> getTableConfiguration()
Description copied from interface:TableColumnConfigurationGets the table configuration.- Specified by:
getTableConfigurationin interfaceTableColumnConfiguration<S,T>- Returns:
- the table configuration
-
getName
public java.lang.String 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
public java.lang.String 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
-
setType
public void setType(java.lang.Class<T> type)
Description copied from interface:TableColumnConfigurationSets the column type.- Specified by:
setTypein interfaceTableColumnConfiguration<S,T>- Parameters:
type- the type
-
setGenericType
public void setGenericType(java.lang.reflect.Type genericType)
Description copied from interface:TableColumnConfigurationSets the generic type.- Specified by:
setGenericTypein interfaceTableColumnConfiguration<S,T>- Parameters:
genericType- the generic type
-
getGenericType
public java.lang.reflect.Type getGenericType()
Description copied from interface:TableColumnConfigurationGets the generic type.- Specified by:
getGenericTypein interfaceTableColumnConfiguration<S,T>- Returns:
- the generic type
-
getType
public java.lang.Class<T> getType()
Description copied from interface:TableColumnConfigurationDetermines the class for a given column.- Specified by:
getTypein interfaceTableColumnConfiguration<S,T>- Returns:
- the column class
-
setPattern
public void setPattern(java.lang.String pattern)
Description copied from interface:TableColumnConfigurationSets the formatting string.- Specified by:
setPatternin interfaceTableColumnConfiguration<S,T>- Parameters:
pattern- the format pattern
-
getPattern
public java.lang.String 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
public java.text.DecimalFormat getNumberFormat()
Description copied from interface:TableColumnConfigurationGets the number format.- Specified by:
getNumberFormatin interfaceTableColumnConfiguration<S,T>- Returns:
- the number format, null if default
-
getDateFormat
public java.text.DateFormat getDateFormat()
Description copied from interface:TableColumnConfigurationGets the date format.- Specified by:
getDateFormatin interfaceTableColumnConfiguration<S,T>- Returns:
- the date format, null if default
-
getDateTimeFormatter
public java.time.format.DateTimeFormatter 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
public void setBlankZero(java.lang.Boolean blankZero)
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
public java.lang.Boolean 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
public java.lang.Boolean 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
public void setUnsigned(java.lang.Boolean unsigned)
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
public java.lang.String getValidChars()
Description copied from interface:TableColumnConfigurationGets allowed characters.- Specified by:
getValidCharsin interfaceTableColumnConfiguration<S,T>- Returns:
- the valid characters, null if use default from editor
-
setValidChars
public void setValidChars(java.lang.String validChars)
Description copied from interface:TableColumnConfigurationSets allowed characters.- Specified by:
setValidCharsin interfaceTableColumnConfiguration<S,T>- Parameters:
validChars- the valid characters, null if use default from editor
-
getInvalidChars
public java.lang.String getInvalidChars()
Description copied from interface:TableColumnConfigurationGets invalid characters.- Specified by:
getInvalidCharsin interfaceTableColumnConfiguration<S,T>- Returns:
- the invalid characters, null if use default from editor
-
setInvalidChars
public void setInvalidChars(java.lang.String invalidChars)
Description copied from interface:TableColumnConfigurationSets invalid characters.- Specified by:
setInvalidCharsin interfaceTableColumnConfiguration<S,T>- Parameters:
invalidChars- the invalid characters, null if use default from editor
-
setAutoSelect
public void setAutoSelect(java.lang.Boolean autoSelect)
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
public java.lang.Boolean 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
public void setMaxColumns(java.lang.Integer maxColumns)
Description copied from interface:TableColumnConfigurationSets the max columns.- Specified by:
setMaxColumnsin interfaceTableColumnConfiguration<S,T>- Parameters:
maxColumns- the max columns, null if not defined
-
getMaxColumns
public java.lang.Integer 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
public void setScale(java.lang.Integer scale)
Description copied from interface:TableColumnConfigurationSets the numeric scale.- Specified by:
setScalein interfaceTableColumnConfiguration<S,T>- Parameters:
scale- the scale, null if not defined
-
getScale
public java.lang.Integer 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
public void setCaseConversion(java.lang.Boolean caseConversion)
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
public java.lang.Boolean 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
public void setSummable(java.lang.Boolean summable)
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
public java.lang.Boolean 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
public java.lang.Boolean 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
public void setEditable(java.lang.Boolean editable)
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
public FxComponent getEditor()
Description copied from interface:TableColumnConfigurationGets the editor component.- Specified by:
getEditorin interfaceTableColumnConfiguration<S,T>- Returns:
- the editor, null if use default from
TableCellType.getEditor()
-
setEditor
public void setEditor(FxComponent editor)
Description copied from interface:TableColumnConfigurationSets the editor component.- Specified by:
setEditorin interfaceTableColumnConfiguration<S,T>- Parameters:
editor- the editor, null if use default fromTableCellType.getEditor()
-
setBinding
public void setBinding(FxTableBinding<S,T> binding)
Description copied from interface:TableColumnConfigurationSets the binding.- Specified by:
setBindingin interfaceTableColumnConfiguration<S,T>- Parameters:
binding- the binding
-
getBinding
public FxTableBinding<S,T> getBinding()
Description copied from interface:TableColumnConfigurationGets the binding for this column.- Specified by:
getBindingin interfaceTableColumnConfiguration<S,T>- Returns:
- the binding, null if none
-
getTableColumn
public FxTableColumn<S,T> getTableColumn()
Description copied from interface:TableColumnConfigurationGets the table column.- Specified by:
getTableColumnin interfaceTableColumnConfiguration<S,T>- Returns:
- the table column
-
createCellValue
protected javafx.beans.value.ObservableValue<T> createCellValue(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
-
createCellValueFactory
protected javafx.util.Callback<javafx.scene.control.TableColumn.CellDataFeatures<S,T>,javafx.beans.value.ObservableValue<T>> createCellValueFactory()
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.- Parameters:
column- the table column- Returns:
- the table cell
-
createCellFactory
protected javafx.util.Callback<javafx.scene.control.TableColumn<S,T>,javafx.scene.control.TableCell<S,T>> createCellFactory()
Creates the cell factory.- Returns:
- the cell factory
-
createTableColumn
protected FxTableColumn<S,T> createTableColumn()
Creates the table column.- Returns:
- the table column
-
-