ejtools-cvs Mailing List for EJTools (Page 11)
Brought to you by:
letiemble
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
(471) |
May
(303) |
Jun
(176) |
Jul
(67) |
Aug
(64) |
Sep
(84) |
Oct
(148) |
Nov
(57) |
Dec
(272) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(356) |
Feb
(304) |
Mar
(214) |
Apr
(22) |
May
(7) |
Jun
(25) |
Jul
|
Aug
(5) |
Sep
(106) |
Oct
|
Nov
(95) |
Dec
(193) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(2) |
Feb
(1) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib Modified Files: ConnectTag.java MBeanAttributeAccessTag.java MBeanAttributeClassTag.java MBeanAttributeEditorTag.java MBeanNameTag.java MBeanParameterClassTag.java MBeanParameterEditorTag.java MBeanResultEditorTag.java NotificationCheckBoxTag.java TreeRendererImpl.java Added Files: MBeanSortTag.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI --- NEW FILE: MBeanSortTag.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.web.taglib; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.List; import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; import org.apache.struts.util.RequestUtils; import org.ejtools.jmx.MBeanSorter; /** * Description of the Class * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @todo Javadoc to complete * @jsp:tag name="mbeanSort" body-content="empty" */ public class MBeanSortTag extends TagSupport { /** Description of the Field */ protected String id = 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 Returned Value * @exception JspException Description of Exception */ public int doStartTag() throws JspException { Object object = null; // Look up the requested bean (if necessary) if (property != null) { object = RequestUtils.lookup(pageContext, name, property, scope); } else { object = RequestUtils.lookup(pageContext, name, scope); } if (object == null) { throw new JspException("Unable to find bean " + name + " or its property " + property); } List content = null; if (object.getClass().isArray()) { content = Arrays.asList((Object[]) object); MBeanSorter.sortByName(content); } else { if (object instanceof Collection) { content = new ArrayList((Collection) object); } if (object instanceof List) { content = (List) object; } if (content != null) { MBeanSorter.sortByName(content); } } // Put the sorted result in the pagecontext if (content != null) { pageContext.setAttribute(id, content); } else { throw new JspException("Cannot sort input " + object); } // Continue processing this page return (SKIP_BODY); } /** * Gets the id attribute of the HiddenObjectTag object * * @return The id value * @jsp:attribute name="id" required="true" rtexprvalue="true" */ public String getId() { return (this.id); } /** * 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 HiddenObjectTag 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); } /** Release all allocated resources. */ public void release() { super.release(); id = null; name = null; property = null; scope = null; } /** * Sets the id attribute of the HiddenObjectTag object * * @param id The new id value */ public void setId(String id) { this.id = id; } /** * 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 HiddenObjectTag 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; } } Index: ConnectTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/ConnectTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConnectTag.java 10 Feb 2003 20:49:34 -0000 1.1 --- ConnectTag.java 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,137 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.servlet.ServletContext; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.ejtools.jmx.browser.web.Constants; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 1 mars 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="connect" body-content="empty" ! */ ! public class ConnectTag extends TagSupport ! { ! /** The key of the application-scope bean we look for. */ ! private String name = Constants.TREE; ! /** The page to which we should forward for the user to log on. */ ! private String page = "/connect.do"; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doEndTag() ! throws JspException ! { ! boolean valid = false; ! ! ServletContext context = pageContext.getServletContext(); ! ! if (context.getAttribute(name) != null) ! { ! valid = true; ! } ! ! // Forward control based on the results ! if (valid) ! { ! return (EVAL_PAGE); ! } ! else ! { ! try ! { ! pageContext.forward(page); ! } ! catch (Exception e) ! { ! throw new JspException("Error during forwarding to " + page); ! } ! return (SKIP_PAGE); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! return (SKIP_BODY); ! } ! ! ! /** ! * Getter for the name attribute ! * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Getter for the page attribute ! * ! * @return The value of page attribute ! * @jsp:attribute name="page" required="false" rtexprvalue="true" ! */ ! public String getPage() ! { ! return (this.page); ! } ! ! ! /** Description of the Method */ ! public void release() ! { ! super.release(); ! this.name = Constants.TREE; ! this.page = "/connect.do"; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the page attribute ! * ! * @param page The new page value ! */ ! public void setPage(String page) ! { ! this.page = page; ! } ! } ! --- 1,137 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.servlet.ServletContext; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.ejtools.jmx.browser.web.Constants; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 1 mars 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="connect" body-content="empty" ! */ ! public class ConnectTag extends TagSupport ! { ! /** The key of the application-scope bean we look for. */ ! private String name = Constants.TREE; ! /** The page to which we should forward for the user to log on. */ ! private String page = "/connect.do"; ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doEndTag() ! throws JspException ! { ! boolean valid = false; ! ! ServletContext context = pageContext.getServletContext(); ! ! if (context.getAttribute(name) != null) ! { ! valid = true; ! } ! ! // Forward control based on the results ! if (valid) ! { ! return (EVAL_PAGE); ! } ! else ! { ! try ! { ! pageContext.forward(page); ! } ! catch (Exception e) ! { ! throw new JspException("Error during forwarding to " + page); ! } ! return (SKIP_PAGE); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! return (SKIP_BODY); ! } ! ! ! /** ! * Getter for the name attribute ! * ! * @return The value of name attribute ! * @jsp:attribute name="name" required="false" rtexprvalue="true" ! */ ! public String getName() ! { ! return (this.name); ! } ! ! ! /** ! * Getter for the page attribute ! * ! * @return The value of page attribute ! * @jsp:attribute name="page" required="false" rtexprvalue="true" ! */ ! public String getPage() ! { ! return (this.page); ! } ! ! ! /** Description of the Method */ ! public void release() ! { ! super.release(); ! this.name = Constants.TREE; ! this.page = "/connect.do"; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the page attribute ! * ! * @param page The new page value ! */ ! public void setPage(String page) ! { ! this.page = page; ! } ! } ! Index: MBeanAttributeAccessTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanAttributeAccessTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanAttributeAccessTag.java 10 Feb 2003 21:26:45 -0000 1.2 --- MBeanAttributeAccessTag.java 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 1,208 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanAttributeInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! 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$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanAttributeAccess" body-content="empty" ! */ ! public class MBeanAttributeAccessTag 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 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 MessageResources messages = MessageResources.getMessageResources("org.ejtools.jmx.browser.web.taglib.MBeanAttributeInfoAccess"); ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! String output = computeAccess(info); ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! ! } ! ! ! /** ! * Setter for the filter attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Description of the Method ! * ! * @param info Description of the Parameter ! * @return Description of the Returned Value ! */ ! protected String computeAccess(MBeanAttributeInfo info) ! { ! String result = messages.getMessage("access.ro"); ! ! if (info.isIs() || info.isReadable()) ! { ! if (info.isWritable()) ! { ! result = messages.getMessage("access.rw"); ! } ! } ! else ! { ! if (info.isWritable()) ! { ! result = messages.getMessage("access.wo"); ! } ! } ! ! return result; ! } ! } ! --- 1,208 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanAttributeInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! 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$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanAttributeAccess" body-content="empty" ! */ ! public class MBeanAttributeAccessTag 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 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 MessageResources messages = MessageResources.getMessageResources("org.ejtools.jmx.browser.web.taglib.MBeanAttributeInfoAccess"); ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! String output = computeAccess(info); ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! ! } ! ! ! /** ! * Setter for the filter attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! ! ! /** ! * Description of the Method ! * ! * @param info Description of the Parameter ! * @return Description of the Returned Value ! */ ! protected String computeAccess(MBeanAttributeInfo info) ! { ! String result = messages.getMessage("access.ro"); ! ! if (info.isIs() || info.isReadable()) ! { ! if (info.isWritable()) ! { ! result = messages.getMessage("access.rw"); ! } ! } ! else ! { ! if (info.isWritable()) ! { ! result = messages.getMessage("access.wo"); ! } ! } ! ! return result; ! } ! } ! Index: MBeanAttributeClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanAttributeClassTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeClassTag.java 10 Feb 2003 20:49:34 -0000 1.1 --- MBeanAttributeClassTag.java 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,177 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanAttributeInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.util.ClassTools; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanAttributeClass" body-content="empty" ! */ ! public class MBeanAttributeClassTag 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 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 the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! String output = ClassTools.classDisplay(info.getType()); ! ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** 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 filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! --- 1,177 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanAttributeInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.util.ClassTools; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanAttributeClass" body-content="empty" ! */ ! public class MBeanAttributeClassTag 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 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 the Exception ! */ ! public int doStartTag() ! throws JspException ! { ! // Look up the requested bean (if necessary) ! MBeanAttributeInfo info = (MBeanAttributeInfo) RequestUtils.lookup(pageContext, name, scope); ! if (ignore) ! { ! if (info == null) ! { ! return (SKIP_BODY); ! } ! // Nothing to output ! } ! ! String output = ClassTools.classDisplay(info.getType()); ! ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** 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 filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! Index: MBeanAttributeEditorTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanAttributeEditorTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanAttributeEditorTag.java 10 Feb 2003 21:26:45 -0000 1.2 --- MBeanAttributeEditorTag.java 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 1,528 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import java.beans.PropertyEditor; ! import java.util.Hashtable; [...1027 lines suppressed...] ! 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 ""; ! } ! } Index: MBeanNameTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanNameTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanNameTag.java 12 Feb 2003 21:22:45 -0000 1.2 --- MBeanNameTag.java 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 1,218 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.jmx.browser.model.Node; ! import org.ejtools.jmx.browser.model.Resource; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanName" body-content="empty" ! */ ! 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 the 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Gets the full attribute of the MBeanNameTag object ! * ! * @return The full value ! * @jsp:attribute name="full" required="false" rtexprvalue="true" ! */ ! public boolean getFull() ! { ! return (this.full); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** 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 filter value ! */ ! 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 ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! --- 1,218 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.jmx.browser.model.Node; ! import org.ejtools.jmx.browser.model.Resource; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanName" body-content="empty" ! */ ! 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 the 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Gets the full attribute of the MBeanNameTag object ! * ! * @return The full value ! * @jsp:attribute name="full" required="false" rtexprvalue="true" ! */ ! public boolean getFull() ! { ! return (this.full); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** 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 filter value ! */ ! 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 ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! Index: MBeanParameterClassTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanParameterClassTag.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanParameterClassTag.java 10 Feb 2003 20:49:34 -0000 1.1 --- MBeanParameterClassTag.java 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,176 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanParameterInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.util.ClassTools; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanParameterClass" body-content="empty" ! */ ! public class MBeanParameterClassTag 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 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 the 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 ! } ! ! String output = ClassTools.classDisplay(info.getType()); ! ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } ! ! ! /** ! * Setter for the filter attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! --- 1,176 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import javax.management.MBeanParameterInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.util.ClassTools; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanParameterClass" body-content="empty" ! */ ! public class MBeanParameterClassTag 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 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 the 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 ! } ! ! String output = ClassTools.classDisplay(info.getType()); ! ! 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 ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** Release all allocated resources. */ ! public void release() ! { ! super.release(); ! filter = true; ! ignore = false; ! name = null; ! scope = null; ! } ! ! ! /** ! * Setter for the filter attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! public void setScope(String scope) ! { ! this.scope = scope; ! } ! } ! Index: MBeanParameterEditorTag.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/taglib/MBeanParameterEditorTag.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanParameterEditorTag.java 10 Feb 2003 21:26:43 -0000 1.2 --- MBeanParameterEditorTag.java 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 1,345 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.taglib; ! ! import java.beans.PropertyEditor; ! ! import javax.management.MBeanParameterInfo; ! import javax.servlet.jsp.JspException; ! import javax.servlet.jsp.tagext.TagSupport; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.util.MessageResources; ! import org.apache.struts.util.RequestUtils; ! import org.apache.struts.util.ResponseUtils; ! import org.ejtools.beans.CustomPropertyEditorManager; ! import org.ejtools.util.ClassTools; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @jsp:tag name="mbeanParameterEditor" body-content="empty" ! */ ! 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 Logger logger = Logger.getLogger(MBeanAttributeEditorTag.class); ! /** Description of the Field */ ! private static MessageResources messages = MessageResources.getMessageResources("org.ejtools.jmx.browser.web.taglib.MBeanAttributeInfoEditor"); ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! * @exception JspException Description of the 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()); ! ! logger.debug("Parameter class " + c); ! ! if (c == null) ! { ! this.addUnsupportedParameter(); ! } ! else ! { ! if (c.isArray()) ! { ! this.addUnsupportedArrayParameter(); ! } ! else ! { ! propertyeditor = CustomPropertyEditorManager.findEditor(c); ! ! logger.debug("Property Editor " + propertyeditor); ! ! if (propertyeditor == null) ! { ! this.addUnsupportedParameter(); ! } ! else ! { ! this.addParameter(propertyeditor, info); ! } ! } ! } ! ! // Continue processing this page ! return (SKIP_BODY); ! } ! ! ! /** ! * Getter for the filter attribute ! * ! * @return The value of filter attribute ! * @jsp:attribute name="filter" required="false" rtexprvalue="true" ! */ ! public boolean getFilter() ! { ! return (this.filter); ! } ! ! ! /** ! * @return The id value ! * @jsp:attribute name="id" required="true" rtexprvalue="true" ! */ ! public String getId() ! { ! return (this.id); ! } ! ! ! /** ! * Getter for the ignore attribute ! * ! * @return The value of ignore attribute ! * @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); ! } ! ! ! /** ! * 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); ! } ! ! ! /** 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 filter value ! */ ! public void setFilter(boolean filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Sets the id attribute of the MBeanParameterEditorTag object ! * ! * @param id The new id value ! */ ! public void setId(String id) ! { ! this.id = id; ! } ! ! ! /** ! * Setter for the ignore attribute ! * ! * @param ignore The new ignore value ! */ ! public void setIgnore(boolean ignore) ! { ! this.ignore = ignore; ! } ! ! ! /** ! * Setter for the name attribute ! * ! * @param name The new name value ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Setter for the scope attribute ! * ! * @param scope The new scope value ! */ ! 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 Parameter attribute ! * @param info The feature to be added to the Parameter attribute ! * @exception JspException Description of the Exception ! */ ! protected void addParameter(PropertyEditor propertyeditor, MBeanParameterInfo info) ! throws JspException ! { ! StringBuffer buffer = new StringBuffer(); ! int id = -1; ! ! logger.debug("addParameter " + propertyeditor + " " + info.getName()); ! ! 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()); ! } ! ! buffer.append("<input type=\"hidden\" name=\":parameter:"); ! buffer.append(id); ! buffer.append("\" value=\""); ! buffer.append(info.getType()); ! buffer.append("\"/>"); ! ! buffer.append("<input type=\"hidden\" name=\":editor:"); ! buffer.append(id); ! buffer.append("\" value=\""); ! buffer.append(propertyeditor.getClass().getName()); ! buffer.append("\"/>"); ! ! // Boolean types ! if (("java.lang.Boolean".equals(info.getType())) || ("boolean".equals(info.getType()))) ! { ! buffer.append("<select name=\":value:"); ! buffer.append(id); ! buffer.append("\">"); ! ! buffer.append("<option value=\"true\">"); ! buffer.append(messages.getMessage("boolean.true")); ! buffer.append("</option>"); ! ! buffer.append("<option value=\"false\">"); ! buffer.append(messages.getMessage("boolean.false")); ! buffer.append("</option>"); ! ! buffer.append("</select>"); ! } ! // Others types ! else ! { ! buffer.append("<input type=\"text\" name=\":value:"); ! buffer.append(id); ! buffer.append("\"/>"); ! } ! ! ResponseUtils.write(pageContext, buffer.toString()); ! } ! ! ! /** ! * Adds a feature to the UnsupportedProperty attribute of the MBeanAttributeEditorTag object ! ... [truncated message content] |
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/web/action Modified Files: ClearNotificationAction.java ClearSearchAction.java CustomViewAction.java DetailAction.java InvokeAction.java NotificationAction.java RefreshAction.java RegisterAction.java SearchAction.java UnregisterAction.java UpdateAction.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: ClearNotificationAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/ClearNotificationAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClearNotificationAction.java 12 Feb 2003 21:22:44 -0000 1.2 --- ClearNotificationAction.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,88 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClearNotificationAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ClearNotificationAction.class); ! ! ! /** Constructor for the FilterAction object */ ! public ClearNotificationAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! tree.clearNotifications(); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } --- 1,83 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClearNotificationAction extends Action ! { ! /** Constructor for the FilterAction object */ ! public ClearNotificationAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! tree.clearNotifications(); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } Index: ClearSearchAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/ClearSearchAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ClearSearchAction.java 12 Feb 2003 21:22:43 -0000 1.2 --- ClearSearchAction.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,90 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClearSearchAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ClearSearchAction.class); ! ! ! /** Constructor for the FilterAction object */ ! public ClearSearchAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! Vector result = new Vector(); ! context.setAttribute(Constants.SEARCH_RESULT, result); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } --- 1,85 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ClearSearchAction extends Action ! { ! /** Constructor for the FilterAction object */ ! public ClearSearchAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! Vector result = new Vector(); ! context.setAttribute(Constants.SEARCH_RESULT, result); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } Index: CustomViewAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/CustomViewAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CustomViewAction.java 12 Feb 2003 21:22:43 -0000 1.2 --- CustomViewAction.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,189 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Iterator; ! import java.util.Locale; ! ! import javax.management.MBeanAttributeInfo; ! import javax.management.MBeanInfo; ! import javax.management.MBeanOperationInfo; ! import javax.management.ObjectName; ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.mbean.View; ! import org.ejtools.jmx.browser.mbean.ViewLine; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class CustomViewAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(CustomViewAction.class); ! ! ! /** Constructor for the CustomViewAction object */ ! public CustomViewAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! JMXContainer tree = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! logger.debug("Connecting to JMX Server"); ! ! ServletContext context = this.getServlet().getServletContext(); ! tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! ! try ! { ! // TODO : put in constants ! int number = Integer.parseInt(request.getParameter("view")); ! ! // To change ! View view = tree.getView(number); ! logger.debug("Get View " + view); ! ! // TODO : put in constants ! context.setAttribute(Constants.CUSTOM_VIEW, view); ! context.setAttribute(Constants.CUSTOM_VIEW_INDEX, new String("" + number)); ! ! if (view != null) ! { ! Iterator iterator = null; ! View resultView = new View(); ! ! // Process Attributes ! iterator = view.getAttributeLines().iterator(); ! while (iterator.hasNext()) ! { ! ViewLine query = (ViewLine) iterator.next(); ! ! String name = query.getName(); ! Iterator it = tree.query(query.getObjectName(), null).iterator(); ! ! while (it.hasNext()) ! { ! ObjectName on = (ObjectName) it.next(); ! Resource res = (Resource) tree.searchObjectName(on.getCanonicalName()); ! ! MBeanInfo info = res.getMBeanInfo(); ! MBeanAttributeInfo[] attrs = info.getAttributes(); ! ! for (int i = 0; i < attrs.length; i++) ! { ! if (attrs[i].getName().equals(name)) ! { ! resultView.addAttributeResult(res, attrs[i]); ! logger.debug("Add new attribute " + res + " => " + name); ! break; ! } ! } ! } ! } ! ! // Process Operations ! iterator = view.getOperationLines().iterator(); ! while (iterator.hasNext()) ! { ! ViewLine query = (ViewLine) iterator.next(); ! ! String name = query.getName(); ! Iterator it = tree.query(query.getObjectName(), null).iterator(); ! ! while (it.hasNext()) ! { ! ObjectName on = (ObjectName) it.next(); ! Resource res = (Resource) tree.searchObjectName(on.getCanonicalName()); ! ! MBeanInfo info = res.getMBeanInfo(); ! MBeanOperationInfo[] opers = info.getOperations(); ! ! for (int i = 0; i < opers.length; i++) ! { ! if (opers[i].getName().equals(name)) ! { ! resultView.addOperationResult(res, opers[i]); ! logger.debug("Add new attribute " + res + " => " + name); ! break; ! } ! } ! } ! } ! ! context.setAttribute(Constants.CUSTOM_VIEW_ATTRIBUTES, resultView.getAttributeResults()); ! context.setAttribute(Constants.CUSTOM_VIEW_OPERATIONS, resultView.getOperationResults()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.process.view")); ! } ! } ! catch (Exception e) ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.process.view")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } --- 1,189 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Iterator; ! import java.util.Locale; ! ! import javax.management.MBeanAttributeInfo; ! import javax.management.MBeanInfo; ! import javax.management.MBeanOperationInfo; ! import javax.management.ObjectName; ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.mbean.View; ! import org.ejtools.jmx.browser.mbean.ViewLine; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class CustomViewAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(CustomViewAction.class); ! ! ! /** Constructor for the CustomViewAction object */ ! public CustomViewAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! JMXContainer tree = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! logger.debug("Connecting to JMX Server"); ! ! ServletContext context = this.getServlet().getServletContext(); ! tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! ! try ! { ! // TODO : put in constants ! int number = Integer.parseInt(request.getParameter("view")); ! ! // To change ! View view = tree.getView(number); ! logger.debug("Get View " + view); ! ! // TODO : put in constants ! context.setAttribute(Constants.CUSTOM_VIEW, view); ! context.setAttribute(Constants.CUSTOM_VIEW_INDEX, new String("" + number)); ! ! if (view != null) ! { ! Iterator iterator = null; ! View resultView = new View(); ! ! // Process Attributes ! iterator = view.getAttributeLines().iterator(); ! while (iterator.hasNext()) ! { ! ViewLine query = (ViewLine) iterator.next(); ! ! String name = query.getName(); ! Iterator it = tree.query(query.getObjectName(), null).iterator(); ! ! while (it.hasNext()) ! { ! ObjectName on = (ObjectName) it.next(); ! Resource res = (Resource) tree.searchObjectName(on.getCanonicalName()); ! ! MBeanInfo info = res.getMBeanInfo(); ! MBeanAttributeInfo[] attrs = info.getAttributes(); ! ! for (int i = 0; i < attrs.length; i++) ! { ! if (attrs[i].getName().equals(name)) ! { ! resultView.addAttributeResult(res, attrs[i]); ! logger.debug("Add new attribute " + res + " => " + name); ! break; ! } ! } ! } ! } ! ! // Process Operations ! iterator = view.getOperationLines().iterator(); ! while (iterator.hasNext()) ! { ! ViewLine query = (ViewLine) iterator.next(); ! ! String name = query.getName(); ! Iterator it = tree.query(query.getObjectName(), null).iterator(); ! ! while (it.hasNext()) ! { ! ObjectName on = (ObjectName) it.next(); ! Resource res = (Resource) tree.searchObjectName(on.getCanonicalName()); ! ! MBeanInfo info = res.getMBeanInfo(); ! MBeanOperationInfo[] opers = info.getOperations(); ! ! for (int i = 0; i < opers.length; i++) ! { ! if (opers[i].getName().equals(name)) ! { ! resultView.addOperationResult(res, opers[i]); ! logger.debug("Add new attribute " + res + " => " + name); ! break; ! } ! } ! } ! } ! ! context.setAttribute(Constants.CUSTOM_VIEW_ATTRIBUTES, resultView.getAttributeResults()); ! context.setAttribute(Constants.CUSTOM_VIEW_OPERATIONS, resultView.getOperationResults()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.process.view")); ! } ! } ! catch (Exception e) ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.process.view")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } Index: DetailAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/DetailAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DetailAction.java 12 Feb 2003 21:22:43 -0000 1.2 --- DetailAction.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,108 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DetailAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(DetailAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public DetailAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! String reference = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! reference = request.getParameter("reference"); ! logger.debug("ObjectName requested " + reference); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! Resource res = (Resource) tree.searchObjectName(reference); ! ! if (res != null) ! { ! context.setAttribute(Constants.DETAIL, res); ! logger.debug("MBean found => " + res); ! context.setAttribute(Constants.DETAIL_INFO, res.getMBeanInfo()); ! logger.debug("MBeanInfo found => " + res.getMBeanInfo()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("detail")); ! } ! } ! --- 1,108 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.util.Locale; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DetailAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(DetailAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public DetailAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! String reference = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! reference = request.getParameter("reference"); ! logger.debug("ObjectName requested " + reference); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! Resource res = (Resource) tree.searchObjectName(reference); ! ! if (res != null) ! { ! context.setAttribute(Constants.DETAIL, res); ! logger.debug("MBean found => " + res); ! context.setAttribute(Constants.DETAIL_INFO, res.getMBeanInfo()); ! logger.debug("MBeanInfo found => " + res.getMBeanInfo()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("detail")); ! } ! } ! Index: InvokeAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/InvokeAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvokeAction.java 12 Feb 2003 21:22:44 -0000 1.2 --- InvokeAction.java 27 Nov 2003 01:13:07 -0000 1.3 *************** *** 1,215 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.beans.PropertyEditor; ! import java.io.IOException; ! import java.io.PrintWriter; ! import java.io.StringWriter; ! import java.util.Enumeration; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class InvokeAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(InvokeAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public InvokeAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! * @todo I18N to complete ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! String reference = null; ! String operation = null; ! String type = null; ! Vector parameters = new Vector(); ! String[] parameterTypes; ! Object[] parameterValues; ! Object result = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! reference = request.getParameter("reference"); ! logger.debug("ObjectName requested " + reference); ! operation = request.getParameter("operation"); ! logger.debug("Operation requested " + operation); ! type = request.getParameter("type"); ! logger.debug("Operation of type " + type); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! context.setAttribute("operation.name", "" + operation); ! context.setAttribute("operation.type", "" + type); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! Resource res = (Resource) tree.searchObjectName(reference); ! ! if (res != null) ! { ! context.setAttribute(Constants.DETAIL, res); ! logger.debug("MBean found => " + res); ! context.setAttribute(Constants.DETAIL_INFO, res.getMBeanInfo()); ! logger.debug("MBeanInfo found => " + res.getMBeanInfo()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! ! if (res != null) ! { ! try ! { ! Enumeration enum = request.getParameterNames(); ! while (enum.hasMoreElements()) ! { ! String name = (String) enum.nextElement(); ! ! if (name.startsWith(":parameter:")) ! { ! name = name.substring(":parameter:".length()); ! parameters.add(name); ! } ! } ! ! parameterTypes = new String[parameters.size()]; ! parameterValues = new Object[parameters.size()]; ! ! for (int i = 0; i < parameters.size(); i++) ! { ! String name = (String) parameters.elementAt(i); ! String clazz = null; ! String editor = null; ! String value = null; ! ! int position = Integer.parseInt(name); ! ! clazz = request.getParameter(":parameter:" + name); ! editor = request.getParameter(":editor:" + name); ! value = request.getParameter(":value:" + name); ! ! logger.debug("Processing parameter " + name); ! logger.debug("Editor for parameter " + name + " " + editor); ! logger.debug("Value for parameter " + name + " " + value); ! ! PropertyEditor pe = (PropertyEditor) Thread.currentThread().getContextClassLoader().loadClass(editor).newInstance(); ! pe.setAsText(value); ! Object o = pe.getValue(); ! ! logger.debug("Value for parameter " + o); ! ! parameterTypes[position] = clazz; ! parameterValues[position] = o; ! } ! ! logger.debug("Parameters :"); ! for (int i = 0; i < parameterTypes.length; i++) ! { ! logger.debug("> Parameter " + i + " (" + parameterTypes[i] + ") = <" + parameterValues[i] + ">"); ! } ! ! result = res.invoke(operation, parameterValues, parameterTypes); ! } ! catch (Exception e) ! { ! logger.error("Exception occured " + e.getMessage()); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.message", e.getMessage())); ! ! StringWriter w = new StringWriter(); ! PrintWriter pw = new PrintWriter(w); ! e.printStackTrace(pw); ! pw.close(); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.stack", w.toString())); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! context.removeAttribute(Constants.INVOCATION_RESULT); ! ! return (mapping.findForward("error")); ! } ! ! logger.debug("Result from invocation :"); ! logger.debug("----------------------------------------"); ! logger.debug("" + result); ! logger.debug("----------------------------------------"); ! ! if ("void".equals(type)) ! { ! context.setAttribute(Constants.INVOCATION_RESULT, "Void"); ! } ! else ! { ! context.setAttribute(Constants.INVOCATION_RESULT, "" + result); ! } ! ! return (mapping.findForward("result")); ! } ! } --- 1,215 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.beans.PropertyEditor; ! import java.io.IOException; ! import java.io.PrintWriter; ! import java.io.StringWriter; ! import java.util.Enumeration; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class InvokeAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(InvokeAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public InvokeAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! * @todo I18N to complete ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! String reference = null; ! String operation = null; ! String type = null; ! Vector parameters = new Vector(); ! String[] parameterTypes; ! Object[] parameterValues; ! Object result = null; ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! reference = request.getParameter("reference"); ! logger.debug("ObjectName requested " + reference); ! operation = request.getParameter("operation"); ! logger.debug("Operation requested " + operation); ! type = request.getParameter("type"); ! logger.debug("Operation of type " + type); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! context.setAttribute("operation.name", "" + operation); ! context.setAttribute("operation.type", "" + type); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! Resource res = (Resource) tree.searchObjectName(reference); ! ! if (res != null) ! { ! context.setAttribute(Constants.DETAIL, res); ! logger.debug("MBean found => " + res); ! context.setAttribute(Constants.DETAIL_INFO, res.getMBeanInfo()); ! logger.debug("MBeanInfo found => " + res.getMBeanInfo()); ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! ! if (res != null) ! { ! try ! { ! Enumeration enum = request.getParameterNames(); ! while (enum.hasMoreElements()) ! { ! String name = (String) enum.nextElement(); ! ! if (name.startsWith(":parameter:")) ! { ! name = name.substring(":parameter:".length()); ! parameters.add(name); ! } ! } ! ! parameterTypes = new String[parameters.size()]; ! parameterValues = new Object[parameters.size()]; ! ! for (int i = 0; i < parameters.size(); i++) ! { ! String name = (String) parameters.elementAt(i); ! String clazz = null; ! String editor = null; ! String value = null; ! ! int position = Integer.parseInt(name); ! ! clazz = request.getParameter(":parameter:" + name); ! editor = request.getParameter(":editor:" + name); ! value = request.getParameter(":value:" + name); ! ! logger.debug("Processing parameter " + name); ! logger.debug("Editor for parameter " + name + " " + editor); ! logger.debug("Value for parameter " + name + " " + value); ! ! PropertyEditor pe = (PropertyEditor) Thread.currentThread().getContextClassLoader().loadClass(editor).newInstance(); ! pe.setAsText(value); ! Object o = pe.getValue(); ! ! logger.debug("Value for parameter " + o); ! ! parameterTypes[position] = clazz; ! parameterValues[position] = o; ! } ! ! logger.debug("Parameters :"); ! for (int i = 0; i < parameterTypes.length; i++) ! { ! logger.debug("> Parameter " + i + " (" + parameterTypes[i] + ") = <" + parameterValues[i] + ">"); ! } ! ! result = res.invoke(operation, parameterValues, parameterTypes); ! } ! catch (Exception e) ! { ! logger.error("Exception occured " + e.getMessage()); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.message", e.getMessage())); ! ! StringWriter w = new StringWriter(); ! PrintWriter pw = new PrintWriter(w); ! e.printStackTrace(pw); ! pw.close(); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.stack", w.toString())); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! context.removeAttribute(Constants.INVOCATION_RESULT); ! ! return (mapping.findForward("error")); ! } ! ! logger.debug("Result from invocation :"); ! logger.debug("----------------------------------------"); ! logger.debug("" + result); ! logger.debug("----------------------------------------"); ! ! if ("void".equals(type)) ! { ! context.setAttribute(Constants.INVOCATION_RESULT, "Void"); ! } ! else ! { ! context.setAttribute(Constants.INVOCATION_RESULT, "" + result); ! } ! ! return (mapping.findForward("result")); ! } ! } Index: NotificationAction.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/action/NotificationAction.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NotificationAction.java 17 Feb 2003 21:15:49 -0000 1.3 --- NotificationAction.java 27 Nov 2003 01:13:07 -0000 1.4 *************** *** 1,158 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.io.PrintWriter; ! import java.io.StringWriter; ! import java.util.Enumeration; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Clear debug statement ! */ ! public class NotificationAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(NotificationAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public NotificationAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! Vector parameters = new Vector(); ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! ! Enumeration enum = request.getParameterNames(); ! while (enum.hasMoreElements()) ! { ! String name = (String) enum.nextElement(); ! ! logger.debug("Param " + name); ! ! if (name.startsWith(":mbean:")) ! { ! String value = request.getParameter(name); ! parameters.add(value); ! logger.debug("Found " + value); ! } ! } ! ! logger.debug("Parameters " + parameters.size()); ! ! for (int i = 0; i < parameters.size(); i++) ! { ! String reference = (String) parameters.elementAt(i); ! String value = request.getParameter(":state:" + reference); ! ! logger.debug("Reference " + reference); ! logger.debug("Value " + value); ! ! Resource res = (Resource) tree.searchObjectName(reference); ! ! logger.debug("ManagedObject " + res); ! ! if (res != null) ! { ! try ! { ! if ("true".equals(value)) ! { ! res.registerForNotifications(); ! } ! else ! { ! res.unregisterForNotifications(); ! } ! } ! catch (Exception e) ! { ! logger.error("Exception occured " + e.getMessage()); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.message", e.getMessage())); ! ! StringWriter w = new StringWriter(); ! PrintWriter pw = new PrintWriter(w); ! e.printStackTrace(pw); ! pw.close(); ! ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.exception.stack", w.toString())); ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.no.mbean")); ! } ! } ! } ! else ! { ! errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("web.error.cannot.connect")); ! } ! ! // Report any errors we have discovered back to the original form ! if (!errors.empty()) ! { ! saveErrors(request, errors); ! return (mapping.findForward("error")); ! } ! ! return (mapping.findForward("view")); ! } ! } --- 1,158 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.action; ! ! import java.io.IOException; ! import java.io.PrintWriter; ! import java.io.StringWriter; ! import java.util.Enumeration; ! import java.util.Locale; ! import java.util.Vector; ! ! import javax.servlet.ServletContext; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.Action; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionForward; ! import org.apache.struts.action.ActionMapping; ! import org.apache.struts.util.MessageResources; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.web.Constants; ! import org.ejtools.jmx.browser.web.JMXContainer; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 12 novembre 2001 ! * @version $Revision$ ! * @todo Javadoc to complete ! * @todo Clear debug statement ! */ ! public class NotificationAction extends Action ! { ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(NotificationAction.class); ! ! ! /** Constructor for the SearchLoginAction object */ ! public NotificationAction() { } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param form Description of the Parameter ! * @param request Description of the Parameter ! * @param response Description of the Parameter ! * @return Description of the Return Value ! * @exception IOException Description of the Exception ! * @exception ServletException Description of the Exception ! */ ! public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) ! throws IOException, ServletException ! { ! Vector parameters = new Vector(); ! ! // Extract attributes we will need ! Locale locale = getLocale(request); ! MessageResources messages = getResources(); ! ! // Validate the request parameters specified by the user ! ActionErrors errors = new ActionErrors(); ! ! ServletContext context = this.getServlet().getServletContext(); ! JMXContainer tree = (JMXContainer) context.getAttribute(Constants.TREE); ! ! if (tree != null) ! { ! logger.debug("Tree root found => " + tree); ! ! Enumeration enum = request.getParameterNames(); ! while (enum.hasMoreElements()) ! { ! String name = (String) enum.nextElement(); ! ! logger.debug("Param " + name); ! ! if (name.startsWith(":mbean:")) ! { ! String value = request.getParameter(name); ! parameters.add(value); ! logger.debug("Found " + value); ! } ! } ! ! logger.debug("Parameters " + parameters.size... [truncated message content] |
Update of /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/model In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/resources/org/ejtools/jmx/browser/model Modified Files: DomainBeanInfo_fr_FR.properties ResourceBeanInfo_fr_FR.properties ServerBeanInfo_fr_FR.properties Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: DomainBeanInfo_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/model/DomainBeanInfo_fr_FR.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DomainBeanInfo_fr_FR.properties 3 Mar 2003 20:32:08 -0000 1.1 --- DomainBeanInfo_fr_FR.properties 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,13 **** ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Domain. ! # ! bean.displayName=Domaine JMX ! bean.shortDescription=Domaine JMX ! ! property.name.displayName=Nom ! property.name.shortDescription=Nom du domaine ! ! property.size.displayName=Taille ! property.size.shortDescription=Nombre de MBean --- 1,13 ---- ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Domain. ! # ! bean.displayName=Domaine JMX ! bean.shortDescription=Domaine JMX ! ! property.name.displayName=Nom ! property.name.shortDescription=Nom du domaine ! ! property.size.displayName=Taille ! property.size.shortDescription=Nombre de MBean Index: ResourceBeanInfo_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/model/ResourceBeanInfo_fr_FR.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceBeanInfo_fr_FR.properties 3 Mar 2003 20:32:09 -0000 1.1 --- ResourceBeanInfo_fr_FR.properties 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,26 **** ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Resource. ! # ! bean.displayName=Resource JMX ! bean.shortDescription=Resource JMX ! ! property.name.displayName=Nom ! property.name.shortDescription=Nom de la resource ! ! property.className.displayName=Nom de classes ! property.className.shortDescription=Nom de classes ! ! property.domain.displayName=Domaine ! property.domain.shortDescription=Nom du domaine ! ! property.description.displayName=Description ! property.description.shortDescription=Description ! ! property.registeredForNotifications.displayName=Registered for Notifications ! property.registeredForNotifications.shortDescription=Registered for Notifications ! ! property.broadcaster.displayName=Broadcaster of Notifications ! property.broadcaster.shortDescription=Broadcaster of Notifications ! --- 1,26 ---- ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Resource. ! # ! bean.displayName=Resource JMX ! bean.shortDescription=Resource JMX ! ! property.name.displayName=Nom ! property.name.shortDescription=Nom de la resource ! ! property.className.displayName=Nom de classes ! property.className.shortDescription=Nom de classes ! ! property.domain.displayName=Domaine ! property.domain.shortDescription=Nom du domaine ! ! property.description.displayName=Description ! property.description.shortDescription=Description ! ! property.registeredForNotifications.displayName=Registered for Notifications ! property.registeredForNotifications.shortDescription=Registered for Notifications ! ! property.broadcaster.displayName=Broadcaster of Notifications ! property.broadcaster.shortDescription=Broadcaster of Notifications ! Index: ServerBeanInfo_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/model/ServerBeanInfo_fr_FR.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ServerBeanInfo_fr_FR.properties 3 Mar 2003 20:32:09 -0000 1.1 --- ServerBeanInfo_fr_FR.properties 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,43 **** ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Server. ! # ! bean.displayName=Serveur JMX ! bean.shortDescription=Serveur JMX ! ! property.name.displayName=Connexion ! property.name.shortDescription=Nom de la connexion ! ! property.defaultDomain.displayName=Domaine par défaut ! property.defaultDomain.shortDescription=Domaine par défaut ! ! property.count.displayName=Nombre de MBean ! property.count.shortDescription=Nombre de MBean enregistrés ! ! property.factory.displayName=Factory ! property.factory.shortDescription=JNDI context factory ! ! property.packages.displayName=Packages ! property.packages.shortDescription=Packages for context ! ! property.uRL.displayName=URL ! property.uRL.shortDescription=JNDI Server URL ! ! property.binding.displayName=Contexte JNDI ! property.binding.shortDescription=Contexte JNDI du connecteur ! ! property.principal.displayName=Principal ! property.principal.shortDescription=Principal to connect ! ! property.credentials.displayName=Credentials ! property.credentials.shortDescription=Credentials to connect ! ! method.connect.displayName=Connexion ! method.connect.shortDescription=Connection au serveur JMX ! ! method.disconnect.displayName=Déconnexion ! method.disconnect.shortDescription=Déconnexion du serveur JMX ! ! method.refresh.displayName=Rafraîchir ! method.refresh.shortDescription=Rafraîchir le contenu du serveur JMX --- 1,46 ---- ! # ! # Fichier généré - Ne pas éditer! ! # ! # Fichier properties de messages pour Server. ! # ! bean.displayName=Serveur JMX ! bean.shortDescription=Serveur JMX ! ! property.name.displayName=Connexion ! property.name.shortDescription=Nom de la connexion ! ! property.defaultDomain.displayName=Domaine par défaut ! property.defaultDomain.shortDescription=Domaine par défaut ! ! property.count.displayName=Nombre de MBean ! property.count.shortDescription=Nombre de MBean enregistrés ! ! property.factory.displayName=Factory ! property.factory.shortDescription=JNDI context factory ! ! property.packages.displayName=Packages ! property.packages.shortDescription=Packages for context ! ! property.uRL.displayName=URL ! property.uRL.shortDescription=JNDI Server URL ! ! property.binding.displayName=Contexte JNDI ! property.binding.shortDescription=Contexte JNDI du connecteur ! ! property.service.displayName=Service URL ! property.service.shortDescription=JMX Remoting Service URL commençant par 'service:jmx:' ! ! property.principal.displayName=Principal ! property.principal.shortDescription=Principal à utiliser ! ! property.credentials.displayName=Credentials ! property.credentials.shortDescription=Credentials à utiliser ! ! method.connect.displayName=Connexion ! method.connect.shortDescription=Connexion au serveur JMX ! ! method.disconnect.displayName=Déconnexion ! method.disconnect.shortDescription=Déconnexion du serveur JMX ! ! method.refresh.displayName=Rafraîchir ! method.refresh.shortDescription=Rafraîchir le contenu du serveur JMX |
Update of /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/web/taglib In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/resources/org/ejtools/jmx/browser/web/taglib Modified Files: MBeanAttributeInfoAccess.properties MBeanAttributeInfoEditor.properties Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: MBeanAttributeInfoAccess.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/web/taglib/MBeanAttributeInfoAccess.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeInfoAccess.properties 10 Feb 2003 20:59:16 -0000 1.1 --- MBeanAttributeInfoAccess.properties 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,3 **** ! access.ro=RO ! access.rw=RW ! access.wo=WO --- 1,3 ---- ! access.ro=RO ! access.rw=RW ! access.wo=WO Index: MBeanAttributeInfoEditor.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/web/taglib/MBeanAttributeInfoEditor.properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MBeanAttributeInfoEditor.properties 10 Feb 2003 20:59:17 -0000 1.1 --- MBeanAttributeInfoEditor.properties 27 Nov 2003 01:13:08 -0000 1.2 *************** *** 1,3 **** ! boolean.true=True ! boolean.false=False ! hyperlink.go=View --- 1,3 ---- ! boolean.true=True ! boolean.false=False ! hyperlink.go=View |
From: <let...@us...> - 2003-11-27 01:13:12
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/resources/org/ejtools/jmx/browser Modified Files: Resources.properties Resources_fr_FR.properties Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: Resources.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/Resources.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Resources.properties 16 Mar 2003 22:19:07 -0000 1.2 --- Resources.properties 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 19,23 **** about.dialog.text.javaVersion=Java Version about.dialog.text.virtualMachine=Virtual Machine ! # Connection dialog box --- 19,23 ---- about.dialog.text.javaVersion=Java Version about.dialog.text.virtualMachine=Virtual Machine ! about.dialog.text.lookAndFeel=Look And Feel # Connection dialog box *************** *** 67,70 **** --- 67,75 ---- customizer.button.update=Update customizer.button.invoke=Invoke + + + # Text for open/save dialog box + file.dialog.title.load=Load Workspace + file.dialog.title.save=Save Workspace Index: Resources_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/resources/org/ejtools/jmx/browser/Resources_fr_FR.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Resources_fr_FR.properties 18 Mar 2003 21:58:25 -0000 1.2 --- Resources_fr_FR.properties 27 Nov 2003 01:13:08 -0000 1.3 *************** *** 19,23 **** about.dialog.text.javaVersion=Version de Java about.dialog.text.virtualMachine=Machine Virtuelle ! # Connection dialog box --- 19,23 ---- about.dialog.text.javaVersion=Version de Java about.dialog.text.virtualMachine=Machine Virtuelle ! about.dialog.text.lookAndFeel=Look And Feel # Connection dialog box *************** *** 38,50 **** # Creation related text ! create.dialog.title=Create a MBean ! create.dialog.text.description=Fill in the ObjectName and the class to create a MBean create.dialog.text.objectName=ObjectName ! create.dialog.text.className=Class Name ! create.dialog.text.classLoader=ClassLoader ObjectName ! create.dialog.text.argValues=Argument Values (comma separated) ! create.dialog.text.argTypes=Argument Types (comma separated) ! create.dialog.button.create=Create ! create.dialog.button.cancel=Cancel --- 38,50 ---- # Creation related text ! create.dialog.title=Créer un MBean ! create.dialog.text.description=Remplissez le champ ObjectName et la classe pour créer un MBean create.dialog.text.objectName=ObjectName ! create.dialog.text.className=Classe ! create.dialog.text.classLoader=ObjectName du ClassLoader ! create.dialog.text.argValues=Valeurs des arguments (séparateur virgule) ! create.dialog.text.argTypes=Types des arguments (séparateur virgule) ! create.dialog.button.create=Créer ! create.dialog.button.cancel=Annuler *************** *** 67,70 **** --- 67,75 ---- customizer.button.update=Mettre à jour customizer.button.invoke=Executer + + + # Text for open/save dialog box + file.dialog.title.load=Ouvrir Configuration + file.dialog.title.save=Save Configuration |
From: <let...@us...> - 2003-11-27 01:13:12
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/webapp/merge In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/webapp/merge Modified Files: servlets.xml taglibs.xml welcomefiles.xml Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: servlets.xml =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/webapp/merge/servlets.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** servlets.xml 8 Jan 2003 22:36:27 -0000 1.7 --- servlets.xml 27 Nov 2003 01:13:09 -0000 1.8 *************** *** 1,74 **** ! <!-- Standard Action Servlet Configuration (with debugging) --> ! <servlet> ! <servlet-name>action</servlet-name> ! <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> ! <init-param> ! <param-name>application</param-name> ! <param-value>JMXBrowser_WebResources</param-value> ! </init-param> ! <init-param> ! <param-name>config</param-name> ! <param-value>/WEB-INF/struts-config.xml</param-value> ! </init-param> ! <init-param> ! <param-name>debug</param-name> ! <param-value>0</param-value> ! </init-param> ! <init-param> ! <param-name>detail</param-name> ! <param-value>0</param-value> ! </init-param> ! <init-param> ! <param-name>validate</param-name> ! <param-value>true</param-value> ! </init-param> ! <load-on-startup>2</load-on-startup> ! </servlet> ! <!-- Precompiled JSP --> ! <!-- ! <servlet> ! <servlet-name>ADMIN.JSP</servlet-name> ! <servlet-class>admin</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>BROADCASTERS.JSP</servlet-name> ! <servlet-class>broadcasters</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>CUSTOMVIEW.JSP</servlet-name> ! <servlet-class>customview</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>DETAIL.JSP</servlet-name> ! <servlet-class>detail</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>HELP.JSP</servlet-name> ! <servlet-class>help</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>INDEX.JSP</servlet-name> ! <servlet-class>index</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>INVOKE.JSP</servlet-name> ! <servlet-class>invoke</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>NOTIFICATIONS.JSP</servlet-name> ! <servlet-class>notifications</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>SEARCH.JSP</servlet-name> ! <servlet-class>search</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! --> --- 1,74 ---- ! <!-- Standard Action Servlet Configuration (with debugging) --> ! <servlet> ! <servlet-name>action</servlet-name> ! <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> ! <init-param> ! <param-name>application</param-name> ! <param-value>JMXBrowser_WebResources</param-value> ! </init-param> ! <init-param> ! <param-name>config</param-name> ! <param-value>/WEB-INF/struts-config.xml</param-value> ! </init-param> ! <init-param> ! <param-name>debug</param-name> ! <param-value>0</param-value> ! </init-param> ! <init-param> ! <param-name>detail</param-name> ! <param-value>0</param-value> ! </init-param> ! <init-param> ! <param-name>validate</param-name> ! <param-value>true</param-value> ! </init-param> ! <load-on-startup>2</load-on-startup> ! </servlet> ! <!-- Precompiled JSP --> ! <!-- ! <servlet> ! <servlet-name>ADMIN.JSP</servlet-name> ! <servlet-class>admin</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>BROADCASTERS.JSP</servlet-name> ! <servlet-class>broadcasters</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>CUSTOMVIEW.JSP</servlet-name> ! <servlet-class>customview</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>DETAIL.JSP</servlet-name> ! <servlet-class>detail</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>HELP.JSP</servlet-name> ! <servlet-class>help</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>INDEX.JSP</servlet-name> ! <servlet-class>index</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>INVOKE.JSP</servlet-name> ! <servlet-class>invoke</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>NOTIFICATIONS.JSP</servlet-name> ! <servlet-class>notifications</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! <servlet> ! <servlet-name>SEARCH.JSP</servlet-name> ! <servlet-class>search</servlet-class> ! <load-on-startup>10</load-on-startup> ! </servlet> ! --> Index: taglibs.xml =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/webapp/merge/taglibs.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** taglibs.xml 26 Aug 2002 22:32:41 -0000 1.2 --- taglibs.xml 27 Nov 2003 01:13:09 -0000 1.3 *************** *** 1,31 **** ! <!-- Application TagLib --> ! <taglib> ! <taglib-uri>/WEB-INF/application.tld</taglib-uri> ! <taglib-location>/WEB-INF/application.tld</taglib-location> ! </taglib> ! ! <!-- Additional TagLib : EJTools --> ! <taglib> ! <taglib-uri>/WEB-INF/ejtools-taglib.tld</taglib-uri> ! <taglib-location>/WEB-INF/ejtools-taglib.tld</taglib-location> ! </taglib> ! ! <!-- Struts Tag Library Descriptors --> ! <taglib> ! <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> ! </taglib> ! <taglib> ! <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-html.tld</taglib-location> ! </taglib> ! <taglib> ! <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> ! </taglib> ! ! <!-- Additional TagLib : log --> ! <taglib> ! <taglib-uri>/WEB-INF/log.tld</taglib-uri> ! <taglib-location>/WEB-INF/log.tld</taglib-location> ! </taglib> --- 1,31 ---- ! <!-- Application TagLib --> ! <taglib> ! <taglib-uri>/WEB-INF/application.tld</taglib-uri> ! <taglib-location>/WEB-INF/application.tld</taglib-location> ! </taglib> ! ! <!-- Additional TagLib : EJTools --> ! <taglib> ! <taglib-uri>/WEB-INF/ejtools-taglib.tld</taglib-uri> ! <taglib-location>/WEB-INF/ejtools-taglib.tld</taglib-location> ! </taglib> ! ! <!-- Struts Tag Library Descriptors --> ! <taglib> ! <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> ! </taglib> ! <taglib> ! <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-html.tld</taglib-location> ! </taglib> ! <taglib> ! <taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri> ! <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> ! </taglib> ! ! <!-- Additional TagLib : log --> ! <taglib> ! <taglib-uri>/WEB-INF/log.tld</taglib-uri> ! <taglib-location>/WEB-INF/log.tld</taglib-location> ! </taglib> Index: welcomefiles.xml =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/webapp/merge/welcomefiles.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** welcomefiles.xml 13 Jun 2002 20:03:25 -0000 1.1 --- welcomefiles.xml 27 Nov 2003 01:13:09 -0000 1.2 *************** *** 1,5 **** ! <!-- The Usual Welcome File List --> ! <welcome-file-list> ! <welcome-file>index.jsp</welcome-file> ! <welcome-file>index.html</welcome-file> ! </welcome-file-list> --- 1,5 ---- ! <!-- The Usual Welcome File List --> ! <welcome-file-list> ! <welcome-file>index.jsp</welcome-file> ! <welcome-file>index.html</welcome-file> ! </welcome-file-list> |
From: <let...@us...> - 2003-11-27 01:13:11
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/form In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/web/form Modified Files: DetailForm.java RegisterForm.java SearchForm.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: DetailForm.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/form/DetailForm.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DetailForm.java 10 Feb 2003 20:49:42 -0000 1.1 --- DetailForm.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,84 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DetailForm extends ActionForm ! { ! /** Description of the Field */ ! protected String reference = null; ! ! ! /** Constructor for the ConnectForm object */ ! public DetailForm() { } ! ! ! /** ! * Getter for the factory attribute ! * ! * @return The value of factory attribute ! */ ! public String getReference() ! { ! return this.reference; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) { } ! ! ! /** ! * Setter for the factory attribute ! * ! * @param reference The new reference value ! */ ! public void setReference(String reference) ! { ! this.reference = reference; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Returned Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! if ((this.reference == null) || (this.reference.length() < 1)) ! { ! errors.add("reference", new ActionError("error.factory.required")); ! } ! ! return errors; ! } ! } ! --- 1,84 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class DetailForm extends ActionForm ! { ! /** Description of the Field */ ! protected String reference = null; ! ! ! /** Constructor for the ConnectForm object */ ! public DetailForm() { } ! ! ! /** ! * Getter for the factory attribute ! * ! * @return The value of factory attribute ! */ ! public String getReference() ! { ! return this.reference; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) { } ! ! ! /** ! * Setter for the factory attribute ! * ! * @param reference The new reference value ! */ ! public void setReference(String reference) ! { ! this.reference = reference; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Returned Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! if ((this.reference == null) || (this.reference.length() < 1)) ! { ! errors.add("reference", new ActionError("error.factory.required")); ! } ! ! return errors; ! } ! } ! Index: RegisterForm.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/form/RegisterForm.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RegisterForm.java 10 Feb 2003 20:49:42 -0000 1.1 --- RegisterForm.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,208 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class RegisterForm extends ActionForm ! { ! /** Description of the Field */ ! protected String classLoader = ""; ! /** Description of the Field */ ! protected String className = ""; ! /** Description of the Field */ ! protected String objectName = ""; ! /** Description of the Field */ ! protected String parameters = ""; ! /** Description of the Field */ ! protected String signature = ""; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(RegisterForm.class); ! ! ! /** Constructor for the ConnectForm object */ ! public RegisterForm() { } ! ! ! /** ! * Gets the classLoader attribute of the RegisterForm object ! * ! * @return The classLoader value ! */ ! public String getClassLoader() ! { ! return this.classLoader; ! } ! ! ! /** ! * Gets the className attribute of the RegisterForm object ! * ! * @return The className value ! */ ! public String getClassName() ! { ! return this.className; ! } ! ! ! /** ! * Gets the objectName attribute of the RegisterForm object ! * ! * @return The objectName value ! */ ! public String getObjectName() ! { ! return this.objectName; ! } ! ! ! /** ! * Gets the arguments attribute of the RegisterForm object ! * ! * @return The arguments value ! */ ! public String getParameters() ! { ! return this.parameters; ! } ! ! ! /** ! * Gets the signatures attribute of the RegisterForm object ! * ! * @return The signatures value ! */ ! public String getSignature() ! { ! return this.signature; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) ! { ! this.objectName = ""; ! this.className = ""; ! this.classLoader = ""; ! this.parameters = ""; ! this.signature = ""; ! } ! ! ! /** ! * Sets the classLoader attribute of the RegisterForm object ! * ! * @param classLoader The new classLoader value ! */ ! public void setClassLoader(String classLoader) ! { ! this.classLoader = classLoader; ! } ! ! ! /** ! * Sets the className attribute of the RegisterForm object ! * ! * @param className The new className value ! */ ! public void setClassName(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the objectName attribute of the RegisterForm object ! * ! * @param objectName The new objectName value ! */ ! public void setObjectName(String objectName) ! { ! this.objectName = objectName; ! } ! ! ! /** ! * Sets the arguments attribute of the RegisterForm object ! * ! * @param parameters The new parameters value ! */ ! public void setParameters(String parameters) ! { ! this.parameters = parameters; ! } ! ! ! /** ! * Sets the signatures attribute of the RegisterForm object ! * ! * @param signature The new signature value ! */ ! public void setSignature(String signature) ! { ! this.signature = signature; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Return Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! logger.debug("className=<" + this.className + ">"); ! logger.debug("objectName=<" + this.objectName + ">"); ! logger.debug("classLoader=<" + this.classLoader + ">"); ! logger.debug("signature=<" + this.signature + ">"); ! logger.debug("parameters=<" + this.parameters + ">"); ! ! if (this.className.length() == 0) ! { ! errors.add("className", new ActionError("web.error.className.required")); ! } ! if (this.objectName.length() == 0) ! { ! errors.add("objectName", new ActionError("web.error.objectName.required")); ! } ! ! if ((this.parameters.length() > 0) && (this.signature.length() == 0)) ! { ! errors.add("signatures", new ActionError("web.error.signature.required")); ! } ! if ((this.signature.length() > 0) && (this.parameters.length() == 0)) ! { ! errors.add("arguments", new ActionError("web.error.parameters.required")); ! } ! ! return errors; ! } ! } --- 1,208 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.log4j.Logger; ! import org.apache.struts.action.ActionError; ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class RegisterForm extends ActionForm ! { ! /** Description of the Field */ ! protected String classLoader = ""; ! /** Description of the Field */ ! protected String className = ""; ! /** Description of the Field */ ! protected String objectName = ""; ! /** Description of the Field */ ! protected String parameters = ""; ! /** Description of the Field */ ! protected String signature = ""; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(RegisterForm.class); ! ! ! /** Constructor for the ConnectForm object */ ! public RegisterForm() { } ! ! ! /** ! * Gets the classLoader attribute of the RegisterForm object ! * ! * @return The classLoader value ! */ ! public String getClassLoader() ! { ! return this.classLoader; ! } ! ! ! /** ! * Gets the className attribute of the RegisterForm object ! * ! * @return The className value ! */ ! public String getClassName() ! { ! return this.className; ! } ! ! ! /** ! * Gets the objectName attribute of the RegisterForm object ! * ! * @return The objectName value ! */ ! public String getObjectName() ! { ! return this.objectName; ! } ! ! ! /** ! * Gets the arguments attribute of the RegisterForm object ! * ! * @return The arguments value ! */ ! public String getParameters() ! { ! return this.parameters; ! } ! ! ! /** ! * Gets the signatures attribute of the RegisterForm object ! * ! * @return The signatures value ! */ ! public String getSignature() ! { ! return this.signature; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) ! { ! this.objectName = ""; ! this.className = ""; ! this.classLoader = ""; ! this.parameters = ""; ! this.signature = ""; ! } ! ! ! /** ! * Sets the classLoader attribute of the RegisterForm object ! * ! * @param classLoader The new classLoader value ! */ ! public void setClassLoader(String classLoader) ! { ! this.classLoader = classLoader; ! } ! ! ! /** ! * Sets the className attribute of the RegisterForm object ! * ! * @param className The new className value ! */ ! public void setClassName(String className) ! { ! this.className = className; ! } ! ! ! /** ! * Sets the objectName attribute of the RegisterForm object ! * ! * @param objectName The new objectName value ! */ ! public void setObjectName(String objectName) ! { ! this.objectName = objectName; ! } ! ! ! /** ! * Sets the arguments attribute of the RegisterForm object ! * ! * @param parameters The new parameters value ! */ ! public void setParameters(String parameters) ! { ! this.parameters = parameters; ! } ! ! ! /** ! * Sets the signatures attribute of the RegisterForm object ! * ! * @param signature The new signature value ! */ ! public void setSignature(String signature) ! { ! this.signature = signature; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Return Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! logger.debug("className=<" + this.className + ">"); ! logger.debug("objectName=<" + this.objectName + ">"); ! logger.debug("classLoader=<" + this.classLoader + ">"); ! logger.debug("signature=<" + this.signature + ">"); ! logger.debug("parameters=<" + this.parameters + ">"); ! ! if (this.className.length() == 0) ! { ! errors.add("className", new ActionError("web.error.className.required")); ! } ! if (this.objectName.length() == 0) ! { ! errors.add("objectName", new ActionError("web.error.objectName.required")); ! } ! ! if ((this.parameters.length() > 0) && (this.signature.length() == 0)) ! { ! errors.add("signatures", new ActionError("web.error.signature.required")); ! } ! if ((this.signature.length() > 0) && (this.parameters.length() == 0)) ! { ! errors.add("arguments", new ActionError("web.error.parameters.required")); ! } ! ! return errors; ! } ! } Index: SearchForm.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/form/SearchForm.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SearchForm.java 10 Feb 2003 20:49:42 -0000 1.1 --- SearchForm.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,182 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SearchForm extends ActionForm ! { ! /** Description of the Field */ ! protected String attribute = ""; ! /** Description of the Field */ ! protected String filter = "*:*"; ! /** Description of the Field */ ! protected String query = ""; ! /** Description of the Field */ ! protected String type = "java.lang.String"; ! /** Description of the Field */ ! protected String value = ""; ! ! ! /** Constructor for the ConnectForm object */ ! public SearchForm() { } ! ! ! /** ! * Gets the attribute attribute of the SearchForm object ! * ! * @return The attribute value ! */ ! public String getAttribute() ! { ! return this.attribute; ! } ! ! ! /** ! * Getter for the factory attribute ! * ! * @return The value of factory attribute ! */ ! public String getFilter() ! { ! return this.filter; ! } ! ! ! /** ! * Gets the query attribute of the SearchForm object ! * ! * @return The query value ! */ ! public String getQuery() ! { ! return this.query; ! } ! ! ! /** ! * Gets the type attribute of the SearchForm object ! * ! * @return The type value ! */ ! public String getType() ! { ! return this.type; ! } ! ! ! /** ! * Gets the value attribute of the SearchForm object ! * ! * @return The value value ! */ ! public String getValue() ! { ! return this.value; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) ! { ! this.filter = "*:*"; ! } ! ! ! /** ! * Sets the attribute attribute of the SearchForm object ! * ! * @param attribute The new attribute value ! */ ! public void setAttribute(String attribute) ! { ! this.attribute = attribute; ! } ! ! ! /** ! * Setter for the factory attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(String filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Sets the query attribute of the SearchForm object ! * ! * @param query The new query value ! */ ! public void setQuery(String query) ! { ! this.query = query; ! } ! ! ! /** ! * Sets the type attribute of the SearchForm object ! * ! * @param type The new type value ! */ ! public void setType(String type) ! { ! this.type = type; ! } ! ! ! /** ! * Sets the value attribute of the SearchForm object ! * ! * @param value The new value value ! */ ! public void setValue(String value) ! { ! this.value = value; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Returned Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! /* ! * if ((filter == null) || (filter.length() < 1)) ! * { ! * errors.add("filter", new ActionError("web.error.filter.required")); ! * } ! */ ! return errors; ! } ! } --- 1,182 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web.form; ! ! import javax.servlet.http.HttpServletRequest; ! ! import org.apache.struts.action.ActionErrors; ! import org.apache.struts.action.ActionForm; ! import org.apache.struts.action.ActionMapping; ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 13 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class SearchForm extends ActionForm ! { ! /** Description of the Field */ ! protected String attribute = ""; ! /** Description of the Field */ ! protected String filter = "*:*"; ! /** Description of the Field */ ! protected String query = ""; ! /** Description of the Field */ ! protected String type = "java.lang.String"; ! /** Description of the Field */ ! protected String value = ""; ! ! ! /** Constructor for the ConnectForm object */ ! public SearchForm() { } ! ! ! /** ! * Gets the attribute attribute of the SearchForm object ! * ! * @return The attribute value ! */ ! public String getAttribute() ! { ! return this.attribute; ! } ! ! ! /** ! * Getter for the factory attribute ! * ! * @return The value of factory attribute ! */ ! public String getFilter() ! { ! return this.filter; ! } ! ! ! /** ! * Gets the query attribute of the SearchForm object ! * ! * @return The query value ! */ ! public String getQuery() ! { ! return this.query; ! } ! ! ! /** ! * Gets the type attribute of the SearchForm object ! * ! * @return The type value ! */ ! public String getType() ! { ! return this.type; ! } ! ! ! /** ! * Gets the value attribute of the SearchForm object ! * ! * @return The value value ! */ ! public String getValue() ! { ! return this.value; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! */ ! public void reset(ActionMapping mapping, HttpServletRequest request) ! { ! this.filter = "*:*"; ! } ! ! ! /** ! * Sets the attribute attribute of the SearchForm object ! * ! * @param attribute The new attribute value ! */ ! public void setAttribute(String attribute) ! { ! this.attribute = attribute; ! } ! ! ! /** ! * Setter for the factory attribute ! * ! * @param filter The new filter value ! */ ! public void setFilter(String filter) ! { ! this.filter = filter; ! } ! ! ! /** ! * Sets the query attribute of the SearchForm object ! * ! * @param query The new query value ! */ ! public void setQuery(String query) ! { ! this.query = query; ! } ! ! ! /** ! * Sets the type attribute of the SearchForm object ! * ! * @param type The new type value ! */ ! public void setType(String type) ! { ! this.type = type; ! } ! ! ! /** ! * Sets the value attribute of the SearchForm object ! * ! * @param value The new value value ! */ ! public void setValue(String value) ! { ! this.value = value; ! } ! ! ! /** ! * Description of the Method ! * ! * @param mapping Description of the Parameter ! * @param request Description of the Parameter ! * @return Description of the Returned Value ! */ ! public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) ! { ! ActionErrors errors = new ActionErrors(); ! ! /* ! * if ((filter == null) || (filter.length() < 1)) ! * { ! * errors.add("filter", new ActionError("web.error.filter.required")); ! * } ! */ ! return errors; ! } ! } |
From: <let...@us...> - 2003-11-27 01:13:11
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/web Modified Files: Constants.java JMXContainer.java QueryConstants.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: Constants.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/Constants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Constants.java 10 Feb 2003 20:49:41 -0000 1.1 --- Constants.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,46 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 28 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public final class Constants ! { ! /** Description of the Field */ ! public final static String CONNECTOR = "tree"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW = "custom.view"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_ATTRIBUTES = "custom.view.attributes"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_INDEX = "custom.view.index"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_OPERATIONS = "custom.view.operations"; ! /** Description of the Field */ ! public final static String DETAIL = "detail"; ! /** Description of the Field */ ! public final static String DETAIL_INFO = "detail.info"; ! /** Description of the Field */ ! public final static String DOMAIN = "domain"; ! /** Description of the Field */ ! public final static String INVOCATION_RESULT = "invoke.result"; ! /** Description of the Field */ ! public final static String NUMBER = "number"; ! /** Description of the Field */ ! public final static int RECORD_PER_PAGE = 50; ! /** Description of the Field */ ! public final static String SEARCH_RESULT = "search.result"; ! /** Description of the Field */ ! public final static String TREE = "tree"; ! } --- 1,46 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 28 février 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public final class Constants ! { ! /** Description of the Field */ ! public final static String CONNECTOR = "tree"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW = "custom.view"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_ATTRIBUTES = "custom.view.attributes"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_INDEX = "custom.view.index"; ! /** Description of the Field */ ! public final static String CUSTOM_VIEW_OPERATIONS = "custom.view.operations"; ! /** Description of the Field */ ! public final static String DETAIL = "detail"; ! /** Description of the Field */ ! public final static String DETAIL_INFO = "detail.info"; ! /** Description of the Field */ ! public final static String DOMAIN = "domain"; ! /** Description of the Field */ ! public final static String INVOCATION_RESULT = "invoke.result"; ! /** Description of the Field */ ! public final static String NUMBER = "number"; ! /** Description of the Field */ ! public final static int RECORD_PER_PAGE = 50; ! /** Description of the Field */ ! public final static String SEARCH_RESULT = "search.result"; ! /** Description of the Field */ ! public final static String TREE = "tree"; ! } Index: JMXContainer.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/JMXContainer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JMXContainer.java 10 Feb 2003 20:49:41 -0000 1.1 --- JMXContainer.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,209 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! import java.beans.beancontext.BeanContextServicesSupport; ! import java.util.Collection; ! import java.util.Set; ! ! import javax.management.ObjectInstance; ! import javax.management.ObjectName; ! import javax.management.QueryExp; ! ! import org.ejtools.jmx.browser.mbean.View; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.model.Server; ! import org.ejtools.jmx.browser.model.service.CacheService; ! import org.ejtools.jmx.browser.model.service.CacheServiceProvider; ! import org.ejtools.jmx.browser.model.service.ConnectionServiceProvider; ! import org.ejtools.jmx.browser.model.service.CustomizationServiceProvider; ! import org.ejtools.jmx.browser.model.service.NotificationServiceProvider; ! ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class JMXContainer extends BeanContextServicesSupport ! { ! /** Description of the Field */ ! protected CacheServiceProvider cacheProvider; ! /** Description of the Field */ ! protected ConnectionServiceProvider connectionProvider; ! /** Description of the Field */ ! protected CustomizationServiceProvider customizationProvider; ! /** Description of the Field */ ! protected NotificationServiceProvider notificationProvider; ! /** Description of the Field */ ! protected Server server; ! ! ! /** Constructor for the JMXTree object */ ! public JMXContainer() ! { ! try ! { ! this.connectionProvider = new ConnectionServiceProvider(); ! this.notificationProvider = new NotificationServiceProvider(); ! this.cacheProvider = new CacheServiceProvider(); ! this.customizationProvider = new CustomizationServiceProvider(); ! this.server = new Server(); ! ! this.add(this.cacheProvider); ! this.add(this.connectionProvider); ! this.add(this.notificationProvider); ! this.add(this.customizationProvider); ! this.add(this.server); ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! } ! ! ! /** Description of the Method */ ! public void clearNotifications() ! { ! this.notificationProvider.clearAll(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param className Description of the Parameter ! * @param name Description of the Parameter ! * @param loaderName Description of the Parameter ! * @param params Description of the Parameter ! * @param signature Description of the Parameter ! * @return Description of the Return Value ! * @exception Exception Description of the Exception ! */ ! public ObjectInstance createMBean(java.lang.String className, ObjectName name, ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature) ! throws Exception ! { ! return this.server.createMBean(className, name, loaderName, params, signature); ! } ! ! ! /** ! * Getter for the count attribute ! * ! * @return The value of count attribute ! */ ! public int getCount() ! { ! return this.server.getCount(); ! } ! ! ! /** ! * Getter for the defaultDomain attribute ! * ! * @return The value of defaultDomain attribute ! */ ! public String getDefaultDomain() ! { ! return this.server.getDefaultDomain(); ! } ! ! ! /** ! * Gets the notifications attribute of the JMXContainer object ! * ! * @return The notifications value ! */ ! public Collection getNotifications() ! { ! return this.notificationProvider.listAll(); ! } ! ! ! /** ! * Getter for the server attribute ! * ! * @return The value of server attribute ! */ ! public Collection getServer() ! { ! return this.server; ! } ! ! ! /** ! * Gets the view attribute of the JMXContainer object ! * ! * @param index Description of the Parameter ! * @return The view value ! */ ! public View getView(int index) ! { ! return this.customizationProvider.getView(index); ! } ! ! ! /** ! * Gets the views attribute of the JMXContainer object ! * ! * @return The views value ! */ ! public Collection getViews() ! { ! return this.customizationProvider.getViews(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param name Description of the Parameter ! * @param exp Description of the Parameter ! * @return Description of the Return Value ! * @exception Exception Description of the Exception ! */ ! public Set query(ObjectName name, QueryExp exp) ! throws Exception ! { ! return this.server.query(name, exp); ! } ! ! ! /** Description of the Method */ ! public void refresh() ! { ! this.server.refresh(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param objectName Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object searchObjectName(String objectName) ! { ! Resource resource = (Resource) this.cacheProvider.get(CacheService.RESOURCE_TYPE, objectName); ! try ! { ! if ((resource != null) && (resource.isRegistered())) ! { ! return resource; ! } ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! return null; ! } ! } --- 1,209 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! import java.beans.beancontext.BeanContextServicesSupport; ! import java.util.Collection; ! import java.util.Set; ! ! import javax.management.ObjectInstance; ! import javax.management.ObjectName; ! import javax.management.QueryExp; ! ! import org.ejtools.jmx.browser.mbean.View; ! import org.ejtools.jmx.browser.model.Resource; ! import org.ejtools.jmx.browser.model.Server; ! import org.ejtools.jmx.browser.model.service.CacheService; ! import org.ejtools.jmx.browser.model.service.CacheServiceProvider; ! import org.ejtools.jmx.browser.model.service.ConnectionServiceProvider; ! import org.ejtools.jmx.browser.model.service.CustomizationServiceProvider; ! import org.ejtools.jmx.browser.model.service.NotificationServiceProvider; ! ! ! /** ! * Description of the Class ! * ! * @author letiemble ! * @created 25 avril 2002 ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class JMXContainer extends BeanContextServicesSupport ! { ! /** Description of the Field */ ! protected CacheServiceProvider cacheProvider; ! /** Description of the Field */ ! protected ConnectionServiceProvider connectionProvider; ! /** Description of the Field */ ! protected CustomizationServiceProvider customizationProvider; ! /** Description of the Field */ ! protected NotificationServiceProvider notificationProvider; ! /** Description of the Field */ ! protected Server server; ! ! ! /** Constructor for the JMXTree object */ ! public JMXContainer() ! { ! try ! { ! this.connectionProvider = new ConnectionServiceProvider(); ! this.notificationProvider = new NotificationServiceProvider(); ! this.cacheProvider = new CacheServiceProvider(); ! this.customizationProvider = new CustomizationServiceProvider(); ! this.server = new Server(); ! ! this.add(this.cacheProvider); ! this.add(this.connectionProvider); ! this.add(this.notificationProvider); ! this.add(this.customizationProvider); ! this.add(this.server); ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! } ! ! ! /** Description of the Method */ ! public void clearNotifications() ! { ! this.notificationProvider.clearAll(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param className Description of the Parameter ! * @param name Description of the Parameter ! * @param loaderName Description of the Parameter ! * @param params Description of the Parameter ! * @param signature Description of the Parameter ! * @return Description of the Return Value ! * @exception Exception Description of the Exception ! */ ! public ObjectInstance createMBean(java.lang.String className, ObjectName name, ObjectName loaderName, java.lang.Object[] params, java.lang.String[] signature) ! throws Exception ! { ! return this.server.createMBean(className, name, loaderName, params, signature); ! } ! ! ! /** ! * Getter for the count attribute ! * ! * @return The value of count attribute ! */ ! public int getCount() ! { ! return this.server.getCount(); ! } ! ! ! /** ! * Getter for the defaultDomain attribute ! * ! * @return The value of defaultDomain attribute ! */ ! public String getDefaultDomain() ! { ! return this.server.getDefaultDomain(); ! } ! ! ! /** ! * Gets the notifications attribute of the JMXContainer object ! * ! * @return The notifications value ! */ ! public Collection getNotifications() ! { ! return this.notificationProvider.listAll(); ! } ! ! ! /** ! * Getter for the server attribute ! * ! * @return The value of server attribute ! */ ! public Collection getServer() ! { ! return this.server; ! } ! ! ! /** ! * Gets the view attribute of the JMXContainer object ! * ! * @param index Description of the Parameter ! * @return The view value ! */ ! public View getView(int index) ! { ! return this.customizationProvider.getView(index); ! } ! ! ! /** ! * Gets the views attribute of the JMXContainer object ! * ! * @return The views value ! */ ! public Collection getViews() ! { ! return this.customizationProvider.getViews(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param name Description of the Parameter ! * @param exp Description of the Parameter ! * @return Description of the Return Value ! * @exception Exception Description of the Exception ! */ ! public Set query(ObjectName name, QueryExp exp) ! throws Exception ! { ! return this.server.query(name, exp); ! } ! ! ! /** Description of the Method */ ! public void refresh() ! { ! this.server.refresh(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param objectName Description of the Parameter ! * @return Description of the Return Value ! */ ! public Object searchObjectName(String objectName) ! { ! Resource resource = (Resource) this.cacheProvider.get(CacheService.RESOURCE_TYPE, objectName); ! try ! { ! if ((resource != null) && (resource.isRegistered())) ! { ! return resource; ! } ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! return null; ! } ! } Index: QueryConstants.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/web/QueryConstants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** QueryConstants.java 10 Feb 2003 20:49:41 -0000 1.1 --- QueryConstants.java 27 Nov 2003 01:13:07 -0000 1.2 *************** *** 1,75 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! import java.io.Serializable; ! import java.util.Collection; ! import java.util.Vector; ! ! /** ! * @author letiemble ! * @created 2 janvier 2002 ! * @version $Revision$ ! */ ! public class QueryConstants implements Serializable ! { ! /** Description of the Field */ ! protected Vector queries; ! /** Description of the Field */ ! protected Vector types; ! ! ! /** Constructor for the SearchTypeEditor object */ ! public QueryConstants() ! { ! types = new Vector(); ! types.add("java.lang.String"); ! types.add("java.lang.Integer"); ! types.add("java.lang.Long"); ! types.add("java.lang.Float"); ! types.add("java.lang.Double"); ! types.add("java.lang.Boolean"); ! ! types.add("byte"); ! types.add("short"); ! types.add("int"); ! types.add("long"); ! types.add("float"); ! types.add("double"); ! types.add("boolean"); ! ! queries = new Vector(); ! queries.add("="); ! queries.add(">"); ! queries.add(">="); ! queries.add("<"); ! queries.add("<="); ! } ! ! ! /** ! * Gets the values attribute of the SearchTypeConstants object ! * ! * @return The values value ! */ ! public Collection getQueries() ! { ! return this.queries; ! } ! ! ! /** ! * Gets the labels attribute of the SearchTypeConstants object ! * ! * @return The labels value ! */ ! public Collection getTypes() ! { ! return this.types; ! } ! } ! --- 1,75 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.jmx.browser.web; ! ! import java.io.Serializable; ! import java.util.Collection; ! import java.util.Vector; ! ! /** ! * @author letiemble ! * @created 2 janvier 2002 ! * @version $Revision$ ! */ ! public class QueryConstants implements Serializable ! { ! /** Description of the Field */ ! protected Vector queries; ! /** Description of the Field */ ! protected Vector types; ! ! ! /** Constructor for the SearchTypeEditor object */ ! public QueryConstants() ! { ! types = new Vector(); ! types.add("java.lang.String"); ! types.add("java.lang.Integer"); ! types.add("java.lang.Long"); ! types.add("java.lang.Float"); ! types.add("java.lang.Double"); ! types.add("java.lang.Boolean"); ! ! types.add("byte"); ! types.add("short"); ! types.add("int"); ! types.add("long"); ! types.add("float"); ! types.add("double"); ! types.add("boolean"); ! ! queries = new Vector(); ! queries.add("="); ! queries.add(">"); ! queries.add(">="); ! queries.add("<"); ! queries.add("<="); ! } ! ! ! /** ! * Gets the values attribute of the SearchTypeConstants object ! * ! * @return The values value ! */ ! public Collection getQueries() ! { ! return this.queries; ! } ! ! ! /** ! * Gets the labels attribute of the SearchTypeConstants object ! * ! * @return The labels value ! */ ! public Collection getTypes() ! { ! return this.types; ! } ! } ! |
From: <let...@us...> - 2003-11-27 01:13:11
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/state Added Files: WorkbenchState.java WorkbenchStoreVisitor.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI --- NEW FILE: WorkbenchState.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.state; import java.beans.beancontext.BeanContext; import java.io.File; import java.net.URL; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.ejtools.graph.frame.GraphInternalFrame; import org.ejtools.jmx.browser.Browser; import org.ejtools.jmx.browser.frame.ServerInternalFrame; import org.ejtools.jmx.browser.model.Domain; import org.ejtools.jmx.browser.model.Resource; import org.ejtools.jmx.browser.model.Server; import org.ejtools.jmx.browser.state.rules.GraphInternalFrameRule; import org.ejtools.jmx.browser.state.rules.ResourceGraphRule; import org.ejtools.jmx.browser.state.rules.ResourceRule; import org.ejtools.jmx.browser.state.rules.ServerInternalFrameRule; import org.ejtools.jmx.browser.state.rules.ServerRule; import org.ejtools.util.service.ProfileRule; import org.ejtools.util.state.LoadHandler; import org.ejtools.util.state.StoreVisitor; import org.w3c.dom.Document; /** * @author Laurent Etiemble * @created 3 juin 2003 * @version $Revision: 1.1 $ */ public class WorkbenchState { /** Description of the Field */ private BeanContext context; /** Description of the Field */ private Document document; /** Description of the Field */ private URL workbenchURL; /** *Constructor for the FilePersistenceStore object * * @param context Description of the Parameter */ public WorkbenchState(BeanContext context) { this.context = context; } /** * Gets the workbenchFile attribute of the WorkbenchStore object * * @return The workbenchFile value */ public URL getWorkbenchURL() { return this.workbenchURL; } /** Description of the Method */ public void load() { // Check that the URL is not null andthat URL is a file if ((this.workbenchURL == null) && (!this.workbenchURL.getProtocol().equals("file"))) { return; } try { LoadHandler handler = new LoadHandler(); handler.getContext().put("CONTAINER", this.context); handler.addRule("/workbench/graph-frame", new GraphInternalFrameRule()); handler.addRule("/workbench/jmx-frame", new ServerInternalFrameRule()); handler.addRule("/workbench/jmx-frame/profile", new ProfileRule()); handler.addRule("/workbench/jmx-frame/profile/property", new ProfileRule.ProfilePropertyRule()); handler.addRule("/workbench/jmx-frame/jmx-server", new ServerRule()); handler.addRule("/workbench/jmx-frame/jmx-server/jmx-resource", new ResourceRule()); handler.addRule("/workbench/jmx-frame/jmx-server/jmx-resource/jmx-graph", new ResourceGraphRule()); SAXParserFactory factory = SAXParserFactory.newInstance(); SAXParser parser = factory.newSAXParser(); File file = new File(this.workbenchURL.getFile()); parser.parse(file, handler); } catch (Exception e) { e.printStackTrace(); } } /** * Sets the workbenchFile attribute of the WorkbenchStore object * * @param workbenchURL The new workbenchURL value */ public void setWorkbenchURL(URL workbenchURL) { this.workbenchURL = workbenchURL; } /** Description of the Method */ public void store() { // Check that the URL is not null andthat URL is a file if ((this.workbenchURL == null) && (!this.workbenchURL.getProtocol().equals("file"))) { return; } try { DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = dbFactory.newDocumentBuilder(); this.document = builder.newDocument(); StoreVisitor visitor = new WorkbenchStoreVisitor(this.document); visitor.registerForPersistence(Browser.class); visitor.registerForPersistence(ServerInternalFrame.class); visitor.registerForPersistence(GraphInternalFrame.class); visitor.registerForPersistence(Server.class); visitor.registerForPersistence(Domain.class); visitor.registerForPersistence(Resource.class); visitor.persist(this.context); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); transformer.setOutputProperty("indent", "true"); Source source = new DOMSource(this.document); File file = new File(this.workbenchURL.getFile()); Result result = new StreamResult(file); transformer.transform(source, result); } catch (Exception e) { e.printStackTrace(); } } } --- NEW FILE: WorkbenchStoreVisitor.java --- /* * ianRR, is a new RR * * Distributable under LGPL license. * See terms at http://opensource.org/licenses/lgpl-license.php */ package org.ejtools.jmx.browser.state; import java.util.Iterator; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.apache.log4j.Logger; import org.ejtools.beans.Sort; import org.ejtools.graph.frame.GraphInternalFrame; import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphProducer; import org.ejtools.jmx.browser.Browser; import org.ejtools.jmx.browser.frame.ServerInternalFrame; import org.ejtools.jmx.browser.model.Domain; import org.ejtools.jmx.browser.model.Resource; import org.ejtools.jmx.browser.model.Server; import org.ejtools.util.service.Profile; import org.ejtools.util.state.DefaultStoreVisitor; /** * @version $Revision: 1.1 $ * @author Laurent Etiemble * @created 3 juin 2003 */ public class WorkbenchStoreVisitor extends DefaultStoreVisitor { private Document document; private static Logger logger = Logger.getLogger(WorkbenchStoreVisitor.class); /** * Constructor for the WorkbenchStoreVisitor object * * @param document Description of the Parameter */ public WorkbenchStoreVisitor(Document document) { this.document = document; this.pushCurrentNode(this.document); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(ServerInternalFrame o) { logger.debug("ServerInternalFrame"); Element eFrame = this.document.createElement("jmx-frame"); eFrame.setAttribute("title", o.getTitle()); Element eProfile = this.document.createElement("profile"); eFrame.appendChild(eProfile); Profile profile = o.getProfile(); for (Iterator iterator = profile.keySet().iterator(); iterator.hasNext(); ) { String key = (String) iterator.next(); Element property = this.document.createElement("property"); property.setAttribute("key", key); property.appendChild(this.document.createTextNode(profile.getProperty(key))); eProfile.appendChild(property); } this.peekCurrentNode().appendChild(eFrame); this.pushCurrentNode(eFrame); this.persist(o.iterator()); this.popCurrentNode(); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(GraphInternalFrame o) { logger.debug("GraphInternalFrame"); Element eFrame = this.document.createElement("graph-frame"); eFrame.setAttribute("name", o.getName()); eFrame.setAttribute("delay", String.valueOf(o.getDelay())); eFrame.setAttribute("scale", String.valueOf(o.getScale())); this.peekCurrentNode().appendChild(eFrame); this.pushCurrentNode(eFrame); this.persist(o.iterator()); this.popCurrentNode(); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(Server o) { logger.debug("Server"); Element server = this.document.createElement("jmx-server"); server.setAttribute("name", o.getName()); server.setAttribute("connected", "" + o.isConnected()); this.peekCurrentNode().appendChild(server); this.pushCurrentNode(server); this.persist(o.iterator()); this.popCurrentNode(); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(Domain o) { this.persist(o.iterator()); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(Browser o) { logger.debug("Browser"); Element workbench = this.document.createElement("workbench"); this.peekCurrentNode().appendChild(workbench); this.pushCurrentNode(workbench); this.persist(Sort.getChildrenByClass(o.iterator(), GraphInternalFrame.class)); this.persist(Sort.getChildrenByClass(o.iterator(), ServerInternalFrame.class)); this.popCurrentNode(); } /** * Description of the Method * * @param o Description of the Parameter */ public void persist(Resource o) { try { int g = o.getGraphProducers().size(); boolean notif = o.isRegisteredForNotifications(); if ((g > 0) || notif) { Element resource = this.document.createElement("jmx-resource"); resource.setAttribute("objectName", o.getCanonicalName()); if (notif) { resource.setAttribute("listen", "true"); } if (g > 0) { GraphConsumer[] consumers = o.getGraphConsumers(); for (Iterator iterator = o.getGraphProducers().keySet().iterator(); iterator.hasNext(); ) { String attribute = (String) iterator.next(); GraphProducer producer = (GraphProducer) o.getGraphProducers().get(attribute); GraphConsumer consumer = null; for (int i = 0; i < consumers.length; i++) { GraphConsumer gc = consumers[i]; if (gc.containsGraphProducer(producer)) { consumer = gc; } } if (consumer != null) { Element graph = this.document.createElement("jmx-graph"); graph.setAttribute("attribute", attribute); graph.setAttribute("target", consumer.toString()); resource.appendChild(graph); } //else //{ // logger.warn("A graph producer is not linked to a graph consumer !!!"); //} } } this.peekCurrentNode().appendChild(resource); this.pushCurrentNode(resource); this.persist(o.iterator()); this.popCurrentNode(); } } catch (Exception e) { e.printStackTrace(); } } } |
From: <let...@us...> - 2003-11-27 01:13:11
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/mbean/resources In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/mbean/resources Modified Files: jboss-service.xml Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: jboss-service.xml =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/mbean/resources/jboss-service.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** jboss-service.xml 3 Mar 2003 21:02:16 -0000 1.3 --- jboss-service.xml 27 Nov 2003 01:13:08 -0000 1.4 *************** *** 1,4 **** ! <?xml version="1.0" encoding="UTF-8"?> ! <service> ! <mbean code="org.ejtools.jmx.browser.mbean.CustomViewDeployer" name="user:service=CustomViewDeployer"/> ! </service> --- 1,4 ---- ! <?xml version="1.0" encoding="UTF-8"?> ! <service> ! <mbean code="org.ejtools.jmx.browser.mbean.CustomViewDeployer" name="user:service=CustomViewDeployer"/> ! </service> |
From: <let...@us...> - 2003-11-27 01:13:11
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/ui In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/ui Modified Files: MBeanCustomizer.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI Index: MBeanCustomizer.java =================================================================== RCS file: /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/ui/MBeanCustomizer.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MBeanCustomizer.java 6 Apr 2003 11:50:18 -0000 1.5 --- MBeanCustomizer.java 27 Nov 2003 01:13:07 -0000 1.6 *************** *** 20,25 **** --- 20,27 ---- import java.beans.PropertyEditor; import java.util.ArrayList; + import java.util.Arrays; import java.util.Hashtable; import java.util.Iterator; + import java.util.List; import java.util.ResourceBundle; *************** *** 38,41 **** --- 40,44 ---- import javax.swing.JScrollPane; import javax.swing.JTextArea; + import javax.swing.SwingConstants; import org.apache.log4j.Logger; *************** *** 48,51 **** --- 51,55 ---- import org.ejtools.graph.service.GraphConsumerSelector; import org.ejtools.jmx.MBeanAccessor; + import org.ejtools.jmx.MBeanSorter; import org.ejtools.jmx.browser.model.Resource; import org.ejtools.util.ClassTools; *************** *** 57,62 **** * * @author letiemble - * @created 8 avril 2002 * @version $Revision$ * @todo Protected method to choose PropertyEditor by Class and Name * @todo Non Supported classes displayed --- 61,66 ---- * * @author letiemble * @version $Revision$ + * @created 8 avril 2002 * @todo Protected method to choose PropertyEditor by Class and Name * @todo Non Supported classes displayed *************** *** 219,223 **** // Create the attribute label ! JLabel label = new JLabel(attributeInfo.getName() + " :", JLabel.RIGHT); label.setToolTipText(attributeInfo.getDescription()); label.setForeground(AwtToolkit.DARK_BLUE); --- 223,227 ---- // Create the attribute label ! JLabel label = new JLabel(attributeInfo.getName() + " :", SwingConstants.RIGHT); label.setToolTipText(attributeInfo.getDescription()); label.setForeground(AwtToolkit.DARK_BLUE); *************** *** 357,361 **** protected void addToGraph(String attribute) { ! GraphConsumer consumer = GraphConsumerSelector.select(this); if (consumer != null) { --- 361,365 ---- protected void addToGraph(String attribute) { ! GraphConsumer consumer = GraphConsumerSelector.selectWithDialog(this); if (consumer != null) { *************** *** 366,372 **** /** ! * Adds a feature to the UnsupportedProperty attribute of the GenericMBeanCustomizer object * ! * @param attributeInfo The feature to be added to the UnsupportedProperty attribute */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) --- 370,378 ---- /** ! * Adds a feature to the UnsupportedProperty attribute of the ! * GenericMBeanCustomizer object * ! * @param attributeInfo The feature to be added to the UnsupportedProperty ! * attribute */ protected void addUnsupportedProperty(MBeanAttributeInfo attributeInfo) *************** *** 375,379 **** gridbagconstraints.insets = new Insets(2, 2, 2, 2); ! JLabel jlabel = new JLabel(attributeInfo.getName() + " :", JLabel.RIGHT); jlabel.setToolTipText(attributeInfo.getDescription()); jlabel.setForeground(AwtToolkit.DARK_BLUE); --- 381,385 ---- gridbagconstraints.insets = new Insets(2, 2, 2, 2); ! JLabel jlabel = new JLabel(attributeInfo.getName() + " :", SwingConstants.RIGHT); jlabel.setToolTipText(attributeInfo.getDescription()); jlabel.setForeground(AwtToolkit.DARK_BLUE); *************** *** 411,430 **** gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! MBeanAttributeInfo[] infos = info.getAttributes(); ! if (infos.length == 0) { return; } this.mbeanAttributes = new JPanel(new GridBagLayout()); this.mbeanAttributes.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.attributes"))); ! for (int i = 0; i < infos.length; i++) { PropertyEditor propertyeditor = null; ! Class c = ClassTools.getClass(infos[i].getType()); if (c == null) { ! this.addUnsupportedProperty(infos[i]); } else --- 417,439 ---- gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! MBeanAttributeInfo[] infosArray = info.getAttributes(); ! if (infosArray.length == 0) { return; } + List infos = Arrays.asList(infosArray); + MBeanSorter.sortByName(infos); this.mbeanAttributes = new JPanel(new GridBagLayout()); this.mbeanAttributes.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.attributes"))); ! for (int i = 0; i < infos.size(); i++) { + MBeanAttributeInfo attributeInfo = (MBeanAttributeInfo) infos.get(i); PropertyEditor propertyeditor = null; ! Class c = ClassTools.getClass(attributeInfo.getType()); if (c == null) { ! this.addUnsupportedProperty(attributeInfo); } else *************** *** 434,438 **** Class componentType = c.getComponentType(); propertyeditor = new ArrayEditor(componentType); ! this.addProperty(propertyeditor, infos[i]); } else --- 443,447 ---- Class componentType = c.getComponentType(); propertyeditor = new ArrayEditor(componentType); ! this.addProperty(propertyeditor, attributeInfo); } else *************** *** 443,447 **** propertyeditor = CustomPropertyEditorManager.findEditor(String.class); } ! this.addProperty(propertyeditor, infos[i]); } gridbagconstraints.weighty = 1.0D; --- 452,456 ---- propertyeditor = CustomPropertyEditorManager.findEditor(String.class); } ! this.addProperty(propertyeditor, attributeInfo); } gridbagconstraints.weighty = 1.0D; *************** *** 519,535 **** gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! MBeanConstructorInfo[] infos = info.getConstructors(); ! if (infos.length == 0) { return; } this.mbeanConstructors = new JPanel(new GridBagLayout()); this.mbeanConstructors.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.constructors"))); ! for (int i = 0; i < infos.length; i++) { StringBuffer display = new StringBuffer(); ! display.append(infos[i].getName()); display.append("("); ! MBeanParameterInfo[] parameters = infos[i].getSignature(); if (parameters.length > 0) { --- 528,548 ---- gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! MBeanConstructorInfo[] infosArray = info.getConstructors(); ! if (infosArray.length == 0) { return; } + List infos = Arrays.asList(infosArray); + MBeanSorter.sortByName(infos); + this.mbeanConstructors = new JPanel(new GridBagLayout()); this.mbeanConstructors.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.constructors"))); ! for (int i = 0; i < infos.size(); i++) { + MBeanConstructorInfo ctorInfo = (MBeanConstructorInfo) infos.get(i); StringBuffer display = new StringBuffer(); ! display.append(ctorInfo.getName()); display.append("("); ! MBeanParameterInfo[] parameters = ctorInfo.getSignature(); if (parameters.length > 0) { *************** *** 545,550 **** display.append(")"); ! JLabel label = new JLabel(display.toString(), JLabel.LEFT); ! label.setToolTipText(infos[i].getDescription()); label.setForeground(Color.black); this.mbeanConstructors.add(label, gridbagconstraints); --- 558,563 ---- display.append(")"); ! JLabel label = new JLabel(display.toString(), SwingConstants.LEFT); ! label.setToolTipText(ctorInfo.getDescription()); label.setForeground(Color.black); this.mbeanConstructors.add(label, gridbagconstraints); *************** *** 574,578 **** gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(resources.getString("customizer.text.class.name") + " : ", JLabel.RIGHT); label.setToolTipText(resources.getString("customizer.tooltip.class.name")); label.setForeground(AwtToolkit.DARK_BLUE); --- 587,591 ---- gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(resources.getString("customizer.text.class.name") + " : ", SwingConstants.RIGHT); label.setToolTipText(resources.getString("customizer.tooltip.class.name")); label.setForeground(AwtToolkit.DARK_BLUE); *************** *** 581,585 **** gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! label = new JLabel(info.getClassName(), JLabel.LEFT); label.setForeground(Color.black); this.mbeanInfo.add(label, gridbagconstraints); --- 594,598 ---- gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! label = new JLabel(info.getClassName(), SwingConstants.LEFT); label.setForeground(Color.black); this.mbeanInfo.add(label, gridbagconstraints); *************** *** 587,591 **** gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(resources.getString("customizer.text.class.description") + " : ", JLabel.RIGHT); label.setToolTipText(resources.getString("customizer.tooltip.class.description")); label.setForeground(AwtToolkit.DARK_BLUE); --- 600,604 ---- gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(resources.getString("customizer.text.class.description") + " : ", SwingConstants.RIGHT); label.setToolTipText(resources.getString("customizer.tooltip.class.description")); label.setForeground(AwtToolkit.DARK_BLUE); *************** *** 594,598 **** gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! label = new JLabel(info.getDescription(), JLabel.LEFT); label.setForeground(Color.black); this.mbeanInfo.add(label, gridbagconstraints); --- 607,611 ---- gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! label = new JLabel(info.getDescription(), SwingConstants.LEFT); label.setForeground(Color.black); this.mbeanInfo.add(label, gridbagconstraints); *************** *** 635,652 **** gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! MBeanNotificationInfo[] infos = info.getNotifications(); ! if (infos.length == 0) { return; } this.mbeanNotifications = new JPanel(new GridBagLayout()); this.mbeanNotifications.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.notifications"))); ! for (int i = 0; i < infos.length; i++) { gridbagconstraints.weightx = 0.0D; ! gridbagconstraints.gridheight = infos[i].getNotifTypes().length; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! JLabel label = new JLabel(infos[i].getName() + " ", JLabel.RIGHT); ! label.setToolTipText(infos[i].getDescription()); label.setForeground(AwtToolkit.DARK_BLUE); this.mbeanNotifications.add(label, gridbagconstraints); --- 648,669 ---- gridbagconstraints.fill = GridBagConstraints.HORIZONTAL; ! MBeanNotificationInfo[] infosArray = info.getNotifications(); ! if (infosArray.length == 0) { return; } + List infos = Arrays.asList(infosArray); + MBeanSorter.sortByName(infos); + this.mbeanNotifications = new JPanel(new GridBagLayout()); this.mbeanNotifications.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.notifications"))); ! for (int i = 0; i < infos.size(); i++) { + MBeanNotificationInfo notificationInfo = (MBeanNotificationInfo) infos.get(i); gridbagconstraints.weightx = 0.0D; ! gridbagconstraints.gridheight = notificationInfo.getNotifTypes().length; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! JLabel label = new JLabel(notificationInfo.getName() + " ", SwingConstants.RIGHT); ! label.setToolTipText(notificationInfo.getDescription()); label.setForeground(AwtToolkit.DARK_BLUE); this.mbeanNotifications.add(label, gridbagconstraints); *************** *** 655,661 **** gridbagconstraints.gridheight = 1; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! for (int j = 0; j < infos[i].getNotifTypes().length; j++) { ! label = new JLabel(infos[i].getNotifTypes()[j], JLabel.LEFT); label.setForeground(Color.black); this.mbeanNotifications.add(label, gridbagconstraints); --- 672,678 ---- gridbagconstraints.gridheight = 1; gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! for (int j = 0; j < notificationInfo.getNotifTypes().length; j++) { ! label = new JLabel(notificationInfo.getNotifTypes()[j], SwingConstants.LEFT); label.setForeground(Color.black); this.mbeanNotifications.add(label, gridbagconstraints); *************** *** 750,768 **** gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! MBeanOperationInfo[] infos = info.getOperations(); ! if (infos.length == 0) { return; } this.mbeanOperations = new JPanel(new GridBagLayout()); this.mbeanOperations.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.operations"))); ! for (int i = 0; i < infos.length; i++) { ! MBeanOperationInfo operationInfo = infos[i]; gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = 1; String returnType = ClassTools.classDisplay(operationInfo.getReturnType() + " "); ! JLabel label = new JLabel(returnType, JLabel.RIGHT); label.setForeground(AwtToolkit.DARK_BLUE); this.mbeanOperations.add(label, gridbagconstraints); --- 767,788 ---- gridbagconstraints.gridwidth = GridBagConstraints.REMAINDER; ! MBeanOperationInfo[] infosArray = info.getOperations(); ! if (infosArray.length == 0) { return; } + List infos = Arrays.asList(infosArray); + MBeanSorter.sortByName(infos); + this.mbeanOperations = new JPanel(new GridBagLayout()); this.mbeanOperations.setBorder(BorderFactory.createTitledBorder(resources.getString("customizer.text.operations"))); ! for (int i = 0; i < infos.size(); i++) { ! MBeanOperationInfo operationInfo = (MBeanOperationInfo) infos.get(i); gridbagconstraints.weightx = 0.0D; gridbagconstraints.gridwidth = 1; String returnType = ClassTools.classDisplay(operationInfo.getReturnType() + " "); ! JLabel label = new JLabel(returnType, SwingConstants.RIGHT); label.setForeground(AwtToolkit.DARK_BLUE); this.mbeanOperations.add(label, gridbagconstraints); *************** *** 787,791 **** gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(display.toString(), JLabel.LEFT); label.setToolTipText(operationInfo.getDescription()); label.setForeground(Color.black); --- 807,811 ---- gridbagconstraints.weightx = 1.0D; gridbagconstraints.gridwidth = GridBagConstraints.RELATIVE; ! label = new JLabel(display.toString(), SwingConstants.LEFT); label.setToolTipText(operationInfo.getDescription()); label.setForeground(Color.black); *************** *** 843,848 **** * * @author letiembl - * @created 21 novembre 2002 * @version $Revision$ */ protected class Updater --- 863,868 ---- * * @author letiembl * @version $Revision$ + * @created 21 novembre 2002 */ protected class Updater *************** *** 892,901 **** { Object newValue = this.editor.getValue(); ! if ((newValue != null) && (this.info.isReadable())) { ! Object oldValue = MBeanCustomizer.this.object.getAttribute(this.info.getName()); ! if (!newValue.equals(oldValue)) { - Attribute attr = new Attribute(this.info.getName(), newValue); MBeanCustomizer.this.object.setAttribute(attr); } --- 912,928 ---- { Object newValue = this.editor.getValue(); ! if (newValue != null) { ! Attribute attr = new Attribute(this.info.getName(), newValue); ! if (this.info.isReadable()) ! { ! Object oldValue = MBeanCustomizer.this.object.getAttribute(this.info.getName()); ! if (!newValue.equals(oldValue)) ! { ! MBeanCustomizer.this.object.setAttribute(attr); ! } ! } ! else { MBeanCustomizer.this.object.setAttribute(attr); } *************** *** 910,912 **** } } - --- 937,938 ---- |
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules In directory sc8-pr-cvs1:/tmp/cvs-serv13614/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules Added Files: GraphInternalFrameRule.java ResourceGraphRule.java ResourceRule.java ServerInternalFrameRule.java ServerRule.java Log Message: Address Bug #775745 Address Todo #800902 Address Todo #755528 Remove @created tags Add support for MXJ4 2.0.0 (still beta) Add support for JXM Remoting through RMI --- NEW FILE: GraphInternalFrameRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.jmx.browser.state.rules; import java.beans.beancontext.BeanContextServices; import java.util.Map; import org.ejtools.graph.frame.GraphInternalFrame; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class GraphInternalFrameRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { BeanContextServices container = (BeanContextServices) context.get("CONTAINER"); GraphInternalFrame frame = new GraphInternalFrame(); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String name = attrs.getValue("name"); frame.setName(name); String delay = attrs.getValue("delay"); frame.setName(name); frame.setDelay(Long.parseLong(delay)); String scale = attrs.getValue("scale"); frame.setName(name); frame.setScale(Double.parseDouble(scale)); container.add(frame); } } --- NEW FILE: ResourceGraphRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.jmx.browser.state.rules; import java.util.Map; import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphConsumerSelector; import org.ejtools.jmx.browser.model.Resource; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class ResourceGraphRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { Resource resource = (Resource) context.get("RESOURCE"); if (resource != null) { Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String attribute = attrs.getValue("attribute"); String target = attrs.getValue("target"); GraphConsumer consumer = GraphConsumerSelector.select(resource, target); resource.registerForGraph(consumer, attribute); } } } --- NEW FILE: ResourceRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.jmx.browser.state.rules; import java.util.Map; import org.ejtools.jmx.browser.frame.ServerInternalFrame; import org.ejtools.jmx.browser.model.Resource; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class ResourceRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String objectName = attrs.getValue("objectName"); Resource resource = frame.queryMBean(objectName); if (resource != null) { context.put("RESOURCE", resource); String listen = attrs.getValue("listen"); if ("true".equals(listen)) { try { resource.registerForNotifications(); } catch (Exception e) { e.printStackTrace(); } } } } } --- NEW FILE: ServerInternalFrameRule.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.jmx.browser.state.rules; import java.util.Map; import org.ejtools.jmx.browser.frame.ServerInternalFrame; import org.ejtools.util.state.DefaultRule; /** * @author letiembl * @version $Revision: 1.1 $ * @created 20 juin 2003 */ public class ServerInternalFrameRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { ServerInternalFrame frame = new ServerInternalFrame(); context.put("FRAME", frame); context.put("HOLDER", frame); } } --- NEW FILE: ServerRule.java --- /* * Created on 20 juin 2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.ejtools.jmx.browser.state.rules; import java.beans.beancontext.BeanContextServices; import java.util.Map; import org.ejtools.jmx.browser.frame.ServerInternalFrame; import org.ejtools.jmx.browser.model.Server; import org.ejtools.util.state.DefaultRule; import org.xml.sax.Attributes; /** * @author letiemble * @created 20 juin 2003 * @version $Revision: 1.1 $ */ public class ServerRule extends DefaultRule { /** * Description of the Method * * @param context Description of the Parameter */ public void loadEnter(Map context) { BeanContextServices container = (BeanContextServices) context.get("CONTAINER"); ServerInternalFrame frame = (ServerInternalFrame) context.get("FRAME"); Server server = new Server(); context.put("SERVER", server); frame.setServer(server); container.add(frame); Attributes attrs = (Attributes) context.get("ATTRIBUTES"); String name = attrs.getValue("name"); server.setName(name); String connected = attrs.getValue("connected"); if ("true".equals(connected)) { server.connect(); } } } |
From: <let...@us...> - 2003-11-27 00:58:59
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules In directory sc8-pr-cvs1:/tmp/cvs-serv11997/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules Log Message: Directory /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state/rules added to the repository |
From: <let...@us...> - 2003-11-27 00:58:48
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state In directory sc8-pr-cvs1:/tmp/cvs-serv11829/jmx.browser/src/main/org/ejtools/jmx/browser/state Log Message: Directory /cvsroot/ejtools/applications/jmx.browser/src/main/org/ejtools/jmx/browser/state added to the repository |
From: <let...@us...> - 2003-11-27 00:53:35
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame In directory sc8-pr-cvs1:/tmp/cvs-serv10226/graph/src/main/org/ejtools/graph/frame Modified Files: ControlCompositeTrack.java GraphInternalFrame.java Log Message: Address Todo #800900 Address Todo #803019 Remove @created tags Index: ControlCompositeTrack.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame/ControlCompositeTrack.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ControlCompositeTrack.java 15 Sep 2003 22:11:22 -0000 1.4 --- ControlCompositeTrack.java 27 Nov 2003 00:53:32 -0000 1.5 *************** *** 173,177 **** } ! NumberFormat format = new DecimalFormat("0"); Map timeline = new TreeMap(); for (int i = 0; i < allPoints.size(); i++) --- 173,177 ---- } ! NumberFormat format = new DecimalFormat(resources.getString("export.as.text.column.numeric.format")); Map timeline = new TreeMap(); for (int i = 0; i < allPoints.size(); i++) *************** *** 193,197 **** } ! result.append("Time"); for (int i = 0; i < headers.size(); i++) { --- 193,199 ---- } ! result.append(resources.getString("export.as.text.column.absolute.time")); ! result.append(","); ! result.append(resources.getString("export.as.text.column.relative.time")); for (int i = 0; i < headers.size(); i++) { *************** *** 201,204 **** --- 203,210 ---- result.append("\n"); + long delay = 0; + double[] lasts = new double[headers.size()]; + Arrays.fill(lasts, 0.0d); + for (Iterator it = timeline.keySet().iterator(); it.hasNext(); ) { *************** *** 206,210 **** double[] values = (double[]) timeline.get(time); ! result.append(time.toString()); for (int i = 0; i < headers.size(); i++) --- 212,227 ---- double[] values = (double[]) timeline.get(time); ! long current = Long.parseLong(time); ! result.append(current); ! result.append(","); ! if (delay > 0) ! { ! result.append(current - delay); ! } ! else ! { ! result.append(delay); ! delay = current; ! } for (int i = 0; i < headers.size(); i++) *************** *** 214,217 **** --- 231,239 ---- { result.append(values[i]); + lasts[i] = values[i]; + } + else + { + result.append(lasts[i]); } } *************** *** 294,298 **** * * @author letiembl - * @created 17 d?cembre 2002 * @version $Revision$ */ --- 316,319 ---- Index: GraphInternalFrame.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/frame/GraphInternalFrame.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphInternalFrame.java 15 Sep 2003 22:11:22 -0000 1.4 --- GraphInternalFrame.java 27 Nov 2003 00:53:32 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- import java.awt.BorderLayout; + import java.awt.image.BufferedImage; import java.io.File; import java.util.Hashtable; *************** *** 29,36 **** --- 30,39 ---- import org.ejtools.graph.Track; import org.ejtools.graph.action.ExportAsImageAction; + import org.ejtools.graph.action.ExportAsTextAction; import org.ejtools.graph.renderer.JPanelGraphRenderer; import org.ejtools.graph.renderer.TriAxisLayoutRenderer; import org.ejtools.graph.service.GraphConsumer; import org.ejtools.graph.service.GraphProducer; + import org.ejtools.util.export.CSVTools; import org.ejtools.util.export.PNGTools; *************** *** 114,126 **** })); ! // this.add(new ExportAsTextAction( ! // new Command() ! // { ! // public void execute() ! // { ! // StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText(); ! // logger.debug(buffer.toString()); ! // } ! // })); this.add(new ExportAsImageAction( --- 117,133 ---- })); ! this.add(new ExportAsTextAction( ! new Command() ! { ! public void execute() ! { ! StringBuffer buffer = GraphInternalFrame.this.composite.getPointsAsText(); ! File file = CSVTools.selectCSVFile(); ! if (file != null) ! { ! CSVTools.exportAsCVS(buffer, file); ! } ! } ! })); this.add(new ExportAsImageAction( *************** *** 129,136 **** public void execute() { File file = PNGTools.selectPNGFile(); if (file != null) { ! PNGTools.exportAsPNG(GraphInternalFrame.this.printArea, file); } } --- 136,144 ---- public void execute() { + BufferedImage image = PNGTools.paintAsPNG(GraphInternalFrame.this.printArea); File file = PNGTools.selectPNGFile(); if (file != null) { ! PNGTools.exportAsPNG(image, file); } } |
From: <let...@us...> - 2003-11-27 00:53:35
|
Update of /cvsroot/ejtools/libraries/graph/src/resources/org/ejtools/graph In directory sc8-pr-cvs1:/tmp/cvs-serv10226/graph/src/resources/org/ejtools/graph Modified Files: GraphService.properties GraphService_fr_FR.properties Log Message: Address Todo #800900 Address Todo #803019 Remove @created tags Index: GraphService.properties =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/resources/org/ejtools/graph/GraphService.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GraphService.properties 15 Sep 2003 22:02:50 -0000 1.2 --- GraphService.properties 27 Nov 2003 00:53:32 -0000 1.3 *************** *** 20,23 **** --- 20,27 ---- graph.button.remove=Remove + export.as.text.column.absolute.time=Abs. Time + export.as.text.column.relative.time=Rel. Time + export.as.text.column.numeric.format=0 + action.tools=Tools action.tools.export.as.text=Export as Text Data Index: GraphService_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/resources/org/ejtools/graph/GraphService_fr_FR.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GraphService_fr_FR.properties 15 Sep 2003 23:08:27 -0000 1.4 --- GraphService_fr_FR.properties 27 Nov 2003 00:53:32 -0000 1.5 *************** *** 20,23 **** --- 20,27 ---- graph.button.remove=Retirer + export.as.text.column.absolute.time=Temps Abs. + export.as.text.column.relative.time=Temps Rel. + export.as.text.column.numeric.format=0 + action.tools=Outils action.tools.export.as.text=Exporter en données texte |
From: <let...@us...> - 2003-11-27 00:53:35
|
Update of /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph In directory sc8-pr-cvs1:/tmp/cvs-serv10226/graph/src/main/org/ejtools/graph Modified Files: Track.java Log Message: Address Todo #800900 Address Todo #803019 Remove @created tags Index: Track.java =================================================================== RCS file: /cvsroot/ejtools/libraries/graph/src/main/org/ejtools/graph/Track.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Track.java 15 Sep 2003 22:11:22 -0000 1.10 --- Track.java 27 Nov 2003 00:53:31 -0000 1.11 *************** *** 1,288 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.geom.Point2D; ! import java.beans.PropertyChangeEvent; ! import java.beans.PropertyChangeListener; ! import java.text.DecimalFormat; ! import java.text.NumberFormat; ! import java.util.Calendar; ! import java.util.Collection; ! import java.util.Vector; ! ! import javax.swing.BorderFactory; ! import javax.swing.JComponent; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.border.BevelBorder; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Track implements GraphElement, LabelElement ! { ! /** Description of the Field */ ! protected Color color = Color.black; ! /** Description of the Field */ ! protected TrackLabel component; ! /** Description of the Field */ ! protected NumberFormat format = new DecimalFormat("0"); ! /** Description of the Field */ ! protected String label; ! /** Description of the Field */ ! protected String name; ! /** Description of the Field */ ! protected Vector points = new Vector(); ! /** Description of the Field */ ! protected Range xr = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! /** Description of the Field */ ! protected Range yr = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! ! ! /** ! * Constructor for the Track object ! * ! * @param name Description of the Parameter ! */ ! public Track(String name) ! { ! this.name = name; ! this.label = name; ! this.component = new TrackLabel(this.name); ! } ! ! ! /** ! * Adds a feature to the Point attribute of the Track object ! * ! * @param value The feature to be added to the Value attribute ! */ ! public void addValue(double value) ! { ! long time = Calendar.getInstance().getTime().getTime(); ! ! synchronized (this) ! { ! Point2D.Double point = new Point2D.Double(time, value); ! this.points.add(point); ! this.xr.put(time); ! this.yr.put(value); ! this.setLabel(this.name + " : " + this.format.format(value)); ! } ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! this.points.clear(); ! } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) ! { ! graphics.setColor(this.color); ! ! int x1 = 0; ! int y1 = 0; ! int x2 = 0; ! int y2 = 0; ! Point2D point = null; ! ! if (this.points.size() > 1) ! { ! point = (Point2D) this.points.get(0); ! x1 = (int) (point.getX() * scaleX + offsetX); ! y1 = (int) (point.getY() * scaleY + offsetY); ! for (int i = 1; i < this.points.size(); i++) ! { ! point = (Point2D) this.points.get(i); ! x2 = (int) (point.getX() * scaleX + offsetX); ! y2 = (int) (point.getY() * scaleY + offsetY); ! if (x2 > 0) ! { ! graphics.drawLine(x1, y1, x2, y2); ! } ! x1 = x2; ! y1 = y2; ! } ! } ! } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return this.color; ! } ! ! ! /** ! * @return The component value ! */ ! public JComponent getComponent() ! { ! return this.component; ! } ! ! ! /** ! * Gets the points attribute of the Track object ! * ! * @return The points value ! */ ! public Collection getPoints() ! { ! return (Collection) this.points.clone(); ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! return this.xr; ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! return this.yr; ! } ! ! ! /** ! * Sets the color. ! * ! * @param color The color to set ! */ ! public void setColor(Color color) ! { ! this.color = color; ! this.component.propertyChange(new PropertyChangeEvent(this, "color", "", this.color)); ! } ! ! ! /** ! * Sets the label. ! * ! * @param label The label to set ! */ ! public void setLabel(String label) ! { ! this.label = label; ! this.component.propertyChange(new PropertyChangeEvent(this, "label", "", this.label)); ! } ! ! ! /** ! * Sets the name. ! * ! * @param name The name to set ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @created 13 novembre 2002 ! * @version $Revision$ ! */ ! private class TrackLabel extends JPanel implements PropertyChangeListener ! { ! /** Description of the Field */ ! protected JPanel colorPanel = new JPanel(); ! /** Description of the Field */ ! protected JLabel label = new JLabel(); ! ! ! /** ! * Constructor for CustomJLabel. ! * ! * @param text ! */ ! public TrackLabel(String text) ! { ! super(); ! this.setLayout(new GridBagLayout()); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.insets = new Insets(1, 1, 1, 1); ! ! constraints.weightx = 0.0d; ! this.add(this.colorPanel, constraints); ! this.colorPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); ! ! constraints.weightx = 1.0d; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! this.add(this.label, constraints); ! this.label.setText(text); ! this.label.setToolTipText(text); ! } ! ! ! /** Constructor for CustomJLabel. */ ! public TrackLabel() { } ! ! ! /** ! * @param evt Description of the Parameter ! */ ! public void propertyChange(PropertyChangeEvent evt) ! { ! if ("label".equals(evt.getPropertyName())) ! { ! String text = (String) evt.getNewValue(); ! this.label.setText(text); ! this.label.setToolTipText(text); ! } ! if ("color".equals(evt.getPropertyName())) ! { ! this.colorPanel.setBackground((Color) evt.getNewValue()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return this.label.getText(); ! } ! } ! } --- 1,287 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.graph; ! ! import java.awt.Color; ! import java.awt.Graphics; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.geom.Point2D; ! import java.beans.PropertyChangeEvent; ! import java.beans.PropertyChangeListener; ! import java.text.DecimalFormat; ! import java.text.NumberFormat; ! import java.util.Calendar; ! import java.util.Collection; ! import java.util.Vector; ! ! import javax.swing.BorderFactory; ! import javax.swing.JComponent; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.border.BevelBorder; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class Track implements GraphElement, LabelElement ! { ! /** Description of the Field */ ! protected Color color = Color.black; ! /** Description of the Field */ ! protected TrackLabel component; ! /** Description of the Field */ ! protected NumberFormat format = new DecimalFormat("0"); ! /** Description of the Field */ ! protected String label; ! /** Description of the Field */ ! protected String name; ! /** Description of the Field */ ! protected Vector points = new Vector(); ! /** Description of the Field */ ! protected Range xr = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! /** Description of the Field */ ! protected Range yr = new Range(Double.MAX_VALUE, Double.MIN_VALUE); ! ! ! /** ! * Constructor for the Track object ! * ! * @param name Description of the Parameter ! */ ! public Track(String name) ! { ! this.name = name; ! this.label = name; ! this.component = new TrackLabel(this.name); ! } ! ! ! /** ! * Adds a feature to the Point attribute of the Track object ! * ! * @param value The feature to be added to the Value attribute ! */ ! public void addValue(double value) ! { ! long time = Calendar.getInstance().getTime().getTime(); ! ! synchronized (this) ! { ! Point2D.Double point = new Point2D.Double(time, value); ! this.points.add(point); ! this.xr.put(time); ! this.yr.put(value); ! this.setLabel(this.name + " : " + this.format.format(value)); ! } ! } ! ! ! /** Description of the Method */ ! public void clear() ! { ! this.points.clear(); ! } ! ! ! /** ! * @param graphics Description of the Parameter ! * @param scaleX Description of the Parameter ! * @param offsetX Description of the Parameter ! * @param scaleY Description of the Parameter ! * @param offsetY Description of the Parameter ! */ ! public void draw(Graphics graphics, double scaleX, double offsetX, double scaleY, double offsetY) ! { ! graphics.setColor(this.color); ! ! int x1 = 0; ! int y1 = 0; ! int x2 = 0; ! int y2 = 0; ! Point2D point = null; ! ! if (this.points.size() > 1) ! { ! point = (Point2D) this.points.get(0); ! x1 = (int) (point.getX() * scaleX + offsetX); ! y1 = (int) (point.getY() * scaleY + offsetY); ! for (int i = 1; i < this.points.size(); i++) ! { ! point = (Point2D) this.points.get(i); ! x2 = (int) (point.getX() * scaleX + offsetX); ! y2 = (int) (point.getY() * scaleY + offsetY); ! if (x2 > 0) ! { ! graphics.drawLine(x1, y1, x2, y2); ! } ! x1 = x2; ! y1 = y2; ! } ! } ! } ! ! ! /** ! * @return The color value ! */ ! public Color getColor() ! { ! return this.color; ! } ! ! ! /** ! * @return The component value ! */ ! public JComponent getComponent() ! { ! return this.component; ! } ! ! ! /** ! * Gets the points attribute of the Track object ! * ! * @return The points value ! */ ! public Collection getPoints() ! { ! return (Collection) this.points.clone(); ! } ! ! ! /** ! * @return The xRange value ! */ ! public Range getXRange() ! { ! return this.xr; ! } ! ! ! /** ! * @return The yRange value ! */ ! public Range getYRange() ! { ! return this.yr; ! } ! ! ! /** ! * Sets the color. ! * ! * @param color The color to set ! */ ! public void setColor(Color color) ! { ! this.color = color; ! this.component.propertyChange(new PropertyChangeEvent(this, "color", "", this.color)); ! } ! ! ! /** ! * Sets the label. ! * ! * @param label The label to set ! */ ! public void setLabel(String label) ! { ! this.label = label; ! this.component.propertyChange(new PropertyChangeEvent(this, "label", "", this.label)); ! } ! ! ! /** ! * Sets the name. ! * ! * @param name The name to set ! */ ! public void setName(String name) ! { ! this.name = name; ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @version $Revision$ ! */ ! private class TrackLabel extends JPanel implements PropertyChangeListener ! { ! /** Description of the Field */ ! protected JPanel colorPanel = new JPanel(); ! /** Description of the Field */ ! protected JLabel label = new JLabel(); ! ! ! /** ! * Constructor for CustomJLabel. ! * ! * @param text ! */ ! public TrackLabel(String text) ! { ! super(); ! this.setLayout(new GridBagLayout()); ! ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.insets = new Insets(1, 1, 1, 1); ! ! constraints.weightx = 0.0d; ! this.add(this.colorPanel, constraints); ! this.colorPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED)); ! ! constraints.weightx = 1.0d; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! this.add(this.label, constraints); ! this.label.setText(text); ! this.label.setToolTipText(text); ! } ! ! ! /** Constructor for CustomJLabel. */ ! public TrackLabel() { } ! ! ! /** ! * @param evt Description of the Parameter ! */ ! public void propertyChange(PropertyChangeEvent evt) ! { ! if ("label".equals(evt.getPropertyName())) ! { ! String text = (String) evt.getNewValue(); ! this.label.setText(text); ! this.label.setToolTipText(text); ! } ! if ("color".equals(evt.getPropertyName())) ! { ! this.colorPanel.setBackground((Color) evt.getNewValue()); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Return Value ! */ ! public String toString() ! { ! return this.label.getText(); ! } ! } ! } |
From: <let...@us...> - 2003-11-27 00:51:50
|
Update of /cvsroot/ejtools/libraries/adwt/src/resources/org/ejtools/adwt In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/resources/org/ejtools/adwt Added Files: Resources.properties Resources_fr_FR.properties Log Message: Address Todo #755528 Remove @created tags --- NEW FILE: Resources.properties --- workspace.file.dialog.extension.description=Workspace (*.xml) --- NEW FILE: Resources_fr_FR.properties --- workspace.file.dialog.extension.description=Configuration (*.xml) |
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/main/org/ejtools/adwt Modified Files: BeanContextListView.java GenericCustomizer.java GenericMBeanCustomizer.java GenericMBeanMethodDialog.java SimpleCustomizer.java Added Files: FileUtil.java Log Message: Address Todo #755528 Remove @created tags --- NEW FILE: FileUtil.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.adwt; import java.io.File; import java.net.URL; import java.util.ResourceBundle; import javax.swing.JFileChooser; import javax.swing.filechooser.FileFilter; import org.apache.log4j.Logger; /** * Description of the Class * * @author Laurent Etiemble * @version $Revision: 1.1 $ * @todo Javadoc to complete */ public class FileUtil { /** Description of the Field */ public static FileFilter WORKSPACE_FILE_FILTER = new FileFilter() { public boolean accept(File file) { return file.getName().endsWith(".xml"); } public String getDescription() { return resources.getString("workspace.file.dialog.extension.description"); } }; /** Default logger */ private static Logger logger = Logger.getLogger(FileUtil.class); /** Bundle for I18N */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.Resources"); /**Constructor for the FileUtil object */ private FileUtil() { } /** * Description of the Method * * @param title Description of the Parameter * @param type Description of the Parameter * @return Description of the Return Value * @exception Exception Description of the Exception */ public static URL selectWorkspaceFile(String title, int type) throws Exception { // Fix for JFileChooser/SecurityManager bug (#4264750) SecurityManager s = System.getSecurityManager(); System.setSecurityManager(null); // Choose file JFileChooser chooser = new JFileChooser(System.getProperty("user.dir")); chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); chooser.setDialogTitle(title); chooser.setDialogType(type); chooser.setFileFilter(WORKSPACE_FILE_FILTER); int returnVal = chooser.showDialog(null, title); System.setSecurityManager(s); if (returnVal != JFileChooser.APPROVE_OPTION) { return null; } return chooser.getSelectedFile().toURL(); } } Index: BeanContextListView.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/BeanContextListView.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BeanContextListView.java 15 Sep 2003 22:37:12 -0000 1.4 --- BeanContextListView.java 27 Nov 2003 00:51:44 -0000 1.5 *************** *** 1,289 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.beans.BeanInfo; ! import java.beans.Introspector; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.lang.reflect.Method; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.DefaultListCellRenderer; ! import javax.swing.ImageIcon; ! import javax.swing.JLabel; ! import javax.swing.JList; ! import javax.swing.ListModel; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListView extends JList ! { ! /** ! * Constructor for the BeanContextTreeView object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListView(BeanContext beancontext) ! { ! this.setModel(new BeanContextListModel(beancontext)); ! this.setCellRenderer( ! new DefaultListCellRenderer() ! { ! public Component getListCellRendererComponent(JList list, Object obj, int index, boolean isSelected, boolean cellHasFocus) ! { ! try ! { ! ContextElement contextelement = (ContextElement) obj; ! Object obj1 = contextelement.getUserObject(); ! super.getListCellRendererComponent(list, obj1, index, isSelected, cellHasFocus); ! if (contextelement.icon != null) ! { ! setIcon(contextelement.icon); ! } ! return this; ! } ! catch (Exception _ex) ! { ! System.err.println(_ex.getMessage()); ! return super.getListCellRendererComponent(list, obj, index, isSelected, cellHasFocus); ! } ! } ! }); ! ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @version $Revision$ ! * @created 16 octobre 2001 ! */ ! protected class BeanContextListModel implements ListModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Vector content = new Vector(); ! /** Description of the Field */ ! protected BeanContext context; ! /** Description of the Field */ ! protected Vector listeners = new Vector(); ! ! ! /** ! * Constructor for the BeanContextListModel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListModel(BeanContext beancontext) ! { ! this.context = beancontext; ! this.context.addBeanContextMembershipListener(this); ! this.updateModel(); ! } ! ! ! /** ! * Adds a feature to the ListDataListener attribute of the BeanContextListModel object ! * ! * @param l The feature to be added to the ListDataListener attribute ! */ ! public void addListDataListener(ListDataListener l) ! { ! this.listeners.add(l); ! } ! ! ! /** ! * Description of the Method ! * ! * @param beancontextmembershipevent Description of Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent beancontextmembershipevent) ! { ! this.updateModel(); ! this.notifyListener(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param beancontextmembershipevent Description of Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent beancontextmembershipevent) ! { ! this.updateModel(); ! this.notifyListener(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param index Description of Parameter ! * @return Description of the Returned Value ! */ ! public Object getElementAt(int index) ! { ! return this.content.elementAt(index); ! } ! ! ! /** ! * Gets the size attribute of the BeanContextListModel object ! * ! * @return The size value ! */ ! public int getSize() ! { ! return this.context.size(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param l Description of Parameter ! */ ! public void removeListDataListener(ListDataListener l) ! { ! this.listeners.remove(l); ! } ! ! ! /** Description of the Method */ ! private void notifyListener() ! { ! ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.content.size()); ! for (int i = 0; i < this.listeners.size(); i++) ! { ! ListDataListener listener = (ListDataListener) this.listeners.elementAt(i); ! listener.contentsChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! private void updateModel() ! { ! this.content.clear(); ! Iterator iterator = this.context.iterator(); ! while (iterator.hasNext()) ! { ! this.content.addElement(new ContextElement(iterator.next())); ! } ! } ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @version $Revision$ ! * @created 16 octobre 2001 ! */ ! protected class ContextElement implements BeanContextChildComponentProxy ! { ! /** Description of the Field */ ! protected ImageIcon icon = null; ! /** Description of the Field */ ! protected Object obj; ! /** Description of the Field */ ! protected String txt; ! ! ! /** ! * Constructor for the ContextNode object ! * ! * @param obj1 Description of Parameter ! */ ! public ContextElement(Object obj1) ! { ! obj = obj1; ! try ! { ! BeanInfo beaninfo = Introspector.getBeanInfo(obj1.getClass()); ! if (beaninfo.getIcon(1) != null) ! { ! icon = new ImageIcon(beaninfo.getIcon(1)); ! } ! Method method = obj1.getClass().getMethod("toString", new Class[0]); ! if (method.getDeclaringClass().equals(Object.class)) ! { ! txt = beaninfo.getBeanDescriptor().getDisplayName(); ! } ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! ! /** ! * Gets the component attribute of the ContextNode object ! * ! * @return The component value ! */ ! public Component getComponent() ! { ! if (obj instanceof Component) ! { ! return (Component) obj; ! } ! if (obj instanceof BeanContextContainerProxy) ! { ! return ((BeanContextContainerProxy) obj).getContainer(); ! } ! if (obj instanceof BeanContextChildComponentProxy) ! { ! return ((BeanContextChildComponentProxy) obj).getComponent(); ! } ! else ! { ! return new JLabel("No GUI available", 0); ! } ! } ! ! ! /** ! * Gets the userObject attribute of the ContextNode object ! * ! * @return The userObject value ! */ ! public Object getUserObject() ! { ! return obj; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return txt != null ? txt : obj.toString(); ! } ! } ! } ! --- 1,287 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.beans.BeanInfo; ! import java.beans.Introspector; ! import java.beans.beancontext.BeanContext; ! import java.beans.beancontext.BeanContextChildComponentProxy; ! import java.beans.beancontext.BeanContextContainerProxy; ! import java.beans.beancontext.BeanContextMembershipEvent; ! import java.beans.beancontext.BeanContextMembershipListener; ! import java.lang.reflect.Method; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.DefaultListCellRenderer; ! import javax.swing.ImageIcon; ! import javax.swing.JLabel; ! import javax.swing.JList; ! import javax.swing.ListModel; ! import javax.swing.event.ListDataEvent; ! import javax.swing.event.ListDataListener; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class BeanContextListView extends JList ! { ! /** ! * Constructor for the BeanContextTreeView object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListView(BeanContext beancontext) ! { ! this.setModel(new BeanContextListModel(beancontext)); ! this.setCellRenderer( ! new DefaultListCellRenderer() ! { ! public Component getListCellRendererComponent(JList list, Object obj, int index, boolean isSelected, boolean cellHasFocus) ! { ! try ! { ! ContextElement contextelement = (ContextElement) obj; ! Object obj1 = contextelement.getUserObject(); ! super.getListCellRendererComponent(list, obj1, index, isSelected, cellHasFocus); ! if (contextelement.icon != null) ! { ! setIcon(contextelement.icon); ! } ! return this; ! } ! catch (Exception _ex) ! { ! System.err.println(_ex.getMessage()); ! return super.getListCellRendererComponent(list, obj, index, isSelected, cellHasFocus); ! } ! } ! }); ! ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @version $Revision$ ! */ ! protected class BeanContextListModel implements ListModel, BeanContextMembershipListener ! { ! /** Description of the Field */ ! protected Vector content = new Vector(); ! /** Description of the Field */ ! protected BeanContext context; ! /** Description of the Field */ ! protected Vector listeners = new Vector(); ! ! ! /** ! * Constructor for the BeanContextListModel object ! * ! * @param beancontext Description of Parameter ! */ ! public BeanContextListModel(BeanContext beancontext) ! { ! this.context = beancontext; ! this.context.addBeanContextMembershipListener(this); ! this.updateModel(); ! } ! ! ! /** ! * Adds a feature to the ListDataListener attribute of the BeanContextListModel object ! * ! * @param l The feature to be added to the ListDataListener attribute ! */ ! public void addListDataListener(ListDataListener l) ! { ! this.listeners.add(l); ! } ! ! ! /** ! * Description of the Method ! * ! * @param beancontextmembershipevent Description of Parameter ! */ ! public void childrenAdded(BeanContextMembershipEvent beancontextmembershipevent) ! { ! this.updateModel(); ! this.notifyListener(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param beancontextmembershipevent Description of Parameter ! */ ! public void childrenRemoved(BeanContextMembershipEvent beancontextmembershipevent) ! { ! this.updateModel(); ! this.notifyListener(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param index Description of Parameter ! * @return Description of the Returned Value ! */ ! public Object getElementAt(int index) ! { ! return this.content.elementAt(index); ! } ! ! ! /** ! * Gets the size attribute of the BeanContextListModel object ! * ! * @return The size value ! */ ! public int getSize() ! { ! return this.context.size(); ! } ! ! ! /** ! * Description of the Method ! * ! * @param l Description of Parameter ! */ ! public void removeListDataListener(ListDataListener l) ! { ! this.listeners.remove(l); ! } ! ! ! /** Description of the Method */ ! private void notifyListener() ! { ! ListDataEvent event = new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, 0, this.content.size()); ! for (int i = 0; i < this.listeners.size(); i++) ! { ! ListDataListener listener = (ListDataListener) this.listeners.elementAt(i); ! listener.contentsChanged(event); ! } ! } ! ! ! /** Description of the Method */ ! private void updateModel() ! { ! this.content.clear(); ! Iterator iterator = this.context.iterator(); ! while (iterator.hasNext()) ! { ! this.content.addElement(new ContextElement(iterator.next())); ! } ! } ! } ! ! ! /** ! * Description of the Class ! * ! * @author Administrator ! * @version $Revision$ ! */ ! protected class ContextElement implements BeanContextChildComponentProxy ! { ! /** Description of the Field */ ! protected ImageIcon icon = null; ! /** Description of the Field */ ! protected Object obj; ! /** Description of the Field */ ! protected String txt; ! ! ! /** ! * Constructor for the ContextNode object ! * ! * @param obj1 Description of Parameter ! */ ! public ContextElement(Object obj1) ! { ! obj = obj1; ! try ! { ! BeanInfo beaninfo = Introspector.getBeanInfo(obj1.getClass()); ! if (beaninfo.getIcon(1) != null) ! { ! icon = new ImageIcon(beaninfo.getIcon(1)); ! } ! Method method = obj1.getClass().getMethod("toString", new Class[0]); ! if (method.getDeclaringClass().equals(Object.class)) ! { ! txt = beaninfo.getBeanDescriptor().getDisplayName(); ! } ! } ! catch (Exception exception) ! { ! exception.printStackTrace(); ! } ! } ! ! ! /** ! * Gets the component attribute of the ContextNode object ! * ! * @return The component value ! */ ! public Component getComponent() ! { ! if (obj instanceof Component) ! { ! return (Component) obj; ! } ! if (obj instanceof BeanContextContainerProxy) ! { ! return ((BeanContextContainerProxy) obj).getContainer(); ! } ! if (obj instanceof BeanContextChildComponentProxy) ! { ! return ((BeanContextChildComponentProxy) obj).getComponent(); ! } ! else ! { ! return new JLabel("No GUI available", 0); ! } ! } ! ! ! /** ! * Gets the userObject attribute of the ContextNode object ! * ! * @return The userObject value ! */ ! public Object getUserObject() ! { ! return obj; ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public String toString() ! { ! return txt != null ? txt : obj.toString(); ! } ! } ! } ! Index: GenericCustomizer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/GenericCustomizer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** GenericCustomizer.java 15 Sep 2003 22:37:12 -0000 1.9 --- GenericCustomizer.java 27 Nov 2003 00:51:44 -0000 1.10 *************** *** 1,664 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Color; ! import java.awt.Component; [...1296 lines suppressed...] ! } ! catch (InvocationTargetException invocationtargetexception) ! { ! invocationtargetexception.getTargetException().printStackTrace(); ! JOptionPane.showMessageDialog(((Component) (obj)), invocationtargetexception.getTargetException().getMessage(), "Error", 0); ! } ! catch (Exception exception) ! { ! System.err.println(exception); ! JOptionPane.showMessageDialog(((Component) (obj)), "An exception occured. Check log for details", "Error", 0); ! } ! } ! else ! { ! new GenericMethodDialog(object, methoddescriptor, (Frame) obj); ! } ! } ! } ! } ! Index: GenericMBeanCustomizer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/GenericMBeanCustomizer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GenericMBeanCustomizer.java 15 Sep 2003 22:37:12 -0000 1.7 --- GenericMBeanCustomizer.java 27 Nov 2003 00:51:44 -0000 1.8 *************** *** 1,888 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.awt.Container; [...1743 lines suppressed...] ! * ! * @param e Description of the Parameter ! */ ! public void actionPerformed(ActionEvent e) ! { ! Container frame = SwingUtilities.getAncestorOfClass(Frame.class, p); ! ! try ! { ! object.unregisterMBean(); ! } ! catch (Exception ex) ! { ! System.err.println(ex); ! JOptionPane.showMessageDialog(frame, "An exception occured. Check log for details", "Error", JOptionPane.ERROR_MESSAGE); ! } ! } ! } ! } ! Index: GenericMBeanMethodDialog.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/GenericMBeanMethodDialog.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GenericMBeanMethodDialog.java 15 Sep 2003 22:37:12 -0000 1.7 --- GenericMBeanMethodDialog.java 27 Nov 2003 00:51:44 -0000 1.8 *************** *** 1,298 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.awt.Dimension; ! import java.awt.Frame; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.management.MBeanOperationInfo; ! import javax.management.MBeanParameterInfo; ! import javax.management.ObjectName; ! import javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.ejtools.jmx.MBeanAccessor; ! import org.ejtools.util.ClassTools; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GenericMBeanMethodDialog extends JDialog implements ActionListener ! { ! /** Description of the Field */ ! private MBeanAccessor mConnector; ! ! /** Description of the Field */ ! private Vector mEditors = new Vector(); ! /** Description of the Field */ ! private MBeanOperationInfo mOperation; ! /** Description of the Field */ ! private ObjectName mService; ! ! ! /** ! * Create a new dialog. ! * ! * @param pConnector Connector to the remote MBean Server ! * @param pService Remote Service Bean on which the method should be invoked ! * @param pOperation Operation to be invoked if accepted ! * @param pOwner Owner of the dialog controlling its appearance ! */ ! public GenericMBeanMethodDialog(MBeanAccessor pConnector, ObjectName pService, MBeanOperationInfo pOperation, Frame pOwner) ! { ! super(pOwner, true); ! ! // Check the parameters ! if (pConnector == null) ! { ! throw new IllegalArgumentException("MBeanAccessor must be defined"); ! } ! if (pService == null) ! { ! throw new IllegalArgumentException("Service must be defined"); ! } ! if (pOperation == null) ! { ! throw new IllegalArgumentException("Operation must be defined"); ! } ! mConnector = pConnector; ! mService = pService; ! mOperation = pOperation; ! ! JPanel con = (JPanel) getContentPane(); ! con.setLayout(new GridBagLayout()); ! ! try ! { ! GridBagConstraints c = new GridBagConstraints(); ! c.insets = new Insets(3, 3, 3, 3); ! c.anchor = GridBagConstraints.NORTH; ! c.weighty = 1; ! ! // Header ! JLabel lName = new JLabel(mOperation.getName()); ! c.gridwidth = GridBagConstraints.REMAINDER; ! con.add(lName, c); ! ! // Parameters ! Iterator i = Arrays.asList(mOperation.getSignature()).iterator(); ! while (i.hasNext()) ! { ! MBeanParameterInfo lParameter = (MBeanParameterInfo) i.next(); ! Class cl = ClassTools.getClass(lParameter.getType()); ! ! lName = new JLabel(lParameter.getName() + ":", SwingConstants.RIGHT); ! c.gridwidth = GridBagConstraints.RELATIVE; ! c.fill = GridBagConstraints.NONE; ! c.weightx = 0; ! con.add(lName, c); ! ! if (cl != null) ! { ! PropertyEditor lEditor = PropertyEditorManager.findEditor(cl); ! if (lEditor != null) ! { ! // Set initial value ! if (lEditor.getTags() != null) ! { ! // Set to first value ! lEditor.setAsText(lEditor.getTags()[0]); ! } ! ! Component lEditorComp; ! if (lEditor.supportsCustomEditor()) ! { ! lEditorComp = lEditor.getCustomEditor(); ! } ! else ! { ! String[] lTags = lEditor.getTags(); ! if (lTags != null) ! { ! lEditorComp = new GenericPropertyCustomizer(lEditor, lTags); ! } ! else ! { ! lEditorComp = new GenericPropertyCustomizer(lEditor); ! } ! } ! ! c.gridwidth = GridBagConstraints.REMAINDER; ! c.fill = GridBagConstraints.HORIZONTAL; ! c.weightx = 1; ! con.add(lEditorComp, c); ! ! mEditors.addElement(new Editor(lEditor, lParameter.getType())); ! } ! } ! else ! { ! Component lEditorComp; ! lEditorComp = new JLabel("Unsupported class " + lParameter.getType()); ! ! c.gridwidth = GridBagConstraints.REMAINDER; ! c.fill = GridBagConstraints.HORIZONTAL; ! c.weightx = 1; ! con.add(lEditorComp, c); ! } ! c.weighty = 1; ! } ! ! // Button ! c.gridwidth = GridBagConstraints.REMAINDER; ! JPanel p = new JPanel(); ! JButton ok = new JButton("Invoke"); ! p.add(ok); ! ok.addActionListener(this); ! JButton cancel = new JButton("Cancel"); ! p.add(cancel); ! cancel.addActionListener(this); ! con.add(p, c); ! ! pack(); ! if (getWidth() < 300) ! { ! setSize(new Dimension(300, getHeight())); ! } ! setLocationRelativeTo(pOwner); ! setVisible(true); ! } ! catch (Exception e) ! { ! System.out.println("Exception occurred"); ! e.printStackTrace(); ! } ! } ! ! ! // Public -------------------------------------------------------- ! ! // ActionListener implementation --------------------------------- ! /** ! * Ok or Cancel has been pressed. ! * ! * @param e the event ! */ ! public void actionPerformed(ActionEvent e) ! { ! if (e.getActionCommand().equals("Ok")) ! { ! Object[] params = new Object[mEditors.size()]; ! String[] lTypes = new String[mEditors.size()]; ! Iterator i = mEditors.iterator(); ! int j = 0; ! while (i.hasNext()) ! { ! Editor lEditor = (Editor) i.next(); ! params[j] = lEditor.getEditor().getValue(); ! lTypes[j] = lEditor.getType(); ! j++; ! } ! ! try ! { ! Object lReturn = mConnector.invoke( ! mOperation.getName(), ! params, ! lTypes ! ); ! if (lReturn != null) ! { ! JOptionPane.showMessageDialog( ! this, ! lReturn.toString(), ! "Result", ! JOptionPane.INFORMATION_MESSAGE ! ); ! } ! } ! catch (Exception ex) ! { ! System.err.println(ex); ! JOptionPane.showMessageDialog( ! this, ! "An exception occured. Check log for details", ! "Error", ! JOptionPane.ERROR_MESSAGE ! ); ! } ! } ! setVisible(false); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 7 f?vrier 2002 ! */ ! private class Editor ! { ! /** Description of the Field */ ! private PropertyEditor mEditor; ! /** Description of the Field */ ! private String mType; ! ! ! /** ! * Constructor for the Editor object ! * ! * @param pEditor Description of Parameter ! * @param pType Description of Parameter ! */ ! public Editor(PropertyEditor pEditor, String pType) ! { ! mEditor = pEditor; ! mType = pType; ! } ! ! ! /** ! * Getter for the editor attribute ! * ! * @return The value of editor attribute ! */ ! public PropertyEditor getEditor() ! { ! return mEditor; ! } ! ! ! /** ! * Getter for the type attribute ! * ! * @return The value of type attribute ! */ ! public String getType() ! { ! return mType; ! } ! } ! } ! --- 1,297 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Component; ! import java.awt.Dimension; ! import java.awt.Frame; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.beans.PropertyEditor; ! import java.beans.PropertyEditorManager; ! import java.util.Arrays; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.management.MBeanOperationInfo; ! import javax.management.MBeanParameterInfo; ! import javax.management.ObjectName; ! import javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.ejtools.jmx.MBeanAccessor; ! import org.ejtools.util.ClassTools; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class GenericMBeanMethodDialog extends JDialog implements ActionListener ! { ! /** Description of the Field */ ! private MBeanAccessor mConnector; ! ! /** Description of the Field */ ! private Vector mEditors = new Vector(); ! /** Description of the Field */ ! private MBeanOperationInfo mOperation; ! /** Description of the Field */ ! private ObjectName mService; ! ! ! /** ! * Create a new dialog. ! * ! * @param pConnector Connector to the remote MBean Server ! * @param pService Remote Service Bean on which the method should be invoked ! * @param pOperation Operation to be invoked if accepted ! * @param pOwner Owner of the dialog controlling its appearance ! */ ! public GenericMBeanMethodDialog(MBeanAccessor pConnector, ObjectName pService, MBeanOperationInfo pOperation, Frame pOwner) ! { ! super(pOwner, true); ! ! // Check the parameters ! if (pConnector == null) ! { ! throw new IllegalArgumentException("MBeanAccessor must be defined"); ! } ! if (pService == null) ! { ! throw new IllegalArgumentException("Service must be defined"); ! } ! if (pOperation == null) ! { ! throw new IllegalArgumentException("Operation must be defined"); ! } ! mConnector = pConnector; ! mService = pService; ! mOperation = pOperation; ! ! JPanel con = (JPanel) getContentPane(); ! con.setLayout(new GridBagLayout()); ! ! try ! { ! GridBagConstraints c = new GridBagConstraints(); ! c.insets = new Insets(3, 3, 3, 3); ! c.anchor = GridBagConstraints.NORTH; ! c.weighty = 1; ! ! // Header ! JLabel lName = new JLabel(mOperation.getName()); ! c.gridwidth = GridBagConstraints.REMAINDER; ! con.add(lName, c); ! ! // Parameters ! Iterator i = Arrays.asList(mOperation.getSignature()).iterator(); ! while (i.hasNext()) ! { ! MBeanParameterInfo lParameter = (MBeanParameterInfo) i.next(); ! Class cl = ClassTools.getClass(lParameter.getType()); ! ! lName = new JLabel(lParameter.getName() + ":", SwingConstants.RIGHT); ! c.gridwidth = GridBagConstraints.RELATIVE; ! c.fill = GridBagConstraints.NONE; ! c.weightx = 0; ! con.add(lName, c); ! ! if (cl != null) ! { ! PropertyEditor lEditor = PropertyEditorManager.findEditor(cl); ! if (lEditor != null) ! { ! // Set initial value ! if (lEditor.getTags() != null) ! { ! // Set to first value ! lEditor.setAsText(lEditor.getTags()[0]); ! } ! ! Component lEditorComp; ! if (lEditor.supportsCustomEditor()) ! { ! lEditorComp = lEditor.getCustomEditor(); ! } ! else ! { ! String[] lTags = lEditor.getTags(); ! if (lTags != null) ! { ! lEditorComp = new GenericPropertyCustomizer(lEditor, lTags); ! } ! else ! { ! lEditorComp = new GenericPropertyCustomizer(lEditor); ! } ! } ! ! c.gridwidth = GridBagConstraints.REMAINDER; ! c.fill = GridBagConstraints.HORIZONTAL; ! c.weightx = 1; ! con.add(lEditorComp, c); ! ! mEditors.addElement(new Editor(lEditor, lParameter.getType())); ! } ! } ! else ! { ! Component lEditorComp; ! lEditorComp = new JLabel("Unsupported class " + lParameter.getType()); ! ! c.gridwidth = GridBagConstraints.REMAINDER; ! c.fill = GridBagConstraints.HORIZONTAL; ! c.weightx = 1; ! con.add(lEditorComp, c); ! } ! c.weighty = 1; ! } ! ! // Button ! c.gridwidth = GridBagConstraints.REMAINDER; ! JPanel p = new JPanel(); ! JButton ok = new JButton("Invoke"); ! p.add(ok); ! ok.addActionListener(this); ! JButton cancel = new JButton("Cancel"); ! p.add(cancel); ! cancel.addActionListener(this); ! con.add(p, c); ! ! pack(); ! if (getWidth() < 300) ! { ! setSize(new Dimension(300, getHeight())); ! } ! setLocationRelativeTo(pOwner); ! setVisible(true); ! } ! catch (Exception e) ! { ! System.out.println("Exception occurred"); ! e.printStackTrace(); ! } ! } ! ! ! // Public -------------------------------------------------------- ! ! // ActionListener implementation --------------------------------- ! /** ! * Ok or Cancel has been pressed. ! * ! * @param e the event ! */ ! public void actionPerformed(ActionEvent e) ! { ! if (e.getActionCommand().equals("Ok")) ! { ! Object[] params = new Object[mEditors.size()]; ! String[] lTypes = new String[mEditors.size()]; ! Iterator i = mEditors.iterator(); ! int j = 0; ! while (i.hasNext()) ! { ! Editor lEditor = (Editor) i.next(); ! params[j] = lEditor.getEditor().getValue(); ! lTypes[j] = lEditor.getType(); ! j++; ! } ! ! try ! { ! Object lReturn = mConnector.invoke( ! mOperation.getName(), ! params, ! lTypes ! ); ! if (lReturn != null) ! { ! JOptionPane.showMessageDialog( ! this, ! lReturn.toString(), ! "Result", ! JOptionPane.INFORMATION_MESSAGE ! ); ! } ! } ! catch (Exception ex) ! { ! System.err.println(ex); ! JOptionPane.showMessageDialog( ! this, ! "An exception occured. Check log for details", ! "Error", ! JOptionPane.ERROR_MESSAGE ! ); ! } ! } ! setVisible(false); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! private class Editor ! { ! /** Description of the Field */ ! private PropertyEditor mEditor; ! /** Description of the Field */ ! private String mType; ! ! ! /** ! * Constructor for the Editor object ! * ! * @param pEditor Description of Parameter ! * @param pType Description of Parameter ! */ ! public Editor(PropertyEditor pEditor, String pType) ! { ! mEditor = pEditor; ! mType = pType; ! } ! ! ! /** ! * Getter for the editor attribute ! * ! * @return The value of editor attribute ! */ ! public PropertyEditor getEditor() ! { ! return mEditor; ! } ! ! ! /** ! * Getter for the type attribute ! * ! * @return The value of type attribute ! */ ! public String getType() ! { ! return mType; ! } ! } ! } ! Index: SimpleCustomizer.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/SimpleCustomizer.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** SimpleCustomizer.java 15 Sep 2003 22:37:12 -0000 1.9 --- SimpleCustomizer.java 27 Nov 2003 00:51:44 -0000 1.10 *************** *** 1,620 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt; ! ! import java.awt.Color; ! import java.awt.Component; [...1208 lines suppressed...] ! } ! catch (InvocationTargetException invocationtargetexception) ! { ! invocationtargetexception.getTargetException().printStackTrace(); ! JOptionPane.showMessageDialog(((Component) (obj)), invocationtargetexception.getTargetException().getMessage(), "Error", 0); ! } ! catch (Exception exception) ! { ! System.err.println(exception); ! JOptionPane.showMessageDialog(((Component) (obj)), "An exception occured. Check log for details", "Error", 0); ! } ! } ! else ! { ! new GenericMethodDialog(object, this.methodDescriptor, (Frame) obj); ! } ! } ! } ! } ! |
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/main/org/ejtools/adwt/service Modified Files: HistoryService.java HistoryServiceProvider.java MDIDesktopPane.java MenuBarService.java ToolBarServiceProvider.java Log Message: Address Todo #755528 Remove @created tags Index: HistoryService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/HistoryService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HistoryService.java 15 Sep 2003 22:37:14 -0000 1.4 --- HistoryService.java 27 Nov 2003 00:51:45 -0000 1.5 *************** *** 1,46 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.net.URL; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface HistoryService ! { ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void push(URL url, Object context); ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 7 novembre 2001 ! */ ! public interface Holder ! { ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void loadResource(URL url, Object context); ! } ! } --- 1,45 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.net.URL; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface HistoryService ! { ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void push(URL url, Object context); ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! public interface Holder ! { ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void loadResource(URL url, Object context); ! } ! } Index: HistoryServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/HistoryServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HistoryServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- HistoryServiceProvider.java 27 Nov 2003 00:51:45 -0000 1.5 *************** *** 1,272 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.net.URL; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.Action; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.adwt.action.file.FileHistoryAction; ! import org.ejtools.adwt.action.file.FileHistoryActionTop; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.util.KeyLimitedStack; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class HistoryServiceProvider extends CustomBeanContextServiceProvider implements HistoryService ! { ! /** Description of the Field */ ! protected HistoryService.Holder holder = null; ! /** Description of the Field */ ! protected int maxHistory; ! /** Description of the Field */ ! protected Vector menus = null; ! /** Description of the Field */ ! protected HistoryService service = null; ! /** Description of the Field */ ! protected KeyLimitedStack stack = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(HistoryServiceProvider.class); ! /** Description of the Field */ ! protected final static int MAX_WIDTH = 30; ! ! ! /** ! * Constructor for the HistoryServiceProvider object ! * ! * @param maxHistory Description of Parameter ! * @param holder Description of Parameter ! */ ! public HistoryServiceProvider(HistoryService.Holder holder, int maxHistory) ! { ! this.service = this; ! this.holder = holder; ! this.maxHistory = maxHistory; ! this.stack = new KeyLimitedStack(maxHistory); ! this.menus = new Vector(maxHistory); ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the HistoryServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return new Vector().iterator(); ! } ! ! ! /** ! * Gets the service attribute of the HistoryServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void push(URL url, Object context) ! { ! this.stack.push(new HistoryContext(url, context)); ! ! for (int i = 0; i < stack.size(); i++) ! { ! HistoryContext hc = (HistoryContext) this.stack.elementAt(i); ! URL theUrl = hc.getURL(); ! String s = theUrl.toString(); ! ! if (s.length() > MAX_WIDTH) ! { ! s = "" + (i + 1) + ": " + theUrl.getProtocol() + "..." + s.substring(s.length() - 25); ! } ! else ! { ! s = "" + (i + 1) + ": " + theUrl.toString(); ! } ! ! CommandAction action = (CommandAction) menus.elementAt(i); ! action.putValue(Action.NAME, s); ! action.setEnabled(true); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{HistoryService.class}; ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! CommandAction action; ! ! for (int i = 0; i < this.maxHistory; i++) ! { ! if (i == 0) ! { ! action = new FileHistoryActionTop( ! new FileHistoryCommand(i) ! ); ! } ! else ! { ! action = new FileHistoryAction( ! new FileHistoryCommand(i) ! ); ! } ! action.setEnabled(false); ! menus.add(action); ! this.add(action); ! } ! ! logger.debug("HistoryService added"); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 7 novembre 2001 ! */ ! private class FileHistoryCommand implements Command ! { ! /** Description of the Field */ ! private int position; ! ! ! /** ! * Constructor for the FileHistoryCommand object ! * ! * @param position Description of Parameter ! */ ! public FileHistoryCommand(int position) ! { ! this.position = position; ! } ! ! ! /** Description of the Method */ ! public void execute() ! { ! HistoryContext hc = (HistoryContext) HistoryServiceProvider.this.stack.elementAt(position); ! logger.info("Loading " + hc.getURL()); ! HistoryServiceProvider.this.holder.loadResource(hc.getURL(), hc.getContext()); ! } ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 7 novembre 2001 ! */ ! private class HistoryContext ! { ! /** Description of the Field */ ! private Object context; ! /** Description of the Field */ ! private URL url; ! ! ! /** ! * Constructor for the HistoryContext object ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public HistoryContext(URL url, Object context) ! { ! this.url = url; ! this.context = context; ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of Parameter ! * @return Description of the Returned Value ! */ ! public boolean equals(Object o) ! { ! logger.debug("Object to test " + ((HistoryContext) o).getURL().toString()); ! logger.debug("The URL " + this.url.toString()); ! return ((HistoryContext) o).getURL().equals(this.url); ! } ! ! ! /** ! * Gets the context attribute of the HistoryContext object ! * ! * @return The context value ! */ ! public Object getContext() ! { ! return this.context; ! } ! ! ! /** ! * Gets the uRL attribute of the HistoryContext object ! * ! * @return The uRL value ! */ ! public URL getURL() ! { ! return this.url; ! } ! } ! } ! --- 1,270 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.beans.beancontext.BeanContextServices; ! import java.net.URL; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.Action; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.Command; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.adwt.action.file.FileHistoryAction; ! import org.ejtools.adwt.action.file.FileHistoryActionTop; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! import org.ejtools.util.KeyLimitedStack; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class HistoryServiceProvider extends CustomBeanContextServiceProvider implements HistoryService ! { ! /** Description of the Field */ ! protected HistoryService.Holder holder = null; ! /** Description of the Field */ ! protected int maxHistory; ! /** Description of the Field */ ! protected Vector menus = null; ! /** Description of the Field */ ! protected HistoryService service = null; ! /** Description of the Field */ ! protected KeyLimitedStack stack = null; ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(HistoryServiceProvider.class); ! /** Description of the Field */ ! protected final static int MAX_WIDTH = 30; ! ! ! /** ! * Constructor for the HistoryServiceProvider object ! * ! * @param maxHistory Description of Parameter ! * @param holder Description of Parameter ! */ ! public HistoryServiceProvider(HistoryService.Holder holder, int maxHistory) ! { ! this.service = this; ! this.holder = holder; ! this.maxHistory = maxHistory; ! this.stack = new KeyLimitedStack(maxHistory); ! this.menus = new Vector(maxHistory); ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the HistoryServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return new Vector().iterator(); ! } ! ! ! /** ! * Gets the service attribute of the HistoryServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public void push(URL url, Object context) ! { ! this.stack.push(new HistoryContext(url, context)); ! ! for (int i = 0; i < stack.size(); i++) ! { ! HistoryContext hc = (HistoryContext) this.stack.elementAt(i); ! URL theUrl = hc.getURL(); ! String s = theUrl.toString(); ! ! if (s.length() > MAX_WIDTH) ! { ! s = "" + (i + 1) + ": " + theUrl.getProtocol() + "..." + s.substring(s.length() - 25); ! } ! else ! { ! s = "" + (i + 1) + ": " + theUrl.toString(); ! } ! ! CommandAction action = (CommandAction) menus.elementAt(i); ! action.putValue(Action.NAME, s); ! action.setEnabled(true); ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{HistoryService.class}; ! } ! ! ! /** Description of the Method */ ! protected void initializeBeanContextResources() ! { ! super.initializeBeanContextResources(); ! ! CommandAction action; ! ! for (int i = 0; i < this.maxHistory; i++) ! { ! if (i == 0) ! { ! action = new FileHistoryActionTop( ! new FileHistoryCommand(i) ! ); ! } ! else ! { ! action = new FileHistoryAction( ! new FileHistoryCommand(i) ! ); ! } ! action.setEnabled(false); ! menus.add(action); ! this.add(action); ! } ! ! logger.debug("HistoryService added"); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! private class FileHistoryCommand implements Command ! { ! /** Description of the Field */ ! private int position; ! ! ! /** ! * Constructor for the FileHistoryCommand object ! * ! * @param position Description of Parameter ! */ ! public FileHistoryCommand(int position) ! { ! this.position = position; ! } ! ! ! /** Description of the Method */ ! public void execute() ! { ! HistoryContext hc = (HistoryContext) HistoryServiceProvider.this.stack.elementAt(position); ! logger.info("Loading " + hc.getURL()); ! HistoryServiceProvider.this.holder.loadResource(hc.getURL(), hc.getContext()); ! } ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! private class HistoryContext ! { ! /** Description of the Field */ ! private Object context; ! /** Description of the Field */ ! private URL url; ! ! ! /** ! * Constructor for the HistoryContext object ! * ! * @param url Description of Parameter ! * @param context Description of Parameter ! */ ! public HistoryContext(URL url, Object context) ! { ! this.url = url; ! this.context = context; ! } ! ! ! /** ! * Description of the Method ! * ! * @param o Description of Parameter ! * @return Description of the Returned Value ! */ ! public boolean equals(Object o) ! { ! logger.debug("Object to test " + ((HistoryContext) o).getURL().toString()); ! logger.debug("The URL " + this.url.toString()); ! return ((HistoryContext) o).getURL().equals(this.url); ! } ! ! ! /** ! * Gets the context attribute of the HistoryContext object ! * ! * @return The context value ! */ ! public Object getContext() ! { ! return this.context; ! } ! ! ! /** ! * Gets the uRL attribute of the HistoryContext object ! * ! * @return The uRL value ! */ ! public URL getURL() ! { ! return this.url; ! } ! } ! } ! Index: MDIDesktopPane.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/MDIDesktopPane.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MDIDesktopPane.java 15 Sep 2003 22:37:14 -0000 1.4 --- MDIDesktopPane.java 27 Nov 2003 00:51:45 -0000 1.5 *************** *** 1,574 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Component; ! import java.awt.Dimension; [...1115 lines suppressed...] ! ! int frameHeight = bounds.height / numRows; ! for (curRow = 0; curRow < numRows; curRow++) ! { ! while (frames[i].isIcon()) ! { ! // find the next visible frame ! i++; ! } ! ! frames[i].setBounds(curCol * frameWidth, curRow * frameHeight, frameWidth, frameHeight); ! i++; ! } ! } ! } ! } ! } ! ! } ! Index: MenuBarService.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/MenuBarService.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MenuBarService.java 15 Sep 2003 22:37:14 -0000 1.4 --- MenuBarService.java 27 Nov 2003 00:51:45 -0000 1.5 *************** *** 1,61 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import javax.swing.JMenuBar; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface MenuBarService extends ToolBarService ! { ! /** Description of the Field */ ! public final static int NO_LAYOUT = 0; ! /** Description of the Field */ ! public final static int SEPARATOR_BEFORE = 1; ! /** Description of the Field */ ! public final static int SEPARATOR_AFTER = 2; ! ! ! /** ! * Adds a feature to the MenuBarListener attribute of the MenuBarService object ! * ! * @param mbsl The feature to be added to the MenuBarListener attribute ! */ ! public void addMenuBarListener(MenuBarService.Listener mbsl); ! ! ! /** ! * Description of the Method ! * ! * @param mbsl Description of Parameter ! */ ! public void removeMenuBarListener(MenuBarService.Listener mbsl); ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 5 novembre 2001 ! */ ! public interface Listener ! { ! /** ! * Description of the Method ! * ! * @param menuBar Description of Parameter ! */ ! public void update(JMenuBar menuBar); ! } ! } ! --- 1,60 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import javax.swing.JMenuBar; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public interface MenuBarService extends ToolBarService ! { ! /** Description of the Field */ ! public final static int NO_LAYOUT = 0; ! /** Description of the Field */ ! public final static int SEPARATOR_BEFORE = 1; ! /** Description of the Field */ ! public final static int SEPARATOR_AFTER = 2; ! ! ! /** ! * Adds a feature to the MenuBarListener attribute of the MenuBarService object ! * ! * @param mbsl The feature to be added to the MenuBarListener attribute ! */ ! public void addMenuBarListener(MenuBarService.Listener mbsl); ! ! ! /** ! * Description of the Method ! * ! * @param mbsl Description of Parameter ! */ ! public void removeMenuBarListener(MenuBarService.Listener mbsl); ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! public interface Listener ! { ! /** ! * Description of the Method ! * ! * @param menuBar Description of Parameter ! */ ! public void update(JMenuBar menuBar); ! } ! } ! Index: ToolBarServiceProvider.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/service/ToolBarServiceProvider.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ToolBarServiceProvider.java 15 Sep 2003 22:37:14 -0000 1.4 --- ToolBarServiceProvider.java 27 Nov 2003 00:51:45 -0000 1.5 *************** *** 1,277 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Container; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.Action; ! import javax.swing.Icon; ! import javax.swing.JButton; ! import javax.swing.JToolBar; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ToolBarServiceProvider extends CustomBeanContextServiceProvider implements ToolBarService ! { ! /** Description of the Field */ ! private Hashtable bars = new Hashtable(); ! /** Description of the Field */ ! private boolean bigIcons = false; ! /** Description of the Field */ ! private ToolBarService service = null; ! /** Description of the Field */ ! private JToolBar toolBar = new JToolBar(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ToolBarServiceProvider.class); ! ! ! /** Constructor for the ToolBarServiceProvider object */ ! public ToolBarServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Gets the container attribute of the ToolBarServiceProvider object ! * ! * @return The container value ! */ ! public Container getContainer() ! { ! return this.toolBar; ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return new Vector().iterator(); ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void register(CommandAction action) ! { ! String menu = action.getMenu(); ! JToolBarWrapper bar = (JToolBarWrapper) this.bars.get(menu); ! ! if (bar == null) ! { ! bar = new JToolBarWrapper(); ! bar.setFloatable(false); ! ! this.bars.put(menu, bar); ! ! if (this.toolBar.getComponentCount() > 0) ! { ! this.toolBar.addSeparator(); ! } ! ! this.toolBar.add(bar); ! } ! ! JButton button = bar.add(action); ! ! Object o = null; ! if (this.bigIcons) ! { ! o = action.getValue(CommandAction.ICON); ! } ! else ! { ! o = action.getValue(Action.SMALL_ICON); ! } ! if (o != null) ! { ! button.setIcon((Icon) o); ! } ! if (action.getValue(CommandAction.TOOLTIP) != null) ! { ! button.setToolTipText((String) action.getValue(CommandAction.TOOLTIP)); ! } ! ! toolBar.validate(); ! logger.debug("Button registered"); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * Sets the bigIcons. ! * ! * @param bigIcons The bigIcons to set ! */ ! public void setBigIcons(boolean bigIcons) ! { ! if (this.bars.size() > 0) ! { ! throw new IllegalStateException("Cannot change icon size if buttons are registered"); ! } ! this.bigIcons = bigIcons; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void unregister(CommandAction action) ! { ! String menu = action.getMenu(); ! JToolBarWrapper bar = (JToolBarWrapper) this.bars.get(menu); ! ! if (bar == null) ! { ! return; ! } ! ! bar.remove(action); ! toolBar.validate(); ! logger.debug("Button unregistered"); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ToolBarService.class}; ! } ! ! ! /** ! * Description of the Class ! * ! * @author laurent ! * @version $Revision$ ! * @created 29 d?cembre 2001 ! */ ! protected class JToolBarWrapper extends JToolBar ! { ! /** Description of the Field */ ! protected Hashtable buttons = new Hashtable(); ! ! ! /** Constructor for JToolBarWrapper. */ ! public JToolBarWrapper() ! { ! super(); ! this.setBorder(null); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param orientation ! */ ! public JToolBarWrapper(int orientation) ! { ! super(orientation); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param name ! */ ! public JToolBarWrapper(String name) ! { ! super(name); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param name ! * @param orientation ! */ ! public JToolBarWrapper(String name, int orientation) ! { ! super(name, orientation); ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! * @return Description of the Returned Value ! */ ! public JButton add(Action action) ! { ! JButton button = super.add(action); ! this.buttons.put(action, button); ! return button; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void remove(Action action) ! { ! JButton button = (JButton) this.buttons.get(action); ! this.remove(button); ! } ! } ! } ! --- 1,276 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.service; ! ! import java.awt.Container; ! import java.beans.beancontext.BeanContextServices; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Vector; ! ! import javax.swing.Action; ! import javax.swing.Icon; ! import javax.swing.JButton; ! import javax.swing.JToolBar; ! ! import org.apache.log4j.Logger; ! import org.ejtools.adwt.action.CommandAction; ! import org.ejtools.beans.beancontext.CustomBeanContextServiceProvider; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class ToolBarServiceProvider extends CustomBeanContextServiceProvider implements ToolBarService ! { ! /** Description of the Field */ ! private Hashtable bars = new Hashtable(); ! /** Description of the Field */ ! private boolean bigIcons = false; ! /** Description of the Field */ ! private ToolBarService service = null; ! /** Description of the Field */ ! private JToolBar toolBar = new JToolBar(); ! /** Description of the Field */ ! private static Logger logger = Logger.getLogger(ToolBarServiceProvider.class); ! ! ! /** Constructor for the ToolBarServiceProvider object */ ! public ToolBarServiceProvider() ! { ! this.service = this; ! } ! ! ! /** ! * Gets the container attribute of the ToolBarServiceProvider object ! * ! * @return The container value ! */ ! public Container getContainer() ! { ! return this.toolBar; ! } ! ! ! /** ! * Gets the currentServiceSelectors attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param serviceClass Description of Parameter ! * @return The currentServiceSelectors value ! */ ! public Iterator getCurrentServiceSelectors(BeanContextServices bcs, Class serviceClass) ! { ! return new Vector().iterator(); ! } ! ! ! /** ! * Gets the service attribute of the ApplicationServiceProvider object ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param serviceClass Description of Parameter ! * @param serviceSelector Description of Parameter ! * @return The service value ! */ ! public Object getService(BeanContextServices bcs, Object requestor, Class serviceClass, Object serviceSelector) ! { ! return service; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void register(CommandAction action) ! { ! String menu = action.getMenu(); ! JToolBarWrapper bar = (JToolBarWrapper) this.bars.get(menu); ! ! if (bar == null) ! { ! bar = new JToolBarWrapper(); ! bar.setFloatable(false); ! ! this.bars.put(menu, bar); ! ! if (this.toolBar.getComponentCount() > 0) ! { ! this.toolBar.addSeparator(); ! } ! ! this.toolBar.add(bar); ! } ! ! JButton button = bar.add(action); ! ! Object o = null; ! if (this.bigIcons) ! { ! o = action.getValue(CommandAction.ICON); ! } ! else ! { ! o = action.getValue(Action.SMALL_ICON); ! } ! if (o != null) ! { ! button.setIcon((Icon) o); ! } ! if (action.getValue(CommandAction.TOOLTIP) != null) ! { ! button.setToolTipText((String) action.getValue(CommandAction.TOOLTIP)); ! } ! ! toolBar.validate(); ! logger.debug("Button registered"); ! } ! ! ! /** ! * Description of the Method ! * ! * @param bcs Description of Parameter ! * @param requestor Description of Parameter ! * @param service Description of Parameter ! */ ! public void releaseService(BeanContextServices bcs, Object requestor, Object service) { } ! ! ! /** ! * Sets the bigIcons. ! * ! * @param bigIcons The bigIcons to set ! */ ! public void setBigIcons(boolean bigIcons) ! { ! if (this.bars.size() > 0) ! { ! throw new IllegalStateException("Cannot change icon size if buttons are registered"); ! } ! this.bigIcons = bigIcons; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void unregister(CommandAction action) ! { ! String menu = action.getMenu(); ! JToolBarWrapper bar = (JToolBarWrapper) this.bars.get(menu); ! ! if (bar == null) ! { ! return; ! } ! ! bar.remove(action); ! toolBar.validate(); ! logger.debug("Button unregistered"); ! } ! ! ! /** ! * @return The serviceClass value ! */ ! protected Class[] getServiceClass() ! { ! return new Class[]{ToolBarService.class}; ! } ! ! ! /** ! * Description of the Class ! * ! * @author laurent ! * @version $Revision$ ! */ ! protected class JToolBarWrapper extends JToolBar ! { ! /** Description of the Field */ ! protected Hashtable buttons = new Hashtable(); ! ! ! /** Constructor for JToolBarWrapper. */ ! public JToolBarWrapper() ! { ! super(); ! this.setBorder(null); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param orientation ! */ ! public JToolBarWrapper(int orientation) ! { ! super(orientation); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param name ! */ ! public JToolBarWrapper(String name) ! { ! super(name); ! } ! ! ! /** ! * Constructor for JToolBarWrapper. ! * ! * @param name ! * @param orientation ! */ ! public JToolBarWrapper(String name, int orientation) ! { ! super(name, orientation); ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! * @return Description of the Returned Value ! */ ! public JButton add(Action action) ! { ! JButton button = super.add(action); ! this.buttons.put(action, button); ! return button; ! } ! ! ! /** ! * Description of the Method ! * ! * @param action Description of Parameter ! */ ! public void remove(Action action) ! { ! JButton button = (JButton) this.buttons.get(action); ! this.remove(button); ! } ! } ! } ! |
From: <let...@us...> - 2003-11-27 00:51:50
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/jmx In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/main/org/ejtools/adwt/jmx Modified Files: MBeanMethodDialog.java Log Message: Address Todo #755528 Remove @created tags Index: MBeanMethodDialog.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/jmx/MBeanMethodDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MBeanMethodDialog.java 15 Sep 2003 22:37:13 -0000 1.2 --- MBeanMethodDialog.java 27 Nov 2003 00:51:45 -0000 1.3 *************** *** 1,277 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.jmx; ! ! import java.awt.Component; ! import java.awt.Dimension; ! import java.awt.Frame; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.beans.PropertyEditor; ! import java.util.Arrays; ! import java.util.Iterator; ! import java.util.ResourceBundle; ! import java.util.Vector; ! ! import javax.management.MBeanOperationInfo; ! import javax.management.MBeanParameterInfo; ! import javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.ejtools.beans.CustomPropertyEditorManager; ! import org.ejtools.jmx.MBeanInvokeAccessor; ! import org.ejtools.util.ClassTools; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class MBeanMethodDialog extends JDialog implements ActionListener ! { ! /** Description of the Field */ ! private Vector editors = new Vector(); ! /** Description of the Field */ ! private MBeanOperationInfo operationInfo = null; ! /** Description of the Field */ ! private MBeanInvokeAccessor resource = null; ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.jmx.Resources"); ! ! ! /** ! * Create a new dialog. ! * ! * @param resource Description of the Parameter ! * @param operationInfo Description of the Parameter ! * @param parent Description of the Parameter ! */ ! public MBeanMethodDialog(MBeanInvokeAccessor resource, MBeanOperationInfo operationInfo, Frame parent) ! { ! super(parent, true); ! this.setTitle(resources.getString("invoke.dialog.title")); ! ! // Check the parameters ! if (resource == null) ! { ! throw new IllegalArgumentException("MBeanAccessor must be defined"); ! } ! if (operationInfo == null) ! { ! throw new IllegalArgumentException("Operation must be defined"); ! } ! this.resource = resource; ! this.operationInfo = operationInfo; ! ! JPanel panel = (JPanel) this.getContentPane(); ! panel.setLayout(new GridBagLayout()); ! ! try ! { ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.insets = new Insets(2, 2, 2, 2); ! constraints.anchor = GridBagConstraints.NORTH; ! constraints.weighty = 1.0d; ! ! // Header ! StringBuffer display = new StringBuffer(); ! display.append(resources.getString("invoke.dialog.text.operation") + " : "); ! display.append(this.operationInfo.getName()); ! JLabel nameLabel = new JLabel(display.toString()); ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! panel.add(nameLabel, constraints); ! ! // Parameters ! Iterator i = Arrays.asList(this.operationInfo.getSignature()).iterator(); ! while (i.hasNext()) ! { ! MBeanParameterInfo parameter = (MBeanParameterInfo) i.next(); ! Class clazz = ClassTools.getClass(parameter.getType()); ! ! nameLabel = new JLabel(parameter.getName() + ":", SwingConstants.RIGHT); ! constraints.gridwidth = GridBagConstraints.RELATIVE; ! constraints.fill = GridBagConstraints.NONE; ! constraints.weightx = 0.0d; ! panel.add(nameLabel, constraints); ! ! PropertyEditor editor = null; ! if (clazz != null) ! { ! editor = CustomPropertyEditorManager.findEditor(clazz); ! if (editor != null) ! { ! // Set initial value ! if (editor.getTags() != null) ! { ! // Set to first value ! editor.setAsText(editor.getTags()[0]); ! } ! ! Component component; ! if (editor.supportsCustomEditor()) ! { ! component = editor.getCustomEditor(); ! } ! else ! { ! String[] lTags = editor.getTags(); ! if (lTags != null) ! { ! component = new GenericPropertyCustomizer(editor, lTags); ! } ! else ! { ! component = new GenericPropertyCustomizer(editor); ! } ! } ! ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 1.0d; ! panel.add(component, constraints); ! ! this.editors.addElement(new Editor(editor, parameter.getType())); ! } ! } ! if (editor == null) ! { ! Component component; ! component = new JLabel(resources.getString("invoke.dialog.text.unloadable.class") + " " + parameter.getType()); ! ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 1.0d; ! panel.add(component, constraints); ! } ! constraints.weighty = 1.0d; ! } ! ! // Button ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! JPanel buttons = new JPanel(); ! JButton invokeButton = new JButton(resources.getString("invoke.dialog.button.invoke")); ! invokeButton.setActionCommand("INVOKE"); ! buttons.add(invokeButton); ! invokeButton.addActionListener(this); ! JButton cancelButton = new JButton(resources.getString("invoke.dialog.button.cancel")); ! buttons.add(cancelButton); ! cancelButton.addActionListener(this); ! panel.add(buttons, constraints); ! ! if (this.editors.size() != this.operationInfo.getSignature().length) ! { ! invokeButton.setEnabled(false); ! } ! ! this.pack(); ! if (this.getWidth() < 300) ! { ! this.setSize(new Dimension(300, getHeight())); ! } ! this.setLocationRelativeTo(parent); ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! } ! ! ! /** ! * Ok or Cancel has been pressed. ! * ! * @param e the event ! */ ! public void actionPerformed(ActionEvent e) ! { ! if (e.getActionCommand().equals("INVOKE")) ! { ! Object[] parameters = new Object[this.editors.size()]; ! String[] types = new String[this.editors.size()]; ! int j = 0; ! for (Iterator i = this.editors.iterator(); i.hasNext(); j++) ! { ! Editor editor = (Editor) i.next(); ! parameters[j] = editor.getEditor().getValue(); ! types[j] = editor.getType(); ! } ! ! try ! { ! Object result = resource.invoke(this.operationInfo.getName(), parameters, types); ! } ! catch (Exception ex) ! { ! JOptionPane.showMessageDialog(this, resources.getString("invoke.dialog.text.error"), resources.getString("invoke.dialog.title.error"), JOptionPane.ERROR_MESSAGE); ! } ! } ! this.setVisible(false); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 7 f?vrier 2002 ! */ ! private class Editor ! { ! /** Description of the Field */ ! private PropertyEditor editor; ! /** Description of the Field */ ! private String type; ! ! ! /** ! * Constructor for the Editor object ! * ! * @param editor Description of the Parameter ! * @param type Description of the Parameter ! */ ! public Editor(PropertyEditor editor, String type) ! { ! this.editor = editor; ! this.type = type; ! } ! ! ! /** ! * Getter for the editor attribute ! * ! * @return The value of editor attribute ! */ ! public PropertyEditor getEditor() ! { ! return this.editor; ! } ! ! ! /** ! * Getter for the type attribute ! * ! * @return The value of type attribute ! */ ! public String getType() ! { ! return this.type; ! } ! } ! ! } ! --- 1,276 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.jmx; ! ! import java.awt.Component; ! import java.awt.Dimension; ! import java.awt.Frame; ! import java.awt.GridBagConstraints; ! import java.awt.GridBagLayout; ! import java.awt.Insets; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! import java.beans.PropertyEditor; ! import java.util.Arrays; ! import java.util.Iterator; ! import java.util.ResourceBundle; ! import java.util.Vector; ! ! import javax.management.MBeanOperationInfo; ! import javax.management.MBeanParameterInfo; ! import javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JLabel; ! import javax.swing.JOptionPane; ! import javax.swing.JPanel; ! import javax.swing.SwingConstants; ! ! import org.ejtools.beans.CustomPropertyEditorManager; ! import org.ejtools.jmx.MBeanInvokeAccessor; ! import org.ejtools.util.ClassTools; ! ! import com.dreambean.awt.GenericPropertyCustomizer; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! */ ! public class MBeanMethodDialog extends JDialog implements ActionListener ! { ! /** Description of the Field */ ! private Vector editors = new Vector(); ! /** Description of the Field */ ! private MBeanOperationInfo operationInfo = null; ! /** Description of the Field */ ! private MBeanInvokeAccessor resource = null; ! /** Description of the Field */ ! private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.jmx.Resources"); ! ! ! /** ! * Create a new dialog. ! * ! * @param resource Description of the Parameter ! * @param operationInfo Description of the Parameter ! * @param parent Description of the Parameter ! */ ! public MBeanMethodDialog(MBeanInvokeAccessor resource, MBeanOperationInfo operationInfo, Frame parent) ! { ! super(parent, true); ! this.setTitle(resources.getString("invoke.dialog.title")); ! ! // Check the parameters ! if (resource == null) ! { ! throw new IllegalArgumentException("MBeanAccessor must be defined"); ! } ! if (operationInfo == null) ! { ! throw new IllegalArgumentException("Operation must be defined"); ! } ! this.resource = resource; ! this.operationInfo = operationInfo; ! ! JPanel panel = (JPanel) this.getContentPane(); ! panel.setLayout(new GridBagLayout()); ! ! try ! { ! GridBagConstraints constraints = new GridBagConstraints(); ! constraints.insets = new Insets(2, 2, 2, 2); ! constraints.anchor = GridBagConstraints.NORTH; ! constraints.weighty = 1.0d; ! ! // Header ! StringBuffer display = new StringBuffer(); ! display.append(resources.getString("invoke.dialog.text.operation") + " : "); ! display.append(this.operationInfo.getName()); ! JLabel nameLabel = new JLabel(display.toString()); ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! panel.add(nameLabel, constraints); ! ! // Parameters ! Iterator i = Arrays.asList(this.operationInfo.getSignature()).iterator(); ! while (i.hasNext()) ! { ! MBeanParameterInfo parameter = (MBeanParameterInfo) i.next(); ! Class clazz = ClassTools.getClass(parameter.getType()); ! ! nameLabel = new JLabel(parameter.getName() + ":", SwingConstants.RIGHT); ! constraints.gridwidth = GridBagConstraints.RELATIVE; ! constraints.fill = GridBagConstraints.NONE; ! constraints.weightx = 0.0d; ! panel.add(nameLabel, constraints); ! ! PropertyEditor editor = null; ! if (clazz != null) ! { ! editor = CustomPropertyEditorManager.findEditor(clazz); ! if (editor != null) ! { ! // Set initial value ! if (editor.getTags() != null) ! { ! // Set to first value ! editor.setAsText(editor.getTags()[0]); ! } ! ! Component component; ! if (editor.supportsCustomEditor()) ! { ! component = editor.getCustomEditor(); ! } ! else ! { ! String[] lTags = editor.getTags(); ! if (lTags != null) ! { ! component = new GenericPropertyCustomizer(editor, lTags); ! } ! else ! { ! component = new GenericPropertyCustomizer(editor); ! } ! } ! ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 1.0d; ! panel.add(component, constraints); ! ! this.editors.addElement(new Editor(editor, parameter.getType())); ! } ! } ! if (editor == null) ! { ! Component component; ! component = new JLabel(resources.getString("invoke.dialog.text.unloadable.class") + " " + parameter.getType()); ! ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! constraints.fill = GridBagConstraints.HORIZONTAL; ! constraints.weightx = 1.0d; ! panel.add(component, constraints); ! } ! constraints.weighty = 1.0d; ! } ! ! // Button ! constraints.gridwidth = GridBagConstraints.REMAINDER; ! JPanel buttons = new JPanel(); ! JButton invokeButton = new JButton(resources.getString("invoke.dialog.button.invoke")); ! invokeButton.setActionCommand("INVOKE"); ! buttons.add(invokeButton); ! invokeButton.addActionListener(this); ! JButton cancelButton = new JButton(resources.getString("invoke.dialog.button.cancel")); ! buttons.add(cancelButton); ! cancelButton.addActionListener(this); ! panel.add(buttons, constraints); ! ! if (this.editors.size() != this.operationInfo.getSignature().length) ! { ! invokeButton.setEnabled(false); ! } ! ! this.pack(); ! if (this.getWidth() < 300) ! { ! this.setSize(new Dimension(300, getHeight())); ! } ! this.setLocationRelativeTo(parent); ! } ! catch (Exception e) ! { ! e.printStackTrace(); ! } ! } ! ! ! /** ! * Ok or Cancel has been pressed. ! * ! * @param e the event ! */ ! public void actionPerformed(ActionEvent e) ! { ! if (e.getActionCommand().equals("INVOKE")) ! { ! Object[] parameters = new Object[this.editors.size()]; ! String[] types = new String[this.editors.size()]; ! int j = 0; ! for (Iterator i = this.editors.iterator(); i.hasNext(); j++) ! { ! Editor editor = (Editor) i.next(); ! parameters[j] = editor.getEditor().getValue(); ! types[j] = editor.getType(); ! } ! ! try ! { ! Object result = resource.invoke(this.operationInfo.getName(), parameters, types); ! } ! catch (Exception ex) ! { ! JOptionPane.showMessageDialog(this, resources.getString("invoke.dialog.text.error"), resources.getString("invoke.dialog.title.error"), JOptionPane.ERROR_MESSAGE); ! } ! } ! this.setVisible(false); ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! private class Editor ! { ! /** Description of the Field */ ! private PropertyEditor editor; ! /** Description of the Field */ ! private String type; ! ! ! /** ! * Constructor for the Editor object ! * ! * @param editor Description of the Parameter ! * @param type Description of the Parameter ! */ ! public Editor(PropertyEditor editor, String type) ! { ! this.editor = editor; ! this.type = type; ! } ! ! ! /** ! * Getter for the editor attribute ! * ! * @return The value of editor attribute ! */ ! public PropertyEditor getEditor() ! { ! return this.editor; ! } ! ! ! /** ! * Getter for the type attribute ! * ! * @return The value of type attribute ! */ ! public String getType() ! { ! return this.type; ! } ! } ! ! } ! |
From: <let...@us...> - 2003-11-27 00:51:50
|
Update of /cvsroot/ejtools/libraries/adwt/src/resources/org/ejtools/adwt/action In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/resources/org/ejtools/adwt/action Modified Files: Resources.properties Resources_fr_FR.properties Log Message: Address Todo #755528 Remove @created tags Index: Resources.properties =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/resources/org/ejtools/adwt/action/Resources.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Resources.properties 15 Sep 2003 22:37:14 -0000 1.2 --- Resources.properties 27 Nov 2003 00:51:45 -0000 1.3 *************** *** 81,84 **** --- 81,97 ---- action.file.history=... + action.file.open.workspace=Open Workspace + action.file.open.workspace.accelerator=control O + action.file.open.workspace.mnemonic=79 + action.file.open.workspace.tooltip=Open an existing workspace + + action.file.save.workspace.as=Save Workspace As... + action.file.save.workspace.as.tooltip=Save the workspace as... + + action.file.save.workspace=Save Workspace + action.file.save.workspace.accelerator=control S + action.file.save.workspace.mnemonic=83 + action.file.save.workspace.tooltip=Save the workspace + action.file.exit=Quit action.file.exit.accelerator=control Q Index: Resources_fr_FR.properties =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/resources/org/ejtools/adwt/action/Resources_fr_FR.properties,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Resources_fr_FR.properties 15 Sep 2003 23:08:27 -0000 1.3 --- Resources_fr_FR.properties 27 Nov 2003 00:51:45 -0000 1.4 *************** *** 81,84 **** --- 81,97 ---- action.file.history=... + action.file.open.workspace=Ouvrir Configuration + action.file.open.workspace.accelerator=control O + action.file.open.workspace.mnemonic=79 + action.file.open.workspace.tooltip=Ouvrir une configuration existante + + action.file.save.workspace.as=Sauver Configuration sous... + action.file.save.workspace.as.tooltip=Sauver la configuration sous... + + action.file.save.workspace=Sauver Configuration + action.file.save.workspace.accelerator=control S + action.file.save.workspace.mnemonic=83 + action.file.save.workspace.tooltip=Sauver la configuration + action.file.exit=Quitter action.file.exit.mnemonic=81 |
From: <let...@us...> - 2003-11-27 00:51:50
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/main/org/ejtools/adwt/editor Modified Files: PropertiesEditor.java Log Message: Address Todo #755528 Remove @created tags Index: PropertiesEditor.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/editor/PropertiesEditor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PropertiesEditor.java 15 Sep 2003 22:37:13 -0000 1.4 --- PropertiesEditor.java 27 Nov 2003 00:51:44 -0000 1.5 *************** *** 1,108 **** ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.io.ByteArrayInputStream; ! import java.io.ByteArrayOutputStream; ! import java.io.IOException; ! import java.util.Properties; ! ! import javax.swing.JTextArea; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class PropertiesEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public PropertiesEditor() ! { ! this.value = new Properties(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); ! try ! { ! ((Properties) this.value).store(bytearrayoutputstream, ""); ! } ! catch (IOException ioe) ! { ! } ! return bytearrayoutputstream.toString(); ! } ! ! ! /** ! * Getter for the customEditor attribute ! * ! * @return The value of customEditor attribute ! */ ! public Component getCustomEditor() ! { ! return new PropertiesView(); ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! try ! { ! ((Properties) this.value).load(new ByteArrayInputStream(s.getBytes())); ! this.firePropertyChange(); ! } ! catch (IOException ioe) ! { ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! * @created 19 octobre 2001 ! */ ! protected class PropertiesView extends JTextArea ! { ! /** Constructor for the PropertiesView object */ ! public PropertiesView() ! { ! super(10, 40); ! this.setText(PropertiesEditor.this.getAsText()); ! } ! } ! } --- 1,107 ---- ! /* ! * EJTools, the Enterprise Java Tools ! * ! * Distributable under LGPL license. ! * See terms of license at www.gnu.org. ! */ ! package org.ejtools.adwt.editor; ! ! import java.awt.Component; ! import java.io.ByteArrayInputStream; ! import java.io.ByteArrayOutputStream; ! import java.io.IOException; ! import java.util.Properties; ! ! import javax.swing.JTextArea; ! ! /** ! * Description of the Class ! * ! * @author Laurent Etiemble ! * @version $Revision$ ! * @todo Javadoc to complete ! */ ! public class PropertiesEditor extends GenericEditor ! { ! /** Constructor for the PropertiesEditor object */ ! public PropertiesEditor() ! { ! this.value = new Properties(); ! } ! ! ! /** ! * Getter for the asText attribute ! * ! * @return The value of asText attribute ! */ ! public String getAsText() ! { ! ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); ! try ! { ! ((Properties) this.value).store(bytearrayoutputstream, ""); ! } ! catch (IOException ioe) ! { ! } ! return bytearrayoutputstream.toString(); ! } ! ! ! /** ! * Getter for the customEditor attribute ! * ! * @return The value of customEditor attribute ! */ ! public Component getCustomEditor() ! { ! return new PropertiesView(); ! } ! ! ! /** ! * Setter for the asText attribute ! * ! * @param s The new value for asText attribute ! */ ! public void setAsText(String s) ! { ! try ! { ! ((Properties) this.value).load(new ByteArrayInputStream(s.getBytes())); ! this.firePropertyChange(); ! } ! catch (IOException ioe) ! { ! } ! } ! ! ! /** ! * Description of the Method ! * ! * @return Description of the Returned Value ! */ ! public boolean supportsCustomEditor() ! { ! return true; ! } ! ! ! /** ! * Description of the Class ! * ! * @author letiembl ! * @version $Revision$ ! */ ! protected class PropertiesView extends JTextArea ! { ! /** Constructor for the PropertiesView object */ ! public PropertiesView() ! { ! super(10, 40); ! this.setText(PropertiesEditor.this.getAsText()); ! } ! } ! } |
From: <let...@us...> - 2003-11-27 00:51:49
|
Update of /cvsroot/ejtools/libraries/adwt/src/main/org/ejtools/adwt/action/file In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/main/org/ejtools/adwt/action/file Added Files: OpenWorkspaceAction.java SaveAsWorkspaceAction.java SaveWorkspaceAction.java Log Message: Address Todo #755528 Remove @created tags --- NEW FILE: OpenWorkspaceAction.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.adwt.action.file; import java.util.ResourceBundle; import org.ejtools.adwt.action.Command; import org.ejtools.adwt.action.CommandAction; /** * Description of the Class * * @author letiemble * @version $Revision: 1.1 $ * @todo Javadoc to complete */ public class OpenWorkspaceAction extends CommandAction { /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); /** * Constructor for the CopyAction object * * @param command Description of Parameter */ public OpenWorkspaceAction(Command command) { super(command, resources, "action.file.open.workspace"); this.setMenu("action.file"); this.setToolBar(true); this.setSmallIcon("/toolbarButtonGraphics/general/Open16.gif"); this.setIcon("/toolbarButtonGraphics/general/Open24.gif"); } } --- NEW FILE: SaveAsWorkspaceAction.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.adwt.action.file; import java.util.ResourceBundle; import org.ejtools.adwt.action.Command; import org.ejtools.adwt.action.CommandAction; /** * Description of the Class * * @author letiemble * @version $Revision: 1.1 $ * @todo Javadoc to complete */ public class SaveAsWorkspaceAction extends CommandAction { /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); /** * Constructor for the CopyAction object * * @param command Description of Parameter */ public SaveAsWorkspaceAction(Command command) { super(command, resources, "action.file.save.workspace.as"); this.setMenu("action.file"); } } --- NEW FILE: SaveWorkspaceAction.java --- /* * EJTools, the Enterprise Java Tools * * Distributable under LGPL license. * See terms of license at www.gnu.org. */ package org.ejtools.adwt.action.file; import java.util.ResourceBundle; import org.ejtools.adwt.action.Command; import org.ejtools.adwt.action.CommandAction; /** * Description of the Class * * @author letiemble * @version $Revision: 1.1 $ * @todo Javadoc to complete */ public class SaveWorkspaceAction extends CommandAction { /** Description of the Field */ private static ResourceBundle resources = ResourceBundle.getBundle("org.ejtools.adwt.action.Resources"); /** * Constructor for the CopyAction object * * @param command Description of Parameter */ public SaveWorkspaceAction(Command command) { super(command, resources, "action.file.save.workspace"); this.setMenu("action.file"); this.setToolBar(true); this.setSmallIcon("/toolbarButtonGraphics/general/Save16.gif"); this.setIcon("/toolbarButtonGraphics/general/Save24.gif"); } } |
From: <let...@us...> - 2003-11-27 00:51:49
|
Update of /cvsroot/ejtools/libraries/adwt/src/test/test/adwt/action In directory sc8-pr-cvs1:/tmp/cvs-serv8980/adwt/src/test/test/adwt/action Modified Files: ActionTest.java Log Message: Address Todo #755528 Remove @created tags Index: ActionTest.java =================================================================== RCS file: /cvsroot/ejtools/libraries/adwt/src/test/test/adwt/action/ActionTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ActionTest.java 15 Sep 2003 22:37:15 -0000 1.2 --- ActionTest.java 27 Nov 2003 00:51:45 -0000 1.3 *************** *** 21,27 **** --- 21,30 ---- import org.ejtools.adwt.action.file.NewAction; import org.ejtools.adwt.action.file.OpenAction; + import org.ejtools.adwt.action.file.OpenWorkspaceAction; import org.ejtools.adwt.action.file.PrintAction; import org.ejtools.adwt.action.file.SaveAction; import org.ejtools.adwt.action.file.SaveAsAction; + import org.ejtools.adwt.action.file.SaveAsWorkspaceAction; + import org.ejtools.adwt.action.file.SaveWorkspaceAction; import org.ejtools.adwt.action.help.AboutAction; import org.ejtools.adwt.action.help.HelpOnLineAction; *************** *** 107,110 **** --- 110,119 ---- assertNotNull("Action must be not null", action); action = new SaveAsAction(command); + assertNotNull("Action must be not null", action); + action = new OpenWorkspaceAction(command); + assertNotNull("Action must be not null", action); + action = new SaveWorkspaceAction(command); + assertNotNull("Action must be not null", action); + action = new SaveAsWorkspaceAction(command); assertNotNull("Action must be not null", action); |