- 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:
Styleable
,EventTarget
- Direct Known Subclasses:
FilteredTableColumn
public class TableColumn2<S,T> extends 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);
-
-
Property Summary
Properties Type Property Description ObjectProperty<Node>
southNode
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, tableView
-
Properties inherited from class javafx.scene.control.TableColumnBase
comparator, contextMenu, editable, graphic, id, maxWidth, minWidth, parentColumn, prefWidth, reorderable, resizable, sortable, sortNode, style, text, visible, width
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javafx.scene.control.TableColumn
TableColumn.CellDataFeatures<S extends Object,T extends Object>, TableColumn.CellEditEvent<S extends Object,T extends Object>, TableColumn.SortType
-
-
Field Summary
-
Fields inherited from class javafx.scene.control.TableColumn
DEFAULT_CELL_FACTORY
-
Fields inherited from class javafx.scene.control.TableColumnBase
DEFAULT_COMPARATOR
-
-
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 Node
getSouthNode()
Gets the value of the property southNode.void
setSouthNode(Node value)
Sets the value of the property southNode.ObjectProperty<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.-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javafx.event.EventTarget
buildEventDispatchChain
-
-
-
-
Property Detail
-
southNode
public final ObjectProperty<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.- See Also:
getSouthNode()
,setSouthNode(Node)
-
-
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.
-
-
Method Detail
-
setSouthNode
public final void setSouthNode(Node value)
Sets the value of the property southNode.- 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.
-
getSouthNode
public final Node getSouthNode()
Gets the value of the property southNode.- 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.
-
southNodeProperty
public final ObjectProperty<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.- See Also:
getSouthNode()
,setSouthNode(Node)
-
-