| net.mygwt.ui.client.widget.Component net.mygwt.ui.client.widget.tree.TreeItem
All known Subclasses: net.mygwt.ui.client.widget.tree.RootTreeItem, net.mygwt.ui.client.widget.treetable.TreeTableItem,
TreeItem | public class TreeItem extends Component (Code) | | A item in a Tree . All events are bubbled to the item's parent
tree.
- Events:
- BeforeAdd : (widget, item, index)
Fires before a item is added or inserted. Listeners can set the
doit field to false to cancel the action.
- widget : this
- item : the item being added
- index : the index at which the item will be added
- BeforeRemove : (widget, item)
Fires before a item is removed. Listeners can set the doit
field to false to cancel the action.
- widget : this
- item : the item being removed
- BeforeExpand : (widget)
Fires before a item is expanded. Listeners can set the doit
field to false to cancel the expand.
- BeforeCollapse : (widget)
Fires before a item is collapsed. Listeners can set the
doit field to false to cancel the collapse.
- Add : (widget, item, index)
Fires after a item has been added or inserted.
- widget : this
- item : the item that was added
- index : the index at which the item will be added
- Remove : (widget, item)
Fires after a item has been removed.
- widget : this
- item : the item being removed
- Expand : (widget)
Fires after a item has been expanded.
- Collapse : (widget)
Fires ater a item is collapsed.
- CheckChange : (widget)
Fires after a check state change.
- CSS:
- .my-tree-item (the item itself)
- .my-tree-item-text span (the tree item text)
|
Constructor Summary | |
public | TreeItem() Creates a new tree item. | public | TreeItem(String text) Creates a new tree item. |
childrenRendered | protected boolean childrenRendered(Code) | | |
rootexpandedchecked | protected boolean rootexpandedchecked(Code) | | |
TreeItem | public TreeItem()(Code) | | Creates a new tree item.
|
TreeItem | public TreeItem(String text)(Code) | | Creates a new tree item.
Parameters: text - the item's text |
add | public void add(TreeItem item)(Code) | | Adds a child item.
Parameters: item - the item to be added |
firstChild | public TreeItem firstChild()(Code) | | Returns the item's first child.
the first child or null |
getContainer | public Element getContainer()(Code) | | |
getDepth | public int getDepth()(Code) | | Returns the item's node depth.
the depth |
getIconStyle | public String getIconStyle()(Code) | | Returns the item's icon style.
the icon style |
getItem | public TreeItem getItem(int index)(Code) | | Returns the item at the specified index.
Parameters: index - the index the item at the index |
getItemCount | public int getItemCount()(Code) | | Returns the number of child items.
the child count |
getItems | public TreeItem[] getItems()(Code) | | Returns the item's children.
the children items |
getParentItem | public TreeItem getParentItem()(Code) | | Returns the item's parent.
the parent item |
getPath | public String getPath()(Code) | | Returns the path for this node. The path can be used to expand or select
this node programmatically.
a comma seperated list of tree item id's |
getText | public String getText()(Code) | | Returns the item's text.
the text |
getTreeItemUI | protected TreeItemUI getTreeItemUI()(Code) | | Subclasses may override.
the ui |
getUI | public TreeItemUI getUI()(Code) | | Returns the item's ui instance.
the ui instance |
hasChildren | public boolean hasChildren()(Code) | | Returns true if the item's has children.
the children state |
indexOf | public int indexOf(TreeItem item)(Code) | | Returns the index of the item or -1 if not found.
Parameters: item - the child item the item's index |
insert | public void insert(TreeItem item, int index)(Code) | | Inserts a child item at the specified position.
Parameters: item - the item to be added Parameters: index - index at which the specified element is to be inserted |
isChecked | public boolean isChecked()(Code) | | Returns true if the item is checked.
the checked state |
isExpanded | public boolean isExpanded()(Code) | | Returns true if the item is expanded, and false
otherwise.
the expanded state |
isFirst | boolean isFirst()(Code) | | |
isLeaf | public boolean isLeaf()(Code) | | 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.
the leaf state |
isRoot | public boolean isRoot()(Code) | | Returns true if the item is a root item.
the rooot state |
onRender | protected void onRender()(Code) | | |
remove | public void remove(TreeItem item)(Code) | | Removes a child from the item.
Parameters: item - the item to be removed |
removeAll | public void removeAll()(Code) | | Removes all child items.
|
renderChildren | protected void renderChildren()(Code) | | |
setChecked | public void setChecked(boolean checked)(Code) | | Sets the item's checked value.
Parameters: checked - true to check |
setChildrenRendered | protected void setChildrenRendered(boolean rendered)(Code) | | |
setExpanded | public void setExpanded(boolean expanded)(Code) | | Sets the item's expanded state.
Parameters: expanded - true to expand |
setExpanded | public void setExpanded(boolean expanded, boolean deep)(Code) | | Sets the item's expand state.
Parameters: expanded - true to expand Parameters: deep - true to expand all children |
setIconStyle | public void setIconStyle(String style)(Code) | | Sets the item's icon style.
Parameters: style - the icon style |
setLeaf | public void setLeaf(boolean leaf)(Code) | | 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 |
setRoot | protected void setRoot(boolean isRoot)(Code) | | |
setText | public void setText(String text)(Code) | | Sets the item's text.
Parameters: text - the new text |
toggle | public void toggle()(Code) | | Toggles the item's expand state.
|
Methods inherited from net.mygwt.ui.client.widget.Component | public void addListener(int eventType, Listener listener)(Code)(Java Doc) public void addStyleName(String style)(Code)(Java Doc) public void addWidgetListener(WidgetListener listener)(Code)(Java Doc) protected void afterRender()(Code)(Java Doc) protected Component blur()(Code)(Java Doc) public void disable()(Code)(Java Doc) protected void disableContextMenu(boolean disable)(Code)(Java Doc) public void disableTextSelection(boolean disable)(Code)(Java Doc) public void dispose()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void enableEvents(boolean enable)(Code)(Java Doc) public boolean fireEvent(int type)(Code)(Java Doc) public boolean fireEvent(int type, BaseEvent be)(Code)(Java Doc) public boolean fireEvent(int eventType, Widget widget, Widget item)(Code)(Java Doc) public boolean fireEvent(int eventType, Widget widget, Widget item, int index)(Code)(Java Doc) public Component focus()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public Rectangle getBounds(boolean content)(Code)(Java Doc) protected Menu getContextMenu()(Code)(Java Doc) public Object getData()(Code)(Java Doc) public Object getData(String key)(Code)(Java Doc) public String getDisabledStyle()(Code)(Java Doc) public Element getElement()(Code)(Java Doc) protected Element getFocusElement()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public int getHeight(boolean content)(Code)(Java Doc) public String getId()(Code)(Java Doc) public int getStyle()(Code)(Java Doc) public ToolTip getToolTip()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getWidth(boolean content)(Code)(Java Doc) public void hide()(Code)(Java Doc) public boolean isDisposed()(Code)(Java Doc) public boolean isEnabled()(Code)(Java Doc) public boolean isRendered()(Code)(Java Doc) public boolean isVisible()(Code)(Java Doc) protected void onAttach()(Code)(Java Doc) public void onBaseEvent(BaseEvent be)(Code)(Java Doc) public void onBrowserEvent(Event event)(Code)(Java Doc) protected void onDestroy()(Code)(Java Doc) protected void onDetach()(Code)(Java Doc) protected void onDisable()(Code)(Java Doc) protected void onEnable()(Code)(Java Doc) protected void onHide()(Code)(Java Doc) protected void onHideContextMenu()(Code)(Java Doc) protected void onLoad()(Code)(Java Doc) protected void onRender()(Code)(Java Doc) protected void onResize(int width, int height)(Code)(Java Doc) protected void onRightClick(BaseEvent be)(Code)(Java Doc) protected void onShow()(Code)(Java Doc) protected void onShowContextMenu(int x, int y)(Code)(Java Doc) public void recalculate()(Code)(Java Doc) public void removeAllListeners()(Code)(Java Doc) public void removeFromParent()(Code)(Java Doc) public void removeListener(int eventType, Listener listener)(Code)(Java Doc) public void removeStyleName(String style)(Code)(Java Doc) public void removeWidgetListener(WidgetListener listener)(Code)(Java Doc) protected void render()(Code)(Java Doc) public void setBorders(boolean show)(Code)(Java Doc) public void setBounds(int x, int y, int width, int height)(Code)(Java Doc) public void setBounds(Rectangle rect)(Code)(Java Doc) protected void setContextMenu(Menu menu)(Code)(Java Doc) public void setData(Object data)(Code)(Java Doc) public void setData(String key, Object data)(Code)(Java Doc) public void setDisabledStyle(String style)(Code)(Java Doc) public void setElement(Element elem)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setHeight(int height)(Code)(Java Doc) public void setHeight(String height)(Code)(Java Doc) public void setId(String id)(Code)(Java Doc) public void setIntStyleAttribute(String attr, int value)(Code)(Java Doc) public void setPagePosition(int x, int y)(Code)(Java Doc) public void setPixelSize(int width, int height)(Code)(Java Doc) public void setSize(int width, int height)(Code)(Java Doc) public void setSize(String width, String height)(Code)(Java Doc) public void setStyleAttribute(String attr, String value)(Code)(Java Doc) public void setStyleName(String style)(Code)(Java Doc) public void setTitle(String title)(Code)(Java Doc) public void setToolTip(String text)(Code)(Java Doc) public void setToolTip(String title, String text)(Code)(Java Doc) public void setVisible(boolean visible)(Code)(Java Doc) public void setWidth(int width)(Code)(Java Doc) public void setWidth(String width)(Code)(Java Doc) public void show()(Code)(Java Doc) public void unhook(int type, EventListener listener)(Code)(Java Doc)
|
|
|