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

public Class ChoiceBoxSkin<T>

extends SkinBase<ChoiceBox<T>>
Class Inheritance
Type Parameters
<T>
the type of the item contained in the ChoiceBox
Imports
com.sun.javafx.scene.control.ContextMenuContent, com.sun.javafx.scene.control.behavior.BehaviorBase, .ChoiceBoxBehavior, javafx.scene.control.Control, .SkinBase, .ChoiceBox, .ContextMenu, .Label, .MenuItem, .RadioMenuItem, .SelectionModel, .Separator, .SeparatorMenuItem, .ToggleGroup, javafx.beans.InvalidationListener, javafx.collections.ListChangeListener, .ObservableList, .WeakListChangeListener, javafx.geometry.HPos, .Side, .VPos, javafx.scene.layout.StackPane, javafx.scene.text.Text

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

Field Summary

Modifier and TypeField and Description
private final BehaviorBase<ChoiceBox<T>>
private ObservableList<T>
private final ListChangeListener<T>
private final InvalidationListener
private Label
private StackPane
private ContextMenu
private InvalidationListener
private SelectionModel<T>
private final ToggleGroup
private final WeakListChangeListener<T>

Constructor Summary

AccessConstructor and Description
public
ChoiceBoxSkin(ChoiceBox<T>
The control that this skin should be installed onto.
control
)

Creates a new ChoiceBoxSkin 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
private void
addPopupItem(final T o, int i)

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

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

public void
dispose()

Overrides javafx.scene.control.SkinBase.dispose.

Implements javafx.scene.control.Skin.dispose.

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

pack-priv ContextMenu
pack-priv String
private String
getDisplayText(T value)

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

Overrides javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

private void
private void
private void
private void
private void
Inherited from javafx.scene.control.SkinBase:
computeBaselineOffsetconsumeMouseEventsexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedqueryAccessibleAttributeregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

behaviorback to summary
private final BehaviorBase<ChoiceBox<T>> behavior
choiceBoxItemsback to summary
private ObservableList<T> choiceBoxItems
choiceBoxItemsListenerback to summary
private final ListChangeListener<T> choiceBoxItemsListener
itemsObserverback to summary
private final InvalidationListener itemsObserver
labelback to summary
private Label label
openButtonback to summary
private StackPane openButton
selectionChangeListenerback to summary
private InvalidationListener selectionChangeListener
selectionModelback to summary
private SelectionModel<T> selectionModel
toggleGroupback to summary
private final ToggleGroup toggleGroup
weakChoiceBoxItemsListenerback to summary
private final WeakListChangeListener<T> weakChoiceBoxItemsListener

Constructor Detail

ChoiceBoxSkinback to summary
public ChoiceBoxSkin(ChoiceBox<T> control)

Creates a new ChoiceBoxSkin 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:ChoiceBox<T>

The control that this skin should be installed onto.

Method Detail

addPopupItemback to summary
private void addPopupItem(final T o, int i)
computeMaxHeightback to summary
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeMaxHeight.

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

Doc from javafx.scene.control.SkinBase.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.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
disposeback to summary
public void dispose()

Overrides javafx.scene.control.SkinBase.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
getChoiceBoxPopupback to summary
pack-priv ContextMenu getChoiceBoxPopup()
getChoiceBoxSelectedTextback to summary
pack-priv String getChoiceBoxSelectedText()
getDisplayTextback to summary
private String getDisplayText(T value)
initializeback to summary
private void initialize()
layoutChildrenback to summary
protected void layoutChildren(final double x, final double y, final double w, final double h)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Doc from javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

Annotations
@Override
updateChoiceBoxItemsback to summary
private void updateChoiceBoxItems()
updateLabelTextback to summary
private void updateLabelText()
updatePopupItemsback to summary
private void updatePopupItems()
updateSelectionback to summary
private void updateSelection()
updateSelectionModelback to summary
private void updateSelectionModel()