- 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 ofTableColumn
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 withsetSouthNode(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);
-
-
Constructor Summary
Constructors Constructor Description TableColumn2()
Creates a TableColumn2 control.TableColumn2(String text)
Creates a TableColumn2 control with the text set to the provided string
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javafx.scene.Node
getSouthNode()
void
setSouthNode(javafx.scene.Node value)
javafx.beans.property.ObjectProperty<javafx.scene.Node>
southNodeProperty()
-
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, tableViewProperty
-
Methods 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, widthProperty
-
-
-
-
Constructor Detail
-
TableColumn2
public TableColumn2()
Creates a TableColumn2 control.
-
TableColumn2
public TableColumn2(String text)
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.
-
-