JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

expand all

Profile: desktop, common

Overview

Warning: This class is an experimental/preview control that is not final and will change in future releases. If you have any feedback on this control, please post it to the JavaFX JIRA issue tracker.

Base class for objects represented in a TreeView. The TreeItemBase provides common API and implementation for any item to be displayed in a TreeView. The TreeItem concrete subclass implementation is intended primarily for use in static tree construction or dynamic tree construction using the callback mechanism. Specialty subclasses (such as FileTreeItem) can extend from this class to provide useful reusable API for common tasks.

See Also:
TreeView, TreeItem

Profile: common

Variable Summary

accessnametypeCan ReadCan InitCan WriteDefault Valuedescription
publicchildrenTreeItemBase[]

The children of this TreeItem.

The children of this TreeItem. This is writable only by subclasses so as to provide subclasses control over when and what can be added. For example, a FileTreeItem implementation might want to maintain control and update the subitems based on actual changes to the filesystem.

The children may well not be initialized until expanded is set to true. This delayed computation is a critical property of TreeItems so as to be scalable to large and complex data sets.

 
publicdataObject

The application-specific data represented by this TreeItem.

The application-specific data represented by this TreeItem. If no custom cellFactory is specified, the toString function will be called on this data Object and that will be what is shown to the user.

 
publicexpandedBoolean

Specifies whether the subitems of this TreeItem, if any, are visually displayed.

Specifies whether the subitems of this TreeItem, if any, are visually displayed. When a TreeItem is expanded, both the item and all of its subitems are visible. When not expanded, the subitems are not visible and only the TreeItem itself can be interacted with.

 
publicgraphicNode

The node to show to the left of the data object.

The node to show to the left of the data object. For best effect, this tends to be a 16x16 image.

 
public-readitemCountInteger

A count of the number of items which currently exist for this item and all children where the parent nodes have expanded set to true.

public-read protectedleafBooleansubclasssubclass
public-readlevelInteger
public-readparentTreeItemBase

The parent of this TreeItem.

The parent of this TreeItem. Each TreeItem can have no more than one parent.

 

Inherited Variables

Function Summary

public getNextSibling() : TreeItemBase

Returns the next sibling after this node.

Returns the next sibling after this node.

Returns
TreeItemBase
 
public getNextSibling(afterNode: TreeItemBase) : TreeItemBase

Returns the next sibling after the given node.

Returns the next sibling after the given node.

Parameters
afterNode
Returns
TreeItemBase
 
public getPreviousSibling() : TreeItemBase

Returns the previous sibling before this node.

Returns the previous sibling before this node.

Returns
TreeItemBase
 
public getPreviousSibling(beforeNode: TreeItemBase) : TreeItemBase

Returns the previous sibling after the given node.

Returns the previous sibling after the given node.

Parameters
beforeNode
Returns
TreeItemBase
 

Inherited Functions