< prev index next >

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

Print this page

        

*** 99,108 **** --- 99,109 ---- /** * Returns the number of items in the data model that underpins the control. * An example would be that a ListView focus model would likely return * <code>listView.getItems().size()</code>. The valid range of focusable * indices is between 0 and whatever is returned by this method. + * @return the number of items in the data model that underpins the control */ protected abstract int getItemCount(); /** * Returns the item at the given index. An example using ListView would be
*** 132,142 **** /** * Causes the item at the given index to receive the focus. This does not * cause the current selection to change. Updates the focusedItem and * focusedIndex properties such that <code>focusedIndex = -1</code> unless ! * <code>0 <= index < model size</code>. * * @param index The index of the item to get focus. */ public void focus(int index) { if (index < 0 || index >= getItemCount()) { --- 133,143 ---- /** * Causes the item at the given index to receive the focus. This does not * cause the current selection to change. Updates the focusedItem and * focusedIndex properties such that <code>focusedIndex = -1</code> unless ! * <code>0 &lt;= index &lt; model size</code>. * * @param index The index of the item to get focus. */ public void focus(int index) { if (index < 0 || index >= getItemCount()) {
< prev index next >