synchronize with newest Quantum CVS sources
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / wizards / SchemaSelectionWizardPage.java
1 package com.quantum.wizards;
2
3 import java.beans.PropertyChangeEvent;
4 import java.beans.PropertyChangeListener;
5
6 import com.quantum.Messages;
7 import com.quantum.model.Bookmark;
8 import com.quantum.view.SchemaSelectionControl;
9
10 import org.eclipse.swt.widgets.Composite;
11
12
13 /**
14  * @author BC
15  */
16 public class SchemaSelectionWizardPage extends PropertyChangeWizardPage {
17
18         private final Bookmark bookmark;
19         private SchemaSelectionControl control;
20         private PropertyChangeListener listener;
21
22         /**
23          * @param pageName
24          */
25         protected SchemaSelectionWizardPage(String pageName, Bookmark bookmark) {
26                 super(pageName);
27                 this.bookmark = bookmark;
28                 setTitle(Messages.getString(getClass(), "title"));
29                 setDescription(Messages.getString(getClass(), "description"));
30         }
31
32         public void createControl(Composite parent) {
33                 control = new SchemaSelectionControl(parent, this.bookmark);
34                 control.addPropertyChangeListener(this.listener = new PropertyChangeListener() {
35                         public void propertyChange(PropertyChangeEvent event) {
36                                 firePropertyChange(event.getPropertyName(), event.getOldValue(), event.getNewValue());
37                         }
38                 });
39                 setControl(control);
40         }
41         public void dispose() {
42                 if (this.listener != null) {
43                         this.control.removePropertyChangeListener(this.listener);
44                 }
45                 super.dispose();
46         }
47 }