Author: dolander
Date: Thu Mar 10 15:19:44 2005
New Revision: 157010
URL: http://svn.apache.org/viewcvs?view=rev&rev=157010
Log:
Updated doc....
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java?view=diff&r1=157009&r2=157010
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
Thu Mar 10 15:19:44 2005
@@ -45,7 +45,7 @@
* @jsptagref.tagdescription Renders a navigable tree of [EMAIL PROTECTED]
TreeElement}
* objects.
*
- * <p>The tree is bound to a variable through the <code>tree</code> attribute.
+ * <p>The tree is bound to a variable through the <code>dataSource</code>
attribute.
* If the bound variable exists, then the body content of this tag is not
processed
* and the tree is rendered. If the bound variable doesn't exist, we will
process
* the body and create the <code>TreeElement</code> tree structure and set the
@@ -60,14 +60,16 @@
* <blockquote>
* <ul>
* <li>folder.gif</li>
- * <li>handledownlast.gif</li>
- * <li>handledownmiddle.gif</li>
- * <li>handlerightlast.gif</li>
- * <li>handlerightmiddle.gif</li>
- * <li>linelastnode.gif</li>
- * <li>linemiddlenode.gif</li>
- * <li>linevertical.gif</li>
+ * <li>lastLineJoin.gif</li>
+ * <li>lastNodeCollapsed.gif</li>
+ * <li>lastNodeExpanded.gif</li>
+ * <li>lineJoin.gif</li>
+ * <li>nodeCollapsed.gif</li>
+ * <li>nodeExpanded.gif</li>
+ * <li>rootCollapsed.gif</li>
+ * <li>rootExpanded.gif</li>
* <li>spacer.gif</li>
+ * <li>verticalLine.gif</li>
* </ul>
* </blockquote>
*
@@ -83,14 +85,14 @@
* dataSource="pageflow.myTree"
* selectionAction="postback"
* tagId="myTree">
- * <netui:treeItem expanded="true" action="postback">
+ * <netui:treeItem expanded="true" >
* <netui:treeLabel>Root Folder</netui:treeLabel>
- * <netui:treeItem expanded="false" action="postback">
+ * <netui:treeItem expanded="false">
* <netui:treeLabel>I</netui:treeLabel>
- * <netui:treeItem expanded="false" action="postback">
+ * <netui:treeItem expanded="false">
* <netui:treeLabel>A</netui:treeLabel>
- * <netui:treeItem action="postback">1</netui:treeItem>
- * <netui:treeItem action="postback">2</netui:treeItem>
+ * <netui:treeItem>1</netui:treeItem>
+ * <netui:treeItem>2</netui:treeItem>
* </netui:treeItem>
* </netui:treeItem>
* </netui:treeItem>
@@ -144,7 +146,8 @@
}
/**
- * Sets the action used for expanding and contracting tree nodes.
+ * Sets the action used for expanding and contracting tree nodes. This
action will be
+ * inherited by the <code>TreeElements</code> inside the tree.
* @param action - the action
* @netui:attribute required="false" rtexprvalue="true"
* description="Sets the action used for expanding and contracting tree
nodes."
@@ -157,7 +160,8 @@
}
/**
- * Sets the action used for expanding and contracting tree nodes.
+ * Sets the action used for selecting tree nodes. This action will be
+ * inherited by the <code>TreeElements</code> inside the tree.
* @param action - the action
* @netui:attribute required="true" rtexprvalue="true"
* description="Sets the action used when a tree node is selected."
@@ -170,7 +174,7 @@
}
/**
- * Return the action for selection events on the tree. This action will
be called
+ * Return the action for selection action on the tree. This action will
be called
* when a TreeElement is selected.
* @return the selection action name.
*/
@@ -180,10 +184,11 @@
}
/**
- * Sets the action used for expanding and contracting tree nodes.
- * @param target - the target for expansion
+ * Sets the target for a selection action. This can specify the name
+ * of the frame where the document is to be opened.
+ * @param target - the target for selection
* @netui:attribute rtexprvalue="true"
- * description="Sets the frame target used for expanding and contracting
tree nodes."
+ * description="Sets the frame target used for selecting tree nodes."
* @netui.tldx:attribute category="general" reftype="netui-action-url"
*/
public void setSelectionTarget(String target)
@@ -193,10 +198,12 @@
/**
- * Set the ID of the tag.
+ * Set the ID of the tag. This is required and will not generate the
+ * standard JavaScript lookup code unless <code>RenderTagIdLookup</code>
+ * is set to <code>true</code>.
* @param tagId - the tagId.
* @netui:attribute required="true" rtexprvalue="true"
- * description="Set the id of the tree. This appears on the containing
<div>."
+ * description="Set the id of the tree. This appears on the containing
<div>."
* @netui.tldx:attribute category="general"
*/
public void setTagId(String tagId)
@@ -207,7 +214,7 @@
/**
* Sets the image name for an open non-leaf node with no
- * line below it. (Defaults to "handledownlast.gif").
+ * line below it. (Defaults to "lastNodeExpanded.gif").
* @param lastNodeExpandedImage - the image name (including extension)
* @jsptagref.attributedescription The image name for an open non-leaf
node with no line below it. (Defaults to "handledownlast.gif".)
* @jsptagref.databindable false
@@ -226,7 +233,7 @@
/**
* Sets the image name for an open non-leaf node with a
- * line below it. (Defaults to "handledownmiddle.gif").
+ * line below it. (Defaults to "nodeExpanded.gif").
* @param nodeExpandedImage - the image name (including extension)
* @jsptagref.attributedescription The image name for an open non-leaf
node with a
* line below it. (Defaults to "handledownmiddle.gif".)
@@ -246,7 +253,7 @@
/**
* Sets the image name for a closed non-leaf node with no
- * line below it. (Defaults to "handlerightlast.gif").
+ * line below it. (Defaults to "lastNodeCollapsed.gif").
* @param lastNodeCollapsedImage - the image name (including extension)
* @jsptagref.attributedescription The image name for a closed non-leaf
node with no
* line below it. (Defaults to "handlerightlast.gif".)
@@ -266,7 +273,7 @@
/**
* Sets the image name for a closed non-leaf node with a
- * line below it. (Defaults to "handlerightmiddle.gif").
+ * line below it. (Defaults to "nodeCollapsed.gif").
* @param nodeCollapsedImage - the image name (including extension)
* @jsptagref.attributedescription The image name for a closed non-leaf
node with a
* line below it. (Defaults to "handlerightmiddle.gif".)
@@ -286,7 +293,7 @@
/**
* Sets the image name for a blank area of the tree.
- * (Defaults to "linelastnode.gif").
+ * (Defaults to "lastLineJoin.gif").
* @param lastLineJoinImage - the image name (including extension)
* @jsptagref.attributedescription The image name for a blank area of the
tree.
* (Defaults to "linelastnode.gif")
@@ -305,7 +312,7 @@
/**
* Sets the default icon for TreeElements for a blank area of the tree.
- * (Defaults to "linelastnode.gif").
+ * (Defaults to "folder.gif").
* @param itemIcon - the image name of the itemIcon
* @netui:attribute required="false" rtexprvalue="true"
* description="Sets the default icon for TreeElements for a blank area of
the tree."
@@ -320,7 +327,7 @@
/**
* Sets the image name for an area with a line through it.
- * (Defaults to "linemiddlenode.gif").
+ * (Defaults to "lineJoin.gif").
* @param lineJoinImage - the image name (including extension)
* @jsptagref.attributedescription The image name for an area with a line
through it.
* (Defaults to "linemiddlenode.gif").
@@ -339,7 +346,7 @@
/**
* Sets the image name for an area with a line through it.
- * (Defaults to "linevertical.gif").
+ * (Defaults to "verticalLine.gif").
* @param verticalLineImage - the image name (including extension)
* @jsptagref.attributedescription The image name for an area with a line
through it.
* (Defaults to "linevertical.gif").
@@ -357,16 +364,17 @@
}
/**
- * Sets the name of the directory containing the images for our icons,
- * relative to the page including this tag.
+ * Sets the name of the directory containing the images. This should be
specified
+ * absolutely within the webapp. This target will provide images for the
structure of
+ * the tree. If the <code>iconRoot</code> is not set, then this will also
specify where
+ * the icons come are found.
* @param imageRoot - the directory name
- * @jsptagref.attributedescription The directory containing the images for
tree icons,
- * relative to the page that includes the <netui:tree> tag.
+ * @jsptagref.attributedescription The directory containing the images for
tree icons.
* @jsptagref.databindable false
* @jsptagref.attributesyntaxvalue <i>string_imageRoot</i>
* @netui:attribute required="false" rtexprvalue="true"
* description="Sets the name of the directory containing the images for
our icons,
- * relative to the page including this tag."
+ * and structure of the tree."
* @netui.tldx:attribute category="images"
*/
public void setImageRoot(String imageRoot)
@@ -425,6 +433,11 @@
}
/**
+ * Cause expansion and contraction on the client. When this is set, the
+ * expand and collapse events will be handled on the client. TreeElements
which are hidden
+ * becauses other TreeElements are collapsed will be rendered to the page
and then displayed
+ * by JavaScript on the page. These expansion and contraction events will
not call
+ * the server's expansion action.
* @param runAtClient
* @netui:attribute required="false" rtexprvalue="false"
* description="Indicate that base expand and contraction will happen on
the client."
@@ -471,6 +484,10 @@
}
}
+ /**
+ * Return the root node of the tree.
+ * @return returns the root node of the tree.
+ */
public TreeElement getRootNode()
{
return _rootNode;
@@ -588,7 +605,11 @@
/**
* Sets an expression which indentifies the TreeElement that represents
the root of
- * the tree.
+ * the tree. When the variable being bound to is not null, the body of
the Tree
+ * will be ignored and the tree being bound to will be rendered. If the
variable
+ * being bound to is null, then the body of the tree will be processed to
create
+ * the initial tree state and the bound variable will be set. In this
situation
+ * the property must support both read and write.
* @param dataSource - the tree attribute name
* @netui:attribute required="true"
* description="Sets an expression which indentifies the TreeElement that
represents the root of
@@ -761,7 +782,6 @@
}
// check for the nodes that are expanded...
-
// Add the script support for the tree.
if (_trs.runAtClient) {
IScriptReporter sr = getScriptReporter();
@@ -809,8 +829,8 @@
if (_trs.runAtClient) {
_divState.registerAttribute(AbstractHtmlState.ATTR_GENERAL,
"netui:treeName",
((INameable) treeRoot).getObjectName());
-
}
+
TagRenderingBase divRenderer =
TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, request);
divRenderer.doStartTag(writer, _divState);
sb.append("\n");
@@ -930,5 +950,4 @@
}
return idScript;
}
-
}