- 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 Type Property Description IntegerPropertysizeAllows notifications in the TableView2 control
-
Constructor Summary
Constructors Constructor Description TableView2Skin(TableView2<S> tableView)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeFixedRowHeight()We compute the total height of the fixedRows so that the selection can use it without performance regression.booleancontainsRow(int index)Indicates whether or not the row at the specified index is currently being displayed.TableRow<S>createCell()protected TableHeaderRowcreateTableHeaderRow()protected VirtualFlow<TableRow<S>>createVirtualFlow()intgetCellsSize()protected ObservableSet<Integer>getCurrentlyFixedRow()intgetFirstRow(TablePositionBase<?> pos, int index)This return the first index displaying a cell in case of a rowSpan.doublegetFixedRowHeight()ScrollBargetHBar()intgetItemCount()TableRow<S>getRow(int index)This return the row at the specified index in the list.doublegetRowHeight(int row)Compute the height of a particular row.TableRow<S>getRowIndexed(int index)This returns the TableRow2 which has the specified index if found.ObservableList<Integer>getSelectedColumns()ObservableList<Integer>getSelectedRows()Contains the index of the sortedList.protected SouthTableHeaderRowgetSouthHeader()protected TableHeaderRow2getTableHeaderRow2()ScrollBargetVBar()protected intgetViewColumn(int modelColumn)protected voidinit()* PRIVATE/PROTECTED METHOD * *protected booleanisColumnHeaderVisible()protected voidlayoutChildren(double x, double y, double w, double h)protected voidonFocusAboveCell()protected voidonFocusBelowCell()protected voidonSelectAboveCell()protected voidonSelectBelowCell()voidscrollHorizontally()protected 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)IntegerPropertysizeProperty()Allows notifications in the TableView2 control-
Methods inherited from class javafx.scene.control.skin.TableViewSkinBase
computePrefHeight, computePrefWidth, dispose, getTableHeaderRow, onFocusLeftCell, onFocusRightCell, onMoveToFirstCell, onMoveToLastCell, onScrollPageDown, onScrollPageUp, onSelectLeftCell, onSelectRightCell, queryAccessibleAttribute, updateItemCount
-
Methods inherited from class javafx.scene.control.skin.VirtualContainerBase
getVirtualFlow, markItemCountDirty
-
Methods 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, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners
-
-
-
-
Property Detail
-
size
public final IntegerProperty sizeProperty
Allows notifications in the TableView2 control
-
-
Field Detail
-
tableView
protected TableView2<S> tableView
-
-
Constructor Detail
-
TableView2Skin
public TableView2Skin(TableView2<S> tableView)
- Parameters:
tableView- theTableView2
-
-
Method Detail
-
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
public ObservableList<Integer> getSelectedRows()
Contains the index of the sortedList.- Returns:
- an ObservableList of row indices
-
getSelectedColumns
public ObservableList<Integer> getSelectedColumns()
-
getRowIndexed
public TableRow<S> getRowIndexed(int index)
This returns the TableRow2 which has the specified index if found. Otherwise null is returned.- Parameters:
index- the index- Returns:
- the
TableRow2
-
getFirstRow
public int getFirstRow(TablePositionBase<?> pos, int index)
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
public TableRow<S> getRow(int index)
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:
for a getting a row with its real index.
-
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
public ScrollBar getHBar()
-
getVBar
public ScrollBar getVBar()
-
init
protected final void init()
* PRIVATE/PROTECTED METHOD * *
-
getCurrentlyFixedRow
protected final ObservableSet<Integer> getCurrentlyFixedRow()
-
sizeProperty
public final IntegerProperty 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
protected VirtualFlow<TableRow<S>> createVirtualFlow()
- Overrides:
createVirtualFlowin classVirtualContainerBase<TableView<S>,TableRow<S>>
-
createTableHeaderRow
protected TableHeaderRow createTableHeaderRow()
- Overrides:
createTableHeaderRowin classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
getTableHeaderRow2
protected TableHeaderRow2 getTableHeaderRow2()
-
getSouthHeader
protected SouthTableHeaderRow getSouthHeader()
-
scrollHorizontally
public void scrollHorizontally()
- Overrides:
scrollHorizontallyin classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
scrollHorizontally
protected void scrollHorizontally(TableColumn<S,?> col)
- 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.
-
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)
-
-