com.extjs.gxt.ui.client.widget.tree
Class TreeItem

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.tree.TreeItem
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
TreeTableItem

Deprecated. see TreePanel

public class TreeItem
extends Component

A item in a Tree. All events are bubbled to the item's parent tree.

Events:
BeforeAdd : TreeEvent(tree, parent, item, index)
Fires before a item is added or inserted. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeRemove : TreeEvent(tree, parent, item)
Fires before a item is removed. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeExpand : TreeEvent(tree, item)
Fires before a item is expanded. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
BeforeCollapse : TreeEvent(tree, item)
Fires before a item is collapsed. Listeners can cancel the action by calling BaseEvent.setCancelled(boolean).
Add : TreeEvent(tree, parent, item, index)
Fires after a item has been added or inserted.
Remove : TreeEvent(tree, parent, item)
Fires after a item has been removed.
Expand : TreeEvent(tree, item)
Fires after a item has been expanded.
Collapse : TreeEvent(tree, item)
Fires after a item is collapsed.
CheckChange : TreeEvent(tree, item)
Fires after a check state change.
CSS:
.my-tree-item (the item itself)
.my-tree-item-text span (the tree item text)


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  boolean checked
          Deprecated.  
protected  boolean childrenRendered
          Deprecated.  
protected  boolean expanded
          Deprecated.  
protected  boolean root
          Deprecated.  
protected  Tree tree
          Deprecated.  
protected  TreeItemUI ui
          Deprecated.  
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
TreeItem()
          Deprecated. Creates a new tree item.
TreeItem(java.lang.String text)
          Deprecated. Creates a new tree item.
 
Method Summary
 void add(TreeItem item)
          Deprecated. Adds a child item.
 void add(TreeItem item, int index)
          Deprecated. Inserts a child item at the specified position.
protected  java.lang.String calculateIconStyle()
          Deprecated.  
protected  Tree.Joint calculateJoint()
          Deprecated.  
 boolean equals(java.lang.Object obj)
          Deprecated.  
protected  boolean fireEvent(EventType type, TreeEvent te)
          Deprecated.  
 TreeItem firstChild()
          Deprecated. Returns the item's first child.
 com.google.gwt.user.client.Element getContainer()
          Deprecated. Returns the item's container element.
 int getDepth()
          Deprecated. Returns the item's node depth.
 java.lang.String getIconStyle()
          Deprecated. Returns the item's icon style.
 int getIndent()
          Deprecated.  
 TreeItem getItem(int index)
          Deprecated. Returns the item at the specified index.
 int getItemCount()
          Deprecated. Returns the number of child items.
 java.util.List<TreeItem> getItems()
          Deprecated. Returns the item's children.
 java.util.List<TreeItem> getItems(boolean deep)
          Deprecated. Returns the item's children.
 java.lang.String getItemStyleName()
          Deprecated. Returns the item's style name.
 TreeItem getParentItem()
          Deprecated. Returns the item's parent.
 java.lang.String getPath()
          Deprecated. Returns the path for this node.
 java.lang.String getText()
          Deprecated. Returns the item's text.
 java.lang.String getTextStyle()
          Deprecated. Returns the item's text style.
protected  TreeItemUI getTreeItemUI()
          Deprecated.  
 TreeItemUI getUI()
          Deprecated. Returns the item's ui instance.
 boolean hasChildren()
          Deprecated. Returns true if the item's has children.
 int indexOf(TreeItem item)
          Deprecated. Returns the index of the item or -1 if not found.
 boolean isChecked()
          Deprecated. Returns true if the item is checked.
 boolean isExpanded()
          Deprecated. Returns true if the item is expanded, and false otherwise.
 boolean isLeaf()
          Deprecated. Returns true if the item is a leaf, and false otherwise.
 boolean isRoot()
          Deprecated. Returns true if the item is a root item.
 TreeItem lastChild()
          Deprecated. Returns the item's last child.
 TreeItem nextSibling()
          Deprecated. Returns the item next sibling.
 void onComponentEvent(ComponentEvent ce)
          Deprecated. Any events a component receives will be forwarded to this method.
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Deprecated. Subclasses must override and ensure setElement is called for lazy rendered components.
 TreeItem previousSibling()
          Deprecated. Returns the item's previous sibling.
 void remove(TreeItem item)
          Deprecated. Removes a child from the item.
 void removeAll()
          Deprecated. Removes all child items.
