- 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 theTableView2
items 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 IntegerProperty
size
Allows 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 void
computeFixedRowHeight()
We compute the total height of the fixedRows so that the selection can use it without performance regression.boolean
containsRow(int index)
Indicates whether or not the row at the specified index is currently being displayed.TableRow<S>
createCell()
protected TableHeaderRow
createTableHeaderRow()
protected VirtualFlow<TableRow<S>>
createVirtualFlow()
int
getCellsSize()
protected ObservableSet<Integer>
getCurrentlyFixedRow()
int
getFirstRow(TablePositionBase<?> pos, int index)
This return the first index displaying a cell in case of a rowSpan.double
getFixedRowHeight()
ScrollBar
getHBar()
int
getItemCount()
TableRow<S>
getRow(int index)
This return the row at the specified index in the list.double
getRowHeight(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 SouthTableHeaderRow
getSouthHeader()
protected TableHeaderRow2
getTableHeaderRow2()
ScrollBar
getVBar()
protected int
getViewColumn(int modelColumn)
protected void
init()
* PRIVATE/PROTECTED METHOD * *protected boolean
isColumnHeaderVisible()
protected void
layoutChildren(double x, double y, double w, double h)
protected void
onFocusAboveCell()
protected void
onFocusBelowCell()
protected void
onSelectAboveCell()
protected void
onSelectBelowCell()
void
scrollHorizontally()
protected void
scrollHorizontally(TableColumn<S,?> col)
void
setHbarValue(double value)
If the scene is not yet instantiated, we need to wait otherwise the VirtualFlow will not shift the cells properly.void
setHbarValue(double value, int count)
IntegerProperty
sizeProperty()
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_HEIGHT
is returned. Else, the value is returned from the map thatTableRow2Skin
manages 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
- theTablePositionBase
index
- 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:
layoutChildren
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
isColumnHeaderVisible
protected boolean isColumnHeaderVisible()
-
getViewColumn
protected int getViewColumn(int modelColumn)
-
onFocusAboveCell
protected void onFocusAboveCell()
- Overrides:
onFocusAboveCell
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
onFocusBelowCell
protected void onFocusBelowCell()
- Overrides:
onFocusBelowCell
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
onSelectAboveCell
protected void onSelectAboveCell()
- Overrides:
onSelectAboveCell
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
onSelectBelowCell
protected void onSelectBelowCell()
- Overrides:
onSelectBelowCell
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
createVirtualFlow
protected VirtualFlow<TableRow<S>> createVirtualFlow()
- Overrides:
createVirtualFlow
in classVirtualContainerBase<TableView<S>,TableRow<S>>
-
createTableHeaderRow
protected TableHeaderRow createTableHeaderRow()
- Overrides:
createTableHeaderRow
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
getTableHeaderRow2
protected TableHeaderRow2 getTableHeaderRow2()
-
getSouthHeader
protected SouthTableHeaderRow getSouthHeader()
-
scrollHorizontally
public void scrollHorizontally()
- Overrides:
scrollHorizontally
in classTableViewSkinBase<S,S,TableView<S>,TableRow<S>,TableColumn<S,?>>
-
scrollHorizontally
protected void scrollHorizontally(TableColumn<S,?> col)
- Overrides:
scrollHorizontally
in 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:
getItemCount
in 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)
-
-