Module javafx.controls
Package javafx.scene.control.skin

# Class TableColumnHeader

java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.control.skin.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 Summary

  Properties
  Type | Property | Description
  --- | --- | ---
  `ReadOnlyObjectProperty<TableColumnBase<?,​?>>` | `tableColumn` | A property that refers to the `TableColumnBase` instance that this header is visually represents.

  ### Properties inherited from class javafx.scene.layout.Region

  `background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width`

  ### Properties inherited from class javafx.scene.Parent

  `needsLayout`

  ### Properties inherited from class javafx.scene.Node

  `accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible`

- ## Field Summary

  ### Fields inherited from class javafx.scene.layout.Region

  `USE_COMPUTED_SIZE, USE_PREF_SIZE`

  ### Fields inherited from class javafx.scene.Node

  `BASELINE_OFFSET_SAME_AS_HEIGHT`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `TableColumnHeader​(TableColumnBase tc)` | Creates a new TableColumnHeader instance to visually represent the given `TableColumnBase` instance.

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `protected double` | `computeMinHeight​(double width)` | Computes the minimum height of this region.
  `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.
  `protected double` | `computePrefWidth​(double height)` | Computes the preferred width of this region for the given height.
  `static List<CssMetaData<? extends Styleable,​?>>` | `getClassCssMetaData()` | Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
  `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.
  `TableColumnBase<?,​?>` | `getTableColumn()` | Gets the value of the property tableColumn.
  `protected TableHeaderRow` | `getTableHeaderRow()` | Returns the `TableHeaderRow` associated with this `TableColumnHeader`.
  `protected TableViewSkinBase<?,​?,​?,​?,​?>` | `getTableSkin()` | Returns the `TableViewSkinBase` in which this `TableColumnHeader` is inserted.
  `protected void` | `layoutChildren()` | Invoked during the layout pass to layout the children in this `Parent`.
  `Object` | `queryAccessibleAttribute​(AccessibleAttribute attribute, Object... parameters)` | This method is called by the assistive technology to request the value for an attribute.
  `protected void` | `resizeColumnToFitContent​(int maxRows)` | Resizes this `TableColumnHeader`'s column to fit the width of its content.
  `ReadOnlyObjectProperty<TableColumnBase<?,​?>>` | `tableColumnProperty()` | A property that refers to the `TableColumnBase` instance that this header is visually represents.

  ### Methods inherited from class javafx.scene.layout.Region

  `backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, computeMinWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty`

  ### Methods inherited from class javafx.scene.Parent

  `getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setNeedsLayout, updateBounds`

  ### Methods inherited from class javafx.scene.Node

  `accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface javafx.css.Styleable

  `getStyleableNode`

- ## Property Details

  - ### tableColumn

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

- ## 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