You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/10/19 07:11:15 UTC
svn commit: r326395 [1/3] - in /beehive/trunk/netui:
src/tags-html/org/apache/beehive/netui/tags/
src/tags-html/org/apache/beehive/netui/tags/rendering/
src/tags-html/org/apache/beehive/netui/tags/tree/
src/util/org/apache/beehive/netui/util/config/bea...
Author: rich
Date: Tue Oct 18 22:10:36 2005
New Revision: 326395
URL: http://svn.apache.org/viewcvs?rev=326395&view=rev
Log:
This is a patch from Carlin Rogers to address http://issues.apache.org/jira/browse/BEEHIVE-974 : Allow users to define their own tree renderer
tests: bvt in netui (WinXP)
BB: same (linux)
Added:
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java
- copied, changed from r325990, beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderSupport.java
- copied, changed from r325990, beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderer.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java (with props)
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRendererFactory.java (with props)
beehive/trunk/netui/test/webapps/drt/coreWeb/tree/renderer/
beehive/trunk/netui/test/webapps/drt/coreWeb/tree/renderer/Controller.jpf (with props)
beehive/trunk/netui/test/webapps/drt/coreWeb/tree/renderer/TestTreeRenderer.java (with props)
beehive/trunk/netui/test/webapps/drt/coreWeb/tree/renderer/index.jsp (with props)
beehive/trunk/netui/test/webapps/drt/testRecorder/tests/TreeRenderer.xml (with props)
Removed:
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderer.java
Modified:
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/AttributeRenderer.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderState.java
beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderer.java
beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/bean/JspTagConfig.java
beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/parser/NetUIConfigParser.java
beehive/trunk/netui/src/util/org/apache/beehive/netui/util/config/schema/beehive-netui-config.xsd
beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNested/Controller.jpf
beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
beehive/trunk/netui/test/webapps/drt/testRecorder/tests/RichTreeEncodeContent.xml
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/TagConfig.java Tue Oct 18 22:10:36 2005
@@ -1,105 +1,136 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.netui.tags;
-
-import org.apache.beehive.netui.tags.tree.InheritableState;
-import org.apache.beehive.netui.util.config.ConfigUtil;
-import org.apache.beehive.netui.util.config.bean.JspTagConfig;
-import org.apache.beehive.netui.util.config.bean.IdJavascript;
-
-/**
- * This class implements a series of static method that will return configuration information. The
- * information is buffered, and config properties values defined here. The document type configuration
- * is not found in this class. It is found TagRenderBase {@link org.apache.beehive.netui.tags.rendering.TagRenderingBase}
- * and the HTML tag {@link org.apache.beehive.netui.tags.html.Html}.
- */
-final public class TagConfig
-{
- // This is the value of the javascript support for the webapp. This should
- // be one of the enum values defined above.
- private static int javascriptMode = -1;
-
- private static String defaultTreeImageLocation = null;
-
-
- /**
- * Return true if the legacy JavaScript support should be written to the output stream.
- * @return boolean
- */
- public static boolean isLegacyJavaScript()
- {
- if (javascriptMode == -1) {
- setLegacyJavaScriptMode();
- }
- assert(javascriptMode != -1);
- return (javascriptMode == IdJavascript.INT_LEGACY
- || javascriptMode == IdJavascript.INT_LEGACY_ONLY);
- }
-
- /**
- * Return true if the default JavaScript support should be written to the output stream.
- * @return boolean
- */
- public static boolean isDefaultJavaScript()
- {
- if (javascriptMode == -1) {
- setLegacyJavaScriptMode();
- }
- assert(javascriptMode != -1);
- return (javascriptMode == IdJavascript.INT_DEFAULT
- || javascriptMode == IdJavascript.INT_LEGACY);
- }
-
- /**
- * This method returns the default location for the tree images. This may be configured by setting
- * the <tree-image-location> element in the netui.config file to the location of the images.
- * This location should not include the context path of the webapp or the leading '/', but should be an absolute
- * path within the webapp.
- * <p><tree-image-location>resources/images</tree-image-location>
- * </p>
- * @return the default location of the tree images.
- */
- public static String getTreeImageLocation()
- {
- if (defaultTreeImageLocation == null) {
- JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
- if (tagConfig != null) {
- String s = tagConfig.getTreeImageLocation();
- defaultTreeImageLocation = (s != null) ? s : InheritableState.DEFAULT_IMAGES;
- }
- else
- defaultTreeImageLocation = InheritableState.DEFAULT_IMAGES;
- }
- assert(defaultTreeImageLocation != null);
- return defaultTreeImageLocation;
- }
-
- /**
- * This will set the JavaScript support level for the id and name attributes.
- */
- private static void setLegacyJavaScriptMode()
- {
- JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
- if (tagConfig != null) {
- javascriptMode = tagConfig.getIdJavascript().getValue();
- }
- else {
- javascriptMode = IdJavascript.INT_DEFAULT;
- }
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags;
+
+import org.apache.beehive.netui.tags.tree.InheritableState;
+import org.apache.beehive.netui.util.config.ConfigUtil;
+import org.apache.beehive.netui.util.config.bean.JspTagConfig;
+import org.apache.beehive.netui.util.config.bean.IdJavascript;
+
+/**
+ * This class implements a series of static method that will return configuration information. The
+ * information is buffered, and config properties values defined here. The document type configuration
+ * is not found in this class. It is found TagRenderBase {@link org.apache.beehive.netui.tags.rendering.TagRenderingBase}
+ * and the HTML tag {@link org.apache.beehive.netui.tags.html.Html}.
+ */
+final public class TagConfig
+{
+ // This is the value of the javascript support for the webapp. This should
+ // be one of the enum values defined above.
+ private static int javascriptMode = -1;
+
+ private static String defaultTreeImageLocation = null;
+ private static String defaultTreeRendererClassName = null;
+
+
+ /**
+ * Return true if the legacy JavaScript support should be written to the output stream.
+ * @return boolean
+ */
+ public static boolean isLegacyJavaScript()
+ {
+ if (javascriptMode == -1) {
+ setLegacyJavaScriptMode();
+ }
+ assert(javascriptMode != -1);
+ return (javascriptMode == IdJavascript.INT_LEGACY
+ || javascriptMode == IdJavascript.INT_LEGACY_ONLY);
+ }
+
+ /**
+ * Return true if the default JavaScript support should be written to the output stream.
+ * @return boolean
+ */
+ public static boolean isDefaultJavaScript()
+ {
+ if (javascriptMode == -1) {
+ setLegacyJavaScriptMode();
+ }
+ assert(javascriptMode != -1);
+ return (javascriptMode == IdJavascript.INT_DEFAULT
+ || javascriptMode == IdJavascript.INT_LEGACY);
+ }
+
+ /**
+ * This method returns the default location for the tree images. This may be configured by setting
+ * the <tree-image-location> element in the netui.config file to the location of the images.
+ * This location should not include the context path of the webapp or the leading '/', but should be an absolute
+ * path within the webapp.
+ * <p><tree-image-location>resources/images</tree-image-location>
+ * </p>
+ * @return the default location of the tree images.
+ */
+ public static String getTreeImageLocation()
+ {
+ if (defaultTreeImageLocation == null) {
+ JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
+ if (tagConfig != null) {
+ String s = tagConfig.getTreeImageLocation();
+ defaultTreeImageLocation = (s != null) ? s : InheritableState.DEFAULT_IMAGES;
+ }
+ else
+ defaultTreeImageLocation = InheritableState.DEFAULT_IMAGES;
+ }
+ assert(defaultTreeImageLocation != null);
+ return defaultTreeImageLocation;
+ }
+
+ /**
+ * This method returns the class name of the renderer to use for NetUI
+ * trees in the Web application. The class name returned will usually
+ * be the predefined default NetUI implementation,
+ * {@link org.apache.beehive.netui.tags.tree.TreeRenderer}, unless
+ * NetUI is configured to use a different implementation.
+ * This may be configured by setting the <tree-renderer-class>
+ * element in the beehive-netui-config file to the name of a class that
+ * extends {@link org.apache.beehive.netui.tags.tree.TreeRenderer}.
+ * <p><tree-renderer-class>com.xyz.tree.CustomTreeRenderer</tree-renderer-class>
+ * </p>
+ * <p>Note that the NetUI {@link org.apache.beehive.netui.tags.tree.Tree}
+ * tag has an attribute for setting the name of the TreeRenderer class to
+ * use on a tree by tree bases.
+ * </p>
+ * @return the name of the class to use to renderer the trees in the application.
+ */
+ public static String getTreeRendererClassName()
+ {
+ if (defaultTreeRendererClassName == null) {
+ JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
+ if (tagConfig != null) {
+ // the schema config includes a default value so we shouldn't
+ // get a null value from the config object.
+ defaultTreeRendererClassName = tagConfig.getTreeRendererClass();
+ }
+ }
+ return defaultTreeRendererClassName;
+ }
+
+ /**
+ * This will set the JavaScript support level for the id and name attributes.
+ */
+ private static void setLegacyJavaScriptMode()
+ {
+ JspTagConfig tagConfig = ConfigUtil.getConfig().getJspTagConfig();
+ if (tagConfig != null) {
+ javascriptMode = tagConfig.getIdJavascript().getValue();
+ }
+ else {
+ javascriptMode = IdJavascript.INT_DEFAULT;
+ }
+ }
+}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/FormTag.java Tue Oct 18 22:10:36 2005
@@ -22,7 +22,7 @@
import java.util.HashMap;
/**
- * Renderthe HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
+ * Render the HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
* The action is a required attribute.
*/
public abstract class FormTag extends TagHtmlBase implements HtmlConstants
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/rendering/HtmlTag.java Tue Oct 18 22:10:36 2005
@@ -22,7 +22,7 @@
import java.util.HashMap;
/**
- * Renderthe HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
+ * Render the HTML <form> element. In HTML 4.01 both the start and end tag are rquired.
* The action is a required attribute.
*/
abstract public class HtmlTag extends TagHtmlBase implements HtmlConstants
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/AttributeRenderer.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/AttributeRenderer.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/AttributeRenderer.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/AttributeRenderer.java Tue Oct 18 22:10:36 2005
@@ -24,7 +24,7 @@
import java.util.ArrayList;
-class AttributeRenderer
+public class AttributeRenderer
{
private static final ArrayList empty = new ArrayList();
private static final RemoveInfo emptyRemoves = new RemoveInfo();
Copied: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java (from r325990, beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java)
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java?p2=beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java&p1=beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java&r1=325990&r2=326395&rev=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderer.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/ServletTreeRenderSupport.java Tue Oct 18 22:10:36 2005
@@ -1,77 +1,76 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.netui.tags.tree;
-
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
-
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
-import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
-import org.apache.beehive.netui.util.logging.Logger;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
-
-public class ServletTreeRenderer extends TreeRenderer
-{
- private static final Logger logger = Logger.getInstance(ServletTreeRenderer.class);
- AbstractRenderAppender _writer;
- InternalStringBuilder _sb;
-
- ServletTreeRenderer(TreeRenderState trs, HttpServletRequest request,
- HttpServletResponse response, ServletContext servletContext,
- AbstractRenderAppender writer, InternalStringBuilder sb)
- {
- super(trs, request, response, servletContext);
- _writer = writer;
- _sb = sb;
- }
-
- protected void renderBeforeNode(AbstractRenderAppender writer, TreeElement node)
- {
- writer.append("<![CDATA[");
- }
-
- protected void renderAfterNode(AbstractRenderAppender writer, TreeElement node)
- {
- writer.append("]]>");
- TreeCRI.writeElement(_writer, "treeDiv", writer.toString().trim());
- _sb.setLength(0);
- }
-
- /**
- * Errors during rendering will call through this method. During the XmlHttpRequest, these
- * will just be logged and we will go on.
- * @param message
- * @param e
- * @throws JspException
- */
- protected void registerTagError(String message, Throwable e)
- throws JspException
- {
- System.err.println("Error in rendering tree:" + message);
- logger.error(message, e);
- }
-
- protected String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state)
- {
- // @todo: this needs to be implemented
- return null;
- }
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.tree;
+
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
+/**
+ * Derived class to help handle issues specific to rendering the nodes
+ * of a tree for an XmlHttpRequest via the {@link TreeCRI}.
+ */
+public class ServletTreeRenderSupport extends TreeRenderSupport
+{
+ private static final Logger logger = Logger.getInstance(ServletTreeRenderSupport.class);
+ AbstractRenderAppender _writer;
+ InternalStringBuilder _sb;
+
+ ServletTreeRenderSupport(AbstractRenderAppender writer, InternalStringBuilder sb)
+ {
+ _writer = writer;
+ _sb = sb;
+ }
+
+ protected void renderBeforeNode(AbstractRenderAppender writer, TreeElement node)
+ {
+ writer.append("<![CDATA[");
+ }
+
+ protected void renderAfterNode(AbstractRenderAppender writer, TreeElement node)
+ {
+ writer.append("]]>");
+ TreeCRI.writeElement(_writer, "treeDiv", writer.toString().trim());
+ _sb.setLength(0);
+ }
+
+ /**
+ * Errors during rendering will call through this method. During the XmlHttpRequest, these
+ * will just be logged and we will go on.
+ * @param message
+ * @param e
+ * @throws JspException
+ */
+ protected void registerTagError(String message, Throwable e)
+ throws JspException
+ {
+ System.err.println("Error in rendering tree:" + message);
+ logger.error(message, e);
+ }
+
+ protected String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state)
+ {
+ // @todo: this needs to be implemented
+ return null;
+ }
+}
Copied: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderSupport.java (from r325990, beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderer.java)
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderSupport.java?p2=beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderSupport.java&p1=beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderer.java&r1=325990&r2=326395&rev=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderer.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TagTreeRenderSupport.java Tue Oct 18 22:10:36 2005
@@ -1,32 +1,49 @@
-package org.apache.beehive.netui.tags.tree;
-
-import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
-
-class TagTreeRenderer extends TreeRenderer
-{
- private Tree _tree;
-
- TagTreeRenderer(Tree tree, TreeRenderState trs, HttpServletRequest request,
- HttpServletResponse response, ServletContext servletContext)
- {
- super(trs, request, response, servletContext);
- _tree = tree;
- }
-
- protected void registerTagError(String message, Throwable e)
- throws JspException
- {
- _tree.registerTagError(message, e);
- }
-
- protected String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state)
- {
- return _tree.renderTagId(request, tagId, state);
- }
-
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.tree;
+
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
+/**
+ * Derived class to help handle issues specific to rendering a tree
+ * for the {@link Tree} tag.
+ */
+public class TagTreeRenderSupport extends TreeRenderSupport
+{
+ private Tree _tree;
+
+ TagTreeRenderSupport(Tree tree)
+ {
+ _tree = tree;
+ }
+
+ protected void registerTagError(String message, Throwable e)
+ throws JspException
+ {
+ _tree.registerTagError(message, e);
+ }
+
+ protected String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state)
+ {
+ return _tree.renderTagId(request, tagId, state);
+ }
+
+}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/Tree.java Tue Oct 18 22:10:36 2005
@@ -708,6 +708,36 @@
}
/**
+ * Sets the name of the specific TreeRenderer class to use for rendering this tree.
+ * Use this attribute to define a custom renderer to override the behavior of the
+ * default renderer defined for the Web application. By default, the predefined
+ * NetUI implementation, {@link TreeRenderer}, is defined as the renderer to use
+ * across the Web application. The class must extend the NetUI implementation,
+ * {@link TreeRenderer}.
+ * <p>Note that NetUI may be configured to use a different tree renderer
+ * implementation as the default renderer in the Web application. The Web application
+ * default tree renderer is configured by setting the <tree-renderer-class>
+ * element in the beehive-netui-config file to the name of a class that extends
+ * {@link org.apache.beehive.netui.tags.tree.TreeRenderer}.
+ * </p>
+ * <p><tree-renderer-class>com.xyz.tree.CustomTreeRenderer</tree-renderer-class>
+ * </p>
+ * <p>Setting this attribute will always override the configured NetUI default
+ * tree renderer.
+ * </p>
+ * @param treeRendererClassName the name of the TreeRenderer class to use to render the tree.
+ * @jsptagref.attributedescription The name of the TreeRenderer class to use to render the tree.
+ * @jsptagref.databindable false
+ * @jsptagref.attributesyntaxvalue <i>string_treeRendererClassName</i>
+ * @netui:attribute required="false" rtexprvalue="true"
+ * description="Sets the name of the TreeRenderer class to use to render the tree."
+ */
+ public void setTreeRenderer(String treeRendererClassName)
+ {
+ _trs.treeRendererClassName = setNonEmptyValueAttribute(treeRendererClassName);
+ }
+
+ /**
* Prepare the Tree for rendering.
* @throws JspException if a JSP exception has occurred
*/
@@ -758,7 +788,7 @@
// errors should have been caught above
TreeElement treeRoot = getTreeRoot(_expr);
- // if the tree root hasn't been defined, then we need to update the what the object that is
+ // if the tree root hasn't been defined, then we need to update the object that is
// pointed at by the dataSource expression.
if (treeRoot == null) {
if (_rootNode != null) {
@@ -896,8 +926,17 @@
// Render the tree.
AttributeRenderer extraAttrs = new AttributeRenderer();
- TagTreeRenderer ttr = new TagTreeRenderer(this, _trs, request, response, pageContext.getServletContext());
- ttr.render(sb, treeRoot, 0, extraAttrs, _iState);
+ String treeRendererClassName = _trs.treeRendererClassName;
+ if (treeRendererClassName == null) {
+ treeRendererClassName = TagConfig.getTreeRendererClassName();
+ }
+ TreeRenderer tr = TreeRendererFactory.getInstance(treeRendererClassName);
+ if (tr == null) {
+ tr = new TreeRenderer();
+ }
+ tr.init(_trs, request, response, pageContext.getServletContext());
+ tr.setTreeRenderSupport(new TagTreeRenderSupport(this));
+ tr.render(writer, treeRoot, 0, extraAttrs, _iState);
if (hasErrors()) {
reportErrors();
return;
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeCRI.java Tue Oct 18 22:10:36 2005
@@ -1,199 +1,210 @@
-/*
- * Copyright 2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.netui.tags.tree;
-
-import org.apache.beehive.netui.util.internal.InternalStringBuilder;
-
-import org.apache.beehive.netui.pageflow.interceptor.InterceptorChain;
-import org.apache.beehive.netui.pageflow.interceptor.InterceptorException;
-import org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptor;
-import org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext;
-import org.apache.beehive.netui.pageflow.requeststate.INameable;
-import org.apache.beehive.netui.pageflow.requeststate.NameService;
-import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
-import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
-import org.apache.beehive.netui.util.logging.Logger;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.jsp.JspException;
-import java.io.IOException;
-import java.io.Writer;
-
-public class TreeCRI extends RequestInterceptor
-{
- private static final String TREE_COLLAPSE = "treeCollapse";
- private static final String TREE_EXPAND = "treeExpand";
-
- private static final Logger logger = Logger.getInstance(TreeCRI.class);
-
- // The elements we will create in the document
- private static final String TREE_EXPAND_ELEM = "treeExpand";
-
- public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException
- {
- HttpServletRequest request = ctxt.getRequest();
-
- // Create the command by striping off the context path and the extension
- String cmd = request.getRequestURI();
-
- // catch any runtime errors here and return.
- try {
- int dot = cmd.lastIndexOf('.');
- int slash = cmd.lastIndexOf('/');
- if (slash != -1 && slash != -1) {
- cmd = cmd.substring(slash + 1, dot);
- }
- }
- catch (RuntimeException e) {
- System.err.println("Runtime Error creating XmlRequestServlet Command:" + e.getClass().getName());
- }
-
- // check to see if we handle this command
- if (TREE_COLLAPSE.equals(cmd)) {
- handleExpandCollapse(false, request, ctxt.getResponse(), ctxt.getServletContext());
- }
- else if (TREE_EXPAND.equals(cmd)) {
- handleExpandCollapse(true, request, ctxt.getResponse(), ctxt.getServletContext());
- }
-
- chain.continueChain();
- }
-
- public void postRequest(RequestInterceptorContext context, InterceptorChain chain) throws InterceptorException
- {
- chain.continueChain();
- }
-
- private void handleExpandCollapse(boolean expand, HttpServletRequest req, ServletResponse response,
- ServletContext ctxt)
- {
- String tree = req.getParameter("tree");
- String node = req.getParameter("node");
- String expandSvr = req.getParameter("expandOnServer");
- //System.err.println("TreeCommand:" + ((expand) ? "expand" : "collapse") +
- // " Tree:" + tree + " Node:" + node + " expandSvr:" + expandSvr);
-
- NameService ns = NameService.instance(req.getSession());
- assert(ns != null);
-
- // get the tree from the name service
- INameable n = ns.get(tree);
- if (n == null) {
- logger.error("Tree '" + tree + "' was not found in the NameService");
- return;
- }
- if (!(n instanceof ITreeRootElement)) {
- logger.error("Named Tree was not an instance of a ITreeRootElement");
- return;
- }
-
- ITreeRootElement root = (ITreeRootElement) n;
- TreeElement elem = ((TreeElement) root).findNode(node);
- if (elem == null) {
- System.err.println("Element '" + node + "' not found in the tree");
- return;
- }
- elem.onExpand(req, response);
- elem.setExpanded(expand);
-
- if (expandSvr != null) {
- InternalStringBuilder sb = new InternalStringBuilder(1024);
- StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
- // Start the document
- writeStartElement(writer, TREE_EXPAND_ELEM);
-
- // add a tree identifier
- writeElement(writer, "node", node);
- writeElement(writer, "treeId", tree);
-
- try {
- TreeElement children[] = elem.getChildren();
- AttributeRenderer extraAttrs = new AttributeRenderer();
- int newLevel = elem.getLevel() + 1;
- InternalStringBuilder treeRendering = new InternalStringBuilder();
- TreeElement tmp = elem;
- InheritableState iState = null;
- while (iState == null && tmp != null) {
- iState = tmp.getInheritableState();
- tmp = tmp.getParent();
- }
- if (iState == null) {
- System.err.println("Unable to find InheritableState");
- iState = root.getInheritableState();
- }
-
- ServletTreeRenderer str = new ServletTreeRenderer(root.getTreeRenderState(), req,
- (HttpServletResponse) response, ctxt, writer, treeRendering);
- for (int i = 0; i < children.length; i++) {
- treeRendering.setLength(0);
- str.render(treeRendering, children[i], newLevel, extraAttrs, iState);
- }
- }
- catch (JspException se) {
- se.printStackTrace();
- logger.error("Received a JSP excpetion Rendering the Tree", se);
- return;
- }
- catch (RuntimeException re) {
- //re.printStackTrace();
- logger.error("Received a JSP excpetion Rendering the Tree", re);
- return;
- }
-
- // add the tree text
- writeEndElement(writer, TREE_EXPAND_ELEM);
- write(response, sb.toString());
- }
- }
-
- public static void writeStartElement(AbstractRenderAppender writer, String elementName)
- {
- writer.append("<");
- writer.append(elementName);
- writer.append(">");
-
- }
-
- public static void writeEndElement(AbstractRenderAppender writer, String elementName)
- {
- writer.append("</");
- writer.append(elementName);
- writer.append(">");
- }
-
- public static void writeElement(AbstractRenderAppender writer, String elementName, String value)
- {
- writeStartElement(writer, elementName);
- writer.append(value);
- writeEndElement(writer, elementName);
-
- }
-
- private void write(ServletResponse response, String string)
- {
- try {
- Writer writer = response.getWriter();
- writer.write(string);
- }
- catch (IOException e) {
- }
- }
-}
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.tree;
+
+import org.apache.beehive.netui.util.internal.InternalStringBuilder;
+
+import org.apache.beehive.netui.pageflow.interceptor.InterceptorChain;
+import org.apache.beehive.netui.pageflow.interceptor.InterceptorException;
+import org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptor;
+import org.apache.beehive.netui.pageflow.interceptor.request.RequestInterceptorContext;
+import org.apache.beehive.netui.pageflow.requeststate.INameable;
+import org.apache.beehive.netui.pageflow.requeststate.NameService;
+import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
+import org.apache.beehive.netui.tags.rendering.StringBuilderRenderAppender;
+import org.apache.beehive.netui.tags.TagConfig;
+import org.apache.beehive.netui.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import java.io.IOException;
+import java.io.Writer;
+
+public class TreeCRI extends RequestInterceptor
+{
+ private static final String TREE_COLLAPSE = "treeCollapse";
+ private static final String TREE_EXPAND = "treeExpand";
+
+ private static final Logger logger = Logger.getInstance(TreeCRI.class);
+
+ // The elements we will create in the document
+ private static final String TREE_EXPAND_ELEM = "treeExpand";
+
+ public void preRequest(RequestInterceptorContext ctxt, InterceptorChain chain) throws InterceptorException
+ {
+ HttpServletRequest request = ctxt.getRequest();
+
+ // Create the command by striping off the context path and the extension
+ String cmd = request.getRequestURI();
+
+ // catch any runtime errors here and return.
+ try {
+ int dot = cmd.lastIndexOf('.');
+ int slash = cmd.lastIndexOf('/');
+ if (slash != -1 && slash != -1) {
+ cmd = cmd.substring(slash + 1, dot);
+ }
+ }
+ catch (RuntimeException e) {
+ System.err.println("Runtime Error creating XmlRequestServlet Command:" + e.getClass().getName());
+ }
+
+ // check to see if we handle this command
+ if (TREE_COLLAPSE.equals(cmd)) {
+ handleExpandCollapse(false, request, ctxt.getResponse(), ctxt.getServletContext());
+ }
+ else if (TREE_EXPAND.equals(cmd)) {
+ handleExpandCollapse(true, request, ctxt.getResponse(), ctxt.getServletContext());
+ }
+
+ chain.continueChain();
+ }
+
+ public void postRequest(RequestInterceptorContext context, InterceptorChain chain) throws InterceptorException
+ {
+ chain.continueChain();
+ }
+
+ private void handleExpandCollapse(boolean expand, HttpServletRequest req, ServletResponse response,
+ ServletContext ctxt)
+ {
+ String tree = req.getParameter("tree");
+ String node = req.getParameter("node");
+ String expandSvr = req.getParameter("expandOnServer");
+ //System.err.println("TreeCommand:" + ((expand) ? "expand" : "collapse") +
+ // " Tree:" + tree + " Node:" + node + " expandSvr:" + expandSvr);
+
+ NameService ns = NameService.instance(req.getSession());
+ assert(ns != null);
+
+ // get the tree from the name service
+ INameable n = ns.get(tree);
+ if (n == null) {
+ logger.error("Tree '" + tree + "' was not found in the NameService");
+ return;
+ }
+ if (!(n instanceof ITreeRootElement)) {
+ logger.error("Named Tree was not an instance of a ITreeRootElement");
+ return;
+ }
+
+ ITreeRootElement root = (ITreeRootElement) n;
+ TreeElement elem = ((TreeElement) root).findNode(node);
+ if (elem == null) {
+ System.err.println("Element '" + node + "' not found in the tree");
+ return;
+ }
+ elem.onExpand(req, response);
+ elem.setExpanded(expand);
+
+ if (expandSvr != null) {
+ InternalStringBuilder sb = new InternalStringBuilder(1024);
+ StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);
+ // Start the document
+ writeStartElement(writer, TREE_EXPAND_ELEM);
+
+ // add a tree identifier
+ writeElement(writer, "node", node);
+ writeElement(writer, "treeId", tree);
+
+ try {
+ TreeElement children[] = elem.getChildren();
+ AttributeRenderer extraAttrs = new AttributeRenderer();
+ int newLevel = elem.getLevel() + 1;
+ InternalStringBuilder nodeSB = new InternalStringBuilder();
+ StringBuilderRenderAppender childRendering = new StringBuilderRenderAppender(nodeSB);
+ TreeElement tmp = elem;
+ InheritableState iState = null;
+ while (iState == null && tmp != null) {
+ iState = tmp.getInheritableState();
+ tmp = tmp.getParent();
+ }
+ if (iState == null) {
+ System.err.println("Unable to find InheritableState");
+ iState = root.getInheritableState();
+ }
+
+ TreeRenderState trs = root.getTreeRenderState();
+ String treeRendererClassName = trs.treeRendererClassName;
+ if (treeRendererClassName == null) {
+ treeRendererClassName = TagConfig.getTreeRendererClassName();
+ }
+ TreeRenderer tr = TreeRendererFactory.getInstance(treeRendererClassName);
+ if (tr == null) {
+ tr = new TreeRenderer();
+ }
+ tr.init(trs, req, (HttpServletResponse) response, ctxt);
+ tr.setTreeRenderSupport(new ServletTreeRenderSupport(writer, nodeSB));
+ for (int i = 0; i < children.length; i++) {
+ nodeSB.setLength(0);
+ tr.render(childRendering, children[i], newLevel, extraAttrs, iState);
+ }
+ }
+ catch (JspException se) {
+ se.printStackTrace();
+ logger.error("Received a JSP excpetion Rendering the Tree", se);
+ return;
+ }
+ catch (RuntimeException re) {
+ //re.printStackTrace();
+ logger.error("Received a JSP excpetion Rendering the Tree", re);
+ return;
+ }
+
+ // add the tree text
+ writeEndElement(writer, TREE_EXPAND_ELEM);
+ write(response, sb.toString());
+ }
+ }
+
+ public static void writeStartElement(AbstractRenderAppender writer, String elementName)
+ {
+ writer.append("<");
+ writer.append(elementName);
+ writer.append(">");
+
+ }
+
+ public static void writeEndElement(AbstractRenderAppender writer, String elementName)
+ {
+ writer.append("</");
+ writer.append(elementName);
+ writer.append(">");
+ }
+
+ public static void writeElement(AbstractRenderAppender writer, String elementName, String value)
+ {
+ writeStartElement(writer, elementName);
+ writer.append(value);
+ writeEndElement(writer, elementName);
+
+ }
+
+ private void write(ServletResponse response, String string)
+ {
+ try {
+ Writer writer = response.getWriter();
+ writer.write(string);
+ }
+ catch (IOException e) {
+ }
+ }
+}
Modified: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderState.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderState.java?rev=326395&r1=326394&r2=326395&view=diff
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderState.java (original)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderState.java Tue Oct 18 22:10:36 2005
@@ -1,33 +1,35 @@
-/*
- * Copyright 2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * $Header:$
- */
-package org.apache.beehive.netui.tags.tree;
-
-public class TreeRenderState implements java.io.Serializable
-{
- public String selectedStyle; // selection style
- public String selectedStyleClass; // selection class
- public String unselectedStyle; // unselect style
- public String unselectedStyleClass; // unselect class
- public String disabledStyle; // disabled style
- public String disabledStyleClass; // disabled class
-
- public String tagId; // tag that should uniquely indentify a tree. Required for multiple tree using auto expand
-
- public boolean runAtClient;
- public boolean escapeContent = false; // esapce the content of labels
-}
+/*
+ * Copyright 2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.tree;
+
+public class TreeRenderState implements java.io.Serializable
+{
+ public String selectedStyle; // selection style
+ public String selectedStyleClass; // selection class
+ public String unselectedStyle; // unselect style
+ public String unselectedStyleClass; // unselect class
+ public String disabledStyle; // disabled style
+ public String disabledStyleClass; // disabled class
+
+ public String tagId; // tag that should uniquely indentify a tree. Required for multiple tree using auto expand
+
+ public boolean runAtClient;
+ public boolean escapeContent = false; // esapce the content of labels
+
+ public String treeRendererClassName; // name of the TreeRenderer class to use for rendering
+}
Added: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java
URL: http://svn.apache.org/viewcvs/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java?rev=326395&view=auto
==============================================================================
--- beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java (added)
+++ beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java Tue Oct 18 22:10:36 2005
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * $Header:$
+ */
+package org.apache.beehive.netui.tags.tree;
+
+import org.apache.beehive.netui.tags.html.HtmlConstants;
+import org.apache.beehive.netui.tags.rendering.AbstractHtmlState;
+import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.jsp.JspException;
+
+/**
+ * Base class to help handle issues specific to rendering a tree
+ * for certain paths of execution in NetUI. For example, the handling
+ * of errors is different for the Tree tag rendering than the Serlvet
+ * that renders a tree node for an XmlHttpRequest.
+ */
+abstract public class TreeRenderSupport implements HtmlConstants
+{
+ abstract protected void registerTagError(String message, Throwable e)
+ throws JspException;
+
+ abstract protected String renderTagId(HttpServletRequest request, String tagId, AbstractHtmlState state);
+
+ protected void renderBeforeNode(AbstractRenderAppender writer, TreeElement node)
+ {
+ }
+
+ protected void renderAfterNode(AbstractRenderAppender writer, TreeElement node)
+ {
+ }
+}
Propchange: beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/tree/TreeRenderSupport.java
------------------------------------------------------------------------------
svn:eol-style = native