Fixed: malfunctioned "Remove trailing spaces on editor save"
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / wizards / BookmarkConnectionWizardPage.java
index 36a4077..3acbcfe 100644 (file)
@@ -33,6 +33,7 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage {
     private Text jdbcUrl;
     private URLSetupControl urlSetupControl;
     private Composite container;
+    private boolean requiresRebuild = false;
     
     private PropertyChangeListener listener = new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent event) {
@@ -110,6 +111,13 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage {
                setControl(container);
        }
        
+       public void setVisible(boolean visible) {
+               if (visible && this.requiresRebuild) {
+                       rebuildJDBCControls(this.driver);
+               }
+               super.setVisible(visible);
+       }
+       
        /**
         * @param container
         */
@@ -145,7 +153,7 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage {
                
                if (oldDriverClassName == null 
                                || !oldDriverClassName.equals(this.driver.getClassName())) {
-                       rebuildJDBCControls(this.driver);
+                       this.requiresRebuild = true;
                }
        }
        /**
@@ -217,8 +225,9 @@ class BookmarkConnectionWizardPage extends PropertyChangeWizardPage {
                boolean complete = true;
                complete &= (this.connectionURL != null 
                                && this.connectionURL.trim().length() > 0);
-               complete &= (this.userid != null 
-                               && this.userid.trim().length() > 0);
+               // Some databases don't use user id
+               //complete &= (this.userid != null 
+               //              && this.userid.trim().length() > 0);
                setPageComplete(complete);
        }
        /**