1 19 22 23 package org.netbeans.modules.j2ee.sun.ws7.serverresources.beans; 24 25 import java.beans.*; 26 27 import org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.WS70Resources; 28 import org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.PropertyElement; 29 30 import org.netbeans.modules.j2ee.sun.ide.editors.NameValuePair; 31 32 33 37 public class WS70BaseResourceBean extends Object implements java.io.Serializable { 38 39 protected String name; 40 private String jndiName; 41 protected String description; 42 private String isEnabled; 43 protected NameValuePair[] extraParams; 44 45 transient protected PropertyChangeSupport propertySupport; 46 47 50 public WS70BaseResourceBean() { 51 propertySupport = new PropertyChangeSupport(this); 52 } 53 54 protected void initPropertyChangeSupport(){ 55 if(propertySupport==null) 56 propertySupport = new PropertyChangeSupport ( this ); 57 58 } 59 60 public void addPropertyChangeListener (PropertyChangeListener listener) { 61 initPropertyChangeSupport(); 62 propertySupport.addPropertyChangeListener (listener); 63 } 64 65 public void removePropertyChangeListener (PropertyChangeListener listener) { 66 initPropertyChangeSupport(); 67 propertySupport.removePropertyChangeListener (listener); 68 } 69 70 public String getName() { 71 return name; 72 } 73 public void setName(String value) { 74 String oldValue = name; 75 this.name = value; 76 initPropertyChangeSupport(); 77 propertySupport.firePropertyChange ("name", oldValue, name); } 79 public String getJndiName() { 80 return jndiName; 81 } 82 public void setJndiName(String value) { 83 String oldValue = jndiName; 84 this.jndiName = value; 85 initPropertyChangeSupport(); 86 propertySupport.firePropertyChange ("jndiName", oldValue, jndiName); } 88 public String getDescription() { 89 return description; 90 } 91 public void setDescription(String value) { 92 String oldValue = description; 93 this.description = value; 94 initPropertyChangeSupport(); 95 propertySupport.firePropertyChange ("description", oldValue, description); } 97 public String getIsEnabled() { 98 return isEnabled; 99 } 100 public void setIsEnabled(String value) { 101 String oldValue = isEnabled; 102 this.isEnabled = value; 103 initPropertyChangeSupport(); 104 propertySupport.firePropertyChange ("isEnabled", oldValue, isEnabled); } 106 public NameValuePair[] getExtraParams() { 107 if(this.extraParams == null) 108 this.extraParams = new NameValuePair[0]; 109 return this.extraParams; 110 } 111 public void setExtraParams(Object [] value) { 112 NameValuePair[] pairs = new NameValuePair[value.length]; 113 for (int i = 0; i < value.length; i++) { 114 NameValuePair val = (NameValuePair)value[i]; 115 NameValuePair pair = new NameValuePair(); 116 pair.setParamName(val.getParamName()); 117 pair.setParamValue(val.getParamValue()); 118 pairs[i] = pair; 120 } 121 NameValuePair[] oldValue = extraParams; 122 this.extraParams = pairs; 123 initPropertyChangeSupport(); 124 propertySupport.firePropertyChange ("extraParams", oldValue, extraParams); } 126 127 public WS70Resources getResourceGraph(){ 128 return org.netbeans.modules.j2ee.sun.ws7.serverresources.dd.impl.WS70Resources.createGraph(); 129 } 130 131 public PropertyElement populatePropertyElement(PropertyElement prop, NameValuePair pair){ 132 prop.setName(pair.getParamName()); 133 prop.setValue(pair.getParamValue()); 134 return prop; 135 } 136 } 137 | Popular Tags |