01: package org.openwfe.gpe.model;
02:
03: //superclass of the model
04: //contains listeners for changing properties and children
05:
06: import java.beans.PropertyChangeListener;
07: import java.beans.PropertyChangeSupport;
08: import java.io.IOException;
09: import java.io.ObjectInputStream;
10: import java.io.Serializable;
11:
12: import org.eclipse.ui.views.properties.IPropertyDescriptor;
13: import org.eclipse.ui.views.properties.IPropertySource;
14:
15: abstract public class AbstractFlow implements IPropertySource,
16: Cloneable, Serializable {
17:
18: public static final String CHILDREN = "Children";
19:
20: transient protected PropertyChangeSupport listeners = new PropertyChangeSupport(
21: this );
22:
23: public void addPropertyChangeListener(PropertyChangeListener l) {
24: listeners.addPropertyChangeListener(l);
25: }
26:
27: protected void firePropertyChange(String prop, Object old,
28: Object newValue) {
29: listeners.firePropertyChange(prop, old, newValue);
30: }
31:
32: protected void fireStructureChange(String prop, Object child) {
33: listeners.firePropertyChange(prop, null, child);
34:
35: }
36:
37: public Object getEditableValue() {
38: return this ;
39: }
40:
41: public IPropertyDescriptor[] getPropertyDescriptors() {
42: return new IPropertyDescriptor[0];
43: }
44:
45: public Object getPropertyValue(Object propName) {
46: return null;
47: }
48:
49: public boolean isPropertySet(Object propName) {
50: return true;
51: }
52:
53: private void readObject(ObjectInputStream in) throws IOException,
54: ClassNotFoundException {
55: in.defaultReadObject();
56: listeners = new PropertyChangeSupport(this );
57: }
58:
59: public void removePropertyChangeListener(PropertyChangeListener l) {
60: listeners.removePropertyChangeListener(l);
61: }
62:
63: public void resetPropertyValue(Object propName) {
64: }
65:
66: public void setPropertyValue(Object propName, Object val) {
67: }
68:
69: }
|