[Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib T
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-05-25 20:36:25
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib In directory usw-pr-cvs1:/tmp/cvs-serv1414/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib Modified Files: IndentedObject.java MBeanAttributeEditorTag.java TreeLeafTag.java TreeRendererTag.java TreeSpacerTag.java Added Files: TreeRenderer.java TreeRendererImpl.java Log Message: Pretty Print --- NEW FILE: TreeRenderer.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; import java.io.Serializable; /** * Description of the Class * * @author letiemble * @created 25 avril 2002 * @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); } --- NEW FILE: TreeRendererImpl.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package net.sourceforge.ejtools.jmxbrowser.web.taglib; import net.sourceforge.ejtools.jmxbrowser.model.Domain; import net.sourceforge.ejtools.jmxbrowser.model.Resource; /** * Description of the Class * * @author letiemble * @created 25 avril 2002 * @todo Javadoc to complete */ public class TreeRendererImpl implements TreeRenderer { /** * Gets the icon attribute of the TreeRendererImpl object * * @param o Description of the Parameter * @return The icon value */ public String getIcon(Object o) { if (net.sourceforge.ejtools.jmxbrowser.model.Domain.class.equals(o.getClass())) { return "images/icons/J2EEDomain16.gif"; } if (net.sourceforge.ejtools.jmxbrowser.model.Resource.class.equals(o.getClass())) { return "images/icons/EJBModule16.gif"; } return null; } } Index: IndentedObject.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/IndentedObject.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IndentedObject.java 17 May 2002 17:18:24 -0000 1.1 --- IndentedObject.java 25 May 2002 20:36:22 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- package net.sourceforge.ejtools.jmxbrowser.web.taglib; + /** * Description of the Class Index: MBeanAttributeEditorTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeEditorTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanAttributeEditorTag.java 15 May 2002 20:56:11 -0000 1.2 --- MBeanAttributeEditorTag.java 25 May 2002 20:36:22 -0000 1.3 *************** *** 221,233 **** /** ! * Adds a feature to the ArrayProperty attribute of the ! * MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the ArrayProperty ! * attribute ! * @param attributeInfo The feature to be added to the ArrayProperty ! * attribute ! * @param object The feature to be added to the ArrayProperty ! * attribute * @exception JspException Description of Exception */ --- 221,229 ---- /** ! * Adds a feature to the ArrayProperty attribute of the MBeanAttributeEditorTag object * ! * @param propertyeditor The feature to be added to the ArrayProperty attribute ! * @param attributeInfo The feature to be added to the ArrayProperty attribute ! * @param object The feature to be added to the ArrayProperty attribute * @exception JspException Description of Exception */ *************** *** 281,286 **** /** ! * Adds a feature to the UnsupportedProperty attribute of the ! * MBeanAttributeEditorTag object * * @param propertyeditor The feature to be added to the Property attribute --- 277,281 ---- /** ! * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * * @param propertyeditor The feature to be added to the Property attribute *************** *** 326,334 **** /** ! * Adds a feature to the UnsupportedProperty attribute of the ! * MBeanAttributeEditorTag object * ! * @param attributeInfo The feature to be added to the ! * UnsupportedProperty attribute * @exception JspException Description of Exception */ --- 321,327 ---- /** ! * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * ! * @param attributeInfo The feature to be added to the UnsupportedProperty attribute * @exception JspException Description of Exception */ Index: TreeLeafTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/TreeLeafTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeLeafTag.java 17 May 2002 17:18:24 -0000 1.1 --- TreeLeafTag.java 25 May 2002 20:36:22 -0000 1.2 *************** *** 160,164 **** * Sets the follow attribute of the TreeSpacerTag object * ! * @param value The new value value */ public void setValue(boolean value) --- 160,164 ---- * Sets the follow attribute of the TreeSpacerTag object * ! * @param value The new value value */ public void setValue(boolean value) Index: TreeRendererTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/TreeRendererTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeRendererTag.java 17 May 2002 17:18:24 -0000 1.1 --- TreeRendererTag.java 25 May 2002 20:36:22 -0000 1.2 *************** *** 23,26 **** --- 23,28 ---- { /** Description of the Field */ + protected String className = null; + /** Description of the Field */ protected String name = null; /** Description of the Field */ *************** *** 38,41 **** --- 40,44 ---- public int doStartTag() throws JspException { + String img = null; Object o = null; *************** *** 54,70 **** } ! String c = o.getClass().getName(); ! String img = ""; ! if ("net.sourceforge.ejtools.jmxbrowser.model.Domain".equals(c)) { ! img = "<img src=\"images/icons/J2EEDomain16.gif\">"; } ! if ("net.sourceforge.ejtools.jmxbrowser.model.Resource".equals(c)) { ! img = "<img src=\"images/icons/EJBModule16.gif\">"; } ! ResponseUtils.write(pageContext, img); // Continue processing this page --- 57,76 ---- } ! 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 *************** *** 96,99 **** --- 102,116 ---- /** + * 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 * *************** *** 133,136 **** --- 150,164 ---- { 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; } Index: TreeSpacerTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/TreeSpacerTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeSpacerTag.java 17 May 2002 17:18:24 -0000 1.1 --- TreeSpacerTag.java 25 May 2002 20:36:22 -0000 1.2 *************** *** 68,72 **** for (int i = 0; i < follow.length(); i++) { ! if ("1".equals(follow.substring(i, 1))) { img = "<img src=\"images/tree/line.gif\"/>"; --- 68,72 ---- for (int i = 0; i < follow.length(); i++) { ! if ("1".equals(follow.substring(i, i + 1))) { img = "<img src=\"images/tree/line.gif\"/>"; *************** *** 175,179 **** * Sets the follow attribute of the TreeSpacerTag object * ! * @param value The new value value */ public void setValue(String value) --- 175,179 ---- * Sets the follow attribute of the TreeSpacerTag object * ! * @param value The new value value */ public void setValue(String value) |