M
- The type of the item stored in the cellS
- The type of the item represented by the virtualised control (e.g. TableViewC
- The type of the virtualised control (e.g TableView, TreeTableView)B
- The Behavior of the virtualised controlI
- The type of cell used by this virtualised control (e.g. TableRow, TreeTableRow)TC
- The type of TableColumnBase used by this virtualised control (e.g. TableColumn, TreeTableColumn)public abstract class TableViewSkinBase<M,S,C extends Control,B extends BehaviorBase<C>,I extends IndexedCell<M>,TC extends TableColumnBase<S,?>> extends VirtualContainerBase<C,B,I>
Modifier and Type | Field and Description |
---|---|
private Region |
columnReorderLine
This region is used to overlay atop the table when the user is performing
a column resize operation or a column reordering operation.
|
private Region |
columnReorderOverlay
A region which is resized and positioned such that it perfectly matches
the dimensions of any TableColumn that is being reordered by the user.
|
private boolean |
contentWidthDirty
*
Internal Fields *
*
|
private static java.lang.String |
EMPTY_TABLE_TEXT |
protected boolean |
forceCellRecreate |
private static double |
GOLDEN_RATIO_MULTIPLIER
*
Layout *
*
|
private static boolean |
IS_PANNABLE |
private int |
itemCount |
private InvalidationListener |
itemsChangeListener |
protected boolean |
needCellsRebuilt |
protected boolean |
needCellsReconfigured |
protected boolean |
needCellsRecreated |
private static java.lang.String |
NO_COLUMNS_TEXT |
private Label |
placeholderLabel |
private StackPane |
placeholderRegion
Region placed over the top of the flow (and possibly the header row) if
there is no data and/or there are no columns specified.
|
private MapChangeListener<java.lang.Object,java.lang.Object> |
propertiesMapListener
*
Listeners *
*
|
static java.lang.String |
RECREATE |
static java.lang.String |
REFRESH
*
Static Fields *
*
|
private ListChangeListener<S> |
rowCountListener |
private Callback<C,I> |
rowFactory |
private TableHeaderRow |
tableHeaderRow
The entire header region for all columns.
|
private int |
visibleColCount |
private ListChangeListener<TC> |
visibleLeafColumnsListener |
private WeakInvalidationListener |
weakItemsChangeListener |
private WeakListChangeListener<S> |
weakRowCountListener |
private WeakListChangeListener<TC> |
weakVisibleLeafColumnsListener |
private WeakInvalidationListener |
weakWidthListener |
private InvalidationListener |
widthListener |
flow, rowCountDirty
IS_TOUCH_SUPPORTED
Constructor and Description |
---|
TableViewSkinBase(C control,
B behavior)
*
Constructors *
*
|
Modifier and Type | Method and Description |
---|---|
private void |
checkContentWidthState() |
protected abstract ObjectProperty<Callback<ResizeFeaturesBase,java.lang.Boolean>> |
columnResizePolicyProperty() |
protected double |
computePrefHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred height of this
SkinBase . |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred width of this
SkinBase . |
protected TableHeaderRow |
createTableHeaderRow() |
void |
dispose()
Called by a Skinnable when the Skin is replaced on the Skinnable.
|
protected abstract void |
edit(int index,
TC column) |
Region |
getColumnReorderLine() |
protected abstract ObservableList<TC> |
getColumns() |
protected abstract TablePositionBase<? extends TC> |
getFocusedCell() |
protected abstract TableFocusModel<S,TC> |
getFocusModel() |
protected abstract TableSelectionModel<S> |
getSelectionModel()
*
Abstract Methods *
*
|
protected abstract ObservableList<TC> |
getSortOrder() |
TableHeaderRow |
getTableHeaderRow() |
protected abstract TC |
getVisibleLeafColumn(int col) |
protected abstract ObservableList<? extends TC> |
getVisibleLeafColumns() |
protected abstract int |
getVisibleLeafIndex(TC tc) |
protected void |
handleControlPropertyChanged(java.lang.String p)
*
Public API *
*
|
protected void |
horizontalScroll() |
protected void |
init(C control) |
private boolean |
isCellFocused(int row) |
private boolean |
isCellSelected(int row) |
(package private) boolean |
isColumnPartiallyOrFullyVisible(TC col) |
private boolean |
isLeadIndex(boolean isFocusDriven,
int index) |
protected abstract ObjectProperty<ObservableList<S>> |
itemsProperty() |
protected void |
layoutChildren(double x,
double y,
double w,
double h)
Called during the layout pass of the scenegraph.
|
protected void |
onFocusNextCell() |
protected void |
onFocusPreviousCell() |
protected void |
onMoveToFirstCell() |
protected void |
onMoveToLastCell() |
int |
onScrollPageDown(boolean isFocusDriven)
Function used to scroll the container down by one 'page', although
if this is a horizontal container, then the scrolling will be to the right.
|
int |
onScrollPageUp(boolean isFocusDriven)
Function used to scroll the container up by one 'page', although
if this is a horizontal container, then the scrolling will be to the left.
|
protected void |
onSelectLeftCell() |
protected void |
onSelectNextCell() |
protected void |
onSelectPreviousCell() |
protected void |
onSelectRightCell() |
protected abstract ObjectProperty<Node> |
placeholderProperty() |
protected java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
private void |
refreshView() |
protected abstract boolean |
resizeColumn(TC tc,
double delta) |
protected abstract void |
resizeColumnToFitContent(TC tc,
int maxRows) |
protected abstract ObjectProperty<Callback<C,I>> |
rowFactoryProperty() |
protected void |
scrollHorizontally() |
protected void |
scrollHorizontally(TC col) |
protected abstract BooleanProperty |
tableMenuButtonVisibleProperty() |
private void |
updateContentWidth() |
protected void |
updatePlaceholderRegionVisibility() |
protected void |
updateRowCount() |
void |
updateTableItems(ObservableList<S> oldList,
ObservableList<S> newList) |
private void |
updateVisibleColumnCount()
Keeps track of how many leaf columns are currently visible in this table.
|
private void |
updateVisibleLeafColumnWidthListeners(java.util.List<? extends TC> added,
java.util.List<? extends TC> removed) |
checkState, createCell, createVirtualFlow, getItemCount, getMaxCellWidth, getVirtualFlowPreferredHeight
getBehavior, registerChangeListener, unregisterChangeListener
computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace
public static final java.lang.String REFRESH
public static final java.lang.String RECREATE
private boolean contentWidthDirty
private Region columnReorderLine
private Region columnReorderOverlay
private TableHeaderRow tableHeaderRow
private StackPane placeholderRegion
private Label placeholderLabel
private static final java.lang.String EMPTY_TABLE_TEXT
private static final java.lang.String NO_COLUMNS_TEXT
private int visibleColCount
protected boolean needCellsRebuilt
protected boolean needCellsRecreated
protected boolean needCellsReconfigured
private int itemCount
protected boolean forceCellRecreate
private static final boolean IS_PANNABLE
private MapChangeListener<java.lang.Object,java.lang.Object> propertiesMapListener
private ListChangeListener<S> rowCountListener
private ListChangeListener<TC extends TableColumnBase<S,?>> visibleLeafColumnsListener
private InvalidationListener widthListener
private InvalidationListener itemsChangeListener
private WeakListChangeListener<S> weakRowCountListener
private WeakListChangeListener<TC extends TableColumnBase<S,?>> weakVisibleLeafColumnsListener
private WeakInvalidationListener weakWidthListener
private WeakInvalidationListener weakItemsChangeListener
private static final double GOLDEN_RATIO_MULTIPLIER
protected void init(C control)
protected abstract TableSelectionModel<S> getSelectionModel()
protected abstract TableFocusModel<S,TC> getFocusModel()
protected abstract TablePositionBase<? extends TC> getFocusedCell()
protected abstract ObservableList<? extends TC> getVisibleLeafColumns()
protected abstract int getVisibleLeafIndex(TC tc)
protected abstract TC getVisibleLeafColumn(int col)
protected abstract ObservableList<TC> getColumns()
protected abstract ObservableList<TC> getSortOrder()
protected abstract ObjectProperty<ObservableList<S>> itemsProperty()
protected abstract ObjectProperty<Callback<C,I>> rowFactoryProperty()
protected abstract ObjectProperty<Node> placeholderProperty()
protected abstract BooleanProperty tableMenuButtonVisibleProperty()
protected abstract ObjectProperty<Callback<ResizeFeaturesBase,java.lang.Boolean>> columnResizePolicyProperty()
protected abstract boolean resizeColumn(TC tc, double delta)
protected abstract void resizeColumnToFitContent(TC tc, int maxRows)
protected abstract void edit(int index, TC column)
protected void handleControlPropertyChanged(java.lang.String p)
handleControlPropertyChanged
in class BehaviorSkinBase<C extends Control,B extends BehaviorBase<C>>
public void dispose()
BehaviorSkinBase
Skin.getSkinnable()
and Skin.getNode()
should return null following a call to dispose. Calling dispose twice
has no effect.protected TableHeaderRow createTableHeaderRow()
public TableHeaderRow getTableHeaderRow()
public Region getColumnReorderLine()
public int onScrollPageDown(boolean isFocusDriven)
public int onScrollPageUp(boolean isFocusDriven)
private boolean isLeadIndex(boolean isFocusDriven, int index)
boolean isColumnPartiallyOrFullyVisible(TC col)
protected void horizontalScroll()
protected void updateRowCount()
updateRowCount
in class VirtualContainerBase<C extends Control,B extends BehaviorBase<C>,I extends IndexedCell<M>>
protected void onFocusPreviousCell()
protected void onFocusNextCell()
protected void onSelectPreviousCell()
protected void onSelectNextCell()
protected void onSelectLeftCell()
protected void onSelectRightCell()
protected void onMoveToFirstCell()
protected void onMoveToLastCell()
public void updateTableItems(ObservableList<S> oldList, ObservableList<S> newList)
private void checkContentWidthState()
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
SkinBase
. The default
implementation calculates this height as the height of the area occupied
by its managed children when they are positioned at their current
positions at their preferred heights.computePrefHeight
in class SkinBase<C extends Control>
width
- the width that should be used if preferred height depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
. The default
implementation calculates this width as the width of the area occupied
by its managed children when they are positioned at their
current positions at their preferred widths.computePrefWidth
in class SkinBase<C extends Control>
height
- the height that should be used if preferred width depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected void layoutChildren(double x, double y, double w, double h)
layoutChildren
in class VirtualContainerBase<C extends Control,B extends BehaviorBase<C>,I extends IndexedCell<M>>
private void updateVisibleColumnCount()
private void updateVisibleLeafColumnWidthListeners(java.util.List<? extends TC> added, java.util.List<? extends TC> removed)
protected final void updatePlaceholderRegionVisibility()
private void updateContentWidth()
private void refreshView()
protected void scrollHorizontally()
protected void scrollHorizontally(TC col)
private boolean isCellSelected(int row)
private boolean isCellFocused(int row)
protected java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class SkinBase<C extends Control>
Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)