|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.TreeItem
public class 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 Class Summary | |
|---|---|
static class |
TreeItem.TreeItemImpl
Implementation class for TreeItem. |
static class |
TreeItem.TreeItemImplIE6
IE specific implementation class for TreeItem. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
TreeItem()
Creates an empty tree item. |
|
TreeItem(java.lang.String html)
Constructs a tree item with the given HTML. |
|
TreeItem(Widget widget)
Constructs a tree item with the given Widget. |
|
| Method Summary | |
|---|---|
TreeItem |
addItem(java.lang.String itemText)
Adds a child tree item containing the specified text. |
void |
addItem(TreeItem item)
Adds another item as a child to this one. |
TreeItem |
addItem(Widget widget)
Adds a child tree item containing the specified widget. |
TreeItem |
getChild(int index)
Gets the child at the specified index. |
int |
getChildCount()
Gets the number of children contained in this item. |
int |
getChildIndex(TreeItem child)
Gets the index of the specified child item. |
java.lang.String |
getHTML()
Gets this object's contents as HTML. |
TreeItem |
getParentItem()
Gets this item's parent. |
boolean |
getState()
Gets whether this item's children are displayed. |
java.lang.String |
getText()
Gets this object's text. |
Tree |
getTree()
Gets the tree that contains this item. |
java.lang.Object |
getUserObject()
Gets the user-defined object associated with this item. |
Widget |
getWidget()
Gets the Widget associated with this tree item. |
TreeItem |
insertItem(int beforeIndex,
java.lang.String itemText)
Inserts a child tree item at the specified index containing the specified text. |
void |
insertItem(int beforeIndex,
TreeItem item)
Inserts an item as a child to this one. |
TreeItem |
insertItem(int beforeIndex,
Widget widget)
Inserts a child tree item at the specified index containing the specified widget. |
boolean |
isSelected()
Determines whether this item is currently selected. |
void |
remove()
Removes this item from its tree. |
void |
removeItem(TreeItem item)
Removes one of this item's children. |
void |
removeItems()
Removes all of this item's children. |
void |
setHTML(java.lang.String html)
Sets this object's contents via HTML. |
void |
setSelected(boolean selected)
Selects or deselects this item. |
void |
setState(boolean open)
Sets whether this item's children are displayed. |
void |
setState(boolean open,
boolean fireEvents)
Sets whether this item's children are displayed. |
void |
setText(java.lang.String text)
Sets this object's text. |
void |
setUserObject(java.lang.Object userObj)
Sets the user-defined object associated with this item. |
void |
setWidget(Widget newWidget)
Sets the current widget. |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TreeItem()
public TreeItem(java.lang.String html)
html - the item's HTMLpublic TreeItem(Widget widget)
Widget.
widget - the item's widget| Method Detail |
|---|
public TreeItem addItem(java.lang.String itemText)
itemText - the text to be added
public void addItem(TreeItem item)
item - the item to be addedpublic TreeItem addItem(Widget widget)
widget - the widget to be added
public TreeItem getChild(int index)
index - the index to be retrieved
public int getChildCount()
public int getChildIndex(TreeItem child)
child - the child item to be found
-1 if none is foundpublic java.lang.String getHTML()
HasHTML
getHTML in interface HasHTMLpublic TreeItem getParentItem()
public boolean getState()
true if the item is openpublic java.lang.String getText()
HasText
getText in interface HasTextpublic final Tree getTree()
public java.lang.Object getUserObject()
public Widget getWidget()
Widget associated with this tree item.
public TreeItem insertItem(int beforeIndex,
java.lang.String itemText)
throws java.lang.IndexOutOfBoundsException
beforeIndex - the index where the item will be inserteditemText - the text to be added
java.lang.IndexOutOfBoundsException - if the index is out of range
public void insertItem(int beforeIndex,
TreeItem item)
throws java.lang.IndexOutOfBoundsException
beforeIndex - the index where the item will be inserteditem - the item to be added
java.lang.IndexOutOfBoundsException - if the index is out of range
public TreeItem insertItem(int beforeIndex,
Widget widget)
throws java.lang.IndexOutOfBoundsException
beforeIndex - the index where the item will be insertedwidget - the widget to be added
java.lang.IndexOutOfBoundsException - if the index is out of rangepublic boolean isSelected()
true if it is selectedpublic void remove()
public void removeItem(TreeItem item)
item - the item to be removedpublic void removeItems()
public void setHTML(java.lang.String html)
HasHTMLHasText.setText(String) whenever possible.
setHTML in interface HasHTMLhtml - the object's new HTMLpublic void setSelected(boolean selected)
selected - true to select the item, false to
deselect itpublic void setState(boolean open)
open - whether the item is open
public void setState(boolean open,
boolean fireEvents)
open - whether the item is openfireEvents - true to allow open/close events to bepublic void setText(java.lang.String text)
HasText
setText in interface HasTexttext - the object's new textpublic void setUserObject(java.lang.Object userObj)
userObj - the item's user-defined objectpublic void setWidget(Widget newWidget)
newWidget - Widget to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||