T
- The type of the value that has been selected or otherwise
entered in to this ComboBox.public abstract class ComboBoxBase<T> extends Control
show()
and
hide()
methods are called, however commonly this results in either
a popup or dialog appearing that allows for the user to provide the
required information.
A ComboBox has a value
property that represents
the current user input. This may be based on a selection from a drop-down list,
or it may be from user input when the ComboBox is
editable
.
An editable
ComboBox is one which provides some
means for an end-user to provide input for values that are not otherwise
options available to them. For example, in the ComboBox
implementation,
an editable ComboBox provides a TextField
that may be typed into.
As mentioned above, when the user commits textual input into the textfield
(commonly by pressing the Enter keyboard key), the
value
property will be updated.
The purpose of the separation between this class and, say, ComboBox
is to allow for ComboBox-like controls that do not necessarily pop up a list
of items. Examples of other implementations include color pickers, calendar
pickers, etc. The ComboBox
class provides the default, and most commonly
expected implementation. Refer to that classes javadoc for more information.
ComboBox
Modifier and Type | Field and Description |
---|---|
static EventType<Event> |
ON_HIDDEN
Called when the ComboBox popup/display has been hidden.
|
static EventType<Event> |
ON_HIDING
Called when the ComboBox popup/display will be hidden.
|
static EventType<Event> |
ON_SHOWING
Called prior to the ComboBox showing its popup/display after the user
has clicked or otherwise interacted with the ComboBox.
|
static EventType<Event> |
ON_SHOWN
Called after the ComboBox has shown its popup/display.
|
USE_COMPUTED_SIZE, USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor and Description |
---|
ComboBoxBase()
Creates a default ComboBoxBase instance.
|
Modifier and Type | Method and Description |
---|---|
void |
arm()
Arms the ComboBox.
|
BooleanProperty |
armedProperty()
Indicates that the ComboBox has been "armed" such that a mouse release
will cause the ComboBox
show() method to be invoked. |
void |
disarm()
Disarms the ComboBox.
|
BooleanProperty |
editableProperty()
Specifies whether the ComboBox allows for user input.
|
void |
executeAccessibleAction(AccessibleAction action,
Object... parameters)
This method is called by the assistive technology to request the action
indicated by the argument should be executed.
|
EventHandler<ActionEvent> |
getOnAction() |
EventHandler<Event> |
getOnHidden() |
EventHandler<Event> |
getOnHiding() |
EventHandler<Event> |
getOnShowing() |
EventHandler<Event> |
getOnShown() |
String |
getPromptText() |
T |
getValue() |
void |
hide()
Closes the popup / dialog that was shown when
show() was called. |
boolean |
isArmed() |
boolean |
isEditable() |
boolean |
isShowing() |
ObjectProperty<EventHandler<ActionEvent>> |
onActionProperty()
The ComboBox action, which is invoked whenever the ComboBox
value property is changed. |
ObjectProperty<EventHandler<Event>> |
onHiddenProperty() |
ObjectProperty<EventHandler<Event>> |
onHidingProperty() |
ObjectProperty<EventHandler<Event>> |
onShowingProperty() |
ObjectProperty<EventHandler<Event>> |
onShownProperty() |
StringProperty |
promptTextProperty() |
Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
Object... parameters)
*
Accessibility handling *
*
|
void |
setEditable(boolean value) |
void |
setOnAction(EventHandler<ActionEvent> value) |
void |
setOnHidden(EventHandler<Event> value) |
void |
setOnHiding(EventHandler<Event> value) |
void |
setOnShowing(EventHandler<Event> value) |
void |
setOnShown(EventHandler<Event> value) |
void |
setPromptText(String value) |
void |
setValue(T value) |
void |
show()
Requests that the ComboBox display the popup aspect of the user interface.
|
ReadOnlyBooleanProperty |
showingProperty() |
ObjectProperty<T> |
valueProperty()
The value of this ComboBox is defined as the selected item if the input
is not editable, or if it is editable, the most recent user action:
either the value input by the user, or the last selected item.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, createDefaultSkin, getBaselineOffset, getClassCssMetaData, getContextMenu, getControlCssMetaData, getCssMetaData, getSkin, getTooltip, impl_cssGetFocusTraversableInitialValue, impl_processCSS, isResizable, layoutChildren, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public static final EventType<Event> ON_SHOWING
Called prior to the ComboBox showing its popup/display after the user has clicked or otherwise interacted with the ComboBox.
public static final EventType<Event> ON_SHOWN
Called after the ComboBox has shown its popup/display.
public static final EventType<Event> ON_HIDING
Called when the ComboBox popup/display will be hidden.
public ObjectProperty<T> valueProperty()
public final void setValue(T value)
public final T getValue()
public BooleanProperty editableProperty()
value
property.
Note that when the editable property changes, the value property is reset, along with any other relevant state.
public final void setEditable(boolean value)
public final boolean isEditable()
public ReadOnlyBooleanProperty showingProperty()
public final boolean isShowing()
public final StringProperty promptTextProperty()
public final String getPromptText()
public final void setPromptText(String value)
public BooleanProperty armedProperty()
show()
method to be invoked. This is
subtly different from pressed. Pressed indicates that the mouse has been
pressed on a Node and has not yet been released. arm
however
also takes into account whether the mouse is actually over the
ComboBox and pressed.public final boolean isArmed()
public final ObjectProperty<EventHandler<ActionEvent>> onActionProperty()
value
property is changed. This
may be due to the value property being programmatically changed, when the
user selects an item in a popup list or dialog, or, in the case of
editable
ComboBoxes, it may be when the user
provides their own input (be that via a TextField
or some other
input mechanism.public final void setOnAction(EventHandler<ActionEvent> value)
public final EventHandler<ActionEvent> getOnAction()
public final ObjectProperty<EventHandler<Event>> onShowingProperty()
public final void setOnShowing(EventHandler<Event> value)
public final EventHandler<Event> getOnShowing()
public final ObjectProperty<EventHandler<Event>> onShownProperty()
public final void setOnShown(EventHandler<Event> value)
public final EventHandler<Event> getOnShown()
public final ObjectProperty<EventHandler<Event>> onHidingProperty()
public final void setOnHiding(EventHandler<Event> value)
public final EventHandler<Event> getOnHiding()
public final ObjectProperty<EventHandler<Event>> onHiddenProperty()
public final void setOnHidden(EventHandler<Event> value)
public final EventHandler<Event> getOnHidden()
public void show()
ComboBoxBase
class javadoc, what is actually
shown when this method is called is undefined, but commonly it is some
form of popup or dialog window.public void hide()
show()
was called.public void arm()
public void disarm()
arm()
.public Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters)
queryAccessibleAttribute
in class Control
attribute
- the requested attributeparameters
- optional list of parametersAccessibleAttribute
public void executeAccessibleAction(AccessibleAction action, Object... parameters)
Node
This method is commonly overridden by subclasses to implement
action that are required for a specific role.
If a particular action is not handled, the super class implementation
must be called.
executeAccessibleAction
in class Control
action
- the action to executeparameters
- optional list of parametersAccessibleAction
Copyright © 2020. All rights reserved.