Class TableColumn2<S,T>
java.lang.Object
javafx.scene.control.TableColumnBase<S,T>
javafx.scene.control.TableColumn<S,T>
org.controlsfx.control.tableview2.TableColumn2<S,T>
- Type Parameters:
S- The type of the objects contained within the TableView items list.T- The type of the content in all cells in this TableColumn
- All Implemented Interfaces:
javafx.css.Styleable, javafx.event.EventTarget
- Direct Known Subclasses:
FilteredTableColumn
public class TableColumn2<S,T>
extends javafx.scene.control.TableColumn<S,T>
An extension of
TableColumn that allows adding a South Header Node.
The south header is an extended region below the regular column header, and where
a node can be laid out with setSouthNode(Node).
This node can be used for displaying a filter editor, a column totalizer or
other purposes.
Sample
The following code snippet creates a column and adds a label as south node that will display the occurrences of the text "1" in the column:
TableColumn2<Person,String> firstNameCol = new TableColumn2<>("First Name");
firstNameCol.setCellValueFactory(p -> p.getValue().firstNameProperty());
firstName.setCellFactory(TextField2TableCell.forTableColumn());
Label labelFirstName = new Label();
labelFirstName.textProperty().bind(Bindings.createStringBinding(() ->
"#1: " + table.getItems().stream()
.filter(t -> t.getFirstName()
.contains("1"))
.count(), table.getItems()));
firstName.setSouthNode(labelFirstName);
-
Nested Class Summary
Nested classes/interfaces inherited from class javafx.scene.control.TableColumn
javafx.scene.control.TableColumn.CellDataFeatures<S,T>, javafx.scene.control.TableColumn.CellEditEvent<S, T>, javafx.scene.control.TableColumn.SortType -
Property Summary
PropertiesTypePropertyDescriptionfinal javafx.beans.property.ObjectProperty<javafx.scene.Node> This property allows the developer to set a node to the south of the header of this column, where UI can be displayed.Properties inherited from class javafx.scene.control.TableColumn
cellFactory, cellValueFactory, onEditCancel, onEditCommit, onEditStart, sortType, tableViewProperties inherited from class javafx.scene.control.TableColumnBase
comparator, contextMenu, editable, graphic, id, maxWidth, minWidth, parentColumn, prefWidth, reorderable, resizable, sortable, sortNode, style, text, visible, width -
Field Summary
Fields inherited from class javafx.scene.control.TableColumn
DEFAULT_CELL_FACTORYFields inherited from class javafx.scene.control.TableColumnBase
DEFAULT_COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionCreates a TableColumn2 control.TableColumn2(String text) Creates a TableColumn2 control with the text set to the provided string -
Method Summary
Modifier and TypeMethodDescriptionfinal javafx.scene.NodeGets the value of thesouthNodeproperty.final voidsetSouthNode(javafx.scene.Node value) Sets the value of thesouthNodeproperty.final javafx.beans.property.ObjectProperty<javafx.scene.Node> This property allows the developer to set a node to the south of the header of this column, where UI can be displayed.Methods inherited from class javafx.scene.control.TableColumn
cellFactoryProperty, cellValueFactoryProperty, editAnyEvent, editCancelEvent, editCommitEvent, editStartEvent, getCellFactory, getCellObservableValue, getCellObservableValue, getCellValueFactory, getClassCssMetaData, getColumns, getCssMetaData, getOnEditCancel, getOnEditCommit, getOnEditStart, getSortType, getStyleableNode, getStyleableParent, getTableView, getTypeSelector, onEditCancelProperty, onEditCommitProperty, onEditStartProperty, setCellFactory, setCellValueFactory, setOnEditCancel, setOnEditCommit, setOnEditStart, setSortType, sortTypeProperty, tableViewPropertyMethods inherited from class javafx.scene.control.TableColumnBase
addEventHandler, buildEventDispatchChain, comparatorProperty, contextMenuProperty, editableProperty, getCellData, getCellData, getComparator, getContextMenu, getGraphic, getId, getMaxWidth, getMinWidth, getParentColumn, getPrefWidth, getProperties, getPseudoClassStates, getSortNode, getStyle, getStyleClass, getText, getUserData, getWidth, graphicProperty, hasProperties, idProperty, isEditable, isReorderable, isResizable, isSortable, isVisible, maxWidthProperty, minWidthProperty, parentColumnProperty, prefWidthProperty, removeEventHandler, reorderableProperty, resizableProperty, setComparator, setContextMenu, setEditable, setGraphic, setId, setMaxWidth, setMinWidth, setPrefWidth, setReorderable, setResizable, setSortable, setSortNode, setStyle, setText, setUserData, setVisible, sortableProperty, sortNodeProperty, styleProperty, textProperty, visibleProperty, widthPropertyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javafx.event.EventTarget
buildEventDispatchChain
-
Property Details
-
southNode
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> southNodePropertyThis property allows the developer to set a node to the south of the header of this column, where UI can be displayed.- See Also:
-
-
Constructor Details
-
TableColumn2
public TableColumn2()Creates a TableColumn2 control. -
TableColumn2
Creates a TableColumn2 control with the text set to the provided string- Parameters:
text- The string to show when the TableColumn2 is placed within the TableView2.
-
-
Method Details
-
setSouthNode
public final void setSouthNode(javafx.scene.Node value) Sets the value of thesouthNodeproperty.- Property description:
- This property allows the developer to set a node to the south of the header of this column, where UI can be displayed.
- Parameters:
value- the value for thesouthNodeproperty- See Also:
-
getSouthNode
public final javafx.scene.Node getSouthNode()Gets the value of thesouthNodeproperty.- Property description:
- This property allows the developer to set a node to the south of the header of this column, where UI can be displayed.
- Returns:
- the value of the
southNodeproperty - See Also:
-
southNodeProperty
public final javafx.beans.property.ObjectProperty<javafx.scene.Node> southNodeProperty()This property allows the developer to set a node to the south of the header of this column, where UI can be displayed.- Returns:
- the
southNodeproperty - See Also:
-