Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > afb4c294e8f553dc8d6909c852dc1564 > files > 882

java-1.8.0-openjfx-1.8.0.76-1.b04.1.1.mga5.i586.rpm

<!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 Wed Apr 06 14:51:53 UTC 2016 -->
<title>SelectionModel (JavaFX 8)</title>
<meta name="date" content="2016-04-06">
<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="SelectionModel (JavaFX 8)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":10,"i1":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var methods = {"i0":6,"i1":6,"i2":6,"i3":10,"i4":10,"i5":6,"i6":6,"i7":6,"i8":6,"i9":10,"i10":10,"i11":6,"i12":6,"i13":6,"i14":6,"i15":10,"i16":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/SelectionModel.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&nbsp;8</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javafx/scene/control/SelectionMode.html" title="enum in javafx.scene.control"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javafx/scene/control/Separator.html" title="class in javafx.scene.control"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javafx/scene/control/SelectionModel.html" target="_top">Frames</a></li>
<li><a href="SelectionModel.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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 SelectionModel" class="title">Class SelectionModel&lt;T&gt;</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>javafx.scene.control.SelectionModel&lt;T&gt;</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>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../javafx/scene/control/MultipleSelectionModel.html" title="class in javafx.scene.control">MultipleSelectionModel</a>, <a href="../../../javafx/scene/control/SingleSelectionModel.html" title="class in javafx.scene.control">SingleSelectionModel</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">SelectionModel&lt;T&gt;</span>
extends <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></pre>
<div class="block">SelectionModel is an abstract class used by UI controls to provide a
 consistent API for maintaining selection.</div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>JavaFX 2.0</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>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Property Summary table, listing properties, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Type</th>
<th class="colLast" scope="col">Property and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectedIndexProperty">selectedIndex</a></span></code>
<div class="block">Refers to the selected index property, which is used to indicate
 the currently selected index value in the selection model.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a>&lt;<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectedItemProperty">selectedItem</a></span></code>
<div class="block">Refers to the selected item property, which is used to indicate
 the currently selected item in the selection model.</div>
</td>
</tr>
</table>
</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">&nbsp;</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/SelectionModel.html#SelectionModel--">SelectionModel</a></span>()</code>
<div class="block">Creates a default SelectionModel 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">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</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>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#clearAndSelect-int-">clearAndSelect</a></span>(int&nbsp;index)</code>
<div class="block">A method that clears any selection prior to setting the selection to the
 given index.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.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>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#clearSelection-int-">clearSelection</a></span>(int&nbsp;index)</code>
<div class="block">This method will clear the selection of the item in the given index.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedIndex--">getSelectedIndex</a></span>()</code>
<div class="block">Returns the integer value indicating the currently selected index in
 this model.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedItem--">getSelectedItem</a></span>()</code>
<div class="block">Returns the currently selected object (which resides in the selected index
 position).</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.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>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#isSelected-int-">isSelected</a></span>(int&nbsp;index)</code>
<div class="block">Convenience method to inform if the given index is currently selected
 in this SelectionModel.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#select-int-">select</a></span>(int&nbsp;index)</code>
<div class="block">This will select the given index in the selection model, assuming the
 index is within the valid range (i.e.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#select-T-">select</a></span>(<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&nbsp;obj)</code>
<div class="block">This method will attempt to select the index that contains the given
 object.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectedIndexProperty--">selectedIndexProperty</a></span>()</code>
<div class="block">Refers to the selected index property, which is used to indicate
 the currently selected index value in the selection model.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a>&lt;<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectedItemProperty--">selectedItemProperty</a></span>()</code>
<div class="block">Refers to the selected item property, which is used to indicate
 the currently selected item in the selection model.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectFirst--">selectFirst</a></span>()</code>
<div class="block">This method will attempt to select the first index in the control.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectLast--">selectLast</a></span>()</code>
<div class="block">This method will attempt to select the last index in the control.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectNext--">selectNext</a></span>()</code>
<div class="block">This method will attempt to select the index directly after the current
 focused index.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#selectPrevious--">selectPrevious</a></span>()</code>
<div class="block">This method will attempt to select the index directly before the current
 focused index.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#setSelectedIndex-int-">setSelectedIndex</a></span>(int&nbsp;value)</code>
<div class="block">Sets the value of the property selectedIndex.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/SelectionModel.html#setSelectedItem-T-">setSelectedItem</a></span>(<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&nbsp;value)</code>
<div class="block">Sets the value of the property selectedItem.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;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">
<!-- ============ PROPERTY DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="property.detail">
<!--   -->
</a>
<h3>Property Detail</h3>
<a name="selectedIndexProperty">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectedIndex</h4>
<pre>public final&nbsp;<a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a> selectedIndexProperty</pre>
<div class="block"><p>Refers to the selected index property, which is used to indicate
 the currently selected index value in the selection model. The selected
 index is either -1,
 to represent that there is no selection, or an integer value that is within
 the range of the underlying data model size.

 <p>The selected index property is most commonly used when the selection
 model only allows single selection, but is equally applicable when in
 multiple selection mode. When in this mode, the selected index will always
 represent the last selection made.

 <p>Note that in the case of multiple selection, it is possible to add
 a <a href="../../../javafx/collections/ListChangeListener.html" title="interface in javafx.collections"><code>ListChangeListener</code></a> to the collection returned by
 <a href="../../../javafx/scene/control/MultipleSelectionModel.html#getSelectedIndices--"><code>MultipleSelectionModel.getSelectedIndices()</code></a> to be informed whenever
 the selection changes, and this will also work in the case of single selection.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedIndex--"><code>getSelectedIndex()</code></a>, 
<a href="../../../javafx/scene/control/SelectionModel.html#setSelectedIndex-int-"><code>setSelectedIndex(int)</code></a></dd>
</dl>
</li>
</ul>
<a name="selectedItemProperty">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>selectedItem</h4>
<pre>public final&nbsp;<a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a>&lt;<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&gt; selectedItemProperty</pre>
<div class="block"><p>Refers to the selected item property, which is used to indicate
 the currently selected item in the selection model. The selected item is
 either null,
 to represent that there is no selection, or an Object that is retrieved
 from the underlying data model of the control the selection model is
 associated with.

 <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.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedItem--"><code>getSelectedItem()</code></a>, 
<a href="../../../javafx/scene/control/SelectionModel.html#setSelectedItem-T-"><code>setSelectedItem(T)</code></a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="SelectionModel--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SelectionModel</h4>
<pre>public&nbsp;SelectionModel()</pre>
<div class="block">Creates a default SelectionModel 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="selectedIndexProperty--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectedIndexProperty</h4>
<pre>public final&nbsp;<a href="../../../javafx/beans/property/ReadOnlyIntegerProperty.html" title="class in javafx.beans.property">ReadOnlyIntegerProperty</a>&nbsp;selectedIndexProperty()</pre>
<div class="block"><p>Refers to the selected index property, which is used to indicate
 the currently selected index value in the selection model. The selected
 index is either -1,
 to represent that there is no selection, or an integer value that is within
 the range of the underlying data model size.

 <p>The selected index property is most commonly used when the selection
 model only allows single selection, but is equally applicable when in
 multiple selection mode. When in this mode, the selected index will always
 represent the last selection made.

 <p>Note that in the case of multiple selection, it is possible to add
 a <a href="../../../javafx/collections/ListChangeListener.html" title="interface in javafx.collections"><code>ListChangeListener</code></a> to the collection returned by
 <a href="../../../javafx/scene/control/MultipleSelectionModel.html#getSelectedIndices--"><code>MultipleSelectionModel.getSelectedIndices()</code></a> to be informed whenever
 the selection changes, and this will also work in the case of single selection.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedIndex--"><code>getSelectedIndex()</code></a>, 
<a href="../../../javafx/scene/control/SelectionModel.html#setSelectedIndex-int-"><code>setSelectedIndex(int)</code></a></dd>
</dl>
</li>
</ul>
<a name="setSelectedIndex-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSelectedIndex</h4>
<pre>protected final&nbsp;void&nbsp;setSelectedIndex(int&nbsp;value)</pre>
<div class="block">Sets the value of the property selectedIndex.</div>
<dl>
<dt><span class="simpleTagLabel">Property description:</span></dt>
<dd><p>Refers to the selected index property, which is used to indicate
 the currently selected index value in the selection model. The selected
 index is either -1,
 to represent that there is no selection, or an integer value that is within
 the range of the underlying data model size.

 <p>The selected index property is most commonly used when the selection
 model only allows single selection, but is equally applicable when in
 multiple selection mode. When in this mode, the selected index will always
 represent the last selection made.

 <p>Note that in the case of multiple selection, it is possible to add
 a <a href="../../../javafx/collections/ListChangeListener.html" title="interface in javafx.collections"><code>ListChangeListener</code></a> to the collection returned by
 <a href="../../../javafx/scene/control/MultipleSelectionModel.html#getSelectedIndices--"><code>MultipleSelectionModel.getSelectedIndices()</code></a> to be informed whenever
 the selection changes, and this will also work in the case of single selection.</dd>
</dl>
</li>
</ul>
<a name="getSelectedIndex--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSelectedIndex</h4>
<pre>public final&nbsp;int&nbsp;getSelectedIndex()</pre>
<div class="block"><p>Returns the integer value indicating the currently selected index in
 this model. If there are multiple items selected, this will return the
 most recent selection made.

 <p>Note that the returned value is a snapshot in time - if you wish to
 observe the selection model for changes to the selected index, you can
 add a ChangeListener as such:

 <pre><code>
 SelectionModel sm = ...;
 InvalidationListener listener = ...;
 sm.selectedIndexProperty().addListener(listener);
 </code></pre></div>
</li>
</ul>
<a name="selectedItemProperty--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectedItemProperty</h4>
<pre>public final&nbsp;<a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a>&lt;<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&gt;&nbsp;selectedItemProperty()</pre>
<div class="block"><p>Refers to the selected item property, which is used to indicate
 the currently selected item in the selection model. The selected item is
 either null,
 to represent that there is no selection, or an Object that is retrieved
 from the underlying data model of the control the selection model is
 associated with.

 <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.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../javafx/scene/control/SelectionModel.html#getSelectedItem--"><code>getSelectedItem()</code></a>, 
<a href="../../../javafx/scene/control/SelectionModel.html#setSelectedItem-T-"><code>setSelectedItem(T)</code></a></dd>
</dl>
</li>
</ul>
<a name="setSelectedItem-java.lang.Object-">
<!--   -->
</a><a name="setSelectedItem-T-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSelectedItem</h4>
<pre>protected final&nbsp;void&nbsp;setSelectedItem(<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&nbsp;value)</pre>
<div class="block">Sets the value of the property selectedItem.</div>
<dl>
<dt><span class="simpleTagLabel">Property description:</span></dt>
<dd><p>Refers to the selected item property, which is used to indicate
 the currently selected item in the selection model. The selected item is
 either null,
 to represent that there is no selection, or an Object that is retrieved
 from the underlying data model of the control the selection model is
 associated with.

 <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.</dd>
</dl>
</li>
</ul>
<a name="getSelectedItem--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSelectedItem</h4>
<pre>public final&nbsp;<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&nbsp;getSelectedItem()</pre>
<div class="block">Returns the currently selected object (which resides in the selected index
 position). If there are multiple items selected, this will return the
 object contained at the index returned by getSelectedIndex() (which is
 always the index to the most recently selected item).

 <p>Note that the returned value is a snapshot in time - if you wish to
 observe the selection model for changes to the selected item, you can
 add a ChangeListener as such:

 <pre><code>
 SelectionModel sm = ...;
 InvalidationListener listener = ...;
 sm.selectedItemProperty().addListener(listener);
 </code></pre></div>
</li>
</ul>
<a name="clearAndSelect-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearAndSelect</h4>
<pre>public abstract&nbsp;void&nbsp;clearAndSelect(int&nbsp;index)</pre>
<div class="block">A method that clears any selection prior to setting the selection to the
 given index. The purpose of this method is to avoid having to call
 <a href="../../../javafx/scene/control/SelectionModel.html#clearSelection--"><code>clearSelection()</code></a> first, meaning that observers that are listening to
 the <a href="../../../javafx/scene/control/SelectionModel.html#selectedIndexProperty--"><code>selected index</code></a> property will not
 see the selected index being temporarily set to -1.</div>
<dl>
<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-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>select</h4>
<pre>public abstract&nbsp;void&nbsp;select(int&nbsp;index)</pre>
<div class="block"><p>This will select the given index in the selection model, assuming the
 index is within the valid range (i.e. greater than or equal to zero, and
 less than the total number of items in the underlying data model).

 <p>If there is already one or more indices selected in this model, calling
 this method will <b>not</b> clear these selections - to do so it is
 necessary to first call <a href="../../../javafx/scene/control/SelectionModel.html#clearSelection--"><code>clearSelection()</code></a>.

 <p>If the index is already selected, it will not be selected again, or
 unselected. However, if multiple selection is implemented, then calling
 select on an already selected index will have the effect of making the index
 the new selected index (as returned by <a href="../../../javafx/scene/control/SelectionModel.html#getSelectedIndex--"><code>getSelectedIndex()</code></a>.</div>
<dl>
<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="select-java.lang.Object-">
<!--   -->
</a><a name="select-T-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>select</h4>
<pre>public abstract&nbsp;void&nbsp;select(<a href="../../../javafx/scene/control/SelectionModel.html" title="type parameter in SelectionModel">T</a>&nbsp;obj)</pre>
<div class="block"><p>This method will attempt to select the index that contains the given
 object. It will iterate through the underlying data model until it finds
 an item whose value is equal to the given object. At this point it will
 stop iterating - this means that this method will not select multiple
 indices.</div>
<dl>
<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="clearSelection-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearSelection</h4>
<pre>public abstract&nbsp;void&nbsp;clearSelection(int&nbsp;index)</pre>
<div class="block"><p>This method will clear the selection of the item in the given index.
 If the given index is not selected, nothing will happen.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The selected item to deselect.</dd>
</dl>
</li>
</ul>
<a name="clearSelection--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearSelection</h4>
<pre>public abstract&nbsp;void&nbsp;clearSelection()</pre>
<div class="block"><p>Clears the selection model of all selected indices.</div>
</li>
</ul>
<a name="isSelected-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSelected</h4>
<pre>public abstract&nbsp;boolean&nbsp;isSelected(int&nbsp;index)</pre>
<div class="block"><p>Convenience method to inform if the given index is currently selected
 in this SelectionModel. Is functionally equivalent to calling
 <code>getSelectedIndices().contains(index)</code>.</div>
<dl>
<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="isEmpty--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public abstract&nbsp;boolean&nbsp;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="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="selectPrevious--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectPrevious</h4>
<pre>public abstract&nbsp;void&nbsp;selectPrevious()</pre>
<div class="block"><p>This method will attempt to select the index directly before the current
 focused index. If clearSelection is not called first, this method
 will have the result of selecting the previous index, whilst retaining
 the selection of any other currently selected indices.</p>

 <p>Calling this method will only succeed if:</p>

 <ul>
   <li>There is currently a lead/focused index.
   <li>The lead/focus index is not the first index in the control.
   <li>The previous index is not already selected.
 </ul>

 <p>If any of these conditions is false, no selection event will take
 place.</p></div>
</li>
</ul>
<a name="selectNext--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectNext</h4>
<pre>public abstract&nbsp;void&nbsp;selectNext()</pre>
<div class="block"><p>This method will attempt to select the index directly after the current
 focused index. If clearSelection is not called first, this method
 will have the result of selecting the next index, whilst retaining
 the selection of any other currently selected indices.</p>

 <p>Calling this method will only succeed if:</p>

 <ul>
   <li>There is currently a lead/focused index.
   <li>The lead/focus index is not the last index in the control.
   <li>The next index is not already selected.
 </ul>

 <p>If any of these conditions is false, no selection event will take
 place.</p></div>
</li>
</ul>
<a name="selectFirst--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectFirst</h4>
<pre>public abstract&nbsp;void&nbsp;selectFirst()</pre>
<div class="block"><p>This method will attempt to select the first index in the control. If
 clearSelection is not called first, this method
 will have the result of selecting the first index, whilst retaining
 the selection of any other currently selected indices.</p>

 <p>If the first index is already selected, calling this method will have
 no result, and no selection event will take place.</p></div>
</li>
</ul>
<a name="selectLast--">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>selectLast</h4>
<pre>public abstract&nbsp;void&nbsp;selectLast()</pre>
<div class="block"><p>This method will attempt to select the last index in the control. If
 clearSelection is not called first, this method
 will have the result of selecting the last index, whilst retaining
 the selection of any other currently selected indices.</p>

 <p>If the last index is already selected, calling this method will have
 no result, and no selection event will take place.</p></div>
</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/SelectionModel.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&nbsp;8</div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javafx/scene/control/SelectionMode.html" title="enum in javafx.scene.control"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../javafx/scene/control/Separator.html" title="class in javafx.scene.control"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javafx/scene/control/SelectionModel.html" target="_top">Frames</a></li>
<li><a href="SelectionModel.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</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>