org.cafesip.gwtcomp.client.ui
Class SuperTreeItem

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.TreeItem
          extended by org.cafesip.gwtcomp.client.ui.SuperTreeItem
All Implemented Interfaces:
com.google.gwt.user.client.ui.HasHTML, com.google.gwt.user.client.ui.HasText

public class SuperTreeItem
extends com.google.gwt.user.client.ui.TreeItem

This class extends the GWT TreeItem class and is used for specifying the object type required for the SuperTree's context-menu feature. In addition, it also allows applications to specify a popup menu specific to this tree item. If the application requires to override the level-specific context menu for this tree item, it can use the setContextMenu() method to specify a different context menu.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.TreeItem
com.google.gwt.user.client.ui.TreeItem.TreeItemImpl, com.google.gwt.user.client.ui.TreeItem.TreeItemImplIE6
 
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
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
SuperTreeItem(int type)
          A constructor for this class.
SuperTreeItem(java.lang.String html, int type)
          A constructor for this class.
SuperTreeItem(com.google.gwt.user.client.ui.Widget widget, int type)
          A constructor for this class.
 
Method Summary
 com.google.gwt.user.client.ui.TreeItem addItem(java.lang.String itemText)
           
 void addItem(SuperTreeItem item)
          Add a SuperTree object as a child of this tree element.
 void addItem(com.google.gwt.user.client.ui.TreeItem item)
           
 com.google.gwt.user.client.ui.TreeItem addItem(com.google.gwt.user.client.ui.Widget widget)
           
 PopupMenu getContextMenu()
          Gets the context menu for this element.
 int getType()
          Returns the type of the object.
 java.lang.Object getUserObject()
           
 void setContextMenu(PopupMenu contextMenu)
          Sets an item-specific context menu.
 void setHTML(java.lang.String html)
           
 void setText(java.lang.String text)
           
 void setType(int type)
          Sets the type of this object.
 void setUserObject(java.lang.Object userObject)
           
 void setWidget(com.google.gwt.user.client.ui.Widget newWidget)
           
 
Methods inherited from class com.google.gwt.user.client.ui.TreeItem
getChild, getChildCount, getChildIndex, getFocusableWidget, getHTML, getParentItem, getState, getText, getTree, getWidget, isSelected, onEnsureDebugId, remove, removeItem, removeItems, setSelected, setState, setState
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuperTreeItem

public SuperTreeItem(int type)
A constructor for this class.

Parameters:
type - type of the object. The object type must be greater than zero as zero is a reserved type.

SuperTreeItem

public SuperTreeItem(java.lang.String html,
                     int type)
A constructor for this class.

Parameters:
html - tree item rendition using HTML.
type - type of the object. The object type must be greater than zero as zero is a reserved type.

SuperTreeItem

public SuperTreeItem(com.google.gwt.user.client.ui.Widget widget,
                     int type)
A constructor for this class.

Parameters:
widget - widget rendition of the tree item.
type - type of the object. The object type must be greater than zero as zero is a reserved type.
Method Detail

addItem

public com.google.gwt.user.client.ui.TreeItem addItem(java.lang.String itemText)
Overrides:
addItem in class com.google.gwt.user.client.ui.TreeItem
See Also:

Note that all the items in the tree are converted to GWT HTML object before adding to the tree. Therefore, the GWT Tree.getText() method will return a null.


addItem

public void addItem(SuperTreeItem item)
Add a SuperTree object as a child of this tree element.

Parameters:
item - item to add.

addItem

public void addItem(com.google.gwt.user.client.ui.TreeItem item)
Overrides:
addItem in class com.google.gwt.user.client.ui.TreeItem
See Also:
TreeItem.addItem(com.google.gwt.user.client.ui.TreeItem)

addItem

public com.google.gwt.user.client.ui.TreeItem addItem(com.google.gwt.user.client.ui.Widget widget)
Overrides:
addItem in class com.google.gwt.user.client.ui.TreeItem
See Also:
TreeItem.addItem(com.google.gwt.user.client.ui.Widget)

getContextMenu

public PopupMenu getContextMenu()
Gets the context menu for this element. If an element-specific context menu is not set, a null is returned.

Returns:
Returns the contextMenu.

getType

public int getType()
Returns the type of the object.

Returns:
Returns the type.

getUserObject

public java.lang.Object getUserObject()
Overrides:
getUserObject in class com.google.gwt.user.client.ui.TreeItem
See Also:
TreeItem.getUserObject()

setContextMenu

public void setContextMenu(PopupMenu contextMenu)
Sets an item-specific context menu. This will override the level-specific context menu.

Parameters:
contextMenu - The contextMenu to set.

setHTML

public void setHTML(java.lang.String html)
Specified by:
setHTML in interface com.google.gwt.user.client.ui.HasHTML
Overrides:
setHTML in class com.google.gwt.user.client.ui.TreeItem
See Also:

Note that all the items in the tree are converted to GWT HTML object before adding to the tree. Therefore, the GWT Tree.getHTML() method will return a null.


setText

public void setText(java.lang.String text)
Specified by:
setText in interface com.google.gwt.user.client.ui.HasText
Overrides:
setText in class com.google.gwt.user.client.ui.TreeItem
See Also:

Note that all the items in the tree are converted to GWT HTML object before adding to the tree. Therefore, the GWT Tree.getText() method will return a null.


setType

public void setType(int type)
Sets the type of this object.

Parameters:
type - The type to set.

setUserObject

public void setUserObject(java.lang.Object userObject)
Overrides:
setUserObject in class com.google.gwt.user.client.ui.TreeItem
See Also:
TreeItem.setUserObject(java.lang.Object)

setWidget

public void setWidget(com.google.gwt.user.client.ui.Widget newWidget)
Overrides:
setWidget in class com.google.gwt.user.client.ui.TreeItem
See Also:
TreeItem.setWidget(com.google.gwt.user.client.ui.Widget)


http://www.cafesip.org