protected  void renderChildren()
          Deprecated.  
 void setChecked(boolean checked)
          Deprecated. Sets the item's checked value.
 void setChildrenRendered(boolean rendered)
          Deprecated.  
 void setElement(com.google.gwt.user.client.Element elem)
          Deprecated.  
 void setExpanded(boolean expanded)
          Deprecated. Sets the item's expanded state.
 void setExpanded(boolean expanded, boolean deep)
          Deprecated. Sets the item's expand state.
 void setIconStyle(java.lang.String style)
          Deprecated. Sets the item's icon style.
 void setItemStyleName(java.lang.String itemStyleName)
          Deprecated. Sets a style name that will be added to the tree item's element, not the container element.
 void setLeaf(boolean leaf)
          Deprecated. Sets the item's leaf state.
protected  void setRoot(boolean isRoot)
          Deprecated.  
 void setText(java.lang.String text)
          Deprecated. Sets the item's text.
 void setTextStyle(java.lang.String style)
          Deprecated. Sets the item's text style.
protected  void setTree(Tree tree)
          Deprecated.  
 void setTreeTableElement(com.google.gwt.user.client.Element elem)
          Deprecated.  
 void setUI(TreeItemUI ui)
          Deprecated.  
 void toggle()
          Deprecated. Toggles the item's expand state.
 java.lang.String toString()
          Deprecated.  
 void updateIconStyle()
          Deprecated.  
 void updateJointStyle()
          Deprecated.  
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, afterRender, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createComponentEvent, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, doAttachChildren, doDetachChildren, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, focus, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, notifyHide, notifyShow, onAttach, onBrowserEvent, onDetach, onDetachHelper, onDisable, onEnable, onEnsureDebugId, onHide, onHideContextMenu, onLoad, onRightClick, onShow, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setEnabled, setFiresEvents, setHeight, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setPixelSize, setSize, setStateful, setStateId, setStyleAttribute, setStyleName, setTabIndex, setTitle, setToolTip, setToolTip, setVisible, setWidth, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onUnload, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

childrenRendered

protected boolean childrenRendered
Deprecated. 

root

protected boolean root
Deprecated. 

expanded

protected boolean expanded
Deprecated. 

checked

protected boolean checked
Deprecated. 

tree

protected Tree tree
Deprecated. 

ui

protected TreeItemUI ui
Deprecated. 
Constructor Detail

TreeItem

public TreeItem()
Deprecated. 
Creates a new tree item.


TreeItem

public TreeItem(java.lang.String text)
Deprecated. 
Creates a new tree item.

Parameters:
text - the item's text
Method Detail

add

public void add(TreeItem item)
Deprecated. 
Adds a child item.

Parameters:
item - the item to be added

add

public void add(TreeItem item,
                int index)
Deprecated. 
Inserts a child item at the specified position.

Parameters:
item - the item to be added
index - index at which the specified element is to be inserted

equals

public boolean equals(java.lang.Object obj)
Deprecated. 
Overrides:
equals in class java.lang.Object

firstChild

public TreeItem firstChild()
Deprecated. 
Returns the item's first child.

Returns:
the first child or null

getContainer

public com.google.gwt.user.client.Element getContainer()
Deprecated. 
Returns the item's container element.

Returns:
the container

getDepth

public int getDepth()
Deprecated. 
Returns the item's node depth.

Returns:
the depth

getIconStyle

public java.lang.String getIconStyle()
Deprecated. 
Returns the item's icon style.

Returns:
the icon style

getIndent

public int getIndent()
Deprecated. 

getItem

public TreeItem getItem(int index)
Deprecated. 
Returns the item at the specified index.

Parameters:
index - the index
Returns:
the item at the index

getItemCount

public int getItemCount()
Deprecated. 
Returns the number of child items.

Returns:
the child count

getItems

public java.util.List<TreeItem> getItems()
Deprecated. 
Returns the item's children.

Returns:
the children items

getItems

public java.util.List<TreeItem> getItems(boolean deep)
Deprecated. 
Returns the item's children.

Parameters:
deep - true to retrieve all the item's children
Returns:
the children items

getItemStyleName

public java.lang.String getItemStyleName()
Deprecated. 
Returns the item's style name.

Returns:
the style name

getParentItem

public TreeItem getParentItem()
Deprecated. 
Returns the item's parent.

Returns:
the parent item

getPath

public java.lang.String getPath()
Deprecated. 
Returns the path for this node. The path can be used to expand or select this node programmatically.

Returns:
a comma separated list of tree item id's

getText

public java.lang.String getText()
Deprecated. 
Returns the item's text.

Returns:
the text

getTextStyle

