|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.adf.web.data.TocNode
public class TocNode
A TocNode stores content, maintains hierarchical relationships, and responds to events that occur on a table of
contents node. To store content, a TocNode requires a TocNodeContent object to encapsulate the content at
that node. A TocNode handles its own expand or collapse event and delegates the check box event—for layer
visibility—and the node operation—when node content is clicked—to the TocNodeContent’s event handling methods.
| Field Summary | |
|---|---|
static int |
CONTEXT_MENU_OPERATION
The context menu operation. |
static int |
EXPAND_COLLAPSE_OPERATION
The expand/collapse operation. |
static int |
NODE_OPERATION
The node click operation. |
| Constructor Summary | |
|---|---|
|
TocNode(TocNodeContent content)
Constructs a TocNode. |
|
TocNode(TocNodeContent content,
int order)
Constructs the TocNode and positions the node at the specified position. |
protected |
TocNode(TocNodeContent content,
int order,
TocNode parent)
Constructs the TocNode and adds it to the parent at the specified position. |
| Method Summary | |
|---|---|
TocNode |
addChild(int position,
TocNodeContent cont)
Adds a child to the TOC node placed at the specified order (Order starts at 1). |
void |
addChild(TocNode childNode)
Adds a TocNode to this node's children. |
TocNode |
addChild(TocNodeContent cont)
Adds a child to the TOC node. |
void |
addChild(TocNode childNode,
int position)
Adds a TocNode to this node's children at the specified position. |
TocNode |
findNode(long id)
Finds a node in this node's sub tree based on a nodeId. |
TocNode |
findNode(String nodeKey)
Finds a node in this node's sub tree based on the key of the TocNode. |
Collection<TocNode> |
getChildren()
Returns all the children of this node. |
TocNodeContent |
getContent()
Returns the content of this node. |
String |
getKey()
Returns the key identifying this node in its current position. |
int |
getLevel()
Returns the level of this node which is the level of its parent + 1. |
long |
getNodeId()
|
int |
getOrder()
Returns the order of this node among its siblings. |
TocNode |
getParent()
|
void |
handleCheckedEvent(boolean pChecked,
TocEvent args)
Handles the checked/unchecked operations for the node. |
void |
handleNodeEvent(TocEvent args)
Handles the node event at this node. |
boolean |
isChecked()
|
boolean |
isDirty()
|
boolean |
isDisabled()
|
boolean |
isExpanded()
Returns an indicator whether the node is expanded. |
void |
move(int newPos)
Moves the node at the specified position in the current parent's children tree. |
void |
move(TocNode newParent)
Moves the node to a new parent node at the end of its children tree. |
void |
move(TocNode newParent,
int newPos)
Moves the node to the new parent at the specified position. |
boolean |
removeChild(long id)
Removes a child node according to the nodeId provided. |
boolean |
removeChild(String nodeKey)
Removes a child node according to the key provided. |
boolean |
removeChild(TocNode node)
Removes a node from this node's children. |
void |
setAllExpanded(boolean expanded,
int level)
Sets the expand level for all the nodes. |
void |
setChecked(boolean checked)
|
void |
setDirty(boolean dirty)
|
void |
setDisabled(boolean disabled)
|
void |
setExpanded(boolean expanded)
Sets whether the node is expanded. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int EXPAND_COLLAPSE_OPERATION
public static final int NODE_OPERATION
public static final int CONTEXT_MENU_OPERATION
| Constructor Detail |
|---|
public TocNode(TocNodeContent content)
content - the TocNodeContent to store at the top level.
public TocNode(TocNodeContent content,
int order)
content - the TocNodeContentorder - the index in the parent's children tree
protected TocNode(TocNodeContent content,
int order,
TocNode parent)
content - the TocNodeContentorder - the index in the parent's children treeparent - the parent node| Method Detail |
|---|
public TocNode getParent()
public void move(TocNode newParent,
int newPos)
newParent - the new parent nodenewPos - the new position in the parent's children treepublic void move(int newPos)
newPos - the new position in the parent's children treepublic void move(TocNode newParent)
newParent - public TocNode addChild(TocNodeContent cont)
content - the TocNodeContent
TocNode- the new TocNode
public TocNode addChild(int position,
TocNodeContent cont)
cont - the TocNodeContentord - the position in the TOC
TocNode- the new TocNodepublic void addChild(TocNode childNode)
TocNode to this node's children.
childNode - the TocNode to be added
public void addChild(TocNode childNode,
int position)
TocNode to this node's children at the specified position.
childNode - the TocNode to be addedposition - the position in the parent's children treepublic boolean removeChild(String nodeKey)
nodeKey - the key identifying the node to be removed
public boolean removeChild(long id)
id - the nodeId identifying the node to be removed
public boolean removeChild(TocNode node)
nodeKey - the key identifying the node to remove
public Collection<TocNode> getChildren()
public TocNodeContent getContent()
TocNodeContent- the TocNodeContentpublic int getOrder()
public int getLevel()
public long getNodeId()
public boolean isExpanded()
public boolean isDisabled()
public boolean isChecked()
public boolean isDirty()
public void setDirty(boolean dirty)
dirty - the dirty state to setpublic void setChecked(boolean checked)
checked - the checked to setpublic void setDisabled(boolean disabled)
disabled - the disabled to setpublic void setExpanded(boolean expanded)
expanded - if true, the node is expanded
public void setAllExpanded(boolean expanded,
int level)
expanded - if true, set all nodes expanded.level - the number of levels to be expanded. Fully expand if level < 0.
public void handleNodeEvent(TocEvent args)
throws Exception
TocControl calls this method for
a TOC event which is not a check/uncheck operation. The expand/collapse operation is handled and the arguments are
then passed on to the TocNodeContent of this node to handle any events which occurred at the content level.
args - the TocEvent
Exception
public void handleCheckedEvent(boolean pChecked,
TocEvent args)
throws Exception
checked - if true, the node is checkedargs - TocEvent
Exception - if an error occurs for the checked eventpublic TocNode findNode(String nodeKey)
nodeKey - the TocNode key
TocNode- the TocNode which matches the keypublic TocNode findNode(long id)
nodeKey - the TocNode unique ID
TocNode- the TocNode which matches the node ID providedpublic String getKey()
String- the keypublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||