[Ejtools-cvs] CVS: applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Node.j
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-22 18:00:31
|
Update of /cvsroot/ejtools/applications/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model In directory usw-pr-cvs1:/tmp/cvs-serv29989/jmx.browser/src/main/net/sourceforge/ejtools/jmxbrowser/model Added Files: Node.java Log Message: Initial Import --- NEW FILE: Node.java --- package net.sourceforge.ejtools.jmxbrowser.model; import java.awt.*; import java.beans.*; import java.beans.beancontext.*; import java.util.*; import javax.naming.*; import javax.swing.*; import net.sourceforge.ejtools.awt.*; import net.sourceforge.ejtools.xml.*; import net.sourceforge.ejtools.util.*; /** * Description of the Class * * @author letiembl * @created 13 décembre 2001 */ public abstract class Node extends BeanContextServicesSupport implements BeanContextChildComponentProxy,XmlIconable { /** Description of the Field */ protected transient Customizer c = null; /** Description of the Field */ protected String className = "<undefined>"; /** Description of the Field */ protected String name = "<undefined>"; /** Constructor for the Node object */ public Node() { super(); } public String getSmallIcon(){ return null; } public String getBigIcon(){ return null; } /** * Getter for the className attribute * * @return The value */ public String getClassName() { return this.className; } /** * Gets the component attribute of the Node object * * @return The component value */ public Component getComponent() { if (c == null) { c = new GenericCustomizer(true, this); } return (Component) c; } /** * Gets the name attribute of the Node object * * @return The name value */ public String getName() { return this.name; } /** * Getter for the service attribute * * @param child Description of Parameter * @param requestor Description of Parameter * @param serviceClass Description of Parameter * @param serviceSelector Description of Parameter * @param bcsrl Description of Parameter * @return The value * @exception TooManyListenersException Description of Exception */ public Object getService(BeanContextChild child, Object requestor, Class serviceClass, Object serviceSelector, BeanContextServiceRevokedListener bcsrl) throws TooManyListenersException { Object service = super.getService(child, requestor, serviceClass, serviceSelector, bcsrl); // If the service requested is not provided by this BeanContext, try the parent if (service == null) { BeanContextServices bcs = null; try { bcs = (BeanContextServices) getBeanContext(); } catch (ClassCastException cce) { return null; } return bcs.getService(this, requestor, serviceClass, serviceSelector, bcsrl); } return service; } /** * Description of the Method * * @return Description of the Returned Value */ public Iterator iterator() { return Sort.sortByClassAndName(super.iterator()); } /** * Description of the Method * * @return Description of the Returned Value */ public String toString() { return (name == null || "".equals(name)) ? "Default" : name; } /** * Setter for the name attribute * * @param name The new value */ protected void setName(String name) { this.name = name; } } |