java.lang.Object
javafx.scene.control.SkinBase<C>
javafx.scene.control.skin.VirtualContainerBase<C,I>
javafx.scene.control.skin.TableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
impl.org.controlsfx.tableview2.TableView2Skin<S>
- Type Parameters:
S- The type of the objects contained within theTableView2items list.
public class TableView2Skin<S>
extends TableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
This skin for the TableView2 control
We need to extend directly from TableViewSkinBase in order to work-around
https://bugs.openjdk.java.net/browse/JDK-8090674 if we want to set a custom
TableViewBehavior.
-
Property Summary
Properties -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidWe compute the total height of the fixedRows so that the selection can use it without performance regression.final booleancontainsRow(int index) Indicates whether or not the row at the specified index is currently being displayed.protected TableHeaderRowprotected VirtualFlow<TableRow<S>>intprotected final ObservableSet<Integer>intgetFirstRow(TablePositionBase<?> pos, int index) This return the first index displaying a cell in case of a rowSpan.doublegetHBar()final intgetRow(int index) This return the row at the specified index in the list.doublegetRowHeight(int row) Compute the height of a particular row.getRowIndexed(int index) This returns the TableRow2 which has the specified index if found.Contains the index of the sortedList.protected SouthTableHeaderRowprotected TableHeaderRow2getVBar()protected intgetViewColumn(int modelColumn) protected final voidinit()* PRIVATE/PROTECTED METHOD * *protected booleanprotected voidlayoutChildren(double x, double y, double w, double h) protected voidprotected voidprotected voidprotected voidvoidprotected voidscrollHorizontally(TableColumn<S, ?> col) voidsetHbarValue(double value) If the scene is not yet instantiated, we need to wait otherwise the VirtualFlow will not shift the cells properly.voidsetHbarValue(double value, int count) final IntegerPropertyAllows notifications in the TableView2 controlMethods inherited from class javafx.scene.control.skin.TableViewSkinBase
computePrefHeight, computePrefWidth, dispose, getTableHeaderRow, onFocusLeftCell, onFocusRightCell, onMoveToFirstCell, onMoveToLastCell, onScrollPageDown, onScrollPageUp, onSelectLeftCell, onSelectRightCell, queryAccessibleAttribute, updateItemCountMethods inherited from class javafx.scene.control.skin.VirtualContainerBase
getVirtualFlow, markItemCountDirtyMethods inherited from class javafx.scene.control.SkinBase
computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners
-
Property Details
-
size
Allows notifications in the TableView2 control
-
-
Field Details
-
tableView
-
rowHeader
-
-
Constructor Details
-
TableView2Skin
- Parameters:
tableView- theTableView2
-
-
Method Details
-
getRowHeight
public double getRowHeight(int row) Compute the height of a particular row. IfTableView.getFixedCellSize()is set, all the rows will take this fixed size. Else if there is no value set,DEFAULT_CELL_HEIGHTis returned. Else, the value is returned from the map thatTableRow2Skinmanages to set based on the row requirements.- Parameters:
row- the number of row- Returns:
- the row height
-
getFixedRowHeight
public double getFixedRowHeight() -
getSelectedRows
Contains the index of the sortedList.- Returns:
- an ObservableList of row indices
-
getSelectedColumns
-
getRowIndexed
This returns the TableRow2 which has the specified index if found. Otherwise null is returned.- Parameters:
index- the index- Returns:
- the
TableRow2
-
getFirstRow
This return the first index displaying a cell in case of a rowSpan. If the returned index is the same as given, it means the current cell is the one showing. Otherwise, it means another cell above will be the one drawn.- Parameters:
pos- theTablePositionBaseindex- the index- Returns:
- the index of the first row
-
getRow
This return the row at the specified index in the list. The index specified HAS NOTHING to do with the index of the row.- Parameters:
index- the number of row- Returns:
- the
TableView2 - See Also:
-
containsRow
public final boolean containsRow(int index) Indicates whether or not the row at the specified index is currently being displayed.- Parameters:
index- the index- Returns:
- whether or not the row at the specified index is currently being displayed
-
getCellsSize
public int getCellsSize() -
getHBar
-
getVBar
-
init
protected final void init()* PRIVATE/PROTECTED METHOD * * -
getCurrentlyFixedRow
-
sizeProperty
Allows notifications in the TableView2 control -
layoutChildren
protected void layoutChildren(double x, double y, double w, double h) - Overrides:
layoutChildrenin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
isColumnHeaderVisible
protected boolean isColumnHeaderVisible() -
getViewColumn
protected int getViewColumn(int modelColumn) -
onFocusAboveCell
protected void onFocusAboveCell()- Overrides:
onFocusAboveCellin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
onFocusBelowCell
protected void onFocusBelowCell()- Overrides:
onFocusBelowCellin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
onSelectAboveCell
protected void onSelectAboveCell()- Overrides:
onSelectAboveCellin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
onSelectBelowCell
protected void onSelectBelowCell()- Overrides:
onSelectBelowCellin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
createVirtualFlow
- Overrides:
createVirtualFlowin classVirtualContainerBase<TableView<S>,TableRow<S>>
-
createTableHeaderRow
- Overrides:
createTableHeaderRowin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
getTableHeaderRow2
-
getSouthHeader
-
scrollHorizontally
public void scrollHorizontally()- Overrides:
scrollHorizontallyin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
scrollHorizontally
- Overrides:
scrollHorizontallyin classTableViewSkinBase<S,S, TableView<S>, TableRow<S>, TableColumn<S, ?>>
-
computeFixedRowHeight
public final void computeFixedRowHeight()We compute the total height of the fixedRows so that the selection can use it without performance regression. -
createCell
-
getItemCount
public final int getItemCount()- Specified by:
getItemCountin classVirtualContainerBase<TableView<S>,TableRow<S>>
-
setHbarValue
public void setHbarValue(double value) If the scene is not yet instantiated, we need to wait otherwise the VirtualFlow will not shift the cells properly.- Parameters:
value- the horizontal value
-
setHbarValue
public void setHbarValue(double value, int count)
-