Class TableColumnBase<S,T>
- Type Parameters:
-
S- The type of the UI control (e.g. the type of the 'row'). -
T- The type of the content in all cells in this table column.
- All Implemented Interfaces:
-
Styleable,EventTarget
- Direct Known Subclasses:
-
TableColumn,TreeTableColumn
@IDProperty("id") public abstract class TableColumnBase<S,T> extends Object implements EventTarget, Styleable TableView and TreeTableView) are made up of zero or more instances of a concrete TableColumnBase subclass (TableColumn and TreeTableColumn, respectively). Each table column in a table is responsible for displaying (and editing) the contents of that column. As well as being responsible for displaying and editing data for a single column, a table column also contains the necessary properties to: - Be resized (using
minWidth/prefWidth/maxWidthandwidthproperties) - Have its
visibilitytoggled - Display
header text - Display any
nested columnsit may contain - Have a
context menuwhen the user right-clicks the column header area - Have the contents of the table be sorted (using
comparator,sortableand sortType).
text (what to show in the column header area), and the column cell value factory (which is used to populate individual cells in the column). Refer to the class documentation for TableColumn and TreeTableColumn for more information.- Since:
- JavaFX 8.0
- See Also:
Property Summary
| Type | Property | Description |
|---|---|---|
final ObjectProperty<Comparator<T>> |
comparator |
Comparator function used when sorting this table column. |
final ObjectProperty<ContextMenu> |
contextMenu |
This menu will be shown whenever the user right clicks within the header area of this TableColumnBase. |
final BooleanProperty |
editable |
Specifies whether this table column allows editing. |
final ObjectProperty<Node> |
graphic |
The graphic to show in the table column to allow the user to indicate graphically what is in the column. |
final StringProperty |
id |
The id of this TableColumnBase. |
final DoubleProperty |
maxWidth |
The maximum width the table column is permitted to be resized to. |
final DoubleProperty |
minWidth |
The minimum width the table column is permitted to be resized to. |
final ReadOnlyObjectProperty<TableColumnBase<S, |
parentColumn |
This read-only property will always refer to the parent of this column, in the situation where nested columns are being used. |
final DoubleProperty |
prefWidth |
The preferred width of the TableColumn. |
final BooleanProperty |
reorderable |
A boolean property to toggle on and off the 'reorderability' of this column (with drag and drop - reordering by modifying the appropriate columns list is always allowed). |
final BooleanProperty |
resizable |
Used to indicate whether the width of this column can change. |
final BooleanProperty |
sortable |
A boolean property to toggle on and off the 'sortability' of this column. |
final ObjectProperty<Node> |
sortNode |
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. |
final StringProperty |
style |
A string representation of the CSS style associated with this TableColumnBase instance. |
final StringProperty |
text |
This is the text to show in the header for this column. |
final BooleanProperty |
visible |
Toggling this will immediately toggle the visibility of this column, and all children columns. |
final ReadOnlyDoubleProperty |
width |
The width of this column. |
Field Summary
| Modifier and Type | Field | Description |
|---|---|---|
static final Comparator |
DEFAULT_COMPARATOR |
By default all columns will use this comparator to perform sorting. |
Constructor Summary
| Modifier | Constructor | Description |
|---|---|---|
protected |
Creates a default TableColumn with default cell factory, comparator, and onEditCommit implementation. |
|
protected |
Creates a TableColumn with the text set to the provided string, with default cell factory, comparator, and onEditCommit implementation. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
EventDispatchChain |
buildEventDispatchChain |
Construct an event dispatch chain for this target. |
final ObjectProperty<Comparator<T>> |
comparatorProperty() |
Comparator function used when sorting this table column. |
final ObjectProperty<ContextMenu> |
contextMenuProperty() |
This menu will be shown whenever the user right clicks within the header area of this TableColumnBase. |
final BooleanProperty |
editableProperty() |
Specifies whether this table column allows editing. |
final T |
getCellData |
Returns the actual value for a cell at a given row index (and which belongs to this table column). |
final T |
getCellData |
Returns the actual value for a cell from the given item. |
abstract ObservableValue<T> |
getCellObservableValue |
Attempts to return an ObservableValue<T> for the item in the given index (which is of type S). |
abstract ObservableValue<T> |
getCellObservableValue |
Attempts to return an ObservableValue<T> for the given item (which is of type S). |
abstract ObservableList<? extends TableColumnBase<S, |
getColumns() |
This enables support for nested columns, which can be useful to group together related data. |
final Comparator<T> |
getComparator() |
Gets the value of the comparator property. |
final ContextMenu |
getContextMenu() |
Gets the value of the contextMenu property. |
final Node |
getGraphic() |
Gets the value of the graphic property. |
final String |
getId() |
Gets the value of the id property. |
final double |
getMaxWidth() |
Gets the value of the maxWidth property. |
final double |
getMinWidth() |
Gets the value of the minWidth property. |
final TableColumnBase<S, |
getParentColumn() |
Gets the value of the parentColumn property. |
final double |
getPrefWidth() |
Gets the value of the prefWidth property. |
final ObservableMap<Object, |
getProperties() |
Returns an observable map of properties on this table column for use primarily by application developers. |
final ObservableSet<PseudoClass> |
getPseudoClassStates() |
Return the pseudo-class state of this Styleable. |
final Node |
getSortNode() |
Gets the value of the sortNode property. |
final String |
getStyle() |
Gets the value of the style property. |
ObservableList<String> |
getStyleClass() |
A list of String identifiers which can be used to logically group Nodes, specifically for an external style engine. |
final String |
getText() |
Gets the value of the text property. |
Object |
getUserData() |
Returns a previously set Object property, or null if no such property has been set using the setUserData(java.lang.Object) method. |
final double |
getWidth() |
Gets the value of the width property. |
final ObjectProperty<Node> |
graphicProperty() |
The graphic to show in the table column to allow the user to indicate graphically what is in the column. |
boolean |
hasProperties() |
Tests if this table column has properties. |
final StringProperty |
idProperty() |
The id of this TableColumnBase. |
final boolean |
isEditable() |
Gets the value of the editable property. |
final boolean |
isReorderable() |
Gets the value of the reorderable property. |
final boolean |
isResizable() |
Gets the value of the resizable property. |
final boolean |
isSortable() |
Gets the value of the sortable property. |
final boolean |
isVisible() |
Gets the value of the visible property. |
final DoubleProperty |
maxWidthProperty() |
The maximum width the table column is permitted to be resized to. |
final DoubleProperty |
minWidthProperty() |
The minimum width the table column is permitted to be resized to. |
final ReadOnlyObjectProperty<TableColumnBase<S, |
parentColumnProperty() |
This read-only property will always refer to the parent of this column, in the situation where nested columns are being used. |
final DoubleProperty |
prefWidthProperty() |
The preferred width of the TableColumn. |
final BooleanProperty |
reorderableProperty() |
A boolean property to toggle on and off the 'reorderability' of this column (with drag and drop - reordering by modifying the appropriate columns list is always allowed). |
final BooleanProperty |
resizableProperty() |
Used to indicate whether the width of this column can change. |
final void |
setComparator |
Sets the value of the comparator property. |
final void |
setContextMenu |
Sets the value of the contextMenu property. |
final void |
setEditable |
Sets the value of the editable property. |
final void |
setGraphic |
Sets the value of the graphic property. |
final void |
setId |
Sets the value of the id property. |
final void |
setMaxWidth |
Sets the value of the maxWidth property. |
final void |
setMinWidth |
Sets the value of the minWidth property. |
final void |
setPrefWidth |
Sets the value of the prefWidth property. |
final void |
setReorderable |
Sets the value of the reorderable property. |
final void |
setResizable |
Sets the value of the resizable property. |
final void |
setSortable |
Sets the value of the sortable property. |
final void |
setSortNode |
Sets the value of the sortNode property. |
final void |
setStyle |
Sets the value of the style property. |
final void |
setText |
Sets the value of the text property. |
void |
setUserData |
Convenience method for setting a single Object property that can be retrieved at a later date. |
final void |
setVisible |
Sets the value of the visible property. |
final BooleanProperty |
sortableProperty() |
A boolean property to toggle on and off the 'sortability' of this column. |
final ObjectProperty<Node> |
sortNodeProperty() |
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. |
final StringProperty |
styleProperty() |
A string representation of the CSS style associated with this TableColumnBase instance. |
final StringProperty |
textProperty() |
This is the text to show in the header for this column. |
final BooleanProperty |
visibleProperty() |
Toggling this will immediately toggle the visibility of this column, and all children columns. |
final ReadOnlyDoubleProperty |
widthProperty() |
The width of this column. |
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface javafx.event.EventTarget
addEventFilter, addEventHandler, removeEventFilter, removeEventHandler
Methods declared in interface javafx.css.Styleable
getCssMetaData, getStyleableNode, getStyleableParent, getTypeSelector
Property Details
text
public final StringProperty textProperty
- See Also:
visible
public final BooleanProperty visibleProperty
- See Also:
parentColumn
public final ReadOnlyObjectProperty<TableColumnBase<S,?>> parentColumnProperty
In the currently existing subclasses, to create a nested column is simply a matter of placing the relevant TableColumnBase instances inside the columns ObservableList (for example, see TableColumn.getColumns() and TreeTableColumn.getColumns().
- See Also:
contextMenu
public final ObjectProperty<ContextMenu> contextMenuProperty
id
public final StringProperty idProperty
null.- Default value:
- null
- See Also:
style
public final StringProperty styleProperty
Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.
- Default value:
- empty string
- See Also:
graphic
public final ObjectProperty<Node> graphicProperty
The graphic to show in the table column to allow the user to indicate graphically what is in the column.
- See Also:
sortNode
public final ObjectProperty<Node> sortNodeProperty
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. It may be the only item in the sort order, or it may be a secondary, tertiary, or latter sort item, and the node should reflect this visually. This is only used in the case of the table column being in the sort order (refer to, for example, TableView.getSortOrder() and TreeTableView.getSortOrder()). If not specified, the table column skin implementation is responsible for providing a default sort node.
The sort node is commonly seen represented as a triangle that rotates on screen to indicate whether the table column is part of the sort order, and if so, whether the sort is ascending or descending, and what position in the sort order it is in.
- See Also:
width
public final ReadOnlyDoubleProperty widthProperty
- See Also:
minWidth
public final DoubleProperty minWidthProperty
prefWidth
public final DoubleProperty prefWidthProperty
maxWidth
public final DoubleProperty maxWidthProperty
resizable
public final BooleanProperty resizableProperty
sortable
public final BooleanProperty sortableProperty
A boolean property to toggle on and off the 'sortability' of this column. When this property is true, this column can be included in sort operations. If this property is false, it will not be included in sort operations, even if it is contained within the sort order list of the underlying UI control (e.g. TableView.getSortOrder() or TreeTableView.getSortOrder()).
For example, iIf a TableColumn instance is contained within the TableView sortOrder ObservableList, and its sortable property toggles state, it will force the TableView to perform a sort, as it is likely the view will need updating.
reorderable
public final BooleanProperty reorderableProperty
columns list is always allowed). When this property is true, this column can be reordered by users simply by dragging and dropping the columns into their desired positions. When this property is false, this ability to drag and drop columns is not available.- Since:
- 9
- See Also:
comparator
public final ObjectProperty<Comparator<T>> comparatorProperty
editable
public final BooleanProperty editableProperty
TableView.editableProperty() and TreeTableView.editableProperty(), is true by default.Field Details
DEFAULT_COMPARATOR
public static final Comparator DEFAULT_COMPARATOR
Comparable. If it is, the Comparable.compareTo(java.lang.Object) method is called, otherwise this method will defer to Collator.compare(java.lang.String, java.lang.String).Constructor Details
TableColumnBase
protected TableColumnBase()
TableColumnBase
protected TableColumnBase(String text)
- Parameters:
-
text- The string to show when the TableColumn is placed within the TableView.
Method Details
textProperty
public final StringProperty textProperty()
- Returns:
- the
textproperty - See Also:
setText
public final void setText(String value)
text property.- Property description:
- This is the text to show in the header for this column.
- Parameters:
-
value- the value for thetextproperty - See Also:
getText
public final String getText()
text property.- Property description:
- This is the text to show in the header for this column.
- Returns:
- the value of the
textproperty - See Also:
setVisible
public final void setVisible(boolean value)
visible property.- Property description:
- Toggling this will immediately toggle the visibility of this column, and all children columns.
- Parameters:
-
value- the value for thevisibleproperty - See Also:
isVisible
public final boolean isVisible()
visible property.- Property description:
- Toggling this will immediately toggle the visibility of this column, and all children columns.
- Returns:
- the value of the
visibleproperty - See Also:
visibleProperty
public final BooleanProperty visibleProperty()
- Returns:
- the
visibleproperty - See Also:
getParentColumn
public final TableColumnBase<S,?> getParentColumn()
parentColumn property.- Property description:
- This read-only property will always refer to the parent of this column, in the situation where nested columns are being used.
In the currently existing subclasses, to create a nested column is simply a matter of placing the relevant TableColumnBase instances inside the columns ObservableList (for example, see
TableColumn.getColumns()andTreeTableColumn.getColumns(). - Returns:
- the value of the
parentColumnproperty - See Also:
parentColumnProperty
public final ReadOnlyObjectProperty<TableColumnBase<S,?>> parentColumnProperty()
In the currently existing subclasses, to create a nested column is simply a matter of placing the relevant TableColumnBase instances inside the columns ObservableList (for example, see TableColumn.getColumns() and TreeTableColumn.getColumns().
- Returns:
- the
parentColumnproperty - See Also:
setContextMenu
public final void setContextMenu(ContextMenu value)
contextMenu property.- Property description:
- This menu will be shown whenever the user right clicks within the header area of this TableColumnBase.
- Parameters:
-
value- the value for thecontextMenuproperty - See Also:
getContextMenu
public final ContextMenu getContextMenu()
contextMenu property.- Property description:
- This menu will be shown whenever the user right clicks within the header area of this TableColumnBase.
- Returns:
- the value of the
contextMenuproperty - See Also:
contextMenuProperty
public final ObjectProperty<ContextMenu> contextMenuProperty()
- Returns:
- the
contextMenuproperty - See Also:
setId
public final void setId(String value)
id property.- Property description:
- The id of this TableColumnBase. This simple string identifier is useful for finding a specific TableColumnBase within a UI control that uses TableColumnBase instances. The default value is
null. - Default value:
- null
- Parameters:
-
value- the value for theidproperty - See Also:
getId
public final String getId()
id property.- Specified by:
-
getIdin interfaceStyleable - Property description:
- The id of this TableColumnBase. This simple string identifier is useful for finding a specific TableColumnBase within a UI control that uses TableColumnBase instances. The default value is
null. - Default value:
- null
- Returns:
- the value of the
idproperty - See Also:
idProperty
public final StringProperty idProperty()
null.- Default value:
- null
- Returns:
- the
idproperty - See Also:
setStyle
public final void setStyle(String value)
style property.- Property description:
- A string representation of the CSS style associated with this TableColumnBase instance. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.
- Default value:
- empty string
- Parameters:
-
value- the value for thestyleproperty - See Also:
getStyle
public final String getStyle()
style property.- Specified by:
-
getStylein interfaceStyleable - Property description:
- A string representation of the CSS style associated with this TableColumnBase instance. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.
Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.
- Default value:
- empty string
- Returns:
- the value of the
styleproperty - See Also:
styleProperty
public final StringProperty styleProperty()
Parsing this style might not be supported on some limited platforms. It is recommended to use a standalone CSS file instead.
- Default value:
- empty string
- Returns:
- the
styleproperty - See Also:
getStyleClass
public ObservableList<String> getStyleClass()
- Specified by:
-
getStyleClassin interfaceStyleable - Returns:
- a list of String identifiers which can be used to logically group Nodes, specifically for an external style engine
- See Also:
setGraphic
public final void setGraphic(Node value)
graphic property.- Property description:
The graphic to show in the table column to allow the user to indicate graphically what is in the column.
- Parameters:
-
value- the value for thegraphicproperty - See Also:
getGraphic
public final Node getGraphic()
graphic property.- Property description:
The graphic to show in the table column to allow the user to indicate graphically what is in the column.
- Returns:
- the value of the
graphicproperty - See Also:
graphicProperty
public final ObjectProperty<Node> graphicProperty()
The graphic to show in the table column to allow the user to indicate graphically what is in the column.
- Returns:
- the
graphicproperty - See Also:
setSortNode
public final void setSortNode(Node value)
sortNode property.- Property description:
-
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. It may be the only item in the sort order, or it may be a secondary, tertiary, or latter sort item, and the node should reflect this visually. This is only used in the case of the table column being in the sort order (refer to, for example,
TableView.getSortOrder()andTreeTableView.getSortOrder()). If not specified, the table column skin implementation is responsible for providing a default sort node.The sort node is commonly seen represented as a triangle that rotates on screen to indicate whether the table column is part of the sort order, and if so, whether the sort is ascending or descending, and what position in the sort order it is in.
- Parameters:
-
value- the value for thesortNodeproperty - See Also:
getSortNode
public final Node getSortNode()
sortNode property.- Property description:
-
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. It may be the only item in the sort order, or it may be a secondary, tertiary, or latter sort item, and the node should reflect this visually. This is only used in the case of the table column being in the sort order (refer to, for example,
TableView.getSortOrder()andTreeTableView.getSortOrder()). If not specified, the table column skin implementation is responsible for providing a default sort node.The sort node is commonly seen represented as a triangle that rotates on screen to indicate whether the table column is part of the sort order, and if so, whether the sort is ascending or descending, and what position in the sort order it is in.
- Returns:
- the value of the
sortNodeproperty - See Also:
sortNodeProperty
public final ObjectProperty<Node> sortNodeProperty()
The node to use as the "sort arrow", shown to the user in situations where the table column is part of the sort order. It may be the only item in the sort order, or it may be a secondary, tertiary, or latter sort item, and the node should reflect this visually. This is only used in the case of the table column being in the sort order (refer to, for example, TableView.getSortOrder() and TreeTableView.getSortOrder()). If not specified, the table column skin implementation is responsible for providing a default sort node.
The sort node is commonly seen represented as a triangle that rotates on screen to indicate whether the table column is part of the sort order, and if so, whether the sort is ascending or descending, and what position in the sort order it is in.
- Returns:
- the
sortNodeproperty - See Also:
widthProperty
public final ReadOnlyDoubleProperty widthProperty()
- Returns:
- the width property
- See Also:
getWidth
public final double getWidth()
width property.- Property description:
- The width of this column. Modifying this will result in the column width adjusting visually. It is recommended to not bind this property to an external property, as that will result in the column width not being adjustable by the user through dragging the left and right borders of column headers.
- Returns:
- the value of the
widthproperty - See Also:
setMinWidth
public final void setMinWidth(double value)
minWidth property.- Property description:
- The minimum width the table column is permitted to be resized to.
- Parameters:
-
value- the value for theminWidthproperty - See Also:
getMinWidth
public final double getMinWidth()
minWidth property.- Property description:
- The minimum width the table column is permitted to be resized to.
- Returns:
- the value of the
minWidthproperty - See Also:
minWidthProperty
public final DoubleProperty minWidthProperty()
- Returns:
- the
minWidthproperty - See Also:
prefWidthProperty
public final DoubleProperty prefWidthProperty()
- Returns:
- preferred width property
- See Also:
setPrefWidth
public final void setPrefWidth(double value)
prefWidth property.- Property description:
- The preferred width of the TableColumn.
- Parameters:
-
value- the value for theprefWidthproperty - See Also:
getPrefWidth
public final double getPrefWidth()
prefWidth property.- Property description:
- The preferred width of the TableColumn.
- Returns:
- the value of the
prefWidthproperty - See Also:
maxWidthProperty
public final DoubleProperty maxWidthProperty()
- Returns:
- maximum width property
- See Also:
setMaxWidth
public final void setMaxWidth(double value)
maxWidth property.- Property description:
- The maximum width the table column is permitted to be resized to.
- Parameters:
-
value- the value for themaxWidthproperty - See Also:
getMaxWidth
public final double getMaxWidth()
maxWidth property.- Property description:
- The maximum width the table column is permitted to be resized to.
- Returns:
- the value of the
maxWidthproperty - See Also:
resizableProperty
public final BooleanProperty resizableProperty()
- Returns:
- the
resizableproperty - See Also:
setResizable
public final void setResizable(boolean value)
resizable property.- Property description:
- Used to indicate whether the width of this column can change. It is up to the resizing policy to enforce this however.
- Parameters:
-
value- the value for theresizableproperty - See Also:
isResizable
public final boolean isResizable()
resizable property.- Property description:
- Used to indicate whether the width of this column can change. It is up to the resizing policy to enforce this however.
- Returns:
- the value of the
resizableproperty - See Also:
sortableProperty
public final BooleanProperty sortableProperty()
A boolean property to toggle on and off the 'sortability' of this column. When this property is true, this column can be included in sort operations. If this property is false, it will not be included in sort operations, even if it is contained within the sort order list of the underlying UI control (e.g. TableView.getSortOrder() or TreeTableView.getSortOrder()).
For example, iIf a TableColumn instance is contained within the TableView sortOrder ObservableList, and its sortable property toggles state, it will force the TableView to perform a sort, as it is likely the view will need updating.
- Returns:
- the
sortableproperty - See Also:
setSortable
public final void setSortable(boolean value)
sortable property.- Property description:
-
A boolean property to toggle on and off the 'sortability' of this column. When this property is true, this column can be included in sort operations. If this property is false, it will not be included in sort operations, even if it is contained within the sort order list of the underlying UI control (e.g.
TableView.getSortOrder()orTreeTableView.getSortOrder()).For example, iIf a TableColumn instance is contained within the TableView sortOrder ObservableList, and its sortable property toggles state, it will force the TableView to perform a sort, as it is likely the view will need updating.
- Parameters:
-
value- the value for thesortableproperty - See Also:
isSortable
public final boolean isSortable()
sortable property.- Property description:
-
A boolean property to toggle on and off the 'sortability' of this column. When this property is true, this column can be included in sort operations. If this property is false, it will not be included in sort operations, even if it is contained within the sort order list of the underlying UI control (e.g.
TableView.getSortOrder()orTreeTableView.getSortOrder()).For example, iIf a TableColumn instance is contained within the TableView sortOrder ObservableList, and its sortable property toggles state, it will force the TableView to perform a sort, as it is likely the view will need updating.
- Returns:
- the value of the
sortableproperty - See Also:
reorderableProperty
public final BooleanProperty reorderableProperty()
columns list is always allowed). When this property is true, this column can be reordered by users simply by dragging and dropping the columns into their desired positions. When this property is false, this ability to drag and drop columns is not available.- Returns:
- the
reorderableproperty - Since:
- 9
- See Also:
setReorderable
public final void setReorderable(boolean value)
reorderable property.- Property description:
- A boolean property to toggle on and off the 'reorderability' of this column (with drag and drop - reordering by modifying the appropriate
columnslist is always allowed). When this property is true, this column can be reordered by users simply by dragging and dropping the columns into their desired positions. When this property is false, this ability to drag and drop columns is not available. - Parameters:
-
value- the value for thereorderableproperty - Since:
- 9
- See Also:
isReorderable
public final boolean isReorderable()
reorderable property.- Property description:
- A boolean property to toggle on and off the 'reorderability' of this column (with drag and drop - reordering by modifying the appropriate
columnslist is always allowed). When this property is true, this column can be reordered by users simply by dragging and dropping the columns into their desired positions. When this property is false, this ability to drag and drop columns is not available. - Returns:
- the value of the
reorderableproperty - Since:
- 9
- See Also:
comparatorProperty
public final ObjectProperty<Comparator<T>> comparatorProperty()
- Returns:
- the
comparatorproperty - See Also:
setComparator
public final void setComparator(Comparator<T> value)
comparator property.- Property description:
- Comparator function used when sorting this table column. The two Objects given as arguments are the cell data for two individual cells in this column.
- Parameters:
-
value- the value for thecomparatorproperty - See Also:
getComparator
public final Comparator<T> getComparator()
comparator property.- Property description:
- Comparator function used when sorting this table column. The two Objects given as arguments are the cell data for two individual cells in this column.
- Returns:
- the value of the
comparatorproperty - See Also:
setEditable
public final void setEditable(boolean value)
editable property.- Property description:
- Specifies whether this table column allows editing. This, unlike
TableView.editableProperty()andTreeTableView.editableProperty(), is true by default. - Parameters:
-
value- the value for theeditableproperty - See Also:
isEditable
public final boolean isEditable()
editable property.- Property description:
- Specifies whether this table column allows editing. This, unlike
TableView.editableProperty()andTreeTableView.editableProperty(), is true by default. - Returns:
- the value of the
editableproperty - See Also:
editableProperty
public final BooleanProperty editableProperty()
TableView.editableProperty() and TreeTableView.editableProperty(), is true by default.- Returns:
- the
editableproperty - See Also:
getProperties
public final ObservableMap<Object,Object> getProperties()
- Returns:
- an observable map of properties on this table column for use primarily by application developers
hasProperties
public boolean hasProperties()
- Returns:
- true if node has properties.
setUserData
public void setUserData(Object value)
getUserData().- Parameters:
-
value- The value to be stored - this can later be retrieved by callinggetUserData().
getUserData
public Object getUserData()
setUserData(java.lang.Object) method.- Returns:
- The Object that was previously set, or null if no property has been set or if null was set.
getColumns
public abstract ObservableList<? extends TableColumnBase<S,?>> getColumns()
This has no impact on the table as such - all column indices point to the leaf columns only, and it isn't possible to sort using the parent column, just the leaf columns. In other words, this is purely a visual feature.
- Returns:
- An ObservableList containing TableColumnBase instances (or subclasses) that are the children of this TableColumnBase. If these children TableColumnBase instances are set as visible, they will appear beneath this table column.
getCellData
public final T getCellData(int index)
- Parameters:
-
index- The row index for which the data is required. - Returns:
- The data that belongs to the cell at the intersection of the given row index and the table column that this method is called on.
getCellData
public final T getCellData(S item)
- Parameters:
-
item- The item from which a value of type T should be extracted. - Returns:
- The data that should be used in a specific cell in this column, based on the item passed in as an argument.
getCellObservableValue
public abstract ObservableValue<T> getCellObservableValue(int index)
This is achieved by calling the cell value factory, and returning whatever it returns when passed a CellDataFeatures (see, for example, the CellDataFeatures classes belonging to TableColumn and TreeTableColumn for more information).
- Parameters:
-
index- The index of the item (of type S) for which an ObservableValue<T> is sought. - Returns:
- An ObservableValue<T> for this specific table column.
getCellObservableValue
public abstract ObservableValue<T> getCellObservableValue(S item)
This is achieved by calling the cell value factory, and returning whatever it returns when passed a CellDataFeatures (see, for example, the CellDataFeatures classes belonging to TableColumn and TreeTableColumn for more information).
- Parameters:
-
item- The item (of type S) for which an ObservableValue<T> is sought. - Returns:
- An ObservableValue<T> for this specific table column.
buildEventDispatchChain
public EventDispatchChain buildEventDispatchChain(EventDispatchChain tail)
EventTargetEventTarget. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an EventDispatcher for itself to the chain. In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target.
The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain.
The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.
- Specified by:
-
buildEventDispatchChainin interfaceEventTarget - Parameters:
-
tail- the initial chain to build from - Returns:
- the resulting event dispatch chain for this target
getPseudoClassStates
public final ObservableSet<PseudoClass> getPseudoClassStates()
- Specified by:
-
getPseudoClassStatesin interfaceStyleable - Returns:
- the pseudo-class state
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.