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

public abstract Class ComboBoxBaseSkin<T>

extends SkinBase<ComboBoxBase<T>>
Class Inheritance
Known Direct Subclasses
javafx.scene.control.skin.ComboBoxPopupControl
Type Parameters
<T>
The type of the ComboBox-like control.
Imports
java.util.List, javafx.event.EventHandler, javafx.geometry.HPos, .VPos, javafx.scene.Node, javafx.scene.control.ComboBoxBase, .SkinBase, javafx.scene.input.MouseEvent, javafx.scene.layout.Region, .StackPane, com.sun.javafx.scene.control.ListenerHelper, com.sun.javafx.scene.control.behavior.ComboBoxBaseBehavior

An abstract class intended to be used as the base skin for ComboBox-like controls that are based on ComboBoxBase. Most users of this skin class would be well-advised to also look at ComboBoxPopupControl for additional useful API.
Since
9
See Also
ComboBoxBase, ComboBoxPopupControl

Field Summary

Modifier and TypeField and Description
pack-priv Region
pack-priv StackPane
private Node
private ComboBoxMode
mode

The mode in which this control will be represented.

private final EventHandler<MouseEvent>
private final EventHandler<MouseEvent>
private final EventHandler<MouseEvent>
private final EventHandler<MouseEvent>

Constructor Summary

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

Creates a new instance of ComboBoxBaseSkin, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.

Method Summary

Modifier and TypeMethod and Description
protected double
computeBaselineOffset(double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computeBaselineOffset.

Calculates the baseline offset based on the first managed child.

protected double
computeMaxHeight(double
The width of the Skin, in case this value might dictate the maximum height.
width
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computeMaxHeight.

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

protected double
computeMaxWidth(double
The height of the Skin, in case this value might dictate the maximum width.
height
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computeMaxWidth.

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

protected double
computePrefHeight(double
the width that should be used if preferred height depends on it
width
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase.

protected double
computePrefWidth(double
the height that should be used if preferred width depends on it
height
,
double
the pixel snapped top inset
topInset
,
double
the pixel snapped right inset
rightInset
,
double
the pixel snapped bottom inset
bottomInset
,
double
the pixel snapped left inset
leftInset
)

Overrides javafx.scene.control.SkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

pack-priv void
pack-priv ComboBoxBaseBehavior<T>
public abstract Node

Returns:

the node that will be positioned within the ComboBox 'button' area
getDisplayNode
()

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

pack-priv final ComboBoxMode
public abstract void
hide()

This method will be called when the ComboBox popup should be hidden.

private boolean
protected void
layoutChildren(final double
the x position
x
,
final double
the y position
y
,
final double
the width
w
,
final double
the height
h
)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

pack-priv final void
public abstract void
show()

This method will be called when the ComboBox popup should be displayed.

private void
pack-priv void
Inherited from javafx.scene.control.SkinBase:
computeMinHeightcomputeMinWidthconsumeMouseEventsdisposeexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedqueryAccessibleAttributeregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

arrowback to summary
pack-priv Region arrow
arrowButtonback to summary
pack-priv StackPane arrowButton
displayNodeback to summary
private Node displayNode
modeback to summary
private ComboBoxMode mode

The mode in which this control will be represented.

mouseEnteredEventHandlerback to summary
private final EventHandler<MouseEvent> mouseEnteredEventHandler
mouseExitedEventHandlerback to summary
private final EventHandler<MouseEvent> mouseExitedEventHandler
mousePressedEventHandlerback to summary
private final EventHandler<MouseEvent> mousePressedEventHandler
mouseReleasedEventHandlerback to summary
private final EventHandler<MouseEvent> mouseReleasedEventHandler

Constructor Detail

ComboBoxBaseSkinback to summary
public ComboBoxBaseSkin(final ComboBoxBase<T> control)

Creates a new instance of ComboBoxBaseSkin, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.

Parameters
control:ComboBoxBase<T>

The control that this skin should be installed onto.

Method Detail

computeBaselineOffsetback to summary
protected double computeBaselineOffset(double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.SkinBase.computeBaselineOffset.

Doc from javafx.scene.control.SkinBase.computeBaselineOffset.

Calculates the baseline offset based on the first managed child. If there is no such child, returns Node#getBaselineOffset().

Parameters
topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

baseline offset

Annotations
@Override
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.

Parameters
width:double

The width of the Skin, in case this value might dictate the maximum height.

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

A double representing the maximum height of this Skin.

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.

Parameters
height:double

The height of the Skin, in case this value might dictate the maximum width.

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

A double representing the maximum width of this Skin.

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.

Parameters
width:double

the width that should be used if preferred height depends on it

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

the calculated preferred height

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.

Parameters
height:double

the height that should be used if preferred width depends on it

topInset:double

the pixel snapped top inset

rightInset:double

the pixel snapped right inset

bottomInset:double

the pixel snapped bottom inset

leftInset:double

the pixel snapped left inset

Returns:double

the calculated preferred width

Annotations
@Override
focusLostback to summary
pack-priv void focusLost()
getBehaviorback to summary
pack-priv ComboBoxBaseBehavior<T> getBehavior()
getDisplayNodeback to summary
public abstract Node getDisplayNode()

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

Returns:Node

the node that will be positioned within the ComboBox 'button' area

getModeback to summary
pack-priv final ComboBoxMode getMode()
hideback to summary
public abstract void hide()

This method will be called when the ComboBox popup should be hidden. It is up to specific skin implementations to determine how this is handled.

isButtonback to summary
private boolean isButton()
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.

Parameters
x:double

the x position

y:double

the y position

w:double

the width

h:double

the height

Annotations
@Override
setModeback to summary
pack-priv final void setMode(ComboBoxMode value)
showback to summary
public abstract void show()

This method will be called when the ComboBox popup should be displayed. It is up to specific skin implementations to determine how this is handled.

updateArrowButtonListenersback to summary
private void updateArrowButtonListeners()
updateDisplayAreaback to summary
pack-priv void updateDisplayArea()