KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nqadmin > swingSet > formatting > helpers > SelectorElement


1 /* $Id: SelectorElement.java,v 1.4 2005/02/04 22:42:14 yoda2 Exp $
2  *
3  * Tab Spacing = 4
4  *
5  * Copyright (c) 2004-2005, The Pangburn Company, Prasanth R. Pasala and
6  * Diego Gil
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * Redistributions of source code must retain the above copyright notice, this
13  * list of conditions and the following disclaimer. Redistributions in binary
14  * form must reproduce the above copyright notice, this list of conditions and
15  * the following disclaimer in the documentation and/or other materials
16  * provided with the distribution. The names of its contributors may not be
17  * used to endorse or promote products derived from this software without
18  * specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  */

33
34 package com.nqadmin.swingSet.formatting.helpers;
35
36 /**
37  *
38  * @author dags
39  */

40 public class SelectorElement extends Object JavaDoc
41 {
42     
43     /**
44      * Holds value of property listValue.
45      */

46     private Object JavaDoc listValue;
47     
48     /**
49      * Utility field used by bound properties.
50      */

51     private java.beans.PropertyChangeSupport JavaDoc propertyChangeSupport = new java.beans.PropertyChangeSupport JavaDoc(this);
52     
53     /**
54      * Holds value of property dataValue.
55      */

56     private Object JavaDoc dataValue;
57     
58     public SelectorElement() {
59         
60     }
61     
62     public SelectorElement(Object JavaDoc bD, Object JavaDoc lD)
63     {
64         this.setDataValue(bD);
65         this.setListValue(lD);
66     }
67     
68     public String JavaDoc toString()
69     {
70         return listValue.toString().trim() + " (" + dataValue.toString().trim() + ")";
71     }
72     
73     /**
74      * Adds a PropertyChangeListener to the listener list.
75      * @param l The listener to add.
76      */

77     public void addPropertyChangeListener(java.beans.PropertyChangeListener JavaDoc l)
78     {
79         
80         propertyChangeSupport.addPropertyChangeListener(l);
81     }
82     
83     /**
84      * Removes a PropertyChangeListener from the listener list.
85      * @param l The listener to remove.
86      */

87     public void removePropertyChangeListener(java.beans.PropertyChangeListener JavaDoc l)
88     {
89         
90         propertyChangeSupport.removePropertyChangeListener(l);
91     }
92     
93     /**
94      * Getter for property listValue.
95      * @return Value of property listValue.
96      */

97     public Object JavaDoc getListValue()
98     
99     {
100         
101         return this.listValue;
102     }
103     
104     /**
105      * Setter for property listValue.
106      * @param listValue New value of property listValue.
107      */

108     public void setListValue(Object JavaDoc listValue)
109     {
110         
111         Object JavaDoc oldListValue = this.listValue;
112         this.listValue = listValue;
113         propertyChangeSupport.firePropertyChange("listValue", oldListValue, listValue);
114     }
115     
116     /**
117      * Getter for property dataValue.
118      * @return Value of property dataValue.
119      */

120     public Object JavaDoc getDataValue()
121     
122     {
123         
124         return this.dataValue;
125     }
126     
127     /**
128      * Setter for property dataValue.
129      * @param dataValue New value of property dataValue.
130      */

131     public void setDataValue(Object JavaDoc dataValue)
132     {
133         Object JavaDoc olddataValue = this.dataValue;
134         this.dataValue = dataValue;
135         propertyChangeSupport.firePropertyChange("dataValue", olddataValue, dataValue);
136     }
137     
138     
139     
140 }
141
Popular Tags