java.lang.Object | ||
↳ | com.google.gwt.user.client.ui.UIObject | |
↳ | com.google.gwt.user.client.ui.TreeItem |
An item that can be contained within a
Tree
.
Each tree item is assigned a unique DOM id in order to support ARIA. See
Accessibility
for more information.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
TreeItem.TreeItemImpl | Implementation class for TreeItem . |
||||||||||
TreeItem.TreeItemImplIE6 | IE specific implementation class for TreeItem . |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an empty tree item.
| |||||||||||
Constructs a tree item with the given HTML.
| |||||||||||
Constructs a tree item with the given HTML.
| |||||||||||
Constructs a tree item with the given
Widget . |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a child tree item containing the specified html.
| |||||||||||
Adds another item as a child to this one.
| |||||||||||
Adds a child tree item containing the specified widget.
| |||||||||||
Adds another item as a child to this one.
| |||||||||||
Adds a child tree item containing the specified html.
| |||||||||||
Adds a child tree item containing the specified text.
| |||||||||||
Returns the
TreeItem aspect of the receiver. | |||||||||||
Gets the child at the specified index.
| |||||||||||
Gets the number of children contained in this item.
| |||||||||||
Gets the index of the specified child item.
| |||||||||||
Gets this object's contents as HTML.
| |||||||||||
Gets this item's parent.
| |||||||||||
Gets whether this item's children are displayed.
| |||||||||||
Gets this object's text.
| |||||||||||
Gets the tree that contains this item.
| |||||||||||
Gets the user-defined object associated with this item.
| |||||||||||
Gets the
Widget associated with this tree item. | |||||||||||
Inserts a child tree item at the specified index containing the specified
widget.
| |||||||||||
Inserts a child tree item at the specified index containing the specified
text.
| |||||||||||
Inserts a child tree item at the specified index containing the specified
text.
| |||||||||||
Inserts an item as a child to this one.
| |||||||||||
Determines whether this item is currently selected.
| |||||||||||
Removes this item from its tree.
| |||||||||||
Removes one of this item's children.
| |||||||||||
Removes one of this item's children.
| |||||||||||
Removes all of this item's children.
| |||||||||||
Sets this object's contents via known-safe HTML.
| |||||||||||
Sets this object's contents via HTML.
| |||||||||||
Selects or deselects this item.
| |||||||||||
Sets whether this item's children are displayed.
| |||||||||||
Sets whether this item's children are displayed.
| |||||||||||
Sets this object's text.
| |||||||||||
Sets the user-defined object associated with this item.
| |||||||||||
Sets the current widget.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a suggested
Focusable instance to use when this tree item
is selected. | |||||||||||
This method is deprecated.
use
getFocusable() instead
| |||||||||||
Affected Elements:
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.safehtml.client.HasSafeHtml
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasHTML
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasText
| |||||||||||
From interface
com.google.gwt.user.client.ui.HasTreeItems
| |||||||||||
From interface
com.google.gwt.user.client.ui.IsTreeItem
|
Creates an empty tree item.
Constructs a tree item with the given HTML.
html | the item's HTML |
---|
Constructs a tree item with the given HTML.
html | the item's HTML |
---|
Constructs a tree item with the given Widget
.
widget | the item's widget |
---|
Adds a child tree item containing the specified html.
itemHtml | the text to be added |
---|
Adds another item as a child to this one.
item | the item to be added |
---|
Adds a child tree item containing the specified widget.
widget | the widget to be added |
---|
Adds another item as a child to this one.
isItem | the wrapper of item to be added |
---|
Adds a child tree item containing the specified html.
itemHtml | the item's HTML |
---|
Adds a child tree item containing the specified text.
itemText | the text of the item to be added |
---|
Gets the child at the specified index.
index | the index to be retrieved |
---|
Gets the number of children contained in this item.
Gets the index of the specified child item.
child | the child item to be found |
---|
-1
if none is found
Gets whether this item's children are displayed.
true
if the item is open
Gets the user-defined object associated with this item.
Inserts a child tree item at the specified index containing the specified widget.
beforeIndex | the index where the item will be inserted |
---|---|
widget | the widget to be added |
IndexOutOfBoundsException | if the index is out of range |
---|
Inserts a child tree item at the specified index containing the specified text.
beforeIndex | the index where the item will be inserted |
---|---|
itemHtml | the item's HTML |
IndexOutOfBoundsException | if the index is out of range |
---|
Inserts a child tree item at the specified index containing the specified text.
beforeIndex | the index where the item will be inserted |
---|---|
itemText | the text to be added |
IndexOutOfBoundsException | if the index is out of range |
---|
Inserts an item as a child to this one.
beforeIndex | the index where the item will be inserted |
---|---|
item | the item to be added |
IndexOutOfBoundsException | if the index is out of range |
---|
Determines whether this item is currently selected.
true
if it is selected
Removes this item from its tree.
Removes one of this item's children.
isItem | the wrapper of item to be removed |
---|
Removes one of this item's children.
item | the item to be removed |
---|
Removes all of this item's children.
Sets this object's contents via known-safe HTML.
The object will behave exactly the same as when a widget's
setHTML(String)
method is
invoked; however the SafeHtml
passed to this method observes the
contract that it can be used in an HTML context without causing unsafe
script execution. Thus, unlike
setHTML(String)
, using this
method cannot result in Cross-Site Scripting security vulnerabilities.
html | the object's new HTML, represented as a SafeHtml object
|
---|
Sets this object's contents via HTML. Use care when setting an object's
HTML; it is an easy way to expose script-based security problems. Consider
using setText(String)
whenever possible.
html | the object's new HTML |
---|
Selects or deselects this item.
selected | true to select the item, false to
deselect it
|
---|
Sets whether this item's children are displayed.
open | whether the item is open |
---|---|
fireEvents | true to allow open/close events to be
|
Sets whether this item's children are displayed.
open | whether the item is open |
---|
Sets the user-defined object associated with this item.
userObj | the item's user-defined object |
---|
Sets the current widget. Any existing child widget will be removed.
newWidget | Widget to set |
---|
Returns a suggested Focusable
instance to use when this tree item
is selected. The tree maintains focus if this method returns null. By
default, if the tree item contains a focusable widget, that widget is
returned.
Note, the Tree
will ignore this value if the user clicked on an
input element such as a button or text area when selecting this item.
This method is deprecated.
use getFocusable()
instead
Returns the widget, if any, that should be focused on if this TreeItem is selected.
Affected Elements:
Widget
next to the image.baseID | the base ID used by the main element |
---|