KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > registry > convertors > TestBean


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

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