public class ComboBoxListViewSkin<T> extends ComboBoxPopupControl<T>
ComboBoxPopupControl.FakeFocusTextField
Modifier and Type | Field and Description |
---|---|
private ListCell<T> |
buttonCell |
private Callback<ListView<T>,ListCell<T>> |
cellFactory |
private static java.lang.String |
COMBO_BOX_ROWS_TO_MEASURE_WIDTH_KEY |
private ComboBox<T> |
comboBox
*
Private fields *
*
|
private ObservableList<T> |
comboBoxItems |
private boolean |
itemCountDirty
*
Listeners *
*
|
private InvalidationListener |
itemsObserver |
private boolean |
listSelectionLock |
private ListView<T> |
listView |
private ObservableList<T> |
listViewItems |
private ListChangeListener<T> |
listViewItemsListener |
private boolean |
listViewSelectionDirty |
private static PseudoClass |
PSEUDO_CLASS_EMPTY |
private static PseudoClass |
PSEUDO_CLASS_FILLED |
private static PseudoClass |
PSEUDO_CLASS_SELECTED
*
Stylesheet Handling *
*
|
private WeakListChangeListener<T> |
weakListViewItemsListener |
COMBO_BOX_STYLE_CLASS, popup
arrow, arrowButton
IS_TOUCH_SUPPORTED
Constructor and Description |
---|
ComboBoxListViewSkin(ComboBox<T> comboBox)
*
Constructors *
*
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeMaxHeight(double width,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
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)
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)
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)
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)
Calculates the preferred height of this
SkinBase . |
protected double |
computePrefWidth(double height,
double topInset,
double rightInset,
double bottomInset,
double leftInset)
Calculates the preferred width of this
SkinBase . |
private ListView<T> |
createListView() |
protected StringConverter<T> |
getConverter()
Subclasses are responsible for getting the converter.
|
private Callback<ListView<T>,ListCell<T>> |
getDefaultCellFactory() |
Node |
getDisplayNode()
This method should return a Node that will be positioned within the
ComboBox 'button' area.
|
protected TextField |
getEditor()
Subclasses are responsible for getting the editor.
|
private int |
getIndexOfComboBoxValueInItemsList() |
ListView<T> |
getListView()
API for testing
|
private double |
getListViewPrefHeight() |
Node |
getPopupContent()
This method should return the Node that will be displayed when the user
clicks on the ComboBox 'button' area.
|
protected void |
handleControlPropertyChanged(java.lang.String p)
Handles changes to properties of the MenuButton.
|
protected boolean |
isHideOnClickEnabled() |
protected void |
layoutChildren(double x,
double y,
double w,
double h)
Called during the layout pass of the scenegraph.
|
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
private void |
updateButtonCell() |
private void |
updateCellFactory() |
void |
updateComboBoxItems() |
protected void |
updateDisplayNode() |
private boolean |
updateDisplayText(ListCell<T> cell,
T item,
boolean empty) |
void |
updateListViewItems() |
private void |
updateValue()
*
Private methods *
*
|
getEditableInputNode, getPopup, hide, reconfigurePopup, setTextFromTextFieldIntoComboBoxValue, show, updateEditable
computeBaselineOffset, focusLost, getMode, setMode, updateDisplayArea
dispose, getBehavior, registerChangeListener, unregisterChangeListener
consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace
private static final java.lang.String COMBO_BOX_ROWS_TO_MEASURE_WIDTH_KEY
private ObservableList<T> comboBoxItems
private ObservableList<T> listViewItems
private boolean listSelectionLock
private boolean listViewSelectionDirty
private boolean itemCountDirty
private final ListChangeListener<T> listViewItemsListener
private final InvalidationListener itemsObserver
private final WeakListChangeListener<T> weakListViewItemsListener
private static final PseudoClass PSEUDO_CLASS_SELECTED
private static final PseudoClass PSEUDO_CLASS_EMPTY
private static final PseudoClass PSEUDO_CLASS_FILLED
protected void handleControlPropertyChanged(java.lang.String p)
handleControlPropertyChanged
in class ComboBoxBaseSkin<T>
protected TextField getEditor()
ComboBoxPopupControl
getEditor
in class ComboBoxPopupControl<T>
protected StringConverter<T> getConverter()
ComboBoxPopupControl
getConverter
in class ComboBoxPopupControl<T>
public Node getDisplayNode()
getDisplayNode
in class ComboBoxBaseSkin<T>
public void updateComboBoxItems()
public void updateListViewItems()
public Node getPopupContent()
ComboBoxPopupControl
getPopupContent
in class ComboBoxPopupControl<T>
protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMinWidth
in class SkinBase<ComboBoxBase<T>>
height
- The height of the Skin, in case this value might dictate
the minimum width.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
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.computePrefWidth
in class ComboBoxBaseSkin<T>
height
- the height that should be used if preferred width depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computeMaxWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMaxWidth
in class ComboBoxBaseSkin<T>
height
- The height of the Skin, in case this value might dictate
the maximum width.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMinHeight
in class SkinBase<ComboBoxBase<T>>
width
- The width of the Skin, in case this value might dictate
the minimum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
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.computePrefHeight
in class ComboBoxBaseSkin<T>
width
- the width that should be used if preferred height depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
SkinBase
computeMaxHeight
in class ComboBoxBaseSkin<T>
width
- The width of the Skin, in case this value might dictate
the maximum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left insetprotected void layoutChildren(double x, double y, double w, double h)
SkinBase
layoutChildren
in class ComboBoxBaseSkin<T>
protected boolean isHideOnClickEnabled()
private void updateValue()
protected void updateDisplayNode()
updateDisplayNode
in class ComboBoxPopupControl<T>
private int getIndexOfComboBoxValueInItemsList()
private void updateButtonCell()
private void updateCellFactory()
private double getListViewPrefHeight()
public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class SkinBase<ComboBoxBase<T>>
Node.queryAccessibleAttribute(javafx.scene.AccessibleAttribute, java.lang.Object...)