Class TableColumnHeader

All Implemented Interfaces:
Styleable, EventTarget
Direct Known Subclasses:
NestedTableColumnHeader

public class TableColumnHeader
extends Region
Region responsible for painting a single column header. A subcomponent used by subclasses of TableViewSkinBase.
Since:
9
  • Property Details

  • Constructor Details

    • TableColumnHeader

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

    • getTableColumn

      public final TableColumnBase<?,​?> getTableColumn()
      Gets the value of the property tableColumn.
      Property description:
      A property that refers to the TableColumnBase instance that this header is visually represents.
    • tableColumnProperty

      public final ReadOnlyObjectProperty<TableColumnBase<?,​?>> tableColumnProperty()
      A property that refers to the TableColumnBase instance that this header is visually represents.
      See Also:
      getTableColumn()
    • layoutChildren

      protected void layoutChildren()
      Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

      Subclasses should override this function to layout content as needed.

      Overrides:
      layoutChildren in class Parent
    • computePrefWidth

      protected double computePrefWidth​(double height)
      Computes the preferred width of this region for the given height. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a VERTICAL content bias, then the height parameter can be ignored.
      Overrides:
      computePrefWidth in class Region
      Parameters:
      height - the height that should be used if preferred width depends on it
      Returns:
      the computed preferred width for this region
    • computeMinHeight

      protected double computeMinHeight​(double width)
      Computes the minimum height of this region. Returns the sum of the top and bottom insets by default. Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computeMinHeight in class Region
      Parameters:
      width - the width that should be used if min height depends on it
      Returns:
      the computed minimum height for this region
    • computePrefHeight

      protected double computePrefHeight​(double width)
      Computes the preferred height of this region for the given width; Region subclasses should override this method to return an appropriate value based on their content and layout strategy. If the subclass doesn't have a HORIZONTAL content bias, then the width parameter can be ignored.
      Overrides:
      computePrefHeight in class Region
      Parameters:
      width - the width that should be used if preferred height depends on it
      Returns:
      the computed preferred height for this region
    • getCssMetaData

      public List<CssMetaData<? extends Styleable,​?>> getCssMetaData()
      This method should delegate to Node.getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.
      Specified by:
      getCssMetaData in interface Styleable
      Overrides:
      getCssMetaData in class Region
      Returns:
      The CssMetaData associated with this node, which may include the CssMetaData of its superclasses.
    • queryAccessibleAttribute

      public Object queryAccessibleAttribute​(AccessibleAttribute attribute, Object... parameters)
      This method is called by the assistive technology to request the value for an attribute.

      This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
      If a particular attribute is not handled, the superclass implementation must be called.

      Overrides:
      queryAccessibleAttribute in class Parent
      Parameters:
      attribute - the requested attribute
      parameters - optional list of parameters
      Returns:
      the value for the requested attribute
      See Also:
      AccessibleAttribute
    • getTableHeaderRow

      protected TableHeaderRow getTableHeaderRow()
      Returns the TableHeaderRow associated with this TableColumnHeader.
      Returns:
      the TableHeaderRow associated with this TableColumnHeader
      Since:
      12
    • getTableSkin

      protected TableViewSkinBase<?,​?,​?,​?,​?> getTableSkin()
      Returns the TableViewSkinBase in which this TableColumnHeader is inserted. This will return null until the TableHeaderRow has been set.
      Returns:
      the TableViewSkinBase in which this TableColumnHeader is inserted, or null
      Since:
      12
    • resizeColumnToFitContent

      protected void resizeColumnToFitContent​(int maxRows)
      Resizes this TableColumnHeader's column to fit the width of its content.
      Implementation Requirements:
      The resulting column width for this implementation is the maximum of the preferred width of the header cell and the preferred width of the first maxRow cells.

      Subclasses can either use this method or override it (without the need to call super()) to provide their custom implementation (such as ones that exclude the header, exclude null content, compute the minimum width, etc.).

      Parameters:
      maxRows - the number of rows considered when resizing. If -1 is given, all rows are considered.
      Since:
      14
    • getClassCssMetaData

      public static List<CssMetaData<? extends Styleable,​?>> getClassCssMetaData()
      Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
      Returns:
      the CssMetaData associated with this class, which may include the CssMetaData of its superclasses