Top Description Fields Constructors Methods
impl.org.controlsfx.tableview2

public Class TableHeaderRow2

extends TableHeaderRow
Class Inheritance
Imports
javafx.application.Platform, javafx.beans.InvalidationListener, .Observable, javafx.collections.ListChangeListener, javafx.event.EventHandler, javafx.scene.control.TableColumn, javafx.scene.control.skin.NestedTableColumnHeader, .TableColumnHeader, .TableHeaderRow, javafx.scene.input.KeyCode, .KeyEvent, javafx.scene.layout.Pane, .Region, .StackPane, javafx.scene.shape.Rectangle, org.controlsfx.control.tableview2.TableView2, java.util.ArrayList, .BitSet, .List, .Objects

The set of horizontal (column) headers.

Field Summary

Modifier and TypeField and Description
private final EventHandler<KeyEvent>
cancelDrag

When a dragging event to reorder columns starts, reordering is set to true.

private final InvalidationListener
columnFixingEnabledHeaderListener

When columnFixingEnabled property changes, we need to update the header style of the fixed columns

pack-priv final TableView2<?>
private final Pane
private final StackPane
private final Region
private static final String
private final ListChangeListener<TableColumn<S, T>>
fixedColumnsListener

When we fix/unfix some columns, we change the style of the Label header text

private final NestedTableColumnHeader
private static final String
private TableColumnHeader
private NestedTableColumnHeader2
private final InvalidationListener
rowHeaderListener

Whether the Row Header is showing, we need to update the width because some space on the left will be available/used.

private double
private static final String
protected BitSet
selectedColumns

When the columns header are clicked, we consider the column as selected.

private final InvalidationListener
selectionListener

When we select some cells, we want the header to be highlighted

pack-priv final TableView2Skin<?>
private final SouthTableHeaderRow
private double
private final List<TableColumnHeader>
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
addStyleHeader(TableColumnHeader header, String style)

Add the fix style of the header Label of the specified column

private void
addStyleSouthHeader(TableColumn<?, ?> column, String style)

private void
pack-priv void
protected double
computePrefHeight(double width)

Overrides javafx.scene.control.skin.TableHeaderRow.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 NestedTableColumnHeader
createRootHeader()

Overrides javafx.scene.control.skin.TableHeaderRow.createRootHeader.

Creates a new NestedTableColumnHeader instance.

private void
fixColumnStyle(TableColumn<S, T> column)

Fix this column regarding the style

public TableColumnHeader
getReorderingRegion()

Overrides javafx.scene.control.skin.TableHeaderRow.getReorderingRegion.

Returns the current TableColumnHeader being moved during reordering.

public SouthTableHeaderRow
public void
init()

Public API

protected void
layoutChildren()

Overrides javafx.scene.control.skin.TableHeaderRow.layoutChildren.

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

private void
removeStyleHeader(TableColumnHeader header, String style)

Remove the fix style of the header Label of the specified column

private void
public void
setReorderingRegion(TableColumnHeader reorderingRegion)

Overrides javafx.scene.control.skin.TableHeaderRow.setReorderingRegion.

Sets the TableColumnHeader that is being moved during a reordering operation.

private void
unfixColumnStyle(TableColumn<S, T> column)

Unfix this column regarding the style

private void
private void
private void
updateHighlightSelection()

Highlight the header Label when selection change.

protected void
updateScrollX()

Overrides javafx.scene.control.skin.TableHeaderRow.updateScrollX.

Called whenever the value of the horizontal scrollbar changes in order to request layout changes, shifting the TableColumnHeaders.

protected void
updateTableWidth()

Overrides javafx.scene.control.skin.TableHeaderRow.updateTableWidth.

Updates the table width when a resize operation occurs.

protected void
private void
Inherited from javafx.scene.control.skin.TableHeaderRow:
computeMinHeightcomputePrefWidthgetRootHeaderisReorderingreorderingPropertysetReorderingshowColumnMenu

Field Detail

cancelDragback to summary
private final EventHandler<KeyEvent> cancelDrag

When a dragging event to reorder columns starts, reordering is set to true. If ESC is pressed, the event can be cancelled, by setting reordering to false and setting the column to not reorderable.

columnFixingEnabledHeaderListenerback to summary
private final InvalidationListener columnFixingEnabledHeaderListener

When columnFixingEnabled property changes, we need to update the header style of the fixed columns

controlback to summary
pack-priv final TableView2<?> control
cornerRegionback to summary
private final Pane cornerRegion

Hides javafx.scene.control.skin.TableHeaderRow.cornerRegion.

dragHeaderback to summary
private final StackPane dragHeader

Hides javafx.scene.control.skin.TableHeaderRow.dragHeader.

fillerback to summary
private final Region filler

Hides javafx.scene.control.skin.TableHeaderRow.filler.

FIXED_STYLEback to summary
private static final String FIXED_STYLE
fixedColumnsListenerback to summary
private final ListChangeListener<TableColumn<S, T>> fixedColumnsListener

When we fix/unfix some columns, we change the style of the Label header text

LEAF_STYLEback to summary
private static final String LEAF_STYLE
reorderingRegionback to summary
private TableColumnHeader reorderingRegion

Hides javafx.scene.control.skin.TableHeaderRow.reorderingRegion.

rootHeader2back to summary
private NestedTableColumnHeader2 rootHeader2
rowHeaderListenerback to summary
private final InvalidationListener rowHeaderListener

Whether the Row Header is showing, we need to update the width because some space on the left will be available/used.

scrollXback to summary
private double scrollX

