Top Inners Fields Constructors Methods
com.dlsc.gemsfx.skins

public Class SelectionBoxSkin<T>

extends SkinBase<SelectionBox<T>>
Class Inheritance
Imports
com.dlsc.gemsfx.SelectionBox, javafx.animation.FadeTransition, .Transition, javafx.application.Platform, javafx.beans.binding.Bindings, javafx.beans.property.BooleanProperty, .ReadOnlyBooleanProperty, .ReadOnlyBooleanWrapper, javafx.beans.value.ChangeListener, javafx.collections.ListChangeListener, .MapChangeListener, javafx.css.PseudoClass, javafx.geometry.Bounds, .HPos, .VPos, javafx.scene.Node, javafx.scene.control.CheckBox, .Label, .PopupControl, .RadioButton, .ScrollPane, .SelectionMode, .Skin, .SkinBase, .ToggleGroup, javafx.scene.input.MouseButton, .MouseEvent, javafx.scene.layout.BorderPane, .Region, .StackPane, .VBox, javafx.util.Duration, .StringConverter, java.util.ArrayList, .Collections, .LinkedHashMap, .List, .Map, .Objects

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
SelectionBoxSkin.SelectionPopup

Custom popup control to show the items in a popup.

private class

Field Summary

Modifier and TypeField and Description
private final Region
private final StackPane
private final SelectionBox<T>
private final Label
private static final PseudoClass
private static final PseudoClass
private final SelectionBoxSkin<T>.SelectionPopup
private static final PseudoClass
private final ChangeListener<SelectionMode>
private final ChangeListener<T>
private final ListChangeListener<T>
private static final String
private static final PseudoClass
private static final PseudoClass
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private double
computeBestWidth(double displayLabelWidth, double leftInset, double rightInset)

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.

private String
private String
getDefaultDisplayText(List<T> selectedItems)

private void
public void
protected void
layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)

Overrides javafx.scene.control.SkinBase.layoutChildren.

Called during the layout pass of the scenegraph.

public void
public void
private void
private void
private void
Inherited from javafx.scene.control.SkinBase:
computeBaselineOffsetconsumeMouseEventsdisposeexecuteAccessibleActiongetChildrengetClassCssMetaDatagetCssMetaDatagetNodegetSkinnablelayoutInArealayoutInArealayoutInAreapositionInAreapositionInAreapseudoClassStateChangedqueryAccessibleAttributeregisterChangeListenerregisterInvalidationListenerregisterListChangeListenersnappedBottomInsetsnappedLeftInsetsnappedRightInsetsnappedTopInsetsnapPositionsnapPositionXsnapPositionYsnapSizesnapSizeXsnapSizeYsnapSpacesnapSpaceXsnapSpaceYunregisterChangeListenersunregisterInvalidationListenersunregisterListChangeListeners

Field Detail

arrowback to summary
private final Region arrow
arrowButtonback to summary
private final StackPane arrowButton
controlback to summary
private final SelectionBox<T> control

Hides javafx.scene.control.SkinBase.control.

displayLabelback to summary
private final Label displayLabel
EMPTY_SELECTION_PSEUDO_CLASSback to summary
private static final PseudoClass EMPTY_SELECTION_PSEUDO_CLASS
MULTIPLE_PSEUDO_CLASSback to summary
private static final PseudoClass MULTIPLE_PSEUDO_CLASS
READ_ONLY_PSEUDO_CLASSback to summary
private static final PseudoClass READ_ONLY_PSEUDO_CLASS
selectionModeChangeListenerback to summary
private final ChangeListener<SelectionMode> selectionModeChangeListener
selectItemChangedListenerback to summary
private final ChangeListener<T> selectItemChangedListener
selectItemsChangeListenerback to summary
private final ListChangeListener<T> selectItemsChangeListener
SHOW_POPUP_PROPERTYback to summary
private static final String SHOW_POPUP_PROPERTY
SHOWING_POPUP_PSEUDO_CLASSback to summary
private static final PseudoClass SHOWING_POPUP_PSEUDO_CLASS
SINGLE_PSEUDO_CLASSback to summary
private static final PseudoClass SINGLE_PSEUDO_CLASS
UPDATE_POPUP_CONTENTback to summary
private static final String UPDATE_POPUP_CONTENT
UPDATE_SELECTION_IN_POPUPback to summary
private static final String UPDATE_SELECTION_IN_POPUP

Constructor Detail

SelectionBoxSkinback to summary
public SelectionBoxSkin(SelectionBox<T> control)

Method Detail

addListenerToControlback to summary
private void addListenerToControl()
computeBestWidthback to summary
private double computeBestWidth(double displayLabelWidth, double leftInset, double rightInset)
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
convertItemToTextback to summary
private String convertItemToText(T item)
getDefaultDisplayTextback to summary
private String getDefaultDisplayText(List<T> selectedItems)
handleSelectionChangeback to summary
private void handleSelectionChange()
hidePopupback to summary
public void hidePopup()
layoutChildrenback to summary
protected void layoutChildren(double contentX, double contentY, double contentWidth, double contentHeight)

Overrides javafx.scene.control.SkinBase.layoutChildren.

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

Called during the layout pass of the scenegraph.

Annotations
@Override
showPopupback to summary
public void showPopup()
updateDisplayLabelTextback to summary
public void updateDisplayLabelText()
updateEmptyPseudoClassback to summary
private void updateEmptyPseudoClass()
updateModePseudoClassback to summary
private void updateModePseudoClass()
updatePseudoAndPopupContentback to summary
private void updatePseudoAndPopupContent()
com.dlsc.gemsfx.skins back to summary

private Class SelectionBoxSkin.SelectionPopup

extends PopupControl
Class Inheritance

Custom popup control to show the items in a popup.

Field Summary

Modifier and TypeField and Description
private static final Duration
private static final String
private Transition
private final SelectionBox<T>
private Transition
Inherited from javafx.scene.control.PopupControl:
bridgeUSE_COMPUTED_SIZEUSE_PREF_SIZE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.PopupControl.createDefaultSkin.

Create a new instance of the default skin for this control.

private Transition
private Transition
private Transition
public final SelectionBox<T>
private Transition
public void
hide()

Overrides javafx.stage.PopupWindow.hide.

Hide this Popup and all its children

public final void
public final boolean
public void
show(Node node)

public final void
Inherited from javafx.scene.control.PopupControl:
getClassCssMetaDatagetCssMetaDatagetIdgetMaxHeightgetMaxWidthgetMinHeightgetMinWidthgetPrefHeightgetPrefWidthgetPseudoClassStatesgetSkingetStylegetStyleableNodegetStyleableParentgetStyleClassgetTypeSelectoridPropertymaxHeightmaxHeightPropertymaxWidthmaxWidthPropertyminHeightminHeightPropertyminWidthminWidthPropertyprefHeightprefHeightPropertyprefWidthprefWidthPropertypseudoClassStateChangedsetIdsetMaxHeightsetMaxSizesetMaxWidthsetMinHeightsetMinSizesetMinWidthsetPrefHeightsetPrefSizesetPrefWidthsetSkinsetStyleskinPropertystyleProperty

Field Detail

ANIM_DURATIONback to summary
private static final Duration ANIM_DURATION
DEFAULT_STYLE_CLASSback to summary
private static final String DEFAULT_STYLE_CLASS
hideTransitionback to summary
private Transition hideTransition
ownerback to summary
private final SelectionBox<T> owner
showTransitionback to summary
private Transition showTransition

Constructor Detail

SelectionPopupback to summary
public SelectionPopup(SelectionBox<T> owner)

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.PopupControl.createDefaultSkin.

Doc from javafx.scene.control.PopupControl.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
createHideTransitionback to summary
private Transition createHideTransition()
createShowTransitionback to summary
private Transition createShowTransition()
getHideTransitionback to summary
private Transition getHideTransition()
getOwnerback to summary
public final SelectionBox<T> getOwner()
getShowTransitionback to summary
private Transition getShowTransition()
hideback to summary
public void hide()

Overrides javafx.stage.PopupWindow.hide.

Doc from javafx.stage.PopupWindow.hide.

Hide this Popup and all its children

Annotations
@Override
initializePopupContentback to summary
public final void initializePopupContent()
isUpdatingback to summary
public final boolean isUpdating()
showback to summary
public void show(Node node)
updateSelectionInPopupback to summary
public final void updateSelectionInPopup()
com.dlsc.gemsfx.skins back to summary

private Class SelectionBoxSkin.SelectionPopupSkin

extends Object
implements Skin<SelectionBoxSkin<T>.SelectionPopup>
Class Inheritance
All Implemented Interfaces
javafx.scene.control.Skin

Field Summary

Modifier and TypeField and Description
private final BorderPane
private final Map<Integer, BooleanProperty>
private final VBox
private final SelectionBoxSkin<T>.SelectionPopup
private final ScrollPane
private final ReadOnlyBooleanWrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private CheckBox
createCheckBoxItem(T item, int index)

private RadioButton
createRadioButtonItem(T item, ToggleGroup toggleGroup, int index)

public void
dispose()

Implements javafx.scene.control.Skin.dispose.

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

public Node
getNode()

Implements javafx.scene.control.Skin.getNode.

Gets the Node which represents this Skin.

public SelectionBoxSkin<T>.SelectionPopup
getSkinnable()

Implements javafx.scene.control.Skin.getSkinnable.

Gets the Skinnable to which this Skin is assigned.

public final boolean
private void
private void
public final ReadOnlyBooleanProperty
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contentPaneback to summary
private final BorderPane contentPane
itemButtonPropertiesback to summary
private final Map<Integer, BooleanProperty> itemButtonProperties
optionsBoxback to summary
private final VBox optionsBox
popupback to summary
private final SelectionBoxSkin<T>.SelectionPopup popup
scrollPaneback to summary
private final ScrollPane scrollPane
updatingback to summary
private final ReadOnlyBooleanWrapper updating

Constructor Detail

SelectionPopupSkinback to summary
public SelectionPopupSkin(SelectionBoxSkin<T>.SelectionPopup popup)

Method Detail

createCheckBoxItemback to summary
private CheckBox createCheckBoxItem(T item, int index)
createRadioButtonItemback to summary
private RadioButton createRadioButtonItem(T item, ToggleGroup toggleGroup, int index)
disposeback to summary
public void dispose()

Implements javafx.scene.control.Skin.dispose.

Doc from javafx.scene.control.Skin.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
getNodeback to summary
public Node getNode()

Implements javafx.scene.control.Skin.getNode.

Doc from javafx.scene.control.Skin.getNode.

Gets the Node which represents this Skin. This must never be null, except after a call to dispose(), and must never change except when changing to null.

Annotations
@Override
getSkinnableback to summary
public SelectionBoxSkin<T>.SelectionPopup getSkinnable()

Implements javafx.scene.control.Skin.getSkinnable.

Doc from javafx.scene.control.Skin.getSkinnable.

Gets the Skinnable to which this Skin is assigned. A Skin must be created for one and only one Skinnable. This value will only ever go from a non-null to null value when the Skin is removed from the Skinnable, and only as a consequence of a call to dispose().

The caller who constructs a Skinnable must also construct a Skin and properly establish the relationship between the Control and its Skin.

Annotations
@Override
isUpdatingback to summary
public final boolean isUpdating()
updatePopupContentback to summary
private void updatePopupContent()
updateSelectionInPopupback to summary
private void updateSelectionInPopup()
updatingPropertyback to summary
public final ReadOnlyBooleanProperty updatingProperty()