Class NestedTableColumnHeader

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class NestedTableColumnHeader
    extends TableColumnHeader

    This class is used to construct the header of a TableView. We take the approach that every TableView header is nested - even if it isn't. This allows for us to use the same code for building a single row of TableColumns as we would with a heavily nested sequences of TableColumns. Because of this, the TableHeaderRow class consists of just one instance of a NestedTableColumnHeader.

    See Also:
    TableColumnHeader, TableHeaderRow, TableColumnBase
    • Constructor Detail

      • NestedTableColumnHeader

        public NestedTableColumnHeader​(TableColumnBase tc)
        Creates a new NestedTableColumnHeader instance to visually represent the given TableColumnBase instance.
        tc - The table column to be visually represented by this instance.
    • Method Detail

      • getColumnHeaders

        public final ObservableList<TableColumnHeader> getColumnHeaders()
        Returns an unmodifiable list of the TableColumnHeader instances that are children of this NestedTableColumnHeader.
        the unmodifiable list of TableColumnHeader of this NestedTableColumnHeader
      • createTableColumnHeader

        protected TableColumnHeader createTableColumnHeader​(TableColumnBase col)
        Creates a new TableColumnHeader instance for the given TableColumnBase instance. The general pattern for implementing this method is as follows:
        • If the given TableColumnBase instance is null, has no child columns, or if the given TableColumnBase instance equals the TableColumnBase instance returned by calling TableColumnHeader.getTableColumn(), then it is suggested to return a TableColumnHeader instance comprised of the given column.
        • Otherwise, we can presume that the given TableColumnBase instance has child columns, and in this case it is suggested to return a NestedTableColumnHeader instance instead.
        Note: In most circumstances this method should not be overridden, but in some circumstances it makes sense (e.g. testing, or when extreme customization is desired).
        col - the table column
        A new TableColumnHeader instance.