public java.lang.String getTextStyle()
Deprecated. 
Returns the item's text style.

Returns:
the text style

getUI

public TreeItemUI getUI()
Deprecated. 
Returns the item's ui instance.

Returns:
the ui instance

hasChildren

public boolean hasChildren()
Deprecated. 
Returns true if the item's has children.

Returns:
the children state

indexOf

public int indexOf(TreeItem item)
Deprecated. 
Returns the index of the item or -1 if not found.

Parameters:
item - the child item
Returns:
the item's index

isChecked

public boolean isChecked()
Deprecated. 
Returns true if the item is checked.

Returns:
the checked state

isExpanded

public boolean isExpanded()
Deprecated. 
Returns true if the item is expanded, and false otherwise.

Returns:
the expanded state

isLeaf

public boolean isLeaf()
Deprecated. 
Returns true if the item is a leaf, and false otherwise. The leaf state allows a tree item to specify if it has children before the children have been realized.

Returns:
the leaf state

isRoot

public boolean isRoot()
Deprecated. 
Returns true if the item is a root item.

Returns:
the root state

lastChild

public TreeItem lastChild()
Deprecated. 
Returns the item's last child.

Returns:
the last child

nextSibling

public TreeItem nextSibling()
Deprecated. 
Returns the item next sibling.

Returns:
the next sibling

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Deprecated. 
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Overrides:
onComponentEvent in class Component
Parameters:
ce - the base event

previousSibling

public TreeItem previousSibling()
Deprecated. 
Returns the item's previous sibling.

Returns:
the previous sibling

remove

public void remove(TreeItem item)
Deprecated. 
Removes a child from the item.

Parameters:
item - the item to be removed

removeAll

public void removeAll()
Deprecated. 
Removes all child items.


setChecked

public void setChecked(boolean checked)
Deprecated. 
Sets the item's checked value.

Parameters:
checked - true to check

setChildrenRendered

public void setChildrenRendered(boolean rendered)
Deprecated. 

setElement

public void setElement(com.google.gwt.user.client.Element elem)
Deprecated. 
Overrides:
setElement in class Component

setExpanded

public void setExpanded(boolean expanded)
Deprecated. 
Sets the item's expanded state.

Parameters:
expanded - true to expand

setExpanded

public void setExpanded(boolean expanded,
                        boolean deep)
Deprecated. 
Sets the item's expand state.

Parameters:
expanded - true to expand
deep - true to expand all children

setIconStyle

public void setIconStyle(java.lang.String style)
Deprecated. 
Sets the item's icon style. The style name should match a CSS style that specifies a background image using the following format:

 .my-icon {
    background: url(images/icons/my-icon.png) no-repeat center left !important;
 }
 

Parameters:
style - the icon style

setItemStyleName

public void setItemStyleName(java.lang.String itemStyleName)
Deprecated. 
Sets a style name that will be added to the tree item's element, not the container element.

Parameters:
itemStyleName - the style name

setLeaf

public void setLeaf(boolean leaf)
Deprecated. 
Sets the item's leaf state. The leaf state allows a tree item to specify if it has children before the children have been realized.

Parameters:
leaf - the state

setText

public void setText(java.lang.String text)
Deprecated. 
Sets the item's text.

Parameters:
text - the new text

setTextStyle

public void setTextStyle(java.lang.String style)
Deprecated. 
Sets the item's text style.

Parameters:
style - the text style

setTreeTableElement

public void setTreeTableElement(com.google.gwt.user.client.Element elem)
Deprecated. 

setUI

public void setUI(TreeItemUI ui)
Deprecated. 

toggle

public void toggle()
Deprecated. 
Toggles the item's expand state.


toString

public java.lang.String toString()
Deprecated. 
Overrides:
toString in class Component

updateIconStyle

public void updateIconStyle()
Deprecated. 

updateJointStyle

public void updateJointStyle()
Deprecated. 

calculateIconStyle

protected java.lang.String calculateIconStyle()
Deprecated. 

calculateJoint

protected Tree.Joint calculateJoint()
Deprecated. 

fireEvent

protected boolean fireEvent(EventType type,
                            TreeEvent te)
Deprecated. 

getTreeItemUI

protected TreeItemUI getTreeItemUI()
Deprecated. 

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Deprecated. 
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class Component
Parameters:
target - the target element
index - the insert location

renderChildren

protected void renderChildren()
Deprecated. 

setRoot

protected void setRoot(boolean isRoot)
Deprecated. 

setTree

protected void setTree(Tree tree)
Deprecated.