1 12 13 package org.ejtools.jmx.browser.model; 14 15 16 17 import java.awt.Component ; 18 19 import java.beans.Customizer ; 20 21 import java.beans.beancontext.BeanContextChildComponentProxy ; 22 23 import java.util.Iterator ; 24 25 26 27 import org.ejtools.adwt.GenericCustomizer; 28 29 import org.ejtools.beans.Sort; 30 31 import org.ejtools.beans.beancontext.CustomBeanContextServicesSupport; 32 33 34 35 50 51 public abstract class Node extends CustomBeanContextServicesSupport implements BeanContextChildComponentProxy 52 53 { 54 55 56 57 protected transient Customizer c = null; 58 59 60 61 protected String className = "<undefined>"; 62 63 64 65 protected String name = "<undefined>"; 66 67 68 69 70 71 72 73 public Node() 74 75 { 76 77 super(); 78 79 } 80 81 82 83 92 93 public String getClassName() 94 95 { 96 97 return this.className; 98 99 } 100 101 102 103 104 105 114 115 public Component getComponent() 116 117 { 118 119 if (c == null) 120 121 { 122 123 c = new GenericCustomizer(true, this); 124 125 } 126 127 return (Component ) c; 128 129 } 130 131 132 133 134 135 144 145 public String getName() 146 147 { 148 149 return this.name; 150 151 } 152 153 154 155 156 157 166 167 public Iterator iterator() 168 169 { 170 171 return Sort.sortByClassAndName(super.iterator()); 172 173 } 174 175 176 177 178 179 188 189 public String toString() 190 191 { 192 193 return (name == null || "".equals(name)) ? "Default" : name; 194 195 } 196 197 198 199 200 201 210 211 protected void setName(String name) 212 213 { 214 215 String old = this.name; 216 217 this.name = name; 218 219 this.firePropertyChange("name", old, this.name); 220 221 } 222 223 } 224 225 | Popular Tags |