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
Type | Property and Description |
---|---|
BooleanProperty |
armed
Indicates that the ComboBox has been "armed" such that a mouse release
will cause the ComboBox
show() method to be invoked. |
BooleanProperty |
editable
Specifies whether the ComboBox allows for user input.
|
<any> |
onAction
The ComboBox action, which is invoked whenever the ComboBox
value property is changed. |
<any> |
onHidden
Called just after the
ComboBoxBase popup/display has been hidden. |
<any> |
onHiding
Called just prior to the
ComboBox popup/display being hidden. |
<any> |
onShowing
Called just prior to the
ComboBoxBase popup/display being shown. |
<any> |
onShown
Called just after the
ComboBoxBase popup/display is shown. |
StringProperty |
promptText
The
ComboBox prompt text to display, or null if no
prompt text is displayed. |
ReadOnlyBooleanProperty |
showing
Represents the current state of the ComboBox popup, and whether it is
currently visible on screen (although it may be hidden behind other windows).
|
<any> |
value
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.
|
contextMenuProperty, skinClassNameProperty, skinProperty, tooltipProperty
Modifier and Type | Field and Description |
---|---|
private BooleanProperty |
armed |
private static java.lang.String |
DEFAULT_STYLE_CLASS
*
Stylesheet Handling *
*
|
private BooleanProperty |
editable |
static <any> |
ON_HIDDEN
Called when the ComboBox popup/display has been hidden.
|
static <any> |
ON_HIDING
Called when the ComboBox popup/display will be hidden.
|
static <any> |
ON_SHOWING
Called prior to the ComboBox showing its popup/display after the user
has clicked or otherwise interacted with the ComboBox.
|
static <any> |
ON_SHOWN
Called after the ComboBox has shown its popup/display.
|
private <any> |
onAction |
private <any> |
onHidden
Called just after the
ComboBoxBase popup/display has been hidden. |
private <any> |
onHiding
Called just prior to the
ComboBox popup/display being hidden. |
private <any> |
onShowing
Called just prior to the
ComboBoxBase popup/display being shown. |
private <any> |
onShown
Called just after the
ComboBoxBase popup/display is shown. |
private StringProperty |
promptText
The
ComboBox prompt text to display, or null if no
prompt text is displayed. |
private static PseudoClass |
PSEUDO_CLASS_ARMED |
private static PseudoClass |
PSEUDO_CLASS_EDITABLE |
private static PseudoClass |
PSEUDO_CLASS_SHOWING |
private ReadOnlyBooleanWrapper |
showing
Represents the current state of the ComboBox popup, and whether it is
currently visible on screen (although it may be hidden behind other windows).
|
private <any> |
value |
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,
java.lang.Object... parameters) |
<any> |
getOnAction()
Gets the value of the property onAction.
|
<any> |
getOnHidden()
Gets the value of the property onHidden.
|
<any> |
getOnHiding()
Gets the value of the property onHiding.
|
<any> |
getOnShowing()
Gets the value of the property onShowing.
|
<any> |
getOnShown()
Gets the value of the property onShown.
|
java.lang.String |
getPromptText()
Gets the value of the property promptText.
|
T |
getValue()
Gets the value of the property value.
|
void |
hide()
Closes the popup / dialog that was shown when
show() was called. |
boolean |
isArmed()
Gets the value of the property armed.
|
boolean |
isEditable()
Gets the value of the property editable.
|
boolean |
isShowing()
Gets the value of the property showing.
|
<any> |
onActionProperty()
The ComboBox action, which is invoked whenever the ComboBox
value property is changed. |
<any> |
onHiddenProperty()
Called just after the
ComboBoxBase popup/display has been hidden. |
<any> |
onHidingProperty()
Called just prior to the
ComboBox popup/display being hidden. |
<any> |
onShowingProperty()
Called just prior to the
ComboBoxBase popup/display being shown. |
<any> |
onShownProperty()
Called just after the
ComboBoxBase popup/display is shown. |
StringProperty |
promptTextProperty()
The
ComboBox prompt text to display, or null if no
prompt text is displayed. |
java.lang.Object |
queryAccessibleAttribute(AccessibleAttribute attribute,
java.lang.Object... parameters) |
private void |
setArmed(boolean value) |
void |
setEditable(boolean value)
Sets the value of the property editable.
|
void |
setOnAction(<any> value)
Sets the value of the property onAction.
|
void |
setOnHidden(<any> value)
Sets the value of the property onHidden.
|
void |
setOnHiding(<any> value)
Sets the value of the property onHiding.
|
void |
setOnShowing(<any> value)
Sets the value of the property onShowing.
|
void |
setOnShown(<any> value)
Sets the value of the property onShown.
|
void |
setPromptText(java.lang.String value)
Sets the value of the property promptText.
|
private void |
setShowing(boolean value) |
void |
setValue(T value)
Sets the value of the property value.
|
void |
show()
Requests that the ComboBox display the popup aspect of the user interface.
|
ReadOnlyBooleanProperty |
showingProperty()
Represents the current state of the ComboBox popup, and whether it is
currently visible on screen (although it may be hidden behind other windows).
|
private ReadOnlyBooleanWrapper |
showingPropertyImpl() |
<any> |
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, getControlChildren, getControlCssMetaData, getCssMetaData, getInitialFocusTraversable, getSkin, getTooltip, isResizable, layoutChildren, loadSkinClass, setContextMenu, setSkin, setTooltip, skinClassNameProperty, skinProperty, tooltipProperty
public <any> valueProperty
getValue()
,
setValue(T)
public BooleanProperty editableProperty
value
property.
Note that when the editable property changes, the value property is reset, along with any other relevant state.
isEditable()
,
setEditable(boolean)
public ReadOnlyBooleanProperty showingProperty
isShowing()
public final StringProperty promptTextProperty
ComboBox
prompt text to display, or null
if no
prompt text is displayed. Prompt text is not displayed in all circumstances,
it is dependent upon the subclasses of ComboBoxBase to clarify when
promptText will be shown. For example, in most cases prompt text will never be
shown when a combo box is non-editable (that is, prompt text is only shown
when user input is allowed via text input).getPromptText()
,
setPromptText(String)
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.isArmed()
public final <any> 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.getOnAction()
,
#setOnAction()
public final <any> onShowingProperty
ComboBoxBase
popup/display being shown.getOnShowing()
,
#setOnShowing()
public final <any> onShownProperty
ComboBoxBase
popup/display is shown.getOnShown()
,
#setOnShown()
public final <any> onHidingProperty
ComboBox
popup/display being hidden.getOnHiding()
,
#setOnHiding()
public final <any> onHiddenProperty
ComboBoxBase
popup/display has been hidden.getOnHidden()
,
#setOnHidden()
public static final <any> 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 <any> ON_SHOWN
Called after the ComboBox has shown its popup/display.
public static final <any> ON_HIDING
Called when the ComboBox popup/display will be hidden.
public static final <any> ON_HIDDEN
Called when the ComboBox popup/display has been hidden.
private <any> value
private BooleanProperty editable
private ReadOnlyBooleanWrapper showing
private StringProperty promptText
ComboBox
prompt text to display, or null
if no
prompt text is displayed. Prompt text is not displayed in all circumstances,
it is dependent upon the subclasses of ComboBoxBase to clarify when
promptText will be shown. For example, in most cases prompt text will never be
shown when a combo box is non-editable (that is, prompt text is only shown
when user input is allowed via text input).private BooleanProperty armed
private <any> onAction
private <any> onShowing
ComboBoxBase
popup/display being shown.private <any> onShown
ComboBoxBase
popup/display is shown.private <any> onHiding
ComboBox
popup/display being hidden.private <any> onHidden
ComboBoxBase
popup/display has been hidden.private static final java.lang.String DEFAULT_STYLE_CLASS
private static final PseudoClass PSEUDO_CLASS_EDITABLE
private static final PseudoClass PSEUDO_CLASS_SHOWING
private static final PseudoClass PSEUDO_CLASS_ARMED
public <any> valueProperty()
getValue()
,
setValue(T)
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.
isEditable()
,
setEditable(boolean)
public final void setEditable(boolean value)
public final boolean isEditable()
public ReadOnlyBooleanProperty showingProperty()
isShowing()
public final boolean isShowing()
private void setShowing(boolean value)
private ReadOnlyBooleanWrapper showingPropertyImpl()
public final StringProperty promptTextProperty()
ComboBox
prompt text to display, or null
if no
prompt text is displayed. Prompt text is not displayed in all circumstances,
it is dependent upon the subclasses of ComboBoxBase to clarify when
promptText will be shown. For example, in most cases prompt text will never be
shown when a combo box is non-editable (that is, prompt text is only shown
when user input is allowed via text input).getPromptText()
,
setPromptText(String)
public final java.lang.String getPromptText()
public final void setPromptText(java.lang.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.isArmed()
private final void setArmed(boolean value)
public final boolean isArmed()
public final <any> 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.getOnAction()
,
#setOnAction()
public final void setOnAction(<any> value)
public final <any> getOnAction()
public final <any> onShowingProperty()
ComboBoxBase
popup/display being shown.getOnShowing()
,
#setOnShowing()
public final void setOnShowing(<any> value)
public final <any> getOnShowing()
public final <any> onShownProperty()
ComboBoxBase
popup/display is shown.getOnShown()
,
#setOnShown()
public final void setOnShown(<any> value)
public final <any> getOnShown()
public final <any> onHidingProperty()
ComboBox
popup/display being hidden.getOnHiding()
,
#setOnHiding()
public final void setOnHiding(<any> value)
public final <any> getOnHiding()
public final <any> onHiddenProperty()
ComboBoxBase
popup/display has been hidden.getOnHidden()
,
#setOnHidden()
public final void setOnHidden(<any> value)
public final <any> 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()
.
Note: This function is intended to be used by experts, primarily
by those implementing new Skins or Behaviors. It is not common
for developers or designers to access this function directly.public java.lang.Object queryAccessibleAttribute(AccessibleAttribute attribute, java.lang.Object... parameters)
queryAccessibleAttribute
in class Control
public void executeAccessibleAction(AccessibleAction action, java.lang.Object... parameters)
executeAccessibleAction
in class Control