<!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:45 UTC 2016 --> <title>TreeItem (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="TreeItem (JavaFX 8)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":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":10,"i1":9,"i2":9,"i3":10,"i4":9,"i5":9,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":9,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":9,"i27":9,"i28":10}; var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance 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/TreeItem.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/TreeCell.html" title="class in javafx.scene.control"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/control/TreeItem.html" target="_top">Frames</a></li> <li><a href="TreeItem.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><a href="#nested.class.summary">Nested</a> | </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 TreeItem" class="title">Class TreeItem<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>javafx.scene.control.TreeItem<T></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 <a href="../../../javafx/scene/control/TreeItem.html#getValue--"><code>value</code></a> property within TreeItem.</dd> </dl> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a></dd> </dl> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../javafx/scene/control/CheckBoxTreeItem.html" title="class in javafx.scene.control">CheckBoxTreeItem</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">TreeItem<T></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> implements <a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a></pre> <div class="block">The model for a single node supplying a hierarchy of values to a control such as TreeView. The model may be implemented such that values may be loaded in memory as they are needed. <p> The model allows registration of listeners which will be notified as the number of items changes, their position or if the values themselves change. Note however that a TreeItem is <b>not</b> a Node, and therefore no visual events will be fired on the TreeItem. To get these events, it is necessary to add relevant observers to the TreeCell instances (via a custom cell factory - see the <a href="../../../javafx/scene/control/Cell.html" title="class in javafx.scene.control"><code>Cell</code></a> class documentation for more details). <p>In the simplest case, TreeItem instances may be created in memory as such: <pre><code> TreeItem<String> root = new TreeItem<String>("Root Node"); root.setExpanded(true); root.getChildren().addAll( new TreeItem<String>("Item 1"), new TreeItem<String>("Item 2"), new TreeItem<String>("Item 3") ); TreeView<String> treeView = new TreeView<String>(root); </code></pre> This approach works well for simple tree structures, or when the data is not excessive (so that it can easily fit in memory). In situations where the size of the tree structure is unknown (and therefore potentially huge), there is the option of creating TreeItem instances on-demand in a memory-efficient way. To demonstrate this, the code below creates a file system browser: <pre><code> private TreeView buildFileSystemBrowser() { TreeItem<File> root = createNode(new File("/")); return new TreeView<File>(root); } // This method creates a TreeItem to represent the given File. It does this // by overriding the TreeItem.getChildren() and TreeItem.isLeaf() methods // anonymously, but this could be better abstracted by creating a // 'FileTreeItem' subclass of TreeItem. However, this is left as an exercise // for the reader. private TreeItem<File> createNode(final File f) { return new TreeItem<File>(f) { // We cache whether the File is a leaf or not. A File is a leaf if // it is not a directory and does not have any files contained within // it. We cache this as isLeaf() is called often, and doing the // actual check on File is expensive. private boolean isLeaf; // We do the children and leaf testing only once, and then set these // booleans to false so that we do not check again during this // run. A more complete implementation may need to handle more // dynamic file system situations (such as where a folder has files // added after the TreeView is shown). Again, this is left as an // exercise for the reader. private boolean isFirstTimeChildren = true; private boolean isFirstTimeLeaf = true; @Override public ObservableList<TreeItem<File>> getChildren() { if (isFirstTimeChildren) { isFirstTimeChildren = false; // First getChildren() call, so we actually go off and // determine the children of the File contained in this TreeItem. super.getChildren().setAll(buildChildren(this)); } return super.getChildren(); } @Override public boolean isLeaf() { if (isFirstTimeLeaf) { isFirstTimeLeaf = false; File f = (File) getValue(); isLeaf = f.isFile(); } return isLeaf; } private ObservableList<TreeItem<File>> buildChildren(TreeItem<File> TreeItem) { File f = TreeItem.getValue(); if (f != null && f.isDirectory()) { File[] files = f.listFiles(); if (files != null) { ObservableList<TreeItem<File>> children = FXCollections.observableArrayList(); for (File childFile : files) { children.add(createNode(childFile)); } return children; } } return FXCollections.emptyObservableList(); } }; }</code></pre> <strong>TreeItem Events</strong> <p>TreeItem supports the same event bubbling concept as elsewhere in the scenegraph. This means that it is not necessary to listen for events on all TreeItems (and this is certainly not encouraged!). A better, and far more low cost solution is to instead attach event listeners to the TreeView <a href="../../../javafx/scene/control/TreeView.html#rootProperty--"><code>root</code></a> item. As long as there is a path between where the event occurs and the root TreeItem, the event will be bubbled to the root item. <p>It is important to note however that a TreeItem is <strong>not</strong> a Node, which means that only the event types defined in TreeItem will be delivered. To listen to general events (for example mouse interactions), it is necessary to add the necessary listeners to the <a href="../../../javafx/scene/control/Cell.html" title="class in javafx.scene.control"><code>cells</code></a> contained within the TreeView (by providing a <a href="../../../javafx/scene/control/TreeView.html#cellFactoryProperty--"><code>cell factory</code></a>). <p>The TreeItem class defines a number of events, with a defined hierarchy. These are shown below (follow the links to learn more about each event type): <ul> <li><a href="../../../javafx/scene/control/TreeItem.html#treeNotificationEvent--"><code>TreeItem.treeNotificationEvent()</code></a></li> <ul> <li><a href="../../../javafx/scene/control/TreeItem.html#valueChangedEvent--"><code>TreeItem.valueChangedEvent()</code></a></li> <li><a href="../../../javafx/scene/control/TreeItem.html#graphicChangedEvent--"><code>TreeItem.graphicChangedEvent()</code></a></li> <li><code>TreeItem.treeItemCountChangeEvent()</code></li> <ul> <li><a href="../../../javafx/scene/control/TreeItem.html#branchExpandedEvent--"><code>TreeItem.branchExpandedEvent()</code></a></li> <li><a href="../../../javafx/scene/control/TreeItem.html#branchCollapsedEvent--"><code>TreeItem.branchCollapsedEvent()</code></a></li> <li><a href="../../../javafx/scene/control/TreeItem.html#childrenModificationEvent--"><code>TreeItem.childrenModificationEvent()</code></a></li> </ul> </ul> </ul> <p>The indentation shown above signifies the relationship between event types. For example, all TreeItem event types have <a href="../../../javafx/scene/control/TreeItem.html#treeNotificationEvent--"><code>treeNotificationEvent()</code></a> as their parent event type, and the branch <a href="../../../javafx/scene/control/TreeItem.html#branchExpandedEvent--"><code>expand</code></a> / <a href="../../../javafx/scene/control/TreeItem.html#branchCollapsedEvent--"><code>collapse</code></a> event types are both <a href="../../../javafx/scene/control/TreeItem.html#treeNotificationEvent--"><code>treeNotificationEvent()</code></a>. For performance reasons, it is encouraged to listen to only the events you need to listen to. This means that it is encouraged that it is better to listen to, for example, <a href="../../../javafx/scene/control/TreeItem.html#valueChangedEvent--"><code>TreeItem.valueChangedEvent()</code></a>, rather than <a href="../../../javafx/scene/control/TreeItem.html#treeNotificationEvent--"><code>TreeItem.treeNotificationEvent()</code></a>.</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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance 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">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/BooleanProperty.html" title="class in javafx.beans.property">BooleanProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#expandedProperty">expanded</a></span></code> <div class="block">The expanded state of this TreeItem.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#graphicProperty">graphic</a></span></code> <div class="block">The node that is generally shown to the left of the value property.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyBooleanProperty.html" title="class in javafx.beans.property">ReadOnlyBooleanProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#leafProperty">leaf</a></span></code> <div class="block">Represents the TreeItem leaf property, which is true if the TreeItem has no children.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#parentProperty">parent</a></span></code> <div class="block">A property that represents the parent of this TreeItem.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#valueProperty">value</a></span></code> <div class="block">A property representing the application-specific data contained within this TreeItem.</div> </td> </tr> </table> </li> </ul> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static class </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="type parameter in TreeItem.TreeModificationEvent">T</a>></span></code> <div class="block">An <a href="../../../javafx/event/Event.html" title="class in javafx.event"><code>Event</code></a> that contains relevant information for all forms of TreeItem modifications.</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"> </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/TreeItem.html#TreeItem--">TreeItem</a></span>()</code> <div class="block">Creates an empty TreeItem.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#TreeItem-T-">TreeItem</a></span>(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value)</code> <div class="block">Creates a TreeItem with the value property set to the provided object.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#TreeItem-T-javafx.scene.Node-">TreeItem</a></span>(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value, <a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a> graphic)</code> <div class="block">Creates a TreeItem with the value property set to the provided object, and the graphic set to the provided Node.</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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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="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><E extends <a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a>><br>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#addEventHandler-javafx.event.EventType-javafx.event.EventHandler-">addEventHandler</a></span>(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><E> eventType, <a href="../../../javafx/event/EventHandler.html" title="interface in javafx.event">EventHandler</a><E> eventHandler)</code> <div class="block">Registers an event handler to this TreeItem.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#branchCollapsedEvent--">branchCollapsedEvent</a></span>()</code> <div class="block">An EventType used when the TreeItem receives a modification to its expanded property, such that the TreeItem is now in the collapsed state.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#branchExpandedEvent--">branchExpandedEvent</a></span>()</code> <div class="block">An EventType used when the TreeItem receives a modification to its expanded property, such that the TreeItem is now in the expanded state.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/event/EventDispatchChain.html" title="interface in javafx.event">EventDispatchChain</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#buildEventDispatchChain-javafx.event.EventDispatchChain-">buildEventDispatchChain</a></span>(<a href="../../../javafx/event/EventDispatchChain.html" title="interface in javafx.event">EventDispatchChain</a> tail)</code> <div class="block">Construct an event dispatch chain for this target.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#childrenModificationEvent--">childrenModificationEvent</a></span>()</code> <div class="block">An EventType used when the TreeItem receives a direct modification to its children list.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#expandedItemCountChangeEvent--">expandedItemCountChangeEvent</a></span>()</code> <div class="block">The general EventType used when the TreeItem receives a modification that results in the number of children being visible changes.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/BooleanProperty.html" title="class in javafx.beans.property">BooleanProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#expandedProperty--">expandedProperty</a></span>()</code> <div class="block">The expanded state of this TreeItem.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/collections/ObservableList.html" title="interface in javafx.collections">ObservableList</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#getChildren--">getChildren</a></span>()</code> <div class="block">The children of this TreeItem.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#getGraphic--">getGraphic</a></span>()</code> <div class="block">Returns the node that is generally shown to the left of the value property.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#getParent--">getParent</a></span>()</code> <div class="block">The parent of this TreeItem.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#getValue--">getValue</a></span>()</code> <div class="block">Returns the application-specific data represented by this TreeItem.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#graphicChangedEvent--">graphicChangedEvent</a></span>()</code> <div class="block">An EventType used when the TreeItem receives a modification to its graphic property.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#graphicProperty--">graphicProperty</a></span>()</code> <div class="block">The node that is generally shown to the left of the value property.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#isExpanded--">isExpanded</a></span>()</code> <div class="block">Returns the expanded state of this TreeItem.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#isLeaf--">isLeaf</a></span>()</code> <div class="block">A TreeItem is a leaf if it has no children.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyBooleanProperty.html" title="class in javafx.beans.property">ReadOnlyBooleanProperty</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#leafProperty--">leafProperty</a></span>()</code> <div class="block">Represents the TreeItem leaf property, which is true if the TreeItem has no children.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#nextSibling--">nextSibling</a></span>()</code> <div class="block">Returns the next sibling of the TreeItem.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#nextSibling-javafx.scene.control.TreeItem-">nextSibling</a></span>(<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> afterNode)</code> <div class="block">Returns the next sibling after the given node.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#parentProperty--">parentProperty</a></span>()</code> <div class="block">A property that represents the parent of this TreeItem.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#previousSibling--">previousSibling</a></span>()</code> <div class="block">Returns the previous sibling of the TreeItem.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#previousSibling-javafx.scene.control.TreeItem-">previousSibling</a></span>(<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> beforeNode)</code> <div class="block">Returns the previous sibling after the given node.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code><E extends <a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a>><br>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#removeEventHandler-javafx.event.EventType-javafx.event.EventHandler-">removeEventHandler</a></span>(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><E> eventType, <a href="../../../javafx/event/EventHandler.html" title="interface in javafx.event">EventHandler</a><E> eventHandler)</code> <div class="block">Unregisters a previously registered event handler from this TreeItem.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#setExpanded-boolean-">setExpanded</a></span>(boolean value)</code> <div class="block">Sets the expanded state of this TreeItem.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#setGraphic-javafx.scene.Node-">setGraphic</a></span>(<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a> value)</code> <div class="block">Sets the node that is generally shown to the left of the value property.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#setValue-T-">setValue</a></span>(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value)</code> <div class="block">Sets the application-specific data represented by this TreeItem.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#toString--">toString</a></span>()</code> <div class="block">Returns a string representation of this <code>TreeItem</code> object.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#treeNotificationEvent--">treeNotificationEvent</a></span>()</code> <div class="block">The base EventType used to indicate that an event has occurred within a TreeItem.</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code>static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#valueChangedEvent--">valueChangedEvent</a></span>()</code> <div class="block">An EventType used when the TreeItem receives a modification to its value property.</div> </td> </tr> <tr id="i28" class="altColor"> <td class="colFirst"><code><a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javafx/scene/control/TreeItem.html#valueProperty--">valueProperty</a></span>()</code> <div class="block">A property representing the application-specific data contained within this TreeItem.</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 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#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="valueProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>value</h4> <pre>public final <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> valueProperty</pre> <div class="block">A property representing the application-specific data contained within this TreeItem.</div> </li> </ul> <a name="graphicProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>graphic</h4> <pre>public final <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a>> graphicProperty</pre> <div class="block">The node that is generally shown to the left of the value property. For best effect, this tends to be a 16x16 image.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#getGraphic--"><code>getGraphic()</code></a>, <a href="../../../javafx/scene/control/TreeItem.html#setGraphic-javafx.scene.Node-"><code>setGraphic(Node)</code></a></dd> </dl> </li> </ul> <a name="expandedProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>expanded</h4> <pre>public final <a href="../../../javafx/beans/property/BooleanProperty.html" title="class in javafx.beans.property">BooleanProperty</a> expandedProperty</pre> <div class="block">The expanded state of this TreeItem.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#isExpanded--"><code>isExpanded()</code></a>, <a href="../../../javafx/scene/control/TreeItem.html#setExpanded-boolean-"><code>setExpanded(boolean)</code></a></dd> </dl> </li> </ul> <a name="leafProperty"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>leaf</h4> <pre>public final <a href="../../../javafx/beans/property/ReadOnlyBooleanProperty.html" title="class in javafx.beans.property">ReadOnlyBooleanProperty</a> leafProperty</pre> <div class="block">Represents the TreeItem leaf property, which is true if the TreeItem has no children.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#isLeaf--"><code>isLeaf()</code></a></dd> </dl> </li> </ul> <a name="parentProperty"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>parent</h4> <pre>public final <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>> parentProperty</pre> <div class="block">A property that represents the parent of this TreeItem.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#getParent--"><code>getParent()</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="TreeItem--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>TreeItem</h4> <pre>public TreeItem()</pre> <div class="block">Creates an empty TreeItem.</div> </li> </ul> <a name="TreeItem-java.lang.Object-"> <!-- --> </a><a name="TreeItem-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>TreeItem</h4> <pre>public TreeItem(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value)</pre> <div class="block">Creates a TreeItem with the value property set to the provided object.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The object to be stored as the value of this TreeItem.</dd> </dl> </li> </ul> <a name="TreeItem-java.lang.Object-javafx.scene.Node-"> <!-- --> </a><a name="TreeItem-T-javafx.scene.Node-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>TreeItem</h4> <pre>public TreeItem(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value, <a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a> graphic)</pre> <div class="block">Creates a TreeItem with the value property set to the provided object, and the graphic set to the provided Node.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The object to be stored as the value of this TreeItem.</dd> <dd><code>graphic</code> - The Node to show in the TreeView next to this TreeItem.</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="treeNotificationEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>treeNotificationEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> treeNotificationEvent()</pre> <div class="block">The base EventType used to indicate that an event has occurred within a TreeItem. When an event occurs in a TreeItem, the event is fired to any listeners on the TreeItem that the event occurs, before it 'bubbles' up the TreeItem chain by following the TreeItem parent property. This repeats until a TreeItem whose parent TreeItem is null is reached At this point the event stops 'bubbling' and goes no further. This means that events that occur on a TreeItem can be relatively cheap, as a listener needs only be installed on the TreeView root node to be alerted of events happening at any point in the tree.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="expandedItemCountChangeEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>expandedItemCountChangeEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> expandedItemCountChangeEvent()</pre> <div class="block">The general EventType used when the TreeItem receives a modification that results in the number of children being visible changes. This is normally achieved via one of the sub-types of this EventType (see <a href="../../../javafx/scene/control/TreeItem.html#branchExpandedEvent--"><code>branchExpandedEvent()</code></a>, <a href="../../../javafx/scene/control/TreeItem.html#branchCollapsedEvent--"><code>branchCollapsedEvent()</code></a> and <a href="../../../javafx/scene/control/TreeItem.html#childrenModificationEvent--"><code>childrenModificationEvent()</code></a> for the three sub-types).</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaFX 8.0</dd> </dl> </li> </ul> <a name="branchExpandedEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>branchExpandedEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> branchExpandedEvent()</pre> <div class="block">An EventType used when the TreeItem receives a modification to its expanded property, such that the TreeItem is now in the expanded state.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="branchCollapsedEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>branchCollapsedEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> branchCollapsedEvent()</pre> <div class="block">An EventType used when the TreeItem receives a modification to its expanded property, such that the TreeItem is now in the collapsed state.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="childrenModificationEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>childrenModificationEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> childrenModificationEvent()</pre> <div class="block">An EventType used when the TreeItem receives a direct modification to its children list.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="valueChangedEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>valueChangedEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> valueChangedEvent()</pre> <div class="block">An EventType used when the TreeItem receives a modification to its value property.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="graphicChangedEvent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>graphicChangedEvent</h4> <pre>public static <T> <a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><<a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control">TreeItem.TreeModificationEvent</a><T>> graphicChangedEvent()</pre> <div class="block">An EventType used when the TreeItem receives a modification to its graphic property.</div> <dl> <dt><span class="paramLabel">Type Parameters:</span></dt> <dd><code>T</code> - The type of the value contained within the TreeItem.</dd> </dl> </li> </ul> <a name="setValue-java.lang.Object-"> <!-- --> </a><a name="setValue-T-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setValue</h4> <pre>public final void setValue(<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> value)</pre> <div class="block">Sets the application-specific data represented by this TreeItem.</div> </li> </ul> <a name="getValue--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getValue</h4> <pre>public final <a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a> getValue()</pre> <div class="block">Returns the application-specific data represented by this TreeItem.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the data represented by this TreeItem</dd> </dl> </li> </ul> <a name="valueProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>valueProperty</h4> <pre>public final <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> valueProperty()</pre> <div class="block">A property representing the application-specific data contained within this TreeItem.</div> </li> </ul> <a name="setGraphic-javafx.scene.Node-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setGraphic</h4> <pre>public final void setGraphic(<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a> value)</pre> <div class="block">Sets the node that is generally shown to the left of the value property. For best effect, this tends to be a 16x16 image.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The graphic node that will be displayed to the user.</dd> </dl> </li> </ul> <a name="getGraphic--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getGraphic</h4> <pre>public final <a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a> getGraphic()</pre> <div class="block">Returns the node that is generally shown to the left of the value property. For best effect, this tends to be a 16x16 image.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The graphic node that will be displayed to the user.</dd> </dl> </li> </ul> <a name="graphicProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>graphicProperty</h4> <pre>public final <a href="../../../javafx/beans/property/ObjectProperty.html" title="class in javafx.beans.property">ObjectProperty</a><<a href="../../../javafx/scene/Node.html" title="class in javafx.scene">Node</a>> graphicProperty()</pre> <div class="block">The node that is generally shown to the left of the value property. For best effect, this tends to be a 16x16 image.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#getGraphic--"><code>getGraphic()</code></a>, <a href="../../../javafx/scene/control/TreeItem.html#setGraphic-javafx.scene.Node-"><code>setGraphic(Node)</code></a></dd> </dl> </li> </ul> <a name="setExpanded-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setExpanded</h4> <pre>public final void setExpanded(boolean value)</pre> <div class="block">Sets the expanded state of this TreeItem. This has no effect on a TreeItem with no children. On a TreeItem with children however, the result of toggling this property is that visually the children will either become visible or hidden, based on whether expanded is set to true or false.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - If this TreeItem has children, calling setExpanded with <code>true</code> will result in the children becoming visible. Calling setExpanded with <code>false</code> will hide any children belonging to the TreeItem.</dd> </dl> </li> </ul> <a name="isExpanded--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isExpanded</h4> <pre>public final boolean isExpanded()</pre> <div class="block">Returns the expanded state of this TreeItem.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Returns the expanded state of this TreeItem.</dd> </dl> </li> </ul> <a name="expandedProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>expandedProperty</h4> <pre>public final <a href="../../../javafx/beans/property/BooleanProperty.html" title="class in javafx.beans.property">BooleanProperty</a> expandedProperty()</pre> <div class="block">The expanded state of this TreeItem.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#isExpanded--"><code>isExpanded()</code></a>, <a href="../../../javafx/scene/control/TreeItem.html#setExpanded-boolean-"><code>setExpanded(boolean)</code></a></dd> </dl> </li> </ul> <a name="isLeaf--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isLeaf</h4> <pre>public boolean isLeaf()</pre> <div class="block">A TreeItem is a leaf if it has no children. The isLeaf method may of course be overridden by subclasses to support alternate means of defining how a TreeItem may be a leaf, but the general premise is the same: a leaf can not be expanded by the user, and as such will not show a disclosure node or respond to expansion requests.</div> </li> </ul> <a name="leafProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>leafProperty</h4> <pre>public final <a href="../../../javafx/beans/property/ReadOnlyBooleanProperty.html" title="class in javafx.beans.property">ReadOnlyBooleanProperty</a> leafProperty()</pre> <div class="block">Represents the TreeItem leaf property, which is true if the TreeItem has no children.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#isLeaf--"><code>isLeaf()</code></a></dd> </dl> </li> </ul> <a name="getParent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getParent</h4> <pre>public final <a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> getParent()</pre> <div class="block">The parent of this TreeItem. Each TreeItem can have no more than one parent. If a TreeItem has no parent, it represents a root in the tree model.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The parent of this TreeItem, or null if the TreeItem has no parent.</dd> </dl> </li> </ul> <a name="parentProperty--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>parentProperty</h4> <pre>public final <a href="../../../javafx/beans/property/ReadOnlyObjectProperty.html" title="class in javafx.beans.property">ReadOnlyObjectProperty</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>> parentProperty()</pre> <div class="block">A property that represents the parent of this TreeItem.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javafx/scene/control/TreeItem.html#getParent--"><code>getParent()</code></a></dd> </dl> </li> </ul> <a name="getChildren--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getChildren</h4> <pre>public <a href="../../../javafx/collections/ObservableList.html" title="interface in javafx.collections">ObservableList</a><<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>>> getChildren()</pre> <div class="block">The children of this TreeItem. This method is called frequently, and it is therefore recommended that the returned list be cached by any TreeItem implementations.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a list that contains the child TreeItems belonging to the TreeItem.</dd> </dl> </li> </ul> <a name="previousSibling--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>previousSibling</h4> <pre>public <a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> previousSibling()</pre> <div class="block">Returns the previous sibling of the TreeItem. Ordering is based on the position of the TreeItem relative to its siblings in the children list belonging to the parent of the TreeItem.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>A TreeItem that is the previous sibling of the current TreeItem, or null if no such sibling can be found.</dd> </dl> </li> </ul> <a name="previousSibling-javafx.scene.control.TreeItem-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>previousSibling</h4> <pre>public <a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> previousSibling(<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> beforeNode)</pre> <div class="block">Returns the previous sibling after the given node. Ordering is based on the position of the given TreeItem relative to its siblings in the children list belonging to the parent of the TreeItem.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>beforeNode</code> - The TreeItem for which the previous sibling is being sought.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>A TreeItem that is the previous sibling of the given TreeItem, or null if no such sibling can be found.</dd> </dl> </li> </ul> <a name="nextSibling--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>nextSibling</h4> <pre>public <a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> nextSibling()</pre> <div class="block">Returns the next sibling of the TreeItem. Ordering is based on the position of the TreeItem relative to its siblings in the children list belonging to the parent of the TreeItem.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>A TreeItem that is the next sibling of the current TreeItem, or null if no such sibling can be found.</dd> </dl> </li> </ul> <a name="nextSibling-javafx.scene.control.TreeItem-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>nextSibling</h4> <pre>public <a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> nextSibling(<a href="../../../javafx/scene/control/TreeItem.html" title="class in javafx.scene.control">TreeItem</a><<a href="../../../javafx/scene/control/TreeItem.html" title="type parameter in TreeItem">T</a>> afterNode)</pre> <div class="block">Returns the next sibling after the given node. Ordering is based on the position of the given TreeItem relative to its siblings in the children list belonging to the parent of the TreeItem.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>afterNode</code> - The TreeItem for which the next sibling is being sought.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>A TreeItem that is the next sibling of the given TreeItem, or null if no such sibling can be found.</dd> </dl> </li> </ul> <a name="toString--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre> <div class="block">Returns a string representation of this <code>TreeItem</code> object.</div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><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></code> in class <code><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></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a string representation of this <code>TreeItem</code> object.</dd> </dl> </li> </ul> <a name="buildEventDispatchChain-javafx.event.EventDispatchChain-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>buildEventDispatchChain</h4> <pre>public <a href="../../../javafx/event/EventDispatchChain.html" title="interface in javafx.event">EventDispatchChain</a> buildEventDispatchChain(<a href="../../../javafx/event/EventDispatchChain.html" title="interface in javafx.event">EventDispatchChain</a> tail)</pre> <div class="block">Construct an event dispatch chain for this target. The event dispatch chain contains event dispatchers which might be interested in processing of events targeted at this <code>EventTarget</code>. This event target is not automatically added to the chain, so if it wants to process events, it needs to add an <code>EventDispatcher</code> for itself to the chain. <p> In the case the event target is part of some hierarchy, the chain for it is usually built from event dispatchers collected from the root of the hierarchy to the event target. <p> The event dispatch chain is constructed by modifications to the provided initial event dispatch chain. The returned chain should have the initial chain at its end so the dispatchers should be prepended to the initial chain. <p> The caller shouldn't assume that the initial chain remains unchanged nor that the returned value will reference a different chain.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javafx/event/EventTarget.html#buildEventDispatchChain-javafx.event.EventDispatchChain-">buildEventDispatchChain</a></code> in interface <code><a href="../../../javafx/event/EventTarget.html" title="interface in javafx.event">EventTarget</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>tail</code> - the initial chain to build from</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the resulting event dispatch chain for this target</dd> </dl> </li> </ul> <a name="addEventHandler-javafx.event.EventType-javafx.event.EventHandler-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addEventHandler</h4> <pre>public <E extends <a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a>> void addEventHandler(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><E> eventType, <a href="../../../javafx/event/EventHandler.html" title="interface in javafx.event">EventHandler</a><E> eventHandler)</pre> <div class="block">Registers an event handler to this TreeItem. The TreeItem class allows registration of listeners which will be notified as the number of items changes, their position or if the values themselves change. Note however that a TreeItem is <b>not</b> a Node, and therefore no visual events will be fired on the TreeItem. To get these events, it is necessary to add relevant observers to the TreeCell instances (via a custom cell factory - see the <a href="../../../javafx/scene/control/Cell.html" title="class in javafx.scene.control"><code>Cell</code></a> class documentation for more details).</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>eventType</code> - the type of the events to receive by the handler</dd> <dd><code>eventHandler</code> - the handler to register</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the event type or handler is null</dd> </dl> </li> </ul> <a name="removeEventHandler-javafx.event.EventType-javafx.event.EventHandler-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>removeEventHandler</h4> <pre>public <E extends <a href="../../../javafx/event/Event.html" title="class in javafx.event">Event</a>> void removeEventHandler(<a href="../../../javafx/event/EventType.html" title="class in javafx.event">EventType</a><E> eventType, <a href="../../../javafx/event/EventHandler.html" title="interface in javafx.event">EventHandler</a><E> eventHandler)</pre> <div class="block">Unregisters a previously registered event handler from this TreeItem. One handler might have been registered for different event types, so the caller needs to specify the particular event type from which to unregister the handler.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>eventType</code> - the event type from which to unregister</dd> <dd><code>eventHandler</code> - the handler to unregister</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the event type or handler is null</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/TreeItem.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/TreeCell.html" title="class in javafx.scene.control"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javafx/scene/control/TreeItem.TreeModificationEvent.html" title="class in javafx.scene.control"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javafx/scene/control/TreeItem.html" target="_top">Frames</a></li> <li><a href="TreeItem.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><a href="#nested.class.summary">Nested</a> | </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>