java.lang.Object | |||
↳ | com.google.gwt.user.client.ui.UIObject | ||
↳ | com.google.gwt.user.client.ui.Widget | ||
↳ | com.google.gwt.user.client.ui.Tree |
A standard hierarchical tree widget. The tree contains a hierarchy of
TreeItems
that the user can
open, close, and select.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Tree.Resources | A ClientBundle that provides images for this widget. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.gwt.user.client.ui.UIObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an empty tree.
| |||||||||||
Constructs a tree that uses the specified ClientBundle for images.
| |||||||||||
Constructs a tree that uses the specified ClientBundle for images.
| |||||||||||
This constructor is deprecated.
replaced by
Tree(Resources)
| |||||||||||
This constructor is deprecated.
replaced by
Tree(Resources, boolean)
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the widget as a root tree item.
| |||||||||||
Adds a
BlurEvent handler. | |||||||||||
Adds a
FocusEvent handler. | |||||||||||
This method is deprecated.
Use
addFocusHandler(FocusHandler) instead
| |||||||||||
Adds a simple tree item containing the specified html.
| |||||||||||
Adds an item to the root level of this tree.
| |||||||||||
Adds an item to the root level of this tree.
| |||||||||||
Adds a new tree item containing the specified widget.
| |||||||||||
Adds a simple tree item containing the specified html.
| |||||||||||
Adds a
KeyDownEvent handler. | |||||||||||
Adds a
KeyPressEvent handler. | |||||||||||
Adds a
KeyUpEvent handler. | |||||||||||
This method is deprecated.
Use
addKeyDownHandler(KeyDownHandler) , addKeyUpHandler(KeyUpHandler) and
addKeyPressHandler(KeyPressHandler) instead
| |||||||||||
Adds a
MouseDownEvent handler. | |||||||||||
This method is deprecated.
Use
addMouseOverHandler(MouseOverHandler) addMouseMoveHandler(MouseMoveHandler) ,
addMouseDownHandler(MouseDownHandler) , addMouseUpHandler(MouseUpHandler) and
addMouseOutHandler(MouseOutHandler) instead
| |||||||||||
Adds a
MouseMoveEvent handler. | |||||||||||
Adds a
MouseOutEvent handler. | |||||||||||
Adds a
MouseOverEvent handler. | |||||||||||
Adds a
MouseUpEvent handler. | |||||||||||
Adds a
MouseWheelEvent handler. | |||||||||||
Adds a simple tree item containing the specified text.
| |||||||||||
This method is deprecated.
Use
addSelectionHandler(SelectionHandler , addOpenHandler(OpenHandler , and
addCloseHandler(CloseHandler instead
| |||||||||||
Clears all tree items from the current tree.
| |||||||||||
Ensures that the currently-selected item is visible, opening its parents
and scrolling the tree as necessary.
| |||||||||||
Gets the top-level tree item at the specified index.
| |||||||||||
Gets the number of items contained at the root of this tree.
| |||||||||||
Gets the currently selected item.
| |||||||||||
Gets the widget's position in the tab index.
| |||||||||||
Inserts a child tree item at the specified index containing the specified
widget.
| |||||||||||
Inserts an item into the root level of this tree.
| |||||||||||
Inserts a child tree item at the specified index containing the specified
html.
| |||||||||||
Inserts a child tree item at the specified index containing the specified
text.
| |||||||||||
Returns true if animations are enabled, false if not.
| |||||||||||
Gets an iterator for the contained widgets.
| |||||||||||
Fired whenever a browser event is received.
| |||||||||||
Removes a child widget.
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by addFocusHandler(FocusHandler) instead
| |||||||||||
Removes an item from the root level of this tree.
| |||||||||||
Removes an item from the root level of this tree.
| |||||||||||
Removes all items from the root level of this tree.
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by an add*Handler method instead
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by an add*Handler method instead
| |||||||||||
This method is deprecated.
Use the
removeHandler() method on the
object returned by an add*Handler method instead
| |||||||||||
Sets the widget's 'access key'.
| |||||||||||
Enable or disable animations.
| |||||||||||
Explicitly focus/unfocus this widget.
| |||||||||||
Selects a specified item.
| |||||||||||
Selects a specified item.
| |||||||||||
Sets the widget's position in the tab index.
| |||||||||||
Iterator of tree items.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
onAttach() for each of its
child widgets. | |||||||||||
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
onDetach() for each of its
child widgets. | |||||||||||
Indicates if keyboard navigation is enabled for the Tree and for a given
TreeItem.
| |||||||||||
Affected Elements:
| |||||||||||
This method is called immediately after a widget becomes attached to the
browser's document.
|
Constructs an empty tree.
Constructs a tree that uses the specified ClientBundle for images.
resources | a bundle that provides tree specific images |
---|
Constructs a tree that uses the specified ClientBundle for images. If this tree does not use leaf images, the width of the Resources's leaf image will control the leaf indent.
resources | a bundle that provides tree specific images |
---|---|
useLeafImages | use leaf images from bundle |
This constructor is deprecated.
replaced by Tree(Resources)
Constructs a tree that uses the specified image bundle for images.
images | a bundle that provides tree specific images |
---|
This constructor is deprecated.
replaced by Tree(Resources, boolean)
Constructs a tree that uses the specified image bundle for images. If this tree does not use leaf images, the width of the TreeImage's leaf image will control the leaf indent.
images | a bundle that provides tree specific images |
---|---|
useLeafImages | use leaf images from bundle |
Adds the widget as a root tree item.
widget | widget to add. |
---|
Adds a BlurEvent
handler.
handler | the blur handler |
---|
HandlerRegistration
used to remove this handler
Adds a FocusEvent
handler.
handler | the focus handler |
---|
HandlerRegistration
used to remove this handler
This method is deprecated.
Use addFocusHandler(FocusHandler)
instead
Adds a listener interface to receive focus events.
listener | the listener interface to add |
---|
Adds a simple tree item containing the specified html.
itemHtml | the text of the item to be added |
---|
Adds an item to the root level of this tree.
item | the item to be added |
---|
Adds an item to the root level of this tree.
isItem | the wrapper of item to be added |
---|
Adds a new tree item containing the specified widget.
widget | the widget to be added |
---|
Adds a simple tree item containing the specified html.
itemHtml | the html of the item to be added |
---|
Adds a KeyDownEvent
handler.
handler | the key down handler |
---|
HandlerRegistration
used to remove this handler
Adds a KeyPressEvent
handler.
handler | the key press handler |
---|
HandlerRegistration
used to remove this handler
Adds a KeyUpEvent
handler.
handler | the key up handler |
---|
HandlerRegistration
used to remove this handler
This method is deprecated.
Use addKeyDownHandler(KeyDownHandler)
, addKeyUpHandler(KeyUpHandler)
and
addKeyPressHandler(KeyPressHandler)
instead
Adds a listener interface to receive keyboard events.
listener | the listener interface to add |
---|
Adds a MouseDownEvent
handler.
handler | the mouse down handler |
---|
HandlerRegistration
used to remove this handler
This method is deprecated.
Use addMouseOverHandler(MouseOverHandler)
addMouseMoveHandler(MouseMoveHandler)
,
addMouseDownHandler(MouseDownHandler)
, addMouseUpHandler(MouseUpHandler)
and
addMouseOutHandler(MouseOutHandler)
instead
Adds a listener interface to receive mouse events.
listener | the listener interface to add |
---|
Adds a MouseMoveEvent
handler.
handler | the mouse move handler |
---|
HandlerRegistration
used to remove this handler
Adds a MouseOutEvent
handler.
handler | the mouse out handler |
---|
HandlerRegistration
used to remove this handler
Adds a MouseOverEvent
handler.
handler | the mouse over handler |
---|
HandlerRegistration
used to remove this handler
Adds a MouseUpEvent
handler.
handler | the mouse up handler |
---|
HandlerRegistration
used to remove this handler
Adds a MouseWheelEvent
handler.
handler | the mouse wheel handler |
---|
HandlerRegistration
used to remove this handler
Adds a simple tree item containing the specified text.
itemText | the text of the item to be added |
---|
This method is deprecated.
Use addSelectionHandler(SelectionHandler
, addOpenHandler(OpenHandler
, and
addCloseHandler(CloseHandler
instead
Adds a listener interface to receive tree events.
listener | the listener interface to add |
---|
Clears all tree items from the current tree.
Ensures that the currently-selected item is visible, opening its parents and scrolling the tree as necessary.
Gets the top-level tree item at the specified index.
index | the index to be retrieved |
---|
Gets the number of items contained at the root of this tree.
Gets the widget's position in the tab index.
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 an item into the root level of this tree.
beforeIndex | the index where the item will be inserted |
---|---|
item | the item to be added |
IndexOutOfBoundsException | if the index is out of range |
---|
Inserts a child tree item at the specified index containing the specified html.
beforeIndex | the index where the item will be inserted |
---|---|
itemHtml | the html of the item 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 |
---|---|
itemText | the text to be added |
IndexOutOfBoundsException | if the index is out of range |
---|
Returns true if animations are enabled, false if not.
Gets an iterator for the contained widgets. This iterator is required to
implement remove()
.
Fired whenever a browser event is received.
event | the event received |
---|
Removes a child widget.
w | the widget to be removed |
---|
true
if the widget was present
This method is deprecated.
Use the removeHandler()
method on the
object returned by addFocusHandler(FocusHandler)
instead
Removes a previously added listener interface.
listener | the listener interface to remove |
---|
Removes an item from the root level of this tree.
item | the item to be removed |
---|
Removes an item from the root level of this tree.
isItem | the wrapper of item to be removed |
---|
Removes all items from the root level of this tree.
This method is deprecated.
Use the removeHandler()
method on the
object returned by an add*Handler method instead
Removes a previously added listener interface.
listener | the listener interface to remove |
---|
This method is deprecated.
Use the removeHandler()
method on the
object returned by an add*Handler method instead
Removes a previously added listener interface.
listener | the listener interface to remove |
---|
This method is deprecated.
Use the removeHandler()
method on the
object returned by an add*Handler method instead
Removes a previously added listener interface.
listener | the listener interface to remove |
---|
Sets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.
key | the widget's access key |
---|
Enable or disable animations.
enable | true to enable, false to disable |
---|
Explicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events.
focus | whether this widget should take focus or release it |
---|
Selects a specified item.
item | the item to be selected, or null to deselect all
items |
---|---|
fireEvents | true to allow selection events to be fired
|
Selects a specified item.
item | the item to be selected, or null to deselect all
items
|
---|
Sets the widget's position in the tab index. If more than one widget has
the same tab index, each such widget will receive focus in an arbitrary
order. Setting the tab index to -1
will cause this widget to
be removed from the tab order.
index | the widget's tab index |
---|
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call onAttach()
for each of its
child widgets.
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call onDetach()
for each of its
child widgets.
Indicates if keyboard navigation is enabled for the Tree and for a given TreeItem. Subclasses of Tree can override this function to selectively enable or disable keyboard navigation.
currentItem | the currently selected TreeItem |
---|
true
if the Tree will response to arrow keys by
changing the currently selected item
Affected Elements:
TreeItem
.baseID | the base ID used by the main element |
---|
This method is called immediately after a widget becomes attached to the browser's document.