Thread: [Ejtools-cvs] applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib MBeanN
Brought to you by:
letiemble
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib In directory usw-pr-cvs1:/tmp/cvs-serv14005/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib Modified Files: ConnectTag.java MBeanAttributeAccessTag.java MBeanAttributeClassTag.java MBeanAttributeEditorTag.java MBeanParameterClassTag.java TreeRendererImpl.java Added Files: MBeanNameTag.java MBeanParameterEditorTag.java Removed Files: BeanContextTreeTag.java IndentedObject.java MBeanAttributeValueTag.java TreeLeafTag.java TreeRenderer.java TreeRendererTag.java TreeSpacerTag.java Log Message: In progress --- NEW FILE: MBeanNameTag.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 javax.management.MBeanParameterInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import net.sourceforge.ejtools.jmxbrowser.model.Domain; import net.sourceforge.ejtools.jmxbrowser.model.Node; import net.sourceforge.ejtools.jmxbrowser.model.Resource; import net.sourceforge.ejtools.util.ClassTools; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** * Description of the Class * * @author letiemble * @created 25 avril 2002 * @version $Revision: 1.5 $ * @todo Javadoc to complete */ public class MBeanNameTag extends TagSupport { /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; /** Should we ignore missing beans and simply output nothing? */ protected boolean full = true; /** 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; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; /** * Description of the Method * * @return Description of the Returned Value * @exception JspException Description of Exception */ public int doStartTag() throws JspException { String output = ""; // Look up the requested bean (if necessary) Node node = (Node) RequestUtils.lookup(pageContext, name, scope); if (ignore) { if (node == null) { return (SKIP_BODY); } // Nothing to output } if (node instanceof Resource) { Resource res = (Resource) node; output = res.getCanonicalName(); if (!full) { output = output.substring(res.getDomain().length() + 1); } } else { output = node.toString(); } if (filter) { ResponseUtils.write(pageContext, ResponseUtils.filter(output)); } else { ResponseUtils.write(pageContext, output); } // Continue processing this page return (SKIP_BODY); } /** * Getter for the filter attribute * * @return The value of filter attribute */ public boolean getFilter() { return (this.filter); } /** * Gets the full attribute of the MBeanNameTag object * * @return The full value */ public boolean getFull() { return (this.full); } /** * Getter for the ignore attribute * * @return The value of ignore attribute */ public boolean getIgnore() { return (this.ignore); } /** * Getter for the name attribute * * @return The value of name attribute */ public String getName() { return (this.name); } /** * Getter for the scope attribute * * @return The value of scope attribute */ public String getScope() { return (this.scope); } /** Release all allocated resources. */ public void release() { super.release(); filter = true; ignore = false; full = false; name = null; scope = null; } /** * Setter for the filter attribute * * @param filter The new value for filter attribute */ public void setFilter(boolean filter) { this.filter = filter; } /** * Sets the full attribute of the MBeanNameTag object * * @param full The new full value */ public void setFull(boolean full) { this.full = full; } /** * 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; } /** * Setter for the scope attribute * * @param scope The new value for scope attribute */ public void setScope(String scope) { this.scope = scope; } } --- NEW FILE: MBeanParameterEditorTag.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.beans.PropertyEditor; import java.beans.PropertyEditorManager; import javax.management.MBeanParameterInfo; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import net.sourceforge.ejtools.util.ClassTools; import org.apache.log4j.Category; import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; /** * Description of the Class * * @author letiemble * @created 25 avril 2002 * @version $Revision: 1.5 $ * @todo Javadoc to complete */ public class MBeanParameterEditorTag extends TagSupport { /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; /** 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; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; /** Description of the Field */ private static Category logger = Category.getInstance(MBeanAttributeEditorTag.class); /** Description of the Field */ private static MessageResources messages = MessageResources.getMessageResources("net.sourceforge.ejtools.jmxbrowser.web.taglib.MBeanAttributeInfoEditor"); /** * Description of the Method * * @return Description of the Returned Value * @exception JspException Description of Exception */ public int doStartTag() throws JspException { // Look up the requested bean (if necessary) MBeanParameterInfo info = (MBeanParameterInfo) RequestUtils.lookup(pageContext, name, scope); if (ignore) { if (info == null) { return (SKIP_BODY); } // Nothing to output } PropertyEditor propertyeditor = null; Class c = ClassTools.getClass(info.getType()); if (c == null) { addUnsupportedParameter(info); } else { if (c.isArray()) { addUnsupportedArrayParameter(info); } else { propertyeditor = PropertyEditorManager.findEditor(c); if (propertyeditor == null) { addUnsupportedParameter(info); } else { addParameter(propertyeditor , info); } } } // Continue processing this page return (SKIP_BODY); } /** * Getter for the filter attribute * * @return The value of filter attribute */ public boolean getFilter() { return (this.filter); } /** * Gets the id attribute of the MBeanAttributeEditorTag object * * @return The id value */ public String getId() { return (this.id); } /** * Getter for the ignore attribute * * @return The value of ignore attribute */ public boolean getIgnore() { return (this.ignore); } /** * Getter for the name attribute * * @return The value of name attribute */ public String getName() { return (this.name); } /** * Getter for the scope attribute * * @return The value of scope attribute */ public String getScope() { return (this.scope); } /** Release all allocated resources. */ public void release() { super.release(); filter = true; ignore = false; name = null; scope = null; id = null; } /** * Setter for the filter attribute * * @param filter The new value for filter attribute */ public void setFilter(boolean filter) { this.filter = filter; } /** * Sets the id attribute of the MBeanAttributeEditorTag 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; } /** * Setter for the scope attribute * * @param scope The new value for scope attribute */ public void setScope(String scope) { this.scope = scope; } /** * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * * @param propertyeditor The feature to be added to the Property attribute * @param attributeInfo The feature to be added to the Property attribute * @param object The feature to be added to the Property attribute * @exception JspException Description of Exception */ protected void addParameter(PropertyEditor propertyeditor, MBeanParameterInfo info) throws JspException { logger.debug("addParameter " + propertyeditor + " " + info.getName()); String output = ""; int id = -1; try { Integer value = (Integer) pageContext.getAttribute(getId()); id = value.intValue(); } catch (Exception e) { logger.error("Exception during numbering reading " + e.getMessage()); throw new JspException(e.getMessage()); } output = output + "<input type=\"hidden\" name=\":param:" + id + "\" value=\"" + propertyeditor.getClass().getName() + "\"/>"; // Boolean types if (("java.lang.Boolean".equals(info.getType())) || ("boolean".equals(info.getType()))) { output = output + "<select name=\":value:" + id + "\">"; output = output + "<option value=\"true\">" + messages.getMessage("boolean.true") + "</option>"; output = output + "<option value=\"false\">" + messages.getMessage("boolean.false") + "</option>"; output = output + "</select>"; } // Others types else { output = output + "<input type=\"text\" name=\":value:" + id + "\"/>"; } ResponseUtils.write(pageContext, output); } /** * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * * @param info The feature to be added to the UnsupportedArrayParameter attribute * @exception JspException Description of the Exception * @todo I18N */ protected void addUnsupportedArrayParameter(MBeanParameterInfo info) throws JspException { Class c = ClassTools.getClass(info.getType()); String output = "Unsupported Array Paramater : " + c.getComponentType().getName(); if (filter) { output = "<i>" + ResponseUtils.filter(output) + "</i>"; } else { output = "<i>" + output + "</i>"; } ResponseUtils.write(pageContext, output); } /** * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object * * @param info The feature to be added to the UnsupportedParameter attribute * @exception JspException Description of Exception * @todo I18N */ protected void addUnsupportedParameter(MBeanParameterInfo info) throws JspException { String output = "Unsupported Paramater : " + info.getType(); if (filter) { output = "<i>" + ResponseUtils.filter(output) + "</i>"; } else { output = "<i>" + output + "</i>"; } ResponseUtils.write(pageContext, output); } static { PropertyEditorManager.setEditorSearchPath(new String[]{"sun.beans.editors", "net.sourceforge.ejtools.awt.editors"}); } } Index: ConnectTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/ConnectTag.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ConnectTag.java 17 May 2002 17:18:24 -0000 1.5 --- ConnectTag.java 10 Jun 2002 07:49:56 -0000 1.6 *************** *** 18,21 **** --- 18,22 ---- * @author letiemble * @created 1 mars 2002 + * @version $Revision$ * @todo Javadoc to complete */ Index: MBeanAttributeAccessTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeAccessTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MBeanAttributeAccessTag.java 17 May 2002 17:18:24 -0000 1.3 --- MBeanAttributeAccessTag.java 10 Jun 2002 07:49:56 -0000 1.4 *************** *** 20,23 **** --- 20,24 ---- * @author letiemble * @created 25 avril 2002 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 33,37 **** protected String scope = null; /** Description of the Field */ ! private static MessageResources messages = MessageResources.getMessageResources("MBeanAttributeInfoAccess"); --- 34,38 ---- protected String scope = null; /** Description of the Field */ ! private static MessageResources messages = MessageResources.getMessageResources("net.sourceforge.ejtools.jmxbrowser.web.taglib.MBeanAttributeInfoAccess"); Index: MBeanAttributeClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeClassTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanAttributeClassTag.java 15 May 2002 20:56:11 -0000 1.2 --- MBeanAttributeClassTag.java 10 Jun 2002 07:49:56 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- * @author letiemble * @created 25 avril 2002 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 27,30 **** --- 28,33 ---- /** Filter the rendered output for characters that are sensitive in HTML? */ protected boolean filter = true; + /** Description of the Field */ + protected String id = null; /** Should we ignore missing beans and simply output nothing? */ protected boolean ignore = false; *************** *** 81,84 **** --- 84,98 ---- /** + * Gets the id attribute of the MBeanAttributeClassTag object + * + * @return The id value + */ + public String getId() + { + return (this.id); + } + + + /** * Getter for the ignore attribute * *************** *** 121,124 **** --- 135,139 ---- name = null; scope = null; + id = null; } *************** *** 132,135 **** --- 147,161 ---- { this.filter = filter; + } + + + /** + * Sets the id attribute of the MBeanAttributeClassTag object + * + * @param id The new id value + */ + public void setId(String id) + { + this.id = id; } Index: MBeanAttributeEditorTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanAttributeEditorTag.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MBeanAttributeEditorTag.java 25 May 2002 20:36:22 -0000 1.3 --- MBeanAttributeEditorTag.java 10 Jun 2002 07:49:56 -0000 1.4 *************** *** 9,12 **** --- 9,13 ---- import java.beans.PropertyEditor; import java.beans.PropertyEditorManager; + import java.util.Hashtable; import javax.management.MBeanAttributeInfo; *************** *** 17,20 **** --- 18,23 ---- import net.sourceforge.ejtools.util.ClassTools; + import org.apache.log4j.Category; + import org.apache.struts.util.MessageResources; import org.apache.struts.util.RequestUtils; import org.apache.struts.util.ResponseUtils; *************** *** 25,28 **** --- 28,32 ---- * @author letiemble * @created 25 avril 2002 + * @version $Revision$ * @todo Javadoc to complete */ *************** *** 35,42 **** --- 39,53 ---- /** Name of the bean that contains the data we will be rendering. */ protected String name = null; + /** Description of the Field */ + protected String page = "/detail.do"; /** Name of the property to be accessed on the specified bean. */ protected String property = null; /** The scope to be searched to retrieve the specified bean. */ protected String scope = null; + /** Description of the Field */ + private static Category logger = Category.getInstance(MBeanAttributeEditorTag.class); + /** Description of the Field */ + private static MessageResources messages = MessageResources.getMessageResources("net.sourceforge.ejtools.jmxbrowser.web.taglib.MBeanAttributeInfoEditor"); + *************** *** 80,84 **** propertyeditor = PropertyEditorManager.findEditor(String.class); } ! addArrayProperty(bean, propertyeditor, info); } else --- 91,95 ---- propertyeditor = PropertyEditorManager.findEditor(String.class); } ! addArrayProperty(bean, propertyeditor, info, componentType); } else *************** *** 226,234 **** * @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 */ ! protected void addArrayProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException { ! System.out.println("addProperty " + propertyeditor + " " + attributeInfo.getName()); String output = ""; Object obj = null; --- 237,247 ---- * @param attributeInfo The feature to be added to the ArrayProperty attribute * @param object The feature to be added to the ArrayProperty attribute + * @param componentType The feature to be added to the ArrayProperty attribute * @exception JspException Description of Exception */ ! protected void addArrayProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo, Class componentType) throws JspException { ! logger.debug("addProperty " + propertyeditor + " " + attributeInfo.getName()); ! String output = ""; Object obj = null; *************** *** 239,243 **** if (attributeInfo.isReadable()) { ! obj = object.getAttribute(object.getObjectName(), attributeInfo.getName()); } if (obj != null) --- 252,256 ---- if (attributeInfo.isReadable()) { ! obj = object.getAttribute(attributeInfo.getName()); } if (obj != null) *************** *** 246,275 **** } } ! catch (Throwable _ex) { } ! for (int i = 0; i < array.length; i++) { ! try { ! PropertyEditor propertyeditor1 = (PropertyEditor) propertyeditor.getClass().newInstance(); ! propertyeditor1.setValue(array[i]); ! output = propertyeditor1.getAsText(); ! output = output + "<br/>"; ! if (filter) ! { ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); } ! else { ! ResponseUtils.write(pageContext, output); } } - catch (Exception _ex) - { - } } } --- 259,292 ---- } } ! catch (Throwable t) { + logger.warn("Exception during array reading " + t.getMessage()); } ! if (array != null) { ! for (int i = 0; i < array.length; i++) { ! try ! { ! PropertyEditor propertyeditor1 = (PropertyEditor) propertyeditor.getClass().newInstance(); ! propertyeditor1.setValue(array[i]); ! output = propertyeditor1.getAsText(); ! if (filter) ! { ! output = ResponseUtils.filter(output); ! } ! ! output = computeReadableEditor(componentType.getName(), output); ! ! ResponseUtils.write(pageContext, output + "<br/>"); } ! catch (Exception e) { ! logger.warn("Exception during array output " + e.getMessage()); } } } } *************** *** 286,290 **** protected void addProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException { ! System.out.println("addProperty " + propertyeditor + " " + attributeInfo.getName()); String output = ""; --- 303,309 ---- protected void addProperty(MBeanAccessor object, PropertyEditor propertyeditor, MBeanAttributeInfo attributeInfo) throws JspException { ! logger.debug("addProperty " + propertyeditor + " " + attributeInfo.getName()); ! ! Object value = null; String output = ""; *************** *** 293,320 **** if (attributeInfo.isReadable()) { ! propertyeditor.setValue(object.getAttribute(object.getObjectName(), attributeInfo.getName())); } } ! catch (Throwable _ex) { } if (attributeInfo.isWritable()) { ! output = propertyeditor.getAsText(); } else { output = propertyeditor.getAsText(); - } ! if (filter) ! { ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); ! } ! else ! { ! ResponseUtils.write(pageContext, output); } } --- 312,394 ---- if (attributeInfo.isReadable()) { ! value = object.getAttribute(attributeInfo.getName()); ! propertyeditor.setValue(value); } } ! catch (Throwable t) { + logger.warn("Exception during property reading " + t.getMessage()); } if (attributeInfo.isWritable()) { ! output = output + "<input type=\"hidden\" name=\":attribute:" + attributeInfo.getName() + "\" value=\"" + propertyeditor.getClass().getName() + "\"/>"; ! output = output + "<input type=\"hidden\" name=\":previous:" + attributeInfo.getName() + "\" value=\""; ! ! if (value != null) ! { ! output = output + value; ! } ! output = output + "\"/>"; ! ! // Boolean types ! if (("java.lang.Boolean".equals(attributeInfo.getType())) || ("boolean".equals(attributeInfo.getType()))) ! { ! output = output + "<select name=\":value:" + attributeInfo.getName() + "\">"; ! ! output = output + "<option value=\"true\" "; ! if (Boolean.TRUE.equals(value)) ! { ! output = output + "selected"; ! } ! output = output + ">" + messages.getMessage("boolean.true") + "</option>"; ! ! output = output + "<option value=\"false\" "; ! if (Boolean.FALSE.equals(value)) ! { ! output = output + "selected"; ! } ! output = output + ">" + messages.getMessage("boolean.false") + "</option>"; ! ! output = output + "</select>"; ! } ! // Others types ! else ! { ! String content = ""; ! String link = ""; ! ! output = output + "<input type=\"text\" name=\":value:" + attributeInfo.getName() + "\" value=\""; ! ! if (value != null) ! { ! content = propertyeditor.getAsText(); ! ! if (filter) ! { ! content = ResponseUtils.filter(content); ! } ! } ! ! output = output + content + "\"/>"; ! ! link = computeWritableEditor(attributeInfo.getType(), content); ! ! output = output + link; ! } } else { output = propertyeditor.getAsText(); ! if (filter) ! { ! output = ResponseUtils.filter(output); ! } ! ! output = computeReadableEditor(attributeInfo.getType(), output); } + + ResponseUtils.write(pageContext, output); } *************** *** 325,342 **** * @param attributeInfo The feature to be added to the UnsupportedProperty attribute * @exception JspException Description of Exception */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) throws JspException { ! System.out.println("Getting value for attribute " + attributeInfo.getName()); ! String output = "<i>Unsupported Class : " + attributeInfo.getType() + "</i>"; if (filter) { ! ResponseUtils.write(pageContext, ResponseUtils.filter(output)); } else { ! ResponseUtils.write(pageContext, output); } } --- 399,490 ---- * @param attributeInfo The feature to be added to the UnsupportedProperty attribute * @exception JspException Description of Exception + * @todo I18N */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) throws JspException { ! logger.debug("Getting value for attribute " + attributeInfo.getName()); ! ! String output = "Unsupported Class : " + attributeInfo.getType(); if (filter) { ! output = "<i>" + ResponseUtils.filter(output) + "</i>"; } else { ! output = "<i>" + output + "</i>"; } + + ResponseUtils.write(pageContext, output); + } + + + /** + * Description of the Method + * + * @param type Description of the Parameter + * @param value Description of the Parameter + * @return Description of the Return Value + */ + protected String computeReadableEditor(String type, String value) + { + if ((value == null) || ("".equals(value)) || ("null".equals(value))) + { + return value; + } + + if ("javax.management.ObjectName".equals(type)) + { + try + { + Hashtable params = new Hashtable(); + params.put("reference", value); + + String url = RequestUtils.computeURL(pageContext, null, null, page, params, null, false); + + return ("<a href=\"" + url + "\">" + value + "</a>"); + } + catch (Exception e) + { + logger.warn("Exception during computation of readable editor " + e.getMessage()); + } + } + + return value; + } + + + /** + * Description of the Method + * + * @param type Description of the Parameter + * @param value Description of the Parameter + * @return Description of the Return Value + */ + protected String computeWritableEditor(String type, String value) + { + if ((value == null) || ("".equals(value)) || ("null".equals(value))) + { + return ""; + } + + if ("javax.management.ObjectName".equals(type)) + { + try + { + Hashtable params = new Hashtable(); + params.put("reference", value); + + String url = RequestUtils.computeURL(pageContext, null, null, page, params, null, false); + + return (" <a href=\"" + url + "\">" + messages.getMessage("hyperlink.go") + "</a>"); + } + catch (Exception e) + { + logger.warn("Exception during computation of writable editor " + e.getMessage()); + } + } + + return ""; } *************** *** 346,348 **** } } - --- 494,495 ---- Index: MBeanParameterClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/MBeanParameterClassTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanParameterClassTag.java 15 May 2002 20:56:11 -0000 1.2 --- MBeanParameterClassTag.java 10 Jun 2002 07:49:56 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- * @author letiemble * @created 25 avril 2002 + * @version $Revision$ * @todo Javadoc to complete */ Index: TreeRendererImpl.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/web/taglib/TreeRendererImpl.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TreeRendererImpl.java 25 May 2002 20:36:22 -0000 1.1 --- TreeRendererImpl.java 10 Jun 2002 07:49:56 -0000 1.2 *************** *** 7,12 **** --- 7,15 ---- package net.sourceforge.ejtools.jmxbrowser.web.taglib; + import java.util.Hashtable; + import net.sourceforge.ejtools.jmxbrowser.model.Domain; import net.sourceforge.ejtools.jmxbrowser.model.Resource; + import net.sourceforge.ejtools.servlet.http.jsp.tagext.TreeRenderer; /** *************** *** 15,22 **** --- 18,30 ---- * @author letiemble * @created 25 avril 2002 + * @version $Revision$ * @todo Javadoc to complete */ public class TreeRendererImpl implements TreeRenderer { + /** Description of the Field */ + protected static Hashtable icons = new Hashtable(); + + /** * Gets the icon attribute of the TreeRendererImpl object *************** *** 27,39 **** 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; } } --- 35,52 ---- public String getIcon(Object o) { ! String icon = (String) icons.get(o.getClass()); ! ! if (icon == null) { ! icon = "images/toolbarButtonGraphics/general/Bean16.gif"; } ! return icon; ! } ! ! /** Map of the class/icons */ ! static ! { ! icons.put(net.sourceforge.ejtools.jmxbrowser.model.Domain.class, "images/toolbarButtonGraphics/development/J2EEDomain16.gif"); ! icons.put(net.sourceforge.ejtools.jmxbrowser.model.Resource.class, "images/toolbarButtonGraphics/development/Bean16.gif"); } } --- BeanContextTreeTag.java DELETED --- --- IndentedObject.java DELETED --- --- MBeanAttributeValueTag.java DELETED --- --- TreeLeafTag.java DELETED --- --- TreeRenderer.java DELETED --- --- TreeRendererTag.java DELETED --- --- TreeSpacerTag.java DELETED --- |