|
||||||||||
| 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.Widget
com.google.gwt.user.client.ui.Tree
public class Tree
A standard hierarchical tree widget. The tree contains a hierarchy of
TreeItems that the user can
open, close, and select.
| Nested Class Summary | |
|---|---|
static interface |
Tree.Resources
A ClientBundle that provides images for this widget. |
| 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 | |
|---|---|
Tree()
Constructs an empty tree. |
|
Tree(Tree.Resources resources)
Constructs a tree that uses the specified ClientBundle for images. |
|
Tree(Tree.Resources resources,
boolean useLeafImages)
Constructs a tree that uses the specified ClientBundle for images. |
|
Tree(TreeImages images)
Deprecated. replaced by Tree(Resources) |
|
Tree(TreeImages images,
boolean useLeafImages)
Deprecated. replaced by Tree(Resources, boolean) |
|
| Method Summary | |
|---|---|
void |
add(Widget widget)
Adds the widget as a root tree item. |
HandlerRegistration |
addBlurHandler(BlurHandler handler)
Adds a BlurEvent handler. |
HandlerRegistration |
addCloseHandler(CloseHandler<TreeItem> handler)
Adds a CloseEvent handler. |
HandlerRegistration |
addFocusHandler(FocusHandler handler)
Adds a FocusEvent handler. |
void |
addFocusListener(FocusListener listener)
Deprecated. Use addFocusHandler(com.google.gwt.event.dom.client.FocusHandler) instead |
TreeItem |
addItem(java.lang.String itemText)
Adds a simple tree item containing the specified text. |
void |
addItem(TreeItem item)
Adds an item to the root level of this tree. |
TreeItem |
addItem(Widget widget)
Adds a new tree item containing the specified widget. |
void |
addKeyboardListener(KeyboardListener listener)
Deprecated. Use addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler), addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) and
addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) instead |
HandlerRegistration |
addKeyDownHandler(KeyDownHandler handler)
Adds a KeyDownEvent handler. |
HandlerRegistration |
addKeyPressHandler(KeyPressHandler handler)
Adds a KeyPressEvent handler. |
HandlerRegistration |
addKeyUpHandler(KeyUpHandler handler)
Adds a KeyUpEvent handler. |
HandlerRegistration |
addMouseDownHandler(MouseDownHandler handler)
Adds a MouseDownEvent handler. |
void |
addMouseListener(MouseListener listener)
Deprecated. Use addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler) addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler),
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler), addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler) and
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler) instead |
HandlerRegistration |
addMouseMoveHandler(MouseMoveHandler handler)
Adds a MouseMoveEvent handler. |
HandlerRegistration |
addMouseOutHandler(MouseOutHandler handler)
Adds a MouseOutEvent handler. |
HandlerRegistration |
addMouseOverHandler(MouseOverHandler handler)
Adds a MouseOverEvent handler. |
HandlerRegistration |
addMouseUpHandler(MouseUpHandler handler)
Adds a MouseUpEvent handler. |
HandlerRegistration |
addMouseWheelHandler(MouseWheelHandler handler)
Adds a MouseWheelEvent handler. |
HandlerRegistration |
addOpenHandler(OpenHandler<TreeItem> handler)
Adds a OpenEvent handler. |
HandlerRegistration |
addSelectionHandler(SelectionHandler<TreeItem> handler)
Adds a SelectionEvent handler. |
void |
addTreeListener(TreeListener listener)
Deprecated. Use addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler, addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler, and
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler instead |
void |
clear()
Clears all tree items from the current tree. |
void |
ensureSelectedItemVisible()
Ensures that the currently-selected item is visible, opening its parents and scrolling the tree as necessary. |
TreeItem |
getItem(int index)
Gets the top-level tree item at the specified index. |
int |
getItemCount()
Gets the number of items contained at the root of this tree. |
TreeItem |
getSelectedItem()
Gets the currently selected item. |
int |
getTabIndex()
Gets the widget's position in the tab index. |
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 into the root level of this tree. |
TreeItem |
insertItem(int beforeIndex,
Widget widget)
Inserts a child tree item at the specified index containing the specified widget. |
boolean |
isAnimationEnabled()
|
java.util.Iterator<Widget> |
iterator()
Gets an iterator for the contained widgets. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
boolean |
remove(Widget w)
Removes a child widget. |
void |
removeFocusListener(FocusListener listener)
Deprecated. Use the HandlerRegistration.removeHandler() method on the
object returned by addFocusHandler(com.google.gwt.event.dom.client.FocusHandler) instead |
void |
removeItem(TreeItem item)
Removes an item from the root level of this tree. |
void |
removeItems()
Removes all items from the root level of this tree. |
void |
removeKeyboardListener(KeyboardListener listener)
Deprecated. Use the HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead |
void |
removeMouseListener(MouseListener listener)
Deprecated. Use the HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead |
void |
removeTreeListener(TreeListener listener)
Deprecated. Use the HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead |
void |
setAccessKey(char key)
Sets the widget's 'access key'. |
void |
setAnimationEnabled(boolean enable)
Enable or disable animations. |
void |
setFocus(boolean focus)
Explicitly focus/unfocus this widget. |
void |
setSelectedItem(TreeItem item)
Selects a specified item. |
void |
setSelectedItem(TreeItem item,
boolean fireEvents)
Selects a specified item. |
void |
setTabIndex(int index)
Sets the widget's position in the tab index. |
java.util.Iterator<TreeItem> |
treeItemIterator()
Iterator of tree items. |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents |
| 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, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public Tree()
public Tree(Tree.Resources resources)
resources - a bundle that provides tree specific images
public Tree(Tree.Resources resources,
boolean useLeafImages)
resources - a bundle that provides tree specific imagesuseLeafImages - use leaf images from bundle@Deprecated public Tree(TreeImages images)
Tree(Resources)
images - a bundle that provides tree specific images
@Deprecated
public Tree(TreeImages images,
boolean useLeafImages)
Tree(Resources, boolean)
images - a bundle that provides tree specific imagesuseLeafImages - use leaf images from bundle| Method Detail |
|---|
public void add(Widget widget)
add in interface HasWidgetswidget - widget to add.HasWidgets.add(com.google.gwt.user.client.ui.Widget)public HandlerRegistration addBlurHandler(BlurHandler handler)
HasBlurHandlersBlurEvent handler.
addBlurHandler in interface HasBlurHandlershandler - the blur handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addCloseHandler(CloseHandler<TreeItem> handler)
HasCloseHandlersCloseEvent handler.
addCloseHandler in interface HasCloseHandlers<TreeItem>handler - the handler
public HandlerRegistration addFocusHandler(FocusHandler handler)
HasFocusHandlersFocusEvent handler.
addFocusHandler in interface HasFocusHandlershandler - the focus handler
HandlerRegistration used to remove this handler@Deprecated public void addFocusListener(FocusListener listener)
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler) instead
SourcesFocusEvents
addFocusListener in interface SourcesFocusEventslistener - the listener interface to addpublic TreeItem addItem(java.lang.String itemText)
itemText - the text of the item to be added
public void addItem(TreeItem item)
item - the item to be addedpublic TreeItem addItem(Widget widget)
widget - the widget to be added
@Deprecated public void addKeyboardListener(KeyboardListener listener)
addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler), addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler) and
addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler) instead
SourcesKeyboardEvents
addKeyboardListener in interface SourcesKeyboardEventslistener - the listener interface to addpublic HandlerRegistration addKeyDownHandler(KeyDownHandler handler)
HasKeyDownHandlersKeyDownEvent handler.
addKeyDownHandler in interface HasKeyDownHandlershandler - the key down handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addKeyPressHandler(KeyPressHandler handler)
HasKeyPressHandlersKeyPressEvent handler.
addKeyPressHandler in interface HasKeyPressHandlershandler - the key press handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
HasKeyUpHandlersKeyUpEvent handler.
addKeyUpHandler in interface HasKeyUpHandlershandler - the key up handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addMouseDownHandler(MouseDownHandler handler)
HasMouseDownHandlersMouseDownEvent handler.
addMouseDownHandler in interface HasMouseDownHandlershandler - the mouse down handler
HandlerRegistration used to remove this handler@Deprecated public void addMouseListener(MouseListener listener)
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler) addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler),
addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler), addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler) and
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler) instead
SourcesMouseEvents
addMouseListener in interface SourcesMouseEventslistener - the listener interface to addpublic HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler)
HasMouseMoveHandlersMouseMoveEvent handler.
addMouseMoveHandler in interface HasMouseMoveHandlershandler - the mouse move handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addMouseOutHandler(MouseOutHandler handler)
HasMouseOutHandlersMouseOutEvent handler.
addMouseOutHandler in interface HasMouseOutHandlershandler - the mouse out handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addMouseOverHandler(MouseOverHandler handler)
HasMouseOverHandlersMouseOverEvent handler.
addMouseOverHandler in interface HasMouseOverHandlershandler - the mouse over handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addMouseUpHandler(MouseUpHandler handler)
HasMouseUpHandlersMouseUpEvent handler.
addMouseUpHandler in interface HasMouseUpHandlershandler - the mouse up handler
HandlerRegistration used to remove this handlerpublic HandlerRegistration addMouseWheelHandler(MouseWheelHandler handler)
HasMouseWheelHandlersMouseWheelEvent handler.
addMouseWheelHandler in interface HasMouseWheelHandlershandler - the mouse wheel handler
HandlerRegistration used to remove this handlerpublic final HandlerRegistration addOpenHandler(OpenHandler<TreeItem> handler)
HasOpenHandlersOpenEvent handler.
addOpenHandler in interface HasOpenHandlers<TreeItem>handler - the handler
public HandlerRegistration addSelectionHandler(SelectionHandler<TreeItem> handler)
HasSelectionHandlersSelectionEvent handler.
addSelectionHandler in interface HasSelectionHandlers<TreeItem>handler - the handler
@Deprecated public void addTreeListener(TreeListener listener)
addSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler) , addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler) , and
addCloseHandler(com.google.gwt.event.logical.shared.CloseHandler) instead
SourcesTreeEvents
addTreeListener in interface SourcesTreeEventslistener - the listener interface to addpublic void clear()
clear in interface HasWidgetspublic void ensureSelectedItemVisible()
public TreeItem getItem(int index)
index - the index to be retrieved
public int getItemCount()
public TreeItem getSelectedItem()
public int getTabIndex()
Focusable
getTabIndex in interface Focusable
public TreeItem insertItem(int beforeIndex,
java.lang.String itemText)
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)
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)
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 isAnimationEnabled()
isAnimationEnabled in interface HasAnimationpublic java.util.Iterator<Widget> iterator()
HasWidgetsIterator.remove().
iterator in interface HasWidgetsiterator in interface java.lang.Iterable<Widget>public void onBrowserEvent(Event event)
EventListener
onBrowserEvent in interface EventListeneronBrowserEvent in class Widgetevent - the event receivedpublic boolean remove(Widget w)
HasWidgets
remove in interface HasWidgetsw - the widget to be removed
true if the widget was present@Deprecated public void removeFocusListener(FocusListener listener)
HandlerRegistration.removeHandler() method on the
object returned by addFocusHandler(com.google.gwt.event.dom.client.FocusHandler) instead
SourcesFocusEvents
removeFocusListener in interface SourcesFocusEventslistener - the listener interface to removepublic void removeItem(TreeItem item)
item - the item to be removedpublic void removeItems()
@Deprecated public void removeKeyboardListener(KeyboardListener listener)
HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead
SourcesKeyboardEvents
removeKeyboardListener in interface SourcesKeyboardEventslistener - the listener interface to remove@Deprecated public void removeMouseListener(MouseListener listener)
HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead
SourcesMouseEvents
removeMouseListener in interface SourcesMouseEventslistener - the listener interface to remove@Deprecated public void removeTreeListener(TreeListener listener)
HandlerRegistration.removeHandler() method on the
object returned by an add*Handler method instead
SourcesTreeEvents
removeTreeListener in interface SourcesTreeEventslistener - the listener interface to removepublic void setAccessKey(char key)
Focusable
setAccessKey in interface Focusablekey - the widget's access keypublic void setAnimationEnabled(boolean enable)
HasAnimation
setAnimationEnabled in interface HasAnimationenable - true to enable, false to disablepublic void setFocus(boolean focus)
Focusable
setFocus in interface Focusablefocus - whether this widget should take focus or release itpublic void setSelectedItem(TreeItem item)
item - the item to be selected, or null to deselect all
items
public void setSelectedItem(TreeItem item,
boolean fireEvents)
item - the item to be selected, or null to deselect all
itemsfireEvents - true to allow selection events to be firedpublic void setTabIndex(int index)
Focusable-1 will cause this widget to
be removed from the tab order.
setTabIndex in interface Focusableindex - the widget's tab indexpublic java.util.Iterator<TreeItem> treeItemIterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||