1 19 20 package org.netbeans.core.registry.convertors; 21 22 import java.beans.PropertyChangeListener ; 23 import java.beans.PropertyChangeSupport ; 24 25 public class TestBean { 26 27 private PropertyChangeSupport propertySupport; 28 29 private String prop1 = "initial1"; 30 31 private String prop2 = "initial2"; 32 33 public TestBean() { 34 propertySupport = new PropertyChangeSupport (this); 35 } 36 37 public void addPropertyChangeListener(PropertyChangeListener listener) { 38 propertySupport.addPropertyChangeListener(listener); 39 } 40 41 public void removePropertyChangeListener(PropertyChangeListener listener) { 42 propertySupport.removePropertyChangeListener(listener); 43 } 44 45 public String getProp1() { 46 return prop1; 47 } 48 49 public void setProp1(String value) { 50 String oldProp1 = prop1; 51 prop1 = value; 52 propertySupport.firePropertyChange("prop1", oldProp1, prop1); 53 } 54 55 public String getProp2() { 56 return prop2; 57 } 58 59 public void setProp2(String value) { 60 String oldProp2 = prop2; 61 prop2 = value; 62 propertySupport.firePropertyChange("prop2", oldProp2, prop2); 63 } 64 65 } 66 | Popular Tags |