01: /*******************************************************************************
02: * Copyright (c) 2007 Brad Reynolds and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Brad Reynolds - initial API and implementation
10: ******************************************************************************/package org.eclipse.core.tests.internal.databinding.internal.beans;
11:
12: import java.beans.PropertyChangeListener;
13: import java.beans.PropertyChangeSupport;
14: import java.util.ArrayList;
15: import java.util.List;
16: import java.util.Set;
17:
18: /**
19: * Simple non-standard (java.util.List-based property) Java Bean for testing.
20: *
21: * @since 3.3
22: */
23: public class NonStandardBean {
24: /* package */PropertyChangeSupport changeSupport = new PropertyChangeSupport(
25: this );
26: private String value;
27: private List list = new ArrayList();
28: private Set set;
29:
30: public NonStandardBean() {
31: }
32:
33: public NonStandardBean(String value) {
34: this .value = value;
35: }
36:
37: public NonStandardBean(List list) {
38: this .list = list;
39: }
40:
41: public NonStandardBean(Set set) {
42: this .set = set;
43: }
44:
45: public void addPropertyChangeListener(
46: PropertyChangeListener listener) {
47: changeSupport.addPropertyChangeListener(listener);
48: }
49:
50: public void removePropertyChangeListener(
51: PropertyChangeListener listener) {
52: changeSupport.removePropertyChangeListener(listener);
53: }
54:
55: public String getValue() {
56: return value;
57: }
58:
59: public void setValue(String value) {
60: changeSupport.firePropertyChange("value", this .value,
61: this .value = value);
62: }
63:
64: public List getList() {
65: return list;
66: }
67:
68: public void setList(List list) {
69: changeSupport.firePropertyChange("list", this .list,
70: this .list = list);
71: }
72:
73: public Set getSet() {
74: return set;
75: }
76:
77: public void setSet(Set set) {
78: changeSupport.firePropertyChange("set", this.set,
79: this.set = set);
80: }
81: }
|