Class 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 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);
     
    • 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.