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

public Class HorizontalHeader

extends TableHeaderRow
Class Inheritance
Static Imports
impl.org.controlsfx.spreadsheet.GridViewSkin.DEFAULT_CELL_HEIGHT

The set of horizontal (column) headers.

Field Summary

Modifier and TypeField and Description
private final ListChangeListener<SpreadsheetColumn>
fixedColumnsListener

When we freeze/unfreeze some columns, we change the style of the Label header text

pack-priv final GridViewSkin
private final ChangeListener<Boolean>
horizontalHeaderVisibilityListener

Whether the Horizontal Header is showing, we need to toggle its visibility.

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

private final InvalidationListener
verticalHeaderListener

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

private boolean

Constructor Summary

AccessConstructor and Description
public
HorizontalHeader(final GridViewSkin skin)

Constructor

Method Summary

Modifier and TypeMethod and Description
private void
addStyleHeader(Integer i)

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

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
fixColumn(SpreadsheetColumn column)

Fix this column regarding the style

private void
headerClicked(TableColumn<S, T> column, MouseEvent event)

If a header is clicked, we must select the whole column.

public void
init()

Public API

private void
installHeaderMouseEvent()

When we click on header, we want to select the whole column.

private void
removeStyleHeader(Integer i)

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

private void
unfixColumn(SpreadsheetColumn column)

Unfix this column regarding the style

private void
updateHighlightSelection()

Highlight the header Label when selection change.

private void
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
Inherited from javafx.scene.control.skin.TableHeaderRow:
computeMinHeightcomputePrefWidthgetReorderingRegiongetRootHeaderisReorderinglayoutChildrenreorderingPropertysetReorderingsetReorderingRegionshowColumnMenu

Field Detail

fixedColumnsListenerback to summary
private final ListChangeListener<SpreadsheetColumn> fixedColumnsListener

When we freeze/unfreeze some columns, we change the style of the Label header text

gridViewSkinback to summary
pack-priv final GridViewSkin gridViewSkin
horizontalHeaderVisibilityListenerback to summary
private final ChangeListener<Boolean> horizontalHeaderVisibilityListener

Whether the Horizontal Header is showing, we need to toggle its visibility.

lastColumnResizedback to summary
private int lastColumnResized
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

verticalHeaderListenerback to summary
private final InvalidationListener verticalHeaderListener

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

workingback to summary
private boolean working

Constructor Detail

HorizontalHeaderback to summary
public HorizontalHeader(final GridViewSkin skin)

Constructor

Method Detail

addStyleHeaderback to summary
private void addStyleHeader(Integer i)

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

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
fixColumnback to summary
private void fixColumn(SpreadsheetColumn column)

Fix this column regarding the style

headerClickedback to summary
private void headerClicked(TableColumn<S, T> column, MouseEvent event)

If a header is clicked, we must select the whole column. If Control key of Shift key is pressed, we must not deselect the previous selection but just act like the GridViewBehavior would.

initback to summary
public void init()

Public API

installHeaderMouseEventback to summary
private void installHeaderMouseEvent()

When we click on header, we want to select the whole column.

removeStyleHeaderback to summary
private void removeStyleHeader(Integer i)

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

unfixColumnback to summary
private void unfixColumn(SpreadsheetColumn column)

Unfix this column regarding the style

updateHighlightSelectionback to summary
private void updateHighlightSelection()

Highlight the header Label when selection change.

updateHorizontalHeaderVisibilityback to summary
private void updateHorizontalHeaderVisibility(boolean visible)
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.

Protected methods

Annotations
@Override