latest quantum sources 2.3.2
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / wizards / SchemaSelectionWizardPage.java
diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SchemaSelectionWizardPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/SchemaSelectionWizardPage.java
new file mode 100644 (file)
index 0000000..e91f66e
--- /dev/null
@@ -0,0 +1,47 @@
+package com.quantum.wizards;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import com.quantum.Messages;
+import com.quantum.model.Bookmark;
+import com.quantum.view.SchemaSelectionControl;
+
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * @author BC
+ */
+public class SchemaSelectionWizardPage extends PropertyChangeWizardPage {
+
+       private final Bookmark bookmark;
+       private SchemaSelectionControl control;
+       private PropertyChangeListener listener;
+
+       /**
+        * @param pageName
+        */
+       protected SchemaSelectionWizardPage(String pageName, Bookmark bookmark) {
+               super(pageName);
+               this.bookmark = bookmark;
+               setTitle(Messages.getString(getClass(), "title"));
+               setDescription(Messages.getString(getClass(), "description"));
+       }
+
+       public void createControl(Composite parent) {
+               control = new SchemaSelectionControl(parent, this.bookmark);
+               control.addPropertyChangeListener(this.listener = new PropertyChangeListener() {
+                       public void propertyChange(PropertyChangeEvent event) {
+                               firePropertyChange(event.getPropertyName(), event.getOldValue(), event.getNewValue());
+                       }
+               });
+               setControl(control);
+       }
+       public void dispose() {
+               if (this.listener != null) {
+                       this.control.removePropertyChangeListener(this.listener);
+               }
+               super.dispose();
+       }
+}