Thread: [Ejtools-cvs] CVS: libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext BeanCon
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-24 21:07:09
|
Update of /cvsroot/ejtools/libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext In directory usw-pr-cvs1:/tmp/cvs-serv27560/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext Modified Files: BeanContextTreeTag.java IndentedObject.java TreeRendererTag.java TreeSpacerTag.java Log Message: Pretty print of the code Index: BeanContextTreeTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext/BeanContextTreeTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BeanContextTreeTag.java 23 May 2002 21:27:21 -0000 1.1 --- BeanContextTreeTag.java 24 May 2002 21:07:06 -0000 1.2 *************** *** 232,235 **** return result; } - } --- 232,234 ---- Index: IndentedObject.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext/IndentedObject.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IndentedObject.java 23 May 2002 21:27:21 -0000 1.1 --- IndentedObject.java 24 May 2002 21:07:06 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.ejtools.servlet.http.jsp.tagext; + /** * Description of the Class Index: TreeRendererTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext/TreeRendererTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeRendererTag.java 23 May 2002 21:27:21 -0000 1.1 --- TreeRendererTag.java 24 May 2002 21:07:06 -0000 1.2 *************** *** 1,174 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.servlet.http.jsp.tagext; ! ! 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 letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete ! */ ! public class TreeRendererTag 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 class attribute of the TreeRendererTag object ! * ! * @return The class value ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the name attribute of the TreeSpacerTag object ! * ! * @return The name value ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! } ! ! ! /** ! * Sets the class attribute of the TreeRendererTag object ! * ! * @param className The new class value ! */ ! public void setRenderer(String className) ! { ! this.className = className; ! } ! ! ! /** ! * 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 scope attribute of the TreeSpacerTag object ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } --- 1,175 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.servlet.http.jsp.tagext; ! ! 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 letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete ! */ ! public class TreeRendererTag 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 ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeRendererTag object ! * ! * @return The property value ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the class attribute of the TreeRendererTag object ! * ! * @return The class value ! */ ! public String getRenderer() ! { ! return (this.className); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! } ! ! ! /** ! * 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: TreeSpacerTag.java =================================================================== RCS file: /cvsroot/ejtools/libraries/taglib/src/main/net/sourceforge/ejtools/servlet/http/jsp/tagext/TreeSpacerTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeSpacerTag.java 23 May 2002 21:27:21 -0000 1.1 --- TreeSpacerTag.java 24 May 2002 21:07:06 -0000 1.2 *************** *** 1,185 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.servlet.http.jsp.tagext; ! ! 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 letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete ! */ ! 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 ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! */ ! 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,185 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package net.sourceforge.ejtools.servlet.http.jsp.tagext; ! ! 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 letiemble ! * @created 25 avril 2002 ! * @todo Javadoc to complete ! */ ! 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 ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Gets the property attribute of the TreeSpacerTag object ! * ! * @return The property value ! */ ! public String getProperty() ! { ! return (this.property); ! } ! ! ! /** ! * Gets the scope attribute of the TreeSpacerTag object ! * ! * @return The scope value ! */ ! public String getScope() ! { ! return (this.scope); ! } ! ! ! /** ! * Gets the follow attribute of the TreeSpacerTag object ! * ! * @return The follow value ! */ ! 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; ! } ! ! } ! |