APIdia Launch Partner
Top Description Inners Fields Constructors Methods
javafx.scene.control.skin

public Class TableColumnHeader

extends Region
Class Inheritance
Known Direct Subclasses
javafx.scene.control.skin.NestedTableColumnHeader
Imports
com.sun.javafx.scene.control.LambdaMultiplePropertyChangeListenerHandler, .Properties, .TableColumnBaseHelper, .TreeTableViewBackingList, com.sun.javafx.scene.control.skin.Utils, javafx.beans.property.DoubleProperty, .ReadOnlyObjectProperty, .ReadOnlyObjectWrapper, javafx.collections.ListChangeListener, .ObservableList, .WeakListChangeListener, javafx.css.CssMetaData, .PseudoClass, .Styleable, .StyleableDoubleProperty, .StyleableProperty, javafx.css.converter.SizeConverter, javafx.event.EventHandler, javafx.geometry.HPos, .Insets, .Pos, .VPos, javafx.scene.AccessibleAttribute, .AccessibleRole, .Node, javafx.scene.control.ContextMenu, .Label, .SkinBase, .TableCell, .TableColumn, .TableColumnBase, .TableRow, .TableView, .TreeTableCell, .TreeTableColumn, .TreeTableRow, .TreeTableView, javafx.scene.input.ContextMenuEvent, .MouseEvent, javafx.scene.layout.GridPane, .HBox, .Priority, .Region, javafx.util.Callback, java.util.ArrayList, .Collections, .List, .Locale

Region responsible for painting a single column header. A subcomponent used by subclasses of TableViewSkinBase.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private Region
private boolean
pack-priv final LambdaMultiplePropertyChangeListenerHandler
pack-priv int
pack-priv Region
private static final EventHandler<ContextMenuEvent>
pack-priv static final double
pack-priv static final String
private double
pack-priv boolean
private boolean
private boolean
pack-priv Label
private static final EventHandler<MouseEvent>
private static final EventHandler<MouseEvent>
private static final EventHandler<MouseEvent>
private NestedTableColumnHeader
private int
private NestedTableColumnHeader
private static boolean
private static final PseudoClass
private DoubleProperty
private Node
private HBox
private Label
private ListChangeListener<TableColumnBase<?, ?>>
pack-priv int
private ListChangeListener<String>
private ReadOnlyObjectWrapper<TableColumnBase<?, ?>>
tableColumn

A property that refers to the TableColumnBase instance that this header is visually represents.

private TableHeaderRow
private ListChangeListener<TableColumnBase<?, ?>>
private WeakListChangeListener<TableColumnBase<?, ?>>
private final WeakListChangeListener<String>
private final WeakListChangeListener<TableColumnBase<?, ?>>
Inherited from javafx.scene.layout.Region:
USE_COMPUTED_SIZEUSE_PREF_SIZE

Constructor Summary

AccessConstructor and Description
public
TableColumnHeader(final TableColumnBase<S, T>
The table column to be visually represented by this instance.
tc
)

Creates a new TableColumnHeader instance to visually represent the given TableColumnBase instance.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
columnReordering(double sceneX, double sceneY)

pack-priv void
pack-priv void
columnReorderingStarted(double dragOffset)

protected double
computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Computes the minimum height of this region.

protected double
computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

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)

Overrides javafx.scene.layout.Region.computePrefWidth.

Computes the preferred width of this region for the given height.

private <T> TableRow<T>
createMeasureRow(TableView<T> tv, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, Callback<TableView<T>, TableRow<T>> rowFactory)

private <T> TreeTableRow<T>
createMeasureRow(TreeTableView<T> ttv, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, Callback<TreeTableView<T>, TreeTableRow<T>> rowFactory)

pack-priv void
private void
doColumnAutoSize(int cellsToMeasure)

public static List<CssMetaData<? extends Styleable, ?>>

Returns:

the CssMetaData associated with this class, which may include the CssMetaData of its superclasses
getClassCssMetaData
()

Hides javafx.scene.layout.Region.getClassCssMetaData.

Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

private ObservableList<TableColumnBase<?, ?>>
public List<CssMetaData<? extends Styleable, ?>>
getCssMetaData()

Overrides javafx.scene.layout.Region.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

pack-priv double
private int
getIndex(TableColumnBase<?, ?> column)

pack-priv NestedTableColumnHeader
pack-priv NestedTableColumnHeader
private final double
private int
public final TableColumnBase<?, ?>
protected TableHeaderRow

Returns:

the TableHeaderRow associated with this TableColumnHeader
getTableHeaderRow
()

Returns the TableHeaderRow associated with this TableColumnHeader.

protected TableViewSkinBase<?, ?, ?, ?, ?>

Returns:

the TableViewSkinBase in which this TableColumnHeader is inserted, or null
getTableSkin
()

Returns the TableViewSkinBase in which this TableColumnHeader is inserted.

private int
private List<TableColumnBase<S, T>>
pack-priv void
private void
pack-priv void
private boolean
private boolean
protected void
layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

pack-priv void
moveColumn(TableColumnBase<S, T> column, final int newColumnPos)

public Object
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.Parent.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

pack-priv boolean
protected void
resizeColumnToFitContent(int
the number of rows considered when resizing. If -1 is given, all rows are considered.
maxRows
)

Resizes this TableColumnHeader's column to fit the width of its content.

private <T, S> void
resizeColumnToFitContent(TableView<T> tv, TableColumn<T, S> tc, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, int maxRows)

private <T, S> void
resizeColumnToFitContent(TreeTableView<T> ttv, TreeTableColumn<T, S> tc, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, int maxRows)

pack-priv void
pack-priv void
private final void
pack-priv void
private final DoubleProperty
private void
sortColumn(final boolean addColumn)

public final ReadOnlyObjectProperty<TableColumnBase<?, ?>>
private void
private void
private void
private void
private void
updateSortOrderDots(int sortPos)

private void
private void
Inherited from javafx.scene.layout.Region:
backgroundPropertyborderPropertycacheShapePropertycenterShapePropertycomputeMaxHeightcomputeMaxWidthcomputeMinWidthgetBackgroundgetBordergetHeightgetInsetsgetMaxHeightgetMaxWidthgetMinHeightgetMinWidthgetOpaqueInsetsgetPaddinggetPrefHeightgetPrefWidthgetShapegetUserAgentStylesheetgetWidthheightPropertyinsetsPropertyisCacheShapeisCenterShapeisResizableisScaleShapeisSnapToPixellayoutInArealayoutInArealayoutInArealayoutInAreamaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyopaqueInsetsPropertypaddingPropertypositionInAreapositionInAreaprefHeightprefHeightPropertyprefWidthprefWidthPropertyresizescaleShapePropertysetBackgroundsetBordersetCacheShapesetCenterShapesetHeightsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetOpaqueInsetssetPaddingsetPrefHeightsetPrefSizesetPrefWidthsetScaleShapesetShapesetSnapToPixelsetWidthshapePropertysnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYsnapToPixelPropertywidthProperty

Field Detail

arrowback to summary
private Region arrow
autoSizeCompleteback to summary
private boolean autoSizeComplete
changeListenerHandlerback to summary
pack-priv final LambdaMultiplePropertyChangeListenerHandler changeListenerHandler
columnIndexback to summary
pack-priv int columnIndex
columnReorderLineback to summary
pack-priv Region columnReorderLine
contextMenuRequestedHandlerback to summary
private static final EventHandler<ContextMenuEvent> contextMenuRequestedHandler
DEFAULT_COLUMN_WIDTHback to summary
pack-priv static final double DEFAULT_COLUMN_WIDTH
DEFAULT_STYLE_CLASSback to summary
pack-priv static final String DEFAULT_STYLE_CLASS
dragOffsetback to summary
private double dragOffset
isLastVisibleColumnback to summary
pack-priv boolean isLastVisibleColumn
isSizeDirtyback to summary
private boolean isSizeDirty
isSortColumnback to summary
private boolean isSortColumn
labelback to summary
pack-priv Label label
mouseDraggedHandlerback to summary
private static final EventHandler<MouseEvent> mouseDraggedHandler
mousePressedHandlerback to summary
private static final EventHandler<MouseEvent> mousePressedHandler
mouseReleasedHandlerback to summary
private static final EventHandler<MouseEvent> mouseReleasedHandler
nestedColumnHeaderback to summary
private NestedTableColumnHeader nestedColumnHeader
newColumnPosback to summary
private int newColumnPos
parentHeaderback to summary
private NestedTableColumnHeader parentHeader
popupTriggeredOnMousePressedback to summary
private static boolean popupTriggeredOnMousePressed
PSEUDO_CLASS_LAST_VISIBLEback to summary
private static final PseudoClass PSEUDO_CLASS_LAST_VISIBLE
sizeback to summary
private DoubleProperty size
sortArrowback to summary
private Node sortArrow
sortOrderDotsback to summary
private HBox sortOrderDots
sortOrderLabelback to summary
private Label sortOrderLabel
sortOrderListenerback to summary
private ListChangeListener<TableColumnBase<?, ?>> sortOrderListener
sortPosback to summary
pack-priv int sortPos
styleClassListenerback to summary
private ListChangeListener<String> styleClassListener
tableColumnback to summary
private ReadOnlyObjectWrapper<TableColumnBase<?, ?>> tableColumn

A property that refers to the TableColumnBase instance that this header is visually represents.

tableHeaderRowback to summary
private TableHeaderRow tableHeaderRow
visibleLeafColumnsListenerback to summary
private ListChangeListener<TableColumnBase<?, ?>> visibleLeafColumnsListener
weakSortOrderListenerback to summary
private WeakListChangeListener<TableColumnBase<?, ?>> weakSortOrderListener
weakStyleClassListenerback to summary
private final WeakListChangeListener<String> weakStyleClassListener
weakVisibleLeafColumnsListenerback to summary
private final WeakListChangeListener<TableColumnBase<?, ?>> weakVisibleLeafColumnsListener

Constructor Detail

TableColumnHeaderback to summary
public TableColumnHeader(final TableColumnBase<S, T> tc)

Creates a new TableColumnHeader instance to visually represent the given TableColumnBase instance.

Parameters
tc:TableColumnBase<S, T>

The table column to be visually represented by this instance.

Method Detail

columnReorderingback to summary
pack-priv void columnReordering(double sceneX, double sceneY)
columnReorderingCompleteback to summary
pack-priv void columnReorderingComplete()
columnReorderingStartedback to summary
pack-priv void columnReorderingStarted(double dragOffset)
computeMinHeightback to summary
protected double computeMinHeight(double width)

Overrides javafx.scene.layout.Region.computeMinHeight.

Doc from javafx.scene.layout.Region.computeMinHeight.

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.

Annotations
@Override
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.layout.Region.computePrefHeight.

Doc from javafx.scene.layout.Region.computePrefHeight.

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.

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height)

Overrides javafx.scene.layout.Region.computePrefWidth.

Doc from javafx.scene.layout.Region.computePrefWidth.

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.

Annotations
@Override
createMeasureRowback to summary
private <T> TableRow<T> createMeasureRow(TableView<T> tv, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, Callback<TableView<T>, TableRow<T>> rowFactory)
createMeasureRowback to summary
private <T> TreeTableRow<T> createMeasureRow(TreeTableView<T> ttv, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, Callback<TreeTableView<T>, TreeTableRow<T>> rowFactory)
disposeback to summary
pack-priv void dispose()
doColumnAutoSizeback to summary
private void doColumnAutoSize(int cellsToMeasure)
getClassCssMetaDataback to summary
public static List<CssMetaData<? extends Styleable, ?>> getClassCssMetaData()

Hides javafx.scene.layout.Region.getClassCssMetaData.

Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.

Returns:List<CssMetaData<? extends Styleable, ?>>

the CssMetaData associated with this class, which may include the CssMetaData of its superclasses

getColumnsback to summary
private ObservableList<TableColumnBase<?, ?>> getColumns(TableColumnBase<S, T> column)
getCssMetaDataback to summary
public List<CssMetaData<? extends Styleable, ?>> getCssMetaData()

Overrides javafx.scene.layout.Region.getCssMetaData.

Implements javafx.css.Styleable.getCssMetaData.

Doc from javafx.scene.layout.Region.getCssMetaData.

This method should delegate to Node#getClassCssMetaData() so that a Node's CssMetaData can be accessed without the need for reflection.

Annotations
@Override
getDragRectHeightback to summary
pack-priv double getDragRectHeight()
getIndexback to summary
private int getIndex(TableColumnBase<?, ?> column)
getNestedColumnHeaderback to summary
pack-priv NestedTableColumnHeader getNestedColumnHeader()
getParentHeaderback to summary
pack-priv NestedTableColumnHeader getParentHeader()
getSizeback to summary
private final double getSize()
getSortPositionback to summary
private int getSortPosition()
getTableColumnback to summary
public final TableColumnBase<?, ?> getTableColumn()
getTableHeaderRowback to summary
protected TableHeaderRow getTableHeaderRow()

Returns the TableHeaderRow associated with this TableColumnHeader.

Returns:TableHeaderRow

the TableHeaderRow associated with this TableColumnHeader

Since
12
getTableSkinback to summary
protected TableViewSkinBase<?, ?, ?, ?, ?> getTableSkin()

Returns the TableViewSkinBase in which this TableColumnHeader is inserted. This will return null until the TableHeaderRow has been set.

Returns:TableViewSkinBase<?, ?, ?, ?, ?>

the TableViewSkinBase in which this TableColumnHeader is inserted, or null

Since
12
getVisibleSortOrderColumnCountback to summary
private int getVisibleSortOrderColumnCount()
getVisibleSortOrderColumnsback to summary
private List<TableColumnBase<S, T>> getVisibleSortOrderColumns()
initStyleClassesback to summary
pack-priv void initStyleClasses()
initUIback to summary
private void initUI()
installTableColumnStyleClassListenerback to summary
pack-priv void installTableColumnStyleClassListener()
isColumnReorderingEnabledback to summary
private boolean isColumnReorderingEnabled()
isSortingEnabledback to summary
private boolean isSortingEnabled()
layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.Parent.layoutChildren.

Doc from javafx.scene.Parent.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.

Annotations
@Override
moveColumnback to summary
pack-priv void moveColumn(TableColumnBase<S, T> column, final int newColumnPos)
queryAccessibleAttributeback to summary
public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.Parent.queryAccessibleAttribute.

Doc from javafx.scene.Parent.queryAccessibleAttribute.

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.

Annotations
@Override
representsback to summary
pack-priv boolean represents(TableColumnBase<?, ?> column)
resizeColumnToFitContentback to summary
protected void resizeColumnToFitContent(int maxRows)

Resizes this TableColumnHeader's column to fit the width of its content.

Implementation Specification

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:int

the number of rows considered when resizing. If -1 is given, all rows are considered.

Since
14
resizeColumnToFitContentback to summary
private <T, S> void resizeColumnToFitContent(TableView<T> tv, TableColumn<T, S> tc, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, int maxRows)
resizeColumnToFitContentback to summary
private <T, S> void resizeColumnToFitContent(TreeTableView<T> ttv, TreeTableColumn<T, S> tc, TableViewSkinBase<M, S, C extends Control, I extends IndexedCell<M>, TC extends TableColumnBase<S, ?>> tableSkin, int maxRows)
setNestedColumnHeaderback to summary
pack-priv void setNestedColumnHeader(NestedTableColumnHeader nch)
setParentHeaderback to summary
pack-priv void setParentHeader(NestedTableColumnHeader ph)
setTableColumnback to summary
private final void setTableColumn(TableColumnBase<?, ?> column)
setTableHeaderRowback to summary
pack-priv void setTableHeaderRow(TableHeaderRow thr)
sizePropertyback to summary
private final DoubleProperty sizeProperty()
sortColumnback to summary
private void sortColumn(final boolean addColumn)
tableColumnPropertyback to summary
public final ReadOnlyObjectProperty<TableColumnBase<?, ?>> tableColumnProperty()
updateAllHeadersback to summary
private void updateAllHeaders(TableColumnHeader header)
updateColumnIndexback to summary
private void updateColumnIndex()
updateSceneback to summary
private void updateScene()
updateSortGridback to summary
private void updateSortGrid()
updateSortOrderDotsback to summary
private void updateSortOrderDots(int sortPos)
updateSortPositionback to summary
private void updateSortPosition()
updateTableSkinback to summary
private void updateTableSkin()
javafx.scene.control.skin back to summary

private Class TableColumnHeader.StyleableProperties

extends Object
Class Inheritance
  • java.lang.Object
  • javafx.scene.control.skin.TableColumnHeader.StyleableProperties

Field Summary

Modifier and TypeField and Description
private static final CssMetaData<TableColumnHeader, Number>
private static final List<CssMetaData<? extends Styleable, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

SIZEback to summary
private static final CssMetaData<TableColumnHeader, Number> SIZE
STYLEABLESback to summary
private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES

Constructor Detail

StyleablePropertiesback to summary
private StyleableProperties()