Hides javafx.scene.control.skin.TableHeaderRow.scrollX.

SELECTED_STYLEback to summary
private static final String SELECTED_STYLE
selectedColumnsback to summary
protected BitSet selectedColumns

When the columns header are clicked, we consider the column as selected. This BitSet is reset when a modification on cells is done.

selectionListenerback to summary
private final InvalidationListener selectionListener

When we select some cells, we want the header to be highlighted

skinback to summary
pack-priv final TableView2Skin<?> skin
southHeaderRowback to summary
private final SouthTableHeaderRow southHeaderRow
tableWidthback to summary
private double tableWidth

Hides javafx.scene.control.skin.TableHeaderRow.tableWidth.

visibleLeafHeadersback to summary
private final List<TableColumnHeader> visibleLeafHeaders
workingback to summary
private boolean working

Constructor Detail

TableHeaderRow2back to summary
public TableHeaderRow2(final TableView2Skin<?> skin)
Parameters
skin:TableView2Skin<?>

the TableView2Skin

Method Detail

addStyleHeaderback to summary
private void addStyleHeader(TableColumnHeader header, String style)

Add the fix style of the header Label of the specified column

addStyleSouthHeaderback to summary
private void addStyleSouthHeader(TableColumn<?, ?> column, String style)
buildVisibleLeafColumnHeadersback to summary
private void buildVisibleLeafColumnHeaders(List<TableColumnHeader> colHeaders, List<TableColumnHeader> vlch)
clearSelectedColumnsback to summary
pack-priv void clearSelectedColumns()
computePrefHeightback to summary
protected double computePrefHeight(double width)

Overrides javafx.scene.control.skin.TableHeaderRow.computePrefHeight.

Doc from javafx.scene.control.skin.TableHeaderRow.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
createRootHeaderback to summary
protected NestedTableColumnHeader createRootHeader()

Overrides javafx.scene.control.skin.TableHeaderRow.createRootHeader.

Doc from javafx.scene.control.skin.TableHeaderRow.createRootHeader.

Creates a new NestedTableColumnHeader instance. By default this method should not be overridden, but in some circumstances it makes sense (e.g. testing, or when extreme customization is desired).

Annotations
@Override
fixColumnStyleback to summary
private void fixColumnStyle(TableColumn<S, T> column)

Fix this column regarding the style

getReorderingRegionback to summary
public TableColumnHeader getReorderingRegion()

Overrides javafx.scene.control.skin.TableHeaderRow.getReorderingRegion.

Doc from javafx.scene.control.skin.TableHeaderRow.getReorderingRegion.

Returns the current TableColumnHeader being moved during reordering.

Annotations
@Override
getSouthHeaderRowback to summary
public SouthTableHeaderRow getSouthHeaderRow()
initback to summary
public void init()

Public API

layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.control.skin.TableHeaderRow.layoutChildren.

Doc from javafx.scene.control.skin.TableHeaderRow.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
removeStyleHeaderback to summary
private void removeStyleHeader(TableColumnHeader header, String style)

Remove the fix style of the header Label of the specified column

removeStyleSouthHeaderback to summary
private void removeStyleSouthHeader(TableColumn<?, ?> column, String style)
setReorderingRegionback to summary
public void setReorderingRegion(TableColumnHeader reorderingRegion)

Overrides javafx.scene.control.skin.TableHeaderRow.setReorderingRegion.

Doc from javafx.scene.control.skin.TableHeaderRow.setReorderingRegion.

Sets the TableColumnHeader that is being moved during a reordering operation. This is automatically set by the TableColumnHeader when reordering starts. This method should only be called manually if the default reordering behavior is overridden. Calling setReordering(boolean) after the call is required.

Annotations
@Override
unfixColumnStyleback to summary
private void unfixColumnStyle(TableColumn<S, T> column)

Unfix this column regarding the style

updateColumnHeaderVisibilityback to summary
private void updateColumnHeaderVisibility(boolean visible)
updateFixedColumnsStyleback to summary
private void updateFixedColumnsStyle()
updateHighlightSelectionback to summary
private void updateHighlightSelection()

Highlight the header Label when selection change.

updateScrollXback to summary
protected void updateScrollX()

Overrides javafx.scene.control.skin.TableHeaderRow.updateScrollX.

Doc from javafx.scene.control.skin.TableHeaderRow.updateScrollX.

Called whenever the value of the horizontal scrollbar changes in order to request layout changes, shifting the TableColumnHeaders.

For example, if custom components are added around a TableColumnHeader (such as icons above), they will also need to be shifted. When overriding, calling super() is required to shift the TableColumnHeaders, and it's up to the developer to notify its own custom components of this change.

Annotations
@Override
updateTableWidthback to summary
protected void updateTableWidth()

Overrides javafx.scene.control.skin.TableHeaderRow.updateTableWidth.

Doc from javafx.scene.control.skin.TableHeaderRow.updateTableWidth.

Updates the table width when a resize operation occurs. This method is called continuously when the control width is resizing in order to properly clip this TableHeaderRow. Overriding this method allows a subclass to customize the resizing behavior.

Normally, the TableHeaderRow is using the full space (TableView width), but in some cases that space may be reduced. For example, if a vertical header that will display the row number is introduced, the TableHeaderRow would need to be clipped a bit shorter in order not to overlap that vertical header. Calling super() first when overriding this method allows getClip() to compute the right width in order apply a transformation.

Annotations
@Override
updateVisibleLeafColumnHeadersback to summary
protected void updateVisibleLeafColumnHeaders()
updateVisibleLeafStyleback to summary
private void updateVisibleLeafStyle()