|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gwtext.client.core.JsObject
com.gwtext.client.data.Node
public class Node
A data Node class.
Field Summary | |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
configJS
|
Fields inherited from class com.gwtext.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
Node()
Create a new Node instance. |
|
Node(com.google.gwt.core.client.JavaScriptObject jsObj)
|
Method Summary | |
---|---|
void |
addListener(NodeListener listener)
Add a Node listener. |
void |
appendChild(Node child)
Insert node as the last child node of this node. |
void |
bubble(NodeTraversalCallback cb)
Bubbles up the tree from this node, calling the specified function with each node. |
void |
cascade(NodeTraversalCallback cb)
Cascades down the tree from this node, calling the specified function with each node. |
boolean |
contains(Node child)
Returns true if this node is an ancestor (at any point) of the passed node. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
protected Node |
createNode(com.google.gwt.core.client.JavaScriptObject jsNode)
|
void |
eachChild(NodeTraversalCallback cb)
Interates the child nodes of this node, calling the specified function with each node. |
boolean |
equals(java.lang.Object o)
|
Node |
findChildBy(NodeTraversalCallback cb)
Finds the first child by a custom callback function. |
java.lang.String |
getAttribute(java.lang.String name)
Returns a node's attribute as String. |
java.lang.Object |
getAttributeAsObject(java.lang.String name)
Returns a node's Object attribute. |
Node[] |
getChildNodes()
Returns all child nodes of this node. |
int |
getDepth()
Returns depth of this node (the root node has a depth of 0). |
Node |
getFirstChild()
Return the first direct child node of this node, or null if this node has no child nodes. |
java.lang.String |
getId()
Return the node's ID. |
com.google.gwt.core.client.JavaScriptObject |
getJsObj()
|
Node |
getLastChild()
return the last direct child node of this node, or null if this node has no child nodes. |
Node |
getNextSibling()
Return the node immediately following this node in the tree, or null if there is no sibling node. |
Tree |
getOwnerTree()
Returns the tree this node is in. |
Node |
getParentNode()
The parent node for this node. |
java.lang.String |
getPath()
Returns the path for this node. |
java.lang.String |
getPath(java.lang.String attr)
Returns the path for this node. |
Node |
getPreviousSibling()
Return the node immediately preceding this node in the tree, or null if there is no sibling node. |
java.lang.Object |
getUserObject()
Return the user defined object |
int |
hashCode()
|
int |
indexOf(Node child)
Returns the index of a child node. |
Node |
insertBefore(Node node,
Node nodeRef)
Inserts the first node before the second node in this nodes childNodes collection. |
boolean |
isAncestor(Node node)
Returns true if the passed node is an ancestor (at any point) of this node. |
boolean |
isFirst()
Returns true if this node is the first child of its parent. |
boolean |
isLast()
Returns true if this node is the last child of its parent. |
boolean |
isLeaf()
Returns true if this node is a leaf. |
Node |
item(int index)
Returns the child node at the specified index. |
void |
remove()
Removes this node from it's parent. |
Node |
removeChild(Node child)
Removes a child node from this node. |
Node |
replaceChild(Node newChild,
Node oldChild)
Replaces one child node in this node with another. |
protected void |
setAttribute(java.lang.String name,
com.google.gwt.core.client.JavaScriptObject value)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets a attribute on the node. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets a attribute on the node. |
void |
setId(java.lang.String id)
Set the Node's ID. |
void |
setLeaf(boolean leaf)
Sets whether the node is a leaf. |
void |
setUserObject(java.lang.Object userObject)
Associate a user defined Object with the node. |
void |
sort(java.util.Comparator c)
Sorts this nodes children using the supplied sort function. |
Methods inherited from class com.gwtext.client.core.JsObject |
---|
getProperties, isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject configJS
Constructor Detail |
---|
public Node()
public Node(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
protected Node createNode(com.google.gwt.core.client.JavaScriptObject jsNode)
public com.google.gwt.core.client.JavaScriptObject getJsObj()
getJsObj
in class JsObject
public void setAttribute(java.lang.String name, java.lang.Object value)
name
- the attribute namevalue
- the attribute valuepublic void setAttribute(java.lang.String name, java.lang.String value)
name
- the attribute namevalue
- the attribute valueprotected void setAttribute(java.lang.String name, com.google.gwt.core.client.JavaScriptObject value)
public java.lang.String getAttribute(java.lang.String name)
name
- the attribute name
public java.lang.Object getAttributeAsObject(java.lang.String name)
name
- the attribute name
setAttribute(String, Object)
public Node[] getChildNodes()
public Node getFirstChild()
public java.lang.String getId()
public Node getLastChild()
public Node getNextSibling()
public Node getParentNode()
public Node getPreviousSibling()
public void appendChild(Node child)
child
- node to appendpublic void bubble(NodeTraversalCallback cb)
cb
- the callback function handlepublic void cascade(NodeTraversalCallback cb)
cb
- the callback function handlepublic boolean contains(Node child)
child
- the node
public void eachChild(NodeTraversalCallback cb)
cb
- the callback function handlepublic Node findChildBy(NodeTraversalCallback cb)
cb
- the callback function handle
public int getDepth()
public Tree getOwnerTree()
public java.lang.String getPath()
public java.lang.String getPath(java.lang.String attr)
attr
- the attr to use for the path (defaults to the node's id)
public int indexOf(Node child)
child
- the child node
public Node insertBefore(Node node, Node nodeRef)
node
- the node to insertnodeRef
- the node to insert before (if null the node is appended)
public boolean isAncestor(Node node)
node
- the node to test
public boolean isFirst()
public boolean isLast()
public boolean isLeaf()
public Node item(int index)
index
- the index
public void remove()
public Node removeChild(Node child)
child
- the node to remove
public Node replaceChild(Node newChild, Node oldChild)
newChild
- the replacement nodeoldChild
- the node to replace
public void sort(java.util.Comparator c)
c
- the Comparator return 0 if equal, -1 if first node less than second, 1 if first greater than secondpublic void addListener(NodeListener listener)
listener
- the listenerpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setUserObject(java.lang.Object userObject)
userObject
- the user data objectpublic java.lang.Object getUserObject()
public void setId(java.lang.String id)
id
- the node IDpublic void setLeaf(boolean leaf)
leaf
- true if leaf
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |