01: package com.caucho.netbeans.ide.ui;
02:
03: import com.caucho.netbeans.ide.AddInstanceIterator;
04: import java.awt.Component;
05: import java.util.HashSet;
06: import javax.swing.JPanel;
07: import javax.swing.event.ChangeEvent;
08: import javax.swing.event.ChangeListener;
09: import org.openide.WizardDescriptor;
10: import org.openide.util.HelpCtx;
11:
12: abstract public class AbstractWizardPanel implements
13: WizardDescriptor.Panel, ChangeListener {
14: private HashSet<ChangeListener> _listeners = new HashSet<ChangeListener>(
15: 1);
16: protected WizardDescriptor _wizard;
17:
18: public void removeChangeListener(ChangeListener listener) {
19: synchronized (_listeners) {
20: _listeners.remove(listener);
21: }
22: }
23:
24: public void addChangeListener(ChangeListener listener) {
25: synchronized (_listeners) {
26: _listeners.add(listener);
27: }
28: }
29:
30: public void stateChanged(ChangeEvent ev) {
31: HashSet<ChangeListener> listeners;
32:
33: synchronized (_listeners) {
34: listeners = new HashSet<ChangeListener>(_listeners);
35: }
36:
37: for (ChangeListener listener : listeners)
38: listener.stateChanged(ev);
39: }
40:
41: public void storeSettings(Object settings) {
42: }
43:
44: public void readSettings(Object settings) {
45: if (_wizard == null)
46: _wizard = (WizardDescriptor) settings;
47: }
48:
49: protected WizardDescriptor getWizard() {
50: return _wizard;
51: }
52:
53: public HelpCtx getHelp() {
54: return HelpCtx.DEFAULT_HELP;
55: }
56: }
|