[Ejtools-cvs] libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree package.html,NONE,1
Brought to you by:
letiemble
From: <let...@us...> - 2003-12-14 09:48:29
|
Update of /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree In directory sc8-pr-cvs1:/tmp/cvs-serv18305/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree Modified Files: BeanContextTreeTag.java IndentedObject.java TreeIconRendererTag.java TreeLeafTag.java TreeNameRendererTag.java TreeRenderer.java TreeSpacerTag.java Added Files: package.html Log Message: Add more javadocs. Add package.html files. --- NEW FILE: package.html --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!-- EJTools, the Enterprise Java Tools Distributable under LGPL license. See terms of license at www.gnu.org. $Revision: 1.1 $ --> <html> <head/> <body> Provides JSP tags to flatten hierarchy to display them as a tree. </body> </html> Index: BeanContextTreeTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/BeanContextTreeTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BeanContextTreeTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- BeanContextTreeTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,254 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import java.beans.beancontext.BeanContext; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="generateTree" ! * body-content="empty" ! */ ! public class BeanContextTreeTag extends TagSupport ! { ! /** Description of the Field */ ! protected String id = null; ! /** Should we ignore missing beans and simply output nothing? */ ! protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** The scope to be searched to retrieve the specified bean. */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! BeanContext context = null; ! ! if (property != null) ! { ! context = (BeanContext) RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! context = (BeanContext) RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (ignore) ! { ! if (context == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! // Create the beancontext collection ! Collection collection = populate(context, ""); ! pageContext.setAttribute(id, collection); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the id attribute of the BeanContextTreeTag object ! * ! * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" ! */ ! public String getId() ! { ! return (this.id); ! } ! ! ! /** ! * Gets the ignore attribute of the BeanContextTreeTag object ! * ! * @return The ignore value ! * @jsp:attribute name="ignore" ! * required="false" ! * rtexprvalue="true" ! */ ! public boolean getIgnore() ! { ! return (this.ignore); ! } ! ! ! /** ! * Getter for the name attribute ! * ! * @return The value of name attribute ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the BeanContextTreeTag object ! * ! * @return The property value ! * @jsp:attribute name="property" ! * required="false" ! * rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Getter for the scope attribute ! * ! * @return The value of scope attribute ! * @jsp:attribute name="scope" ! * required="false" ! * rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** Description of the Method */ ! public void release() ! { ! super.release(); ! ignore = false; ! name = null; ! property = null; ! scope = null; ! id = null; ! } ! ! ! /** ! * Sets the id attribute of the BeanContextTreeTag object ! * ! * @param id The new id value ! */ ! public void setId(String id) ! { ! this.id = id; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new value for ignore attribute ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new value for name attribute ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the BeanContextTreeTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! * @param depth Description of the Parameter ! * @return Description of the Return Value ! */ ! protected Collection populate(BeanContext context, String depth) ! { ! String newDepth = depth; ! Collection result = new Vector(); ! ! Iterator it = context.iterator(); ! while (it.hasNext()) ! { ! BeanContext bc = (BeanContext) it.next(); ! IndentedObject o = new IndentedObject(); ! o.setObject(bc); ! o.setDepth(depth); ! if (it.hasNext()) ! { ! newDepth = depth + "1"; ! } ! else ! { ! newDepth = depth + "0"; ! o.setLast(true); ! } ! result.add(o); ! ! Collection collection = populate(bc, newDepth); ! result.addAll(collection); ! } ! return result; ! } ! } --- 1,254 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import java.beans.beancontext.BeanContext; ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="generateTree" ! * body-content="empty" ! */ ! public class BeanContextTreeTag extends TagSupport ! { ! /** Description of the Field */ ! protected String id = null; ! /** Should we ignore missing beans and simply output nothing? */ ! protected boolean ignore = false; ! /** Name of the bean that contains the data we will be rendering. */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** The scope to be searched to retrieve the specified bean. */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! BeanContext context = null; ! ! if (property != null) ! { ! context = (BeanContext) RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! context = (BeanContext) RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (ignore) ! { ! if (context == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! // Create the beancontext collection ! Collection collection = populate(context, ""); ! pageContext.setAttribute(id, collection); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the id attribute of the BeanContextTreeTag object ! * ! * @return The id value ! * @jsp:attribute name="id" ! * required="true" ! * rtexprvalue="true" ! */ ! public String getId() ! { ! return (this.id); ! } ! ! ! /** ! * Gets the ignore attribute of the BeanContextTreeTag object ! * ! * @return The ignore value ! * @jsp:attribute name="ignore" ! * required="false" ! * rtexprvalue="true" ! */ ! public boolean getIgnore() ! { ! return (this.ignore); ! } ! ! ! /** ! * Getter for the name attribute ! * ! * @return The value of name attribute ! * @jsp:attribute name="name" ! * required="true" ! * rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the BeanContextTreeTag object ! * ! * @return The property value ! * @jsp:attribute name="property" ! * required="false" ! * rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Getter for the scope attribute ! * ! * @return The value of scope attribute ! * @jsp:attribute name="scope" ! * required="false" ! * rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** Description of the Method */ ! public void release() ! { ! super.release(); ! ignore = false; ! name = null; ! property = null; ! scope = null; ! id = null; ! } ! ! ! /** ! * Sets the id attribute of the BeanContextTreeTag object ! * ! * @param id The new id value ! */ ! public void setId(String id) ! { ! this.id = id; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new value for ignore attribute ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new value for name attribute ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the BeanContextTreeTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new value for scope attribute ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Description of the Method ! * ! * @param context Description of the Parameter ! * @param depth Description of the Parameter ! * @return Description of the Return Value ! */ ! protected Collection populate(BeanContext context, String depth) ! { ! String newDepth = depth; ! Collection result = new Vector(); ! ! Iterator it = context.iterator(); ! while (it.hasNext()) ! { ! BeanContext bc = (BeanContext) it.next(); ! IndentedObject o = new IndentedObject(); ! o.setObject(bc); ! o.setDepth(depth); ! if (it.hasNext()) ! { ! newDepth = depth + "1"; ! } ! else ! { ! newDepth = depth + "0"; ! o.setLast(true); ! } ! result.add(o); ! ! Collection collection = populate(bc, newDepth); ! result.addAll(collection); ! } ! return result; ! } ! } Index: IndentedObject.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/IndentedObject.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** IndentedObject.java 15 Sep 2003 21:58:25 -0000 1.3 --- IndentedObject.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,105 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class IndentedObject ! { ! /** Description of the Field */ ! protected String depth = null; ! /** Description of the Field */ ! protected boolean last = false; ! /** Description of the Field */ ! protected Object o = null; ! ! ! /** Constructor for the IndentedObject object */ ! public IndentedObject() { } ! ! ! /** ! * Gets the depth attribute of the IndentedObject object ! * ! * @return The depth value ! */ ! public String getDepth() ! { ! return this.depth; ! } ! ! ! /** ! * Gets the object attribute of the IndentedObject object ! * ! * @return The object value ! */ ! public Object getObject() ! { ! return this.o; ! } ! ! ! /** ! * Gets the last attribute of the IndentedObject object ! * ! * @return The last value ! */ ! public boolean isLast() ! { ! return this.last; ! } ! ! ! /** ! * Sets the depth attribute of the IndentedObject object ! * ! * @param depth The new depth value ! */ ! public void setDepth(String depth) ! { ! this.depth = depth; ! } ! ! ! /** ! * Sets the last attribute of the IndentedObject object ! * ! * @param last The new last value ! */ ! public void setLast(boolean last) ! { ! this.last = last; ! } ! ! ! /** ! * Sets the object attribute of the IndentedObject object ! * ! * @param o The new object value ! */ ! public void setObject(Object o) ! { ! this.o = o; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return "D=" + depth + " L=" + last + " O=" + o; ! } ! } --- 1,105 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class IndentedObject ! { ! /** Description of the Field */ ! protected String depth = null; ! /** Description of the Field */ ! protected boolean last = false; ! /** Description of the Field */ ! protected Object o = null; ! ! ! /** Constructor for the IndentedObject object */ ! public IndentedObject() { } ! ! ! /** ! * Gets the depth attribute of the IndentedObject object ! * ! * @return The depth value ! */ ! public String getDepth() ! { ! return this.depth; ! } ! ! ! /** ! * Gets the object attribute of the IndentedObject object ! * ! * @return The object value ! */ ! public Object getObject() ! { ! return this.o; ! } ! ! ! /** ! * Gets the last attribute of the IndentedObject object ! * ! * @return The last value ! */ ! public boolean isLast() ! { ! return this.last; ! } ! ! ! /** ! * Sets the depth attribute of the IndentedObject object ! * ! * @param depth The new depth value ! */ ! public void setDepth(String depth) ! { ! this.depth = depth; ! } ! ! ! /** ! * Sets the last attribute of the IndentedObject object ! * ! * @param last The new last value ! */ ! public void setLast(boolean last) ! { ! this.last = last; ! } ! ! ! /** ! * Sets the object attribute of the IndentedObject object ! * ! * @param o The new object value ! */ ! public void setObject(Object o) ! { ! this.o = o; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return "D=" + depth + " L=" + last + " O=" + o; ! } ! } Index: TreeIconRendererTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/TreeIconRendererTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeIconRendererTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- TreeIconRendererTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,185 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeIconRenderer" body-content="empty" ! */ ! public class TreeIconRendererTag extends TagSupport ! { ! /** Description of the Field */ ! protected String className = null; ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! Object o = null; ! ! if (property != null) ! { ! o = RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! o = RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (o == null) ! { ! return (SKIP_BODY); ! } ! ! try ! { ! TreeRenderer renderer = (TreeRenderer) Class.forName(this.className).newInstance(); ! ! img = renderer.getIcon(o); ! } ! catch (Exception e) ! { ! img = null; ! } ! if (img == null) ! { ! img = ""; ! } ! ! ResponseUtils.write(pageContext, "<img src=\"" + img + "\"/>"); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="true" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the class attribute of the TreeRendererTag object ! * ! * @return The class value ! * @jsp:attribute name="renderer" required="true" rtexprvalue="true" ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! scope = null; ! className = null; ! property = null; ! name = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeRendererTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the class attribute of the TreeRendererTag object ! * ! * @param className The new class value ! */ ! public void setRenderer(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } --- 1,185 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeIconRenderer" body-content="empty" ! */ ! public class TreeIconRendererTag extends TagSupport ! { ! /** Description of the Field */ ! protected String className = null; ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! Object o = null; ! ! if (property != null) ! { ! o = RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! o = RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (o == null) ! { ! return (SKIP_BODY); ! } ! ! try ! { ! TreeRenderer renderer = (TreeRenderer) Class.forName(this.className).newInstance(); ! ! img = renderer.getIcon(o); ! } ! catch (Exception e) ! { ! img = null; ! } ! if (img == null) ! { ! img = ""; ! } ! ! ResponseUtils.write(pageContext, "<img src=\"" + img + "\"/>"); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="true" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the class attribute of the TreeRendererTag object ! * ! * @return The class value ! * @jsp:attribute name="renderer" required="true" rtexprvalue="true" ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! scope = null; ! className = null; ! property = null; ! name = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeRendererTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the class attribute of the TreeRendererTag object ! * ! * @param className The new class value ! */ ! public void setRenderer(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } Index: TreeLeafTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/TreeLeafTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeLeafTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- TreeLeafTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,176 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeLeaf" body-content="empty" ! */ ! public class TreeLeafTag extends TagSupport ! { ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! /** Description of the Field */ ! protected boolean value = false; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! boolean leaf = getValue(); ! ! if (name != null) ! { ! if (property != null) ! { ! leaf = ((Boolean) RequestUtils.lookup(pageContext, name, property, scope)).booleanValue(); ! } ! else ! { ! leaf = ((Boolean) RequestUtils.lookup(pageContext, name, scope)).booleanValue(); ! } ! } ! ! if (leaf) ! { ! img = "<img src=\"images/tree/join.gif\"/>"; ! } ! else ! { ! img = "<img src=\"images/tree/joinbottom.gif\"/>"; ! } ! ! ResponseUtils.write(pageContext, img); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! * @jsp:attribute name="value" required="false" rtexprvalue="true" ! */ ! public boolean getValue() ! { ! return (this.value); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! value = false; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeSpacerTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Sets the follow attribute of the TreeSpacerTag object ! * ! * @param value The new value value ! */ ! public void setValue(boolean value) ! { ! this.value = value; ! } ! ! } ! --- 1,176 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeLeaf" body-content="empty" ! */ ! public class TreeLeafTag extends TagSupport ! { ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! /** Description of the Field */ ! protected boolean value = false; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! boolean leaf = getValue(); ! ! if (name != null) ! { ! if (property != null) ! { ! leaf = ((Boolean) RequestUtils.lookup(pageContext, name, property, scope)).booleanValue(); ! } ! else ! { ! leaf = ((Boolean) RequestUtils.lookup(pageContext, name, scope)).booleanValue(); ! } ! } ! ! if (leaf) ! { ! img = "<img src=\"images/tree/join.gif\"/>"; ! } ! else ! { ! img = "<img src=\"images/tree/joinbottom.gif\"/>"; ! } ! ! ResponseUtils.write(pageContext, img); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! * @jsp:attribute name="value" required="false" rtexprvalue="true" ! */ ! public boolean getValue() ! { ! return (this.value); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! value = false; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeSpacerTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Sets the follow attribute of the TreeSpacerTag object ! * ! * @param value The new value value ! */ ! public void setValue(boolean value) ! { ! this.value = value; ! } ! ! } ! Index: TreeNameRendererTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/TreeNameRendererTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeNameRendererTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- TreeNameRendererTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,186 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeNameRenderer" body-content="empty" ! */ ! public class TreeNameRendererTag extends TagSupport ! { ! /** Description of the Field */ ! protected String className = null; ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String display = null; ! Object o = null; ! ! if (property != null) ! { ! o = RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! o = RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (o == null) ! { ! return (SKIP_BODY); ! } ! ! try ! { ! TreeRenderer renderer = (TreeRenderer) Class.forName(this.className).newInstance(); ! ! display = renderer.getDisplayName(o); ! } ! catch (Exception e) ! { ! display = null; ! } ! if (display == null) ! { ! display = ""; ! } ! ! ResponseUtils.write(pageContext, display); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="true" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the class attribute of the TreeRendererTag object ! * ! * @return The class value ! * @jsp:attribute name="renderer" required="true" rtexprvalue="true" ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! scope = null; ! className = null; ! property = null; ! name = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeRendererTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the class attribute of the TreeRendererTag object ! * ! * @param className The new class value ! */ ! public void setRenderer(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } --- 1,186 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeNameRenderer" body-content="empty" ! */ ! public class TreeNameRendererTag extends TagSupport ! { ! /** Description of the Field */ ! protected String className = null; ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String display = null; ! Object o = null; ! ! if (property != null) ! { ! o = RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! o = RequestUtils.lookup(pageContext, name, scope); ! } ! ! if (o == null) ! { ! return (SKIP_BODY); ! } ! ! try ! { ! TreeRenderer renderer = (TreeRenderer) Class.forName(this.className).newInstance(); ! ! display = renderer.getDisplayName(o); ! } ! catch (Exception e) ! { ! display = null; ! } ! if (display == null) ! { ! display = ""; ! } ! ! ResponseUtils.write(pageContext, display); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="true" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the class attribute of the TreeRendererTag object ! * ! * @return The class value ! * @jsp:attribute name="renderer" required="true" rtexprvalue="true" ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! scope = null; ! className = null; ! property = null; ! name = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeRendererTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the class attribute of the TreeRendererTag object ! * ! * @param className The new class value ! */ ! public void setRenderer(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } Index: TreeRenderer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/TreeRenderer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeRenderer.java 15 Sep 2003 21:58:25 -0000 1.3 --- TreeRenderer.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,36 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import java.io.Serializable; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface TreeRenderer extends Serializable ! { ! /** ! * Gets the icon attribute of the TreeRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public String getIcon(Object o); ! ! ! /** ! * Gets the displayName attribute of the TreeRenderer object ! * ! * @param o Description of the Parameter ! * @return The displayName value ! */ ! public String getDisplayName(Object o); ! } --- 1,36 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import java.io.Serializable; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface TreeRenderer extends Serializable ! { ! /** ! * Gets the icon attribute of the TreeRenderer object ! * ! * @param o Description of the Parameter ! * @return The icon value ! */ ! public String getIcon(Object o); ! ! ! /** ! * Gets the displayName attribute of the TreeRenderer object ! * ! * @param o Description of the Parameter ! * @return The displayName value ! */ ! public String getDisplayName(Object o); ! } Index: TreeSpacerTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/org/ejtools/servlet/http/jsp/tagext/tree/TreeSpacerTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** TreeSpacerTag.java 15 Sep 2003 21:58:25 -0000 1.3 --- TreeSpacerTag.java 13 Dec 2003 21:24:50 -0000 1.4 *************** *** 1,191 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeSpacer" body-content="empty" ! */ ! public class TreeSpacerTag extends TagSupport ! { ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! /** Description of the Field */ ! protected String value = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! String follow = getValue(); ! ! if (follow == null) ! { ! if (name == null) ! { ! return (SKIP_BODY); ! } ! if (property != null) ! { ! follow = (String) RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! follow = (String) RequestUtils.lookup(pageContext, name, scope); ! } ! } ! ! if (follow.length() <= 0) ! { ! return (SKIP_BODY); ! } ! ! StringBuffer output = new StringBuffer(); ! ! for (int i = 0; i < follow.length(); i++) ! { ! if ("1".equals(follow.substring(i, i + 1))) ! { ! img = "<img src=\"images/tree/line.gif\"/>"; ! } ! else ! { ! img = "<img src=\"images/tree/empty.gif\"/>"; ! } ! output.append(img); ! } ! ! ResponseUtils.write(pageContext, output.toString()); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! * @jsp:attribute name="value" required="false" rtexprvalue="true" ! */ ! public String getValue() ! { ! return (this.value); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! value = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeSpacerTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Sets the follow attribute of the TreeSpacerTag object ! * ! * @param value The new value value ! */ ! public void setValue(String value) ! { ! this.value = value; ! } ! ! } ! --- 1,191 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.servlet.http.jsp.tagext.tree; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="treeSpacer" body-content="empty" ! */ ! public class TreeSpacerTag extends TagSupport ! { ! /** Description of the Field */ ! protected String name = null; ! /** Description of the Field */ ! protected String property = null; ! /** Description of the Field */ ! protected String scope = null; ! /** Description of the Field */ ! protected String value = null; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! String img = null; ! String follow = getValue(); ! ! if (follow == null) ! { ! if (name == null) ! { ! return (SKIP_BODY); ! } ! if (property != null) ! { ! follow = (String) RequestUtils.lookup(pageContext, name, property, scope); ! } ! else ! { ! follow = (String) RequestUtils.lookup(pageContext, name, scope); ! } ! } ! ! if (follow.length() <= 0) ! { ! return (SKIP_BODY); ! } ! ! StringBuffer output = new StringBuffer(); ! ! for (int i = 0; i < follow.length(); i++) ! { ! if ("1".equals(follow.substring(i, i + 1))) ! { ! img = "<img src=\"images/tree/line.gif\"/>"; ! } ! else ! { ! img = "<img src=\"images/tree/empty.gif\"/>"; ! } ! output.append(img); ! } ! ! ResponseUtils.write(pageContext, output.toString()); ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! * @jsp:attribute name="property" required="false" rtexprvalue="true" ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! * @jsp:attribute name="scope" required="false" rtexprvalue="true" ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! * @jsp:attribute name="value" required="false" rtexprvalue="true" ! */ ! public String getValue() ! { ! return (this.value); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! value = null; ! } ! ! ! /** ! * Sets the name attribute of the TreeSpacerTag object ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Sets the property attribute of the TreeSpacerTag object ! * ! * @param property The new property value ! */ ! public void setProperty(String property) ! { ! this.property = property; ! } ! ! ! /** ! * Sets the scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Sets the follow attribute of the TreeSpacerTag object ! * ! * @param value The new value value ! */ ! public void setValue(String value) ! { ! this.value = value; ! } ! ! } ! |