APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.scene.control.skin

public Class ListViewSkin<T>

extends VirtualContainerBase<ListView<T>, ListCell<T>>
Class Inheritance
Type Parameters
<T>
the list item type
Imports
java.util.ArrayList, .List, javafx.beans.InvalidationListener, .WeakInvalidationListener, javafx.collections.FXCollections, .ListChangeListener, .MapChangeListener, .ObservableList, .ObservableMap, .WeakListChangeListener, .WeakMapChangeListener, javafx.event.EventHandler, javafx.geometry.NodeOrientation, .Orientation, javafx.scene.AccessibleAction, .AccessibleAttribute, .Node, javafx.scene.control.Control, .FocusModel, .IndexedCell, .Label, .ListCell, .ListView, .MultipleSelectionModel, .ScrollBar, .SelectionModel, javafx.scene.input.MouseEvent, javafx.scene.layout.StackPane, com.sun.javafx.scene.control.Properties, com.sun.javafx.scene.control.behavior.ListViewBehavior, com.sun.javafx.scene.control.skin.resources.ControlResources

Default skin implementation for the ListView control.
Since
9
See Also
ListView

Field Summary

Modifier and TypeField and Description
private ListViewBehavior<T>
private static final String
private final VirtualFlow<ListCell<T>>
private static final boolean
private int
private final InvalidationListener
private ObservableList<T>
private final ListChangeListener<T>
private boolean
private Node
private StackPane
placeholderRegion

Region placed over the top of the flow (and possibly the header row) if there is no data.

private MapChangeListener<Object, Object>
private WeakInvalidationListener
private final WeakListChangeListener<T>
private WeakMapChangeListener<Object, Object>

Constructor Summary

AccessConstructor and Description
public
ListViewSkin(final ListView<T>
The control that this skin should be installed onto.
control
)

Creates a new ListViewSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Method Summary

Modifier and TypeMethod and Description
protected double
computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase.

protected double
computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

private ListCell<T>
private static <T> ListCell<T>
public void
dispose()

Overrides javafx.scene.control.skin.VirtualContainerBase.dispose.

Implements javafx.scene.control.Skin.dispose.

Called when a previously installed skin is about to be removed from its associated control.

protected void
executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.SkinBase.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

protected int
getItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Returns the total number of items in this container, including those that are currently hidden because they are out of view.

private void
horizontalUnitScroll(boolean right)

protected void
layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.VirtualContainerBase.layoutChildren.

Called during the layout pass of the scenegraph.

private void
private void
private void
private void
private 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.

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

private void
private void
protected Object
queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.SkinBase.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

protected void
updateItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

This method is called when it is possible that the item count has changed (i.e. scrolling has occurred, the control has resized, etc).

private void
private final void
private void
verticalUnitScroll(boolean down)

Inherited from javafx.scene.control.skin.VirtualContainerBase:
checkStatecreateVirtualFlowgetMaxCellWidthgetVirtualFlowgetVirtualFlowPreferredHeightmarkItemCountDirtyrequestRebuildCellsrequestRecreateCells

Field Detail

behaviorback to summary
private ListViewBehavior<T> behavior
EMPTY_LIST_TEXTback to summary
private static final String EMPTY_LIST_TEXT
flowback to summary
private final VirtualFlow<ListCell<T>> flow

Hides javafx.scene.control.skin.VirtualContainerBase.flow.

IS_PANNABLEback to summary
private static final boolean IS_PANNABLE
itemCountback to summary
private int itemCount
itemsChangeListenerback to summary
private final InvalidationListener itemsChangeListener
listViewItemsback to summary
private ObservableList<T> listViewItems
listViewItemsListenerback to summary
private final ListChangeListener<T> listViewItemsListener
needCellsReconfiguredback to summary
private boolean needCellsReconfigured
placeholderNodeback to summary
private Node placeholderNode
placeholderRegionback to summary
private StackPane placeholderRegion

Region placed over the top of the flow (and possibly the header row) if there is no data.

propertiesMapListenerback to summary
private MapChangeListener<Object, Object> propertiesMapListener
weakItemsChangeListenerback to summary
private WeakInvalidationListener weakItemsChangeListener
weakListViewItemsListenerback to summary
private final WeakListChangeListener<T> weakListViewItemsListener
weakPropertiesMapListenerback to summary
private WeakMapChangeListener<Object, Object> weakPropertiesMapListener

Constructor Detail

ListViewSkinback to summary
public ListViewSkin(final ListView<T> control)

Creates a new ListViewSkin instance, installing the necessary child nodes into the Control children list, as well as the necessary input mappings for handling key, mouse, etc events.

Parameters
control:ListView<T>

The control that this skin should be installed onto.

Method Detail

computePrefHeightback to summary
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Doc from javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this 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.

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Doc from javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this 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.

Annotations
@Override
createCellback to summary
private ListCell<T> createCell()
createDefaultCellImplback to summary
private static <T> ListCell<T> createDefaultCellImpl()
disposeback to summary
public void dispose()

Overrides javafx.scene.control.skin.VirtualContainerBase.dispose.

Implements javafx.scene.control.Skin.dispose.

Doc from javafx.scene.control.skin.VirtualContainerBase.dispose.

Called when a previously installed skin is about to be removed from its associated control. This allows the skin to do clean up, like removing listeners and bindings, and undo any changes to the control's properties. After this method completes, getSkinnable() and getNode() should return null.

Calling dispose() more than once has no effect.

Overridden to remove EventHandler.

Annotations
@Override
executeAccessibleActionback to summary
protected void executeAccessibleAction(AccessibleAction action, Object... parameters)

Overrides javafx.scene.control.SkinBase.executeAccessibleAction.

Doc from javafx.scene.control.SkinBase.executeAccessibleAction.

This method is called by the assistive technology to request the action indicated by the argument should be executed.

This method is commonly overridden by subclasses to implement action that are required for a specific role.
If a particular action is not handled, the superclass implementation must be called.

Annotations
@Override
getItemCountback to summary
protected int getItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Doc from javafx.scene.control.skin.VirtualContainerBase.getItemCount.

Returns the total number of items in this container, including those that are currently hidden because they are out of view.

Annotations
@Override
horizontalUnitScrollback to summary
private void horizontalUnitScroll(boolean right)
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.VirtualContainerBase.layoutChildren.

Doc from javafx.scene.control.skin.VirtualContainerBase.layoutChildren.

Called during the layout pass of the scenegraph.

Annotations
@Override
onFocusNextCellback to summary
private void onFocusNextCell()
onFocusPreviousCellback to summary
private void onFocusPreviousCell()
onMoveToFirstCellback to summary
private void onMoveToFirstCell()
onMoveToLastCellback to summary
private void onMoveToLastCell()
onScrollPageDownback to summary
private 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.

onScrollPageUpback to summary
private 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.

onSelectNextCellback to summary
private void onSelectNextCell()
onSelectPreviousCellback to summary
private void onSelectPreviousCell()
queryAccessibleAttributeback to summary
protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)

Overrides javafx.scene.control.SkinBase.queryAccessibleAttribute.

Doc from javafx.scene.control.SkinBase.queryAccessibleAttribute.

This method is called by the assistive technology to request the value for an attribute.

This method is commonly overridden by subclasses to implement attributes that are required for a specific role.
If a particular attribute is not handled, the superclass implementation must be called.

Annotations
@Override
updateItemCountback to summary
protected void updateItemCount()

Implements abstract javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

Doc from javafx.scene.control.skin.VirtualContainerBase.updateItemCount.

This method is called when it is possible that the item count has changed (i.e. scrolling has occurred, the control has resized, etc). This method should recalculate the item count and store that for future use by the getItemCount method.

Annotations
@Override
updateListViewItemsback to summary
private void updateListViewItems()
updatePlaceholderRegionVisibilityback to summary
private final void updatePlaceholderRegionVisibility()
verticalUnitScrollback to summary
private void verticalUnitScroll(boolean down)