Top Description Fields Constructors Methods
javafx.scene.control.skin

public Class ComboBoxListViewSkin<T>

extends ComboBoxPopupControl<T>
Class Inheritance
Type Parameters
<T>
the type of the ComboBox control
Imports
java.util.List, java.util.function.Supplier, javafx.beans.property.BooleanProperty, .SimpleBooleanProperty, javafx.beans.value.ObservableValue, javafx.collections.FXCollections, .ListChangeListener, .ObservableList, .WeakListChangeListener, javafx.css.PseudoClass, javafx.event.ActionEvent, .EventTarget, javafx.scene.AccessibleAttribute, .AccessibleRole, .Node, .Parent, javafx.scene.control.ComboBox, .Control, .ListCell, .ListView, .SelectionMode, .SelectionModel, .SingleSelectionModel, .TextField, javafx.scene.input.KeyCode, .MouseEvent, javafx.util.Callback, .StringConverter, com.sun.javafx.scene.control.IDisconnectable, .ListenerHelper, com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior, .ComboBoxListViewBehavior

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

Field Summary

Modifier and TypeField and Description
private final ComboBoxListViewBehavior<T>
private ListCell<T>
private Callback<ListView<T>, ListCell<T>>
private static final String
private final ComboBox<T>
private ObservableList<T>
private final BooleanProperty
hideOnClick

By default this skin hides the popup whenever the ListView is clicked in. By setting hideOnClick to false, the popup will not be hidden when the ListView is clicked in. This is beneficial in some scenarios (for example, when the ListView cells have checkboxes).

private boolean
private boolean
private final ListView<T>
private ObservableList<T>
private final ListChangeListener<T>
private boolean
private static final PseudoClass
private static final PseudoClass
private static final PseudoClass
private IDisconnectable
private final WeakListChangeListener<T>
Inherited from javafx.scene.control.skin.ComboBoxPopupControl:
popup

Constructor Summary

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

Creates a new ComboBoxListViewSkin 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
computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxHeight.

Computes the maximum allowable height of the Skin, based on the provided width.

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

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxWidth.

Computes the maximum allowable width of the Skin, based on the provided height.

protected double
computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMinHeight.

Computes the minimum allowable height of the Skin, based on the provided width.

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

Overrides javafx.scene.control.SkinBase.computeMinWidth.

Computes the minimum allowable width of the Skin, based on the provided height.

protected double
computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.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.skin.ComboBoxBaseSkin.computePrefWidth.

Calculates the preferred width of this SkinBase.

private ListView<T>
public void
dispose()

Overrides javafx.scene.control.skin.ComboBoxPopupControl.dispose.

Implements javafx.scene.control.Skin.dispose.

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

pack-priv ComboBoxBaseBehavior<T>
protected StringConverter<T>
getConverter()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getConverter.

Subclasses are responsible for getting the converter.

private Callback<ListView<T>, ListCell<T>>
public Node
getDisplayNode()

Implements abstract javafx.scene.control.skin.ComboBoxBaseSkin.getDisplayNode.

This method should return a Node that will be positioned within the ComboBox 'button' area.

protected TextField
getEditor()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getEditor.

Subclasses are responsible for getting the editor.

private int
pack-priv ListView<T>
private double
public Node
getPopupContent()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getPopupContent.

This method should return the Node that will be displayed when the user clicks on the ComboBox 'button' area.

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

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.layoutChildren.

Called during the layout pass of the scenegraph.

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

public final void
setHideOnClick(boolean value)

private void
private void
private void
pack-priv void
private boolean
updateDisplayText(ListCell<T> cell, T item, boolean empty)

private void
private void
Inherited from javafx.scene.control.skin.ComboBoxPopupControl:
getEditableInputNodegetPopuphideinstallreconfigurePopupsetTextFromTextFieldIntoComboBoxValueshowupdateEditable

Field Detail

behaviorback to summary
private final ComboBoxListViewBehavior<T> behavior
buttonCellback to summary
private ListCell<T> buttonCell
cellFactoryback to summary
private Callback<ListView<T>, ListCell<T>> cellFactory
COMBO_BOX_ROWS_TO_MEASURE_WIDTH_KEYback to summary
private static final String COMBO_BOX_ROWS_TO_MEASURE_WIDTH_KEY
comboBoxback to summary
private final ComboBox<T> comboBox
comboBoxItemsback to summary
private ObservableList<T> comboBoxItems
hideOnClickback to summary
private final BooleanProperty hideOnClick

By default this skin hides the popup whenever the ListView is clicked in. By setting hideOnClick to false, the popup will not be hidden when the ListView is clicked in. This is beneficial in some scenarios (for example, when the ListView cells have checkboxes).

itemCountDirtyback to summary
private boolean itemCountDirty
listSelectionLockback to summary
private boolean listSelectionLock
listViewback to summary
private final ListView<T> listView
listViewItemsback to summary
private ObservableList<T> listViewItems
listViewItemsListenerback to summary
private final ListChangeListener<T> listViewItemsListener
listViewSelectionDirtyback to summary
private boolean listViewSelectionDirty
PSEUDO_CLASS_EMPTYback to summary
private static final PseudoClass PSEUDO_CLASS_EMPTY
PSEUDO_CLASS_FILLEDback to summary
private static final PseudoClass PSEUDO_CLASS_FILLED
PSEUDO_CLASS_SELECTEDback to summary
private static final PseudoClass PSEUDO_CLASS_SELECTED
selectedItemWatcherback to summary
private IDisconnectable selectedItemWatcher
weakListViewItemsListenerback to summary
private final WeakListChangeListener<T> weakListViewItemsListener

Constructor Detail

ComboBoxListViewSkinback to summary
public ComboBoxListViewSkin(final ComboBox<T> control)

Creates a new ComboBoxListViewSkin 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:ComboBox<T>

The control that this skin should be installed onto.

Method Detail

computeMaxHeightback to summary
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxHeight.

Doc from javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxHeight.

Computes the maximum allowable height of the Skin, based on the provided width.

Annotations
@Override
computeMaxWidthback to summary
protected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxWidth.

Doc from javafx.scene.control.skin.ComboBoxBaseSkin.computeMaxWidth.

Computes the maximum allowable width of the Skin, based on the provided height.

Annotations
@Override
computeMinHeightback to summary
protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMinHeight.

Doc from javafx.scene.control.SkinBase.computeMinHeight.

Computes the minimum allowable height of the Skin, based on the provided width.

Annotations
@Override
computeMinWidthback to summary
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMinWidth.

Doc from javafx.scene.control.SkinBase.computeMinWidth.

Computes the minimum allowable width of the Skin, based on the provided height.

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

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.computePrefHeight.

Doc from javafx.scene.control.skin.ComboBoxBaseSkin.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.skin.ComboBoxBaseSkin.computePrefWidth.

Doc from javafx.scene.control.skin.ComboBoxBaseSkin.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
createListViewback to summary
private ListView<T> createListView()
disposeback to summary
public void dispose()

Overrides javafx.scene.control.skin.ComboBoxPopupControl.dispose.

Implements javafx.scene.control.Skin.dispose.

Doc from javafx.scene.control.SkinBase.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.

Annotations
@Override
getBehaviorback to summary
pack-priv ComboBoxBaseBehavior<T> getBehavior()

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.getBehavior.

Annotations
@Override
getConverterback to summary
protected StringConverter<T> getConverter()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getConverter.

Doc from javafx.scene.control.skin.ComboBoxPopupControl.getConverter.

Subclasses are responsible for getting the converter. This will be removed in FX 9 when the converter property is moved up to ComboBoxBase with JDK-8130354.

Annotations
@Override
getDefaultCellFactoryback to summary
private Callback<ListView<T>, ListCell<T>> getDefaultCellFactory()
getDisplayNodeback to summary
public Node getDisplayNode()

Implements abstract javafx.scene.control.skin.ComboBoxBaseSkin.getDisplayNode.

Doc from javafx.scene.control.skin.ComboBoxBaseSkin.getDisplayNode.

This method should return a Node that will be positioned within the ComboBox 'button' area.

Annotations
@Override
getEditorback to summary
protected TextField getEditor()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getEditor.

Doc from javafx.scene.control.skin.ComboBoxPopupControl.getEditor.

Subclasses are responsible for getting the editor. This will be removed in FX 9 when the editor property is moved up to ComboBoxBase with JDK-8130354 Note: ComboBoxListViewSkin should return null if editable is false, even if the ComboBox does have an editor set.

Annotations
@Override
getIndexOfComboBoxValueInItemsListback to summary
private int getIndexOfComboBoxValueInItemsList()
getListViewback to summary
pack-priv ListView<T> getListView()
getListViewPrefHeightback to summary
private double getListViewPrefHeight()
getPopupContentback to summary
public Node getPopupContent()

Implements abstract javafx.scene.control.skin.ComboBoxPopupControl.getPopupContent.

Doc from javafx.scene.control.skin.ComboBoxPopupControl.getPopupContent.

This method should return the Node that will be displayed when the user clicks on the ComboBox 'button' area.

Annotations
@Override
hideOnClickPropertyback to summary
public final BooleanProperty hideOnClickProperty()
isHideOnClickback to summary
public final boolean isHideOnClick()
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.ComboBoxBaseSkin.layoutChildren.

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

Called during the layout pass of the scenegraph.

Annotations
@Override
queryAccessibleAttributeback to summary
public 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
setHideOnClickback to summary
public final void setHideOnClick(boolean value)
updateButtonCellback to summary
private void updateButtonCell()
updateCellFactoryback to summary
private void updateCellFactory()
updateComboBoxItemsback to summary
private void updateComboBoxItems()
updateDisplayNodeback to summary
pack-priv void updateDisplayNode()

Overrides javafx.scene.control.skin.ComboBoxPopupControl.updateDisplayNode.

Annotations
@Override
updateDisplayTextback to summary
private boolean updateDisplayText(ListCell<T> cell, T item, boolean empty)
updateListViewItemsback to summary
private void updateListViewItems()
updateValueback to summary
private void updateValue()