<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_77) on Fri Apr 22 13:46:39 UTC 2016 --> <title>SingleSelectionModel (JavaFX 8)</title> <meta name="date" content="2016-04-22"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="SingleSelectionModel (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":6,"i4":6,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SingleSelectionModel.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/control/SeparatorMenuItem.html" title="class in javafx.scene.control"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/control/Skin.html" title="interface in javafx.scene.control"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/control/SingleSelectionModel.html" target="_top">Frames</a></li> <li><a href="SingleSelectionModel.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javafx.scene.control</div> <h2 title="Class SingleSelectionModel" class="title">Class SingleSelectionModel<T></h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">javafx.scene.control.SelectionModel</a><T></li> <li> <ul class="inheritance"> <li>javafx.scene.control.SingleSelectionModel<T></li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the item contained in the control that can be selected.</dd> </dl> <hr> <br> <pre>public abstract class <span class="typeNameLabel">SingleSelectionModel<T></span> extends <a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><T></pre> <div class="block">A SelectionModel which enforces the requirement that only a single index be selected at any given time. This class exists for controls that allow for pluggable selection models, but which do not allow for multiple selection. A good example is the <a href="../../../javafx/scene/control/ChoiceBox.html" title="class in javafx.scene.control"><code>ChoiceBox</code></a> control. Conversely, most other controls (<a href="../../../javafx/scene/control/ListView.html" title="class in javafx.scene.control"><code>ListView</code></a>, <a href="../../../javafx/scene/control/TreeView.html" title="class in javafx.scene.control"><code>TreeView</code></a>, <a href="../../../javafx/scene/control/TableView.html" title="class in javafx.scene.control"><code>TableView</code></a>, etc) require <a href="../../../javafx/scene/control/MultipleSelectionModel.html" title="class in javafx.scene.control"><code>MultipleSelectionModel</code></a> implementations (although MultipleSelectionModel does still allow for single selection to be set via the <a href="../../../javafx/scene/control/MultipleSelectionModel.html#selectionModeProperty--"><code>selectionMode</code></a> property).</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 2.0</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control"><code>SelectionModel</code></a>, <a href="../../../javafx/scene/control/MultipleSelectionModel.html" title="class in javafx.scene.control"><code>MultipleSelectionModel</code></a>, <a href="../../../javafx/scene/control/SelectionMode.html" title="enum in javafx.scene.control"><code>SelectionMode</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== PROPERTY SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="property.summary"> <!-- --> </a> <h3>Property Summary</h3> <ul class="blockList"> <li class="blockList"><a name="properties.inherited.from.class.javafx.scene.control.SelectionModel"> <!-- --> </a> <h3>Properties inherited from class javafx.scene.control.<a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a></h3> <code><a href="../../../javafx/scene/control/SelectionModel.html#selectedIndexProperty">selectedIndex</a>, <a href="../../../javafx/scene/control/SelectionModel.html#selectedItemProperty">selectedItem</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#SingleSelectionModel--">SingleSelectionModel</a></span>()</code> <div class="block">Creates a default SingleSelectionModel instance.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#clearAndSelect-int-">clearAndSelect</a></span>(int index)</code> <div class="block">In the SingleSelectionModel, this method is functionally equivalent to calling <code>select(index)</code>, as only one selection is allowed at a time.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#clearSelection--">clearSelection</a></span>()</code> <div class="block">Clears the selection model of all selected indices.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#clearSelection-int-">clearSelection</a></span>(int index)</code> <div class="block">Clears the selection of the given index, if it is currently selected.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>protected abstract int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#getItemCount--">getItemCount</a></span>()</code> <div class="block">Gets the number of items available for the selection model.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>protected abstract <a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#getModelItem-int-">getModelItem</a></span>(int index)</code> <div class="block">Gets the data model item associated with a specific index.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#isEmpty--">isEmpty</a></span>()</code> <div class="block">This method is available to test whether there are any selected indices/items.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#isSelected-int-">isSelected</a></span>(int index)</code> <div class="block">This method will return true if the given index is the currently selected index in this SingleSelectionModel.</code>.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#select-int-">select</a></span>(int index)</code> <div class="block">Selects the given index.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#select-T-">select</a></span>(<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a> obj)</code> <div class="block">Selects the index for the first instance of given object in the underlying data model.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#selectFirst--">selectFirst</a></span>()</code> <div class="block">Selects the first index.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#selectLast--">selectLast</a></span>()</code> <div class="block">Selects the last index.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#selectNext--">selectNext</a></span>()</code> <div class="block">Selects the next index.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SingleSelectionModel.html#selectPrevious--">selectPrevious</a></span>()</code> <div class="block">Selects the previous index.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.javafx.scene.control.SelectionModel"> <!-- --> </a> <h3>Methods inherited from class javafx.scene.control.<a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a></h3> <code><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedIndex--">getSelectedIndex</a>, <a href="../../../javafx/scene/control/SelectionModel.html#getSelectedItem--">getSelectedItem</a>, <a href="../../../javafx/scene/control/SelectionModel.html#selectedIndexProperty--">selectedIndexProperty</a>, <a href="../../../javafx/scene/control/SelectionModel.html#selectedItemProperty--">selectedItemProperty</a>, <a href="../../../javafx/scene/control/SelectionModel.html#setSelectedIndex-int-">setSelectedIndex</a>, <a href="../../../javafx/scene/control/SelectionModel.html#setSelectedItem-T-">setSelectedItem</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="SingleSelectionModel--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>SingleSelectionModel</h4> <pre>public SingleSelectionModel()</pre> <div class="block">Creates a default SingleSelectionModel instance.</div> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="clearSelection--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>clearSelection</h4> <pre>public void clearSelection()</pre> <div class="block"><p>Clears the selection model of all selected indices.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#clearSelection--">clearSelection</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> </dl> </li> </ul> <a name="clearSelection-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>clearSelection</h4> <pre>public void clearSelection(int index)</pre> <div class="block">Clears the selection of the given index, if it is currently selected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#clearSelection-int-">clearSelection</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - The selected item to deselect.</dd> </dl> </li> </ul> <a name="isEmpty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isEmpty</h4> <pre>public boolean isEmpty()</pre> <div class="block">This method is available to test whether there are any selected indices/items. It will return true if there are <b>no</b> selected items, and false if there are.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#isEmpty--">isEmpty</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Will return true if there are <b>no</b> selected items, and false if there are.</dd> </dl> </li> </ul> <a name="isSelected-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isSelected</h4> <pre>public boolean isSelected(int index)</pre> <div class="block"><p>This method will return true if the given index is the currently selected index in this SingleSelectionModel.</code>.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#isSelected-int-">isSelected</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - The index to check as to whether it is currently selected or not.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>True if the given index is selected, false otherwise.</dd> </dl> </li> </ul> <a name="clearAndSelect-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>clearAndSelect</h4> <pre>public void clearAndSelect(int index)</pre> <div class="block">In the SingleSelectionModel, this method is functionally equivalent to calling <code>select(index)</code>, as only one selection is allowed at a time.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#clearAndSelect-int-">clearAndSelect</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - The index that should be the only selected index in this selection model.</dd> </dl> </li> </ul> <a name="select-java.lang.Object-"> <!-- --> </a><a name="select-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>select</h4> <pre>public void select(<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a> obj)</pre> <div class="block">Selects the index for the first instance of given object in the underlying data model. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#select-T-">select</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>obj</code> - The object to attempt to select in the underlying data model.</dd> </dl> </li> </ul> <a name="select-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>select</h4> <pre>public void select(int index)</pre> <div class="block">Selects the given index. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#select-int-">select</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - The position of the item to select in the selection model.</dd> </dl> </li> </ul> <a name="selectPrevious--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>selectPrevious</h4> <pre>public void selectPrevious()</pre> <div class="block">Selects the previous index. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#selectPrevious--">selectPrevious</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> </dl> </li> </ul> <a name="selectNext--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>selectNext</h4> <pre>public void selectNext()</pre> <div class="block">Selects the next index. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#selectNext--">selectNext</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> </dl> </li> </ul> <a name="selectFirst--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>selectFirst</h4> <pre>public void selectFirst()</pre> <div class="block">Selects the first index. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#selectFirst--">selectFirst</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> </dl> </li> </ul> <a name="selectLast--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>selectLast</h4> <pre>public void selectLast()</pre> <div class="block">Selects the last index. Since the SingleSelectionModel can only support having a single index selected at a time, this also causes any previously selected index to be unselected.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/scene/control/SelectionModel.html#selectLast--">selectLast</a></code> in class <code><a href="../../../javafx/scene/control/SelectionModel.html" title="class in javafx.scene.control">SelectionModel</a><<a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a>></code></dd> </dl> </li> </ul> <a name="getModelItem-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getModelItem</h4> <pre>protected abstract <a href="../../../javafx/scene/control/SingleSelectionModel.html" title="type parameter in SingleSelectionModel">T</a> getModelItem(int index)</pre> <div class="block">Gets the data model item associated with a specific index.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - The position of the item in the underlying data model.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The item that exists at the given index.</dd> </dl> </li> </ul> <a name="getItemCount--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>getItemCount</h4> <pre>protected abstract int getItemCount()</pre> <div class="block">Gets the number of items available for the selection model. If the number of items can change dynamically, it is the responsibility of the concrete SingleSelectionModel implementation to ensure that items are selected or unselected as appropriate as the items change.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>A number greater than or equal to 0.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/SingleSelectionModel.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">JavaFX 8</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javafx/scene/control/SeparatorMenuItem.html" title="class in javafx.scene.control"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/control/Skin.html" title="interface in javafx.scene.control"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/control/SingleSelectionModel.html" target="_top">Frames</a></li> <li><a href="SingleSelectionModel.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><small><a href="https://docs.oracle.com/javase/8/docs/legal/cpyr.html">Copyright</a> (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.</small></small></p> </body> </html>