< prev index next >

modules/javafx.controls/src/main/java/javafx/scene/control/SelectionModel.java

Print this page

        

*** 60,69 **** --- 60,70 ---- * * <p>Note that in the case of multiple selection, it is possible to add * a {@link ListChangeListener} to the collection returned by * {@link MultipleSelectionModel#getSelectedIndices()} to be informed whenever * the selection changes, and this will also work in the case of single selection. + * @return the selected index property */ public final ReadOnlyIntegerProperty selectedIndexProperty() { return selectedIndex.getReadOnlyProperty(); } private ReadOnlyIntegerWrapper selectedIndex = new ReadOnlyIntegerWrapper(this, "selectedIndex", -1); protected final void setSelectedIndex(int value) { selectedIndex.set(value); }
*** 79,88 **** --- 80,90 ---- * <pre><code> * SelectionModel sm = ...; * InvalidationListener listener = ...; * sm.selectedIndexProperty().addListener(listener); * </code></pre> + * @return the selected index */ public final int getSelectedIndex() { return selectedIndexProperty().get(); } /** * <p>Refers to the selected item property, which is used to indicate
*** 94,103 **** --- 96,106 ---- * * <p>The selected item property is most commonly used when the selection * model is set to be single selection, but is equally applicable when in * multiple selection mode. When in this mode, the selected item will always * represent the last selection made. + * @return the selected item property */ public final ReadOnlyObjectProperty<T> selectedItemProperty() { return selectedItem.getReadOnlyProperty(); } private ReadOnlyObjectWrapper<T> selectedItem = new ReadOnlyObjectWrapper<T>(this, "selectedItem"); protected final void setSelectedItem(T value) { selectedItem.set(value); }
*** 114,123 **** --- 117,127 ---- * <pre><code> * SelectionModel sm = ...; * InvalidationListener listener = ...; * sm.selectedItemProperty().addListener(listener); * </code></pre> + * @return the selected item */ public final T getSelectedItem() { return selectedItemProperty().get(); } /***************************************************************************
< prev index next >