improved include detection
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / properties / BookmarkPropertyPage.java
index 42c4065..2463376 100644 (file)
@@ -4,6 +4,8 @@ import com.quantum.IQuantumConstants;
 import com.quantum.adapters.AdapterFactory;
 import com.quantum.adapters.DriverInfo;
 import com.quantum.model.Bookmark;
+import com.quantum.model.BookmarkCollection;
+import com.quantum.model.JDBCDriver;
 import com.quantum.view.bookmark.TreeNode;
 
 import org.eclipse.swt.SWT;
@@ -240,8 +242,9 @@ public class BookmarkPropertyPage extends PropertyPage {
         int index = this.type.getSelectionIndex();
         bookmark.setType(this.adapters[index].getDriverType());
         bookmark.setConnect(this.jdbcURL.getText());
-        bookmark.setDriver(this.driverName.getText());
-        bookmark.setDriverFile(this.driverPath.getText());
+               JDBCDriver jdbcDriver = BookmarkCollection.getInstance().findDriver(
+                               this.driverName.getText(), this.driverPath.getText());
+               bookmark.setJDBCDriver(jdbcDriver);
         if (this.autoCommit.getSelectionIndex() >= 0)
                bookmark.setAutoCommitPreference(this.autoCommit.getItem(this.autoCommit.getSelectionIndex()));
         return super.performOk();
@@ -277,8 +280,8 @@ public class BookmarkPropertyPage extends PropertyPage {
                else if (bookmark.getAutoCommitPreference().equals(IQuantumConstants.autoCommitSaved))
                        this.autoCommit.select(2);
                        
-        this.driverName.setText(bookmark.getDriver());
+        this.driverName.setText(bookmark.getJDBCDriver().getClassName());
         this.jdbcURL.setText(bookmark.getConnect());
-        this.driverPath.setText(bookmark.getDriverFile());
+        this.driverPath.setText(bookmark.getJDBCDriver().getJarFileName());
     }
 }