Spec-Zone .ru
спецификации, руководства, описания, API
|
public class ChoiceBox<T> extends Control
ChoiceBox может быть сконфигурирован любой, чтобы поддерживать null
как допустимый выбор, или запретить это. В случае, что это запрещается, всегда будет некоторый элемент, который выбирается, пока есть по крайней мере один определенный элемент. По умолчанию никакой элемент не выбирается если иначе не определено. В случае это null
является приемлемым, запись значения по умолчанию может быть вставлена в список вариантов наверху, с именем, подобным "Ни одному", и локализовала для различных Локалей.
Хотя ChoiceBox только позволит пользователю выбирать из предопределенного списка, для разработчика возможно определить выбранный пункт, чтобы быть чем-то другим чем, что доступно в предопределенном списке. Это требуется для нескольких важных вариантов использования.
Это означает, что конфигурация ChoiceBox является независимым порядком. Можно или определить элементы и затем выбранный пункт, или можно определить выбранный пункт и затем элементы. Так или иначе будет функционировать правильно.
import javafx.scene.control.ChoiceBox; ChoiceBox cb = new ChoiceBox(); cb.getItems().addAll("item1", "item2", "item3");
Ввести | Свойство и Описание |
---|---|
ObjectProperty<ObservableList<T>> |
элементы
Элементы, чтобы вывести на экран в поле выбора.
|
ObjectProperty<SingleSelectionModel<T>> |
selectionModel
Модель выбора для ChoiceBox.
|
ReadOnlyBooleanProperty |
показ
Указывает, выводит ли выпадающее на экран список вариантов пользователю.
|
contextMenuProperty, heightProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, prefHeightProperty, prefWidthProperty, skinProperty, tooltipProperty, widthProperty
needsLayoutProperty
blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
USE_COMPUTED_SIZE, USE_PREF_SIZE
Конструктор и Описание |
---|
ChoiceBox()
Создайте новый ChoiceBox, у которого есть пустой список элементов.
|
ChoiceBox(ObservableList<T> items)
Создайте новый ChoiceBox с данным набором элементов.
|
Модификатор и Тип | Метод и Описание |
---|---|
ObservableList<T> |
getItems()
Элементы, чтобы вывести на экран в поле выбора.
|
SingleSelectionModel<T> |
getSelectionModel()
Модель выбора для ChoiceBox.
|
void |
hide()
Закрывает список вариантов.
|
boolean |
isShowing()
Указывает, выводит ли выпадающее на экран список вариантов пользователю.
|
ObjectProperty<ObservableList<T>> |
itemsProperty()
Элементы, чтобы вывести на экран в поле выбора.
|
ObjectProperty<SingleSelectionModel<T>> |
selectionModelProperty()
Модель выбора для ChoiceBox.
|
void |
setItems(ObservableList<T> value)
Элементы, чтобы вывести на экран в поле выбора.
|
void |
setSelectionModel(SingleSelectionModel<T> value)
Модель выбора для ChoiceBox.
|
void |
show()
Открывает список вариантов.
|
ReadOnlyBooleanProperty |
showingProperty()
Указывает, выводит ли выпадающее на экран список вариантов пользователю.
|
computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, contextMenuProperty, getBaselineOffset, getContextMenu, getHeight, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getPrefHeight, getPrefWidth, getSkin, getTooltip, getUserAgentStylesheet, getWidth, heightProperty, intersects, isResizable, layoutChildren, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, setContextMenu, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setPrefHeight, setPrefSize, setPrefWidth, setSkin, setTooltip, setWidth, skinProperty, tooltipProperty, widthProperty
getChildren, getChildrenUnmodifiable, getManagedChildren, isNeedsLayout, layout, lookup, needsLayoutProperty, requestLayout, setNeedsLayout
addEventFilter, addEventHandler, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectProperty, eventDispatcherProperty, fireEvent, focusedProperty, focusTraversableProperty, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragged, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnScroll, getOpacity, getParent, getProperties, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getUserData, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToScene, localToScene, localToScene, lookupAll, managedProperty, mouseTransparentProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDraggedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onScrollProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragged, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnScroll, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, startDragAndDrop, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, visibleProperty
isShowing()
getItems()
, setItems(ObservableList)
public ChoiceBox()
public ChoiceBox(ObservableList<T> items)
items
- public final void setSelectionModel(SingleSelectionModel<T> value)
public final SingleSelectionModel<T> getSelectionModel()
public final ObjectProperty<SingleSelectionModel<T>> selectionModelProperty()
public final boolean isShowing()
public final ReadOnlyBooleanProperty showingProperty()
isShowing()
public final void setItems(ObservableList<T> value)
public final ObservableList<T> getItems()
public final ObjectProperty<ObservableList<T>> itemsProperty()
getItems()
, setItems(ObservableList)
public void show()
public void hide()
Copyright (c) 2008, 2011, Oracle и/или его филиалы. Все права защищены. Использование подвергается