[204620] Need a method of contributing driver definition specific UIs to a connection profile wizard
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.datatools.enablement.oracle.ui/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..73f4382
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Fri Apr 13 14:14:14 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.4
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.enablement.oracle.ui/META-INF/MANIFEST.MF
index 6a52eed..53f76fe 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/META-INF/MANIFEST.MF
@@ -2,14 +2,12 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.datatools.enablement.oracle.ui;singleton:=true
-Bundle-Version: 1.0.0.200711021
+Bundle-Version: 1.0.0.200712041
Bundle-Localization: plugin
-Export-Package: org.eclipse.datatools.enablement.oracle.internal.ui
+Export-Package: org.eclipse.datatools.enablement.oracle.internal.ui,
+ org.eclipse.datatools.enablement.oracle.internal.ui.drivers
Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0)",
- org.eclipse.datatools.connectivity;bundle-version="[1.0.1,2.0.0)",
org.eclipse.datatools.connectivity.ui;bundle-version="[1.0.1,2.0.0)",
- org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.1,2.0.0)",
org.eclipse.datatools.enablement.oracle;bundle-version="[1.0.0,2.0.0)"
Eclipse-LazyStart: true
Bundle-Vendor: %providerName
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/plugin.xml b/plugins/org.eclipse.datatools.enablement.oracle.ui/plugin.xml
index 2828193..8729cd1 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle.ui/plugin.xml
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/plugin.xml
@@ -63,4 +63,51 @@
</propertyEditor>
</extension>
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleOtherDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.10.other.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.10.OracleOtherDriverUIContributor">
+ </driverUIContributor>
+ </extension>
+
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleOtherDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.9.other.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.9.OracleOtherDriverUIContributor">
+ </driverUIContributor>
+ </extension>
+
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleOtherDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.8.other.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.8.OracleOtherDriverUIContributor">
+ </driverUIContributor>
+ </extension>
+
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleThinDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.10.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.10.OracleThinDriverUIContributor">
+ </driverUIContributor>
+ </extension>
+
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleThinDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.9.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.9.OracleThinDriverUIContributor">
+ </driverUIContributor>
+ </extension>
+
+ <extension point="org.eclipse.datatools.connectivity.ui.driverUIContributor">
+ <driverUIContributor
+ class="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.OracleThinDriverUIContributor"
+ driverTemplateID="org.eclipse.datatools.enablement.oracle.8.driverTemplate"
+ id="org.eclipse.datatools.enablement.oracle.internal.ui.drivers.8.OracleThinDriverUIContributor">
+ </driverUIContributor>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/NewOracleConnectionProfileWizard.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/NewOracleConnectionProfileWizard.java
index f303523..76501af 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/NewOracleConnectionProfileWizard.java
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/NewOracleConnectionProfileWizard.java
@@ -10,50 +10,11 @@
*******************************************************************************/
package org.eclipse.datatools.enablement.oracle.internal.ui;
-import java.util.Properties;
+import org.eclipse.datatools.connectivity.ui.wizards.ExtensibleNewConnectionProfileWizard;
-import org.eclipse.datatools.connectivity.ConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard;
-
-public class NewOracleConnectionProfileWizard extends NewConnectionProfileWizard {
-
- protected OracleDBProfileDetailsWizardPage mPropPage;
+public class NewOracleConnectionProfileWizard extends ExtensibleNewConnectionProfileWizard {
public NewOracleConnectionProfileWizard() {
- super();
- }
-
- public void addCustomPages() {
- mPropPage = new OracleDBProfileDetailsWizardPage("detailsPage"); //$NON-NLS-1$
- addPage(mPropPage);
- }
-
- public Properties getProfileProperties() {
- Properties props = new Properties();
- props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID,
- this.mPropPage.getDriverID());
- props.setProperty(
- IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID,
- this.mPropPage.getDBConnProps());
- props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.mPropPage
- .getDriverClass());
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.mPropPage
- .getVendor());
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.mPropPage
- .getVersion());
- props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.mPropPage
- .getDatabaseName());
- props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.mPropPage
- .getDBPWD());
- props.setProperty(
- IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, String
- .valueOf(this.mPropPage.getSaveDBPWD()));
- props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.mPropPage
- .getDBUID());
- props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID,
- this.mPropPage.getURL());
- return props;
+ super(new OracleDBProfileDetailsWizardPage("org.eclipse.datatools.enablement.oracle.internal.ui.OracleDBProfileDetailsWizardPage"));
}
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfileDetailsWizardPage.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfileDetailsWizardPage.java
index 0b78457..7e85b19 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfileDetailsWizardPage.java
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfileDetailsWizardPage.java
@@ -10,14 +10,13 @@
*******************************************************************************/
package org.eclipse.datatools.enablement.oracle.internal.ui;
-import org.eclipse.datatools.connectivity.db.generic.ui.GenericDBProfileDetailsWizardPage;
+import org.eclipse.datatools.connectivity.ui.wizards.ExtensibleProfileDetailsWizardPage;
import org.eclipse.datatools.enablement.internal.oracle.IOracleConnectionProfileConstants;
public class OracleDBProfileDetailsWizardPage
- extends GenericDBProfileDetailsWizardPage{
+ extends ExtensibleProfileDetailsWizardPage{
public OracleDBProfileDetailsWizardPage(String pageName) {
- super(pageName);
- setDriverCategory(IOracleConnectionProfileConstants.ORACLE_CATEGORY_ID);
+ super(pageName, IOracleConnectionProfileConstants.ORACLE_CATEGORY_ID);
}
}
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfilePropertyPage.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfilePropertyPage.java
index b7f7f80..3d78337 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfilePropertyPage.java
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/OracleDBProfilePropertyPage.java
@@ -10,15 +10,13 @@
*******************************************************************************/
package org.eclipse.datatools.enablement.oracle.internal.ui;
-import org.eclipse.datatools.connectivity.db.generic.ui.GenericDBProfilePropertyPage;
+import org.eclipse.datatools.connectivity.ui.wizards.ExtensibleProfileDetailsPropertyPage;
import org.eclipse.datatools.enablement.internal.oracle.IOracleConnectionProfileConstants;
-public class OracleDBProfilePropertyPage extends GenericDBProfilePropertyPage {
+public class OracleDBProfilePropertyPage extends ExtensibleProfileDetailsPropertyPage {
public OracleDBProfilePropertyPage() {
- super();
- noDefaultAndApplyButton();
- setDriverCategory(IOracleConnectionProfileConstants.ORACLE_CATEGORY_ID);
+ super(IOracleConnectionProfileConstants.ORACLE_CATEGORY_ID);
}
}
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/Messages.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/Messages.java
new file mode 100644
index 0000000..dc9c67f
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/Messages.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.datatools.enablement.oracle.internal.ui.drivers;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages {
+ private static final String BUNDLE_NAME = "org.eclipse.datatools.enablement.oracle.internal.ui.drivers.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
+ .getBundle(BUNDLE_NAME);
+
+ private Messages() {
+ }
+
+ public static String getString(String key) {
+ try {
+ return RESOURCE_BUNDLE.getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleOtherDriverUIContributor.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleOtherDriverUIContributor.java
new file mode 100644
index 0000000..cd55116
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleOtherDriverUIContributor.java
@@ -0,0 +1,15 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.datatools.enablement.oracle.internal.ui.drivers;
+
+import org.eclipse.datatools.connectivity.ui.wizards.OtherDriverUIContributor;
+
+public class OracleOtherDriverUIContributor extends OtherDriverUIContributor {
+
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleThinDriverUIContributor.java b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleThinDriverUIContributor.java
new file mode 100644
index 0000000..718dd90
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/OracleThinDriverUIContributor.java
@@ -0,0 +1,483 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors: IBM Corporation - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.datatools.enablement.oracle.internal.ui.drivers;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.datatools.connectivity.ui.wizards.IConnectionProfileConstants;
+import org.eclipse.datatools.connectivity.ui.wizards.IDriverDefinitionConstants;
+import org.eclipse.datatools.connectivity.ui.wizards.IDriverUIContributor;
+import org.eclipse.datatools.connectivity.ui.wizards.IDriverUIContributorInformation;
+import org.eclipse.datatools.enablement.internal.oracle.IOracleDriverDefinitionConstants;
+import org.eclipse.jface.dialogs.DialogPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+
+public class OracleThinDriverUIContributor implements IDriverUIContributor,
+ Listener {
+ private static final String CUI_NEWCW_DATABASE_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_DATABASE_LBL_UI_");
+
+ private static final String CUI_NEWCW_HOST_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_HOST_LBL_UI_");
+
+ private static final String CUI_NEWCW_PORT_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_PORT_LBL_UI_");
+
+ private static final String CUI_NEWCW_USERNAME_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_USERNAME_LBL_UI_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_PASSWORD_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_PASSWORD_LBL_UI_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_CONNECTIONURL_LBL_UI_ = Messages
+ .getString("CUI_NEWCW_CONNECTIONURL_LBL_UI_");
+
+ private static final String CATALOG_LBL_UI_ = Messages
+ .getString("CATALOG_LBL_UI_");
+
+ private static final String ALL_CATALOGS = Messages
+ .getString("ALL_CATALOGS_OPTION_UI_");
+
+ private static final String DBA_CATALOG = Messages
+ .getString("DBA_CATALOG_OPTION_UI_");
+
+ private static final String USER_CATALOG = Messages
+ .getString("USER_CATALOG_OPTION_UI_");
+
+ private static final String CUI_NEWCW_DATABASE_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_DATABASE_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_HOST_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_HOST_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_PORT_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_PORT_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_CATALOG_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_CATALOG_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_USERNAME_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_USERNAME_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private static final String CUI_NEWCW_URL_SUMMARY_DATA_TEXT_ = Messages
+ .getString("CUI_NEWCW_URL_SUMMARY_DATA_TEXT_"); //$NON-NLS-1$
+
+ private IDriverUIContributorInformation contributorInformation;
+
+ private Label databaseLabel;
+
+ private Text databaseText;
+
+ private Label hostLabel;
+
+ private Text hostText;
+
+ private Label portLabel;
+
+ private Text portText;
+
+ private Label usernameLabel;
+
+ private Text usernameText;
+
+ private Label passwordLabel;
+
+ private Text passwordText;
+
+ private Label urlLabel;
+
+ private Text urlText;
+
+ private Label catalogLabel;
+
+ private Combo catalogCombo;
+
+ private DialogPage parentPage;
+
+ private ScrolledComposite parentComposite;
+
+ private Properties properties;
+
+ public boolean determineContributorCompletion() {
+ boolean isComplete = true;
+ if (databaseText.getText().trim().length() < 1) { //$NON-NLS-1$
+ parentPage.setErrorMessage(Messages
+ .getString("CUI_NEWCW_VALIDATE_DATABASE_REQ_UI_")); //$NON-NLS-1$
+ isComplete = false;
+ } else if (hostText.getText().trim().length() < 1) {
+ parentPage.setErrorMessage(Messages
+ .getString("CUI_NEWCW_VALIDATE_HOST_REQ_UI_")); //$NON-NLS-1$
+ isComplete = false;
+ } else if (portText.getText().trim().length() < 1) {
+ parentPage.setErrorMessage(Messages
+ .getString("CUI_NEWCW_VALIDATE_PORT_REQ_UI_")); //$NON-NLS-1$
+ isComplete = false;
+ } else if (usernameText.getText().trim().length() < 1) {
+ parentPage.setErrorMessage(Messages
+ .getString("CUI_NEWCW_VALIDATE_USERID_REQ_UI_")); //$NON-NLS-1$
+ isComplete = false;
+ } else if (passwordText.getText().trim().length() < 1) {
+ parentPage.setErrorMessage(Messages
+ .getString("CUI_NEWCW_VALIDATE_PASSWORD_REQ_UI_")); //$NON-NLS-1$
+ isComplete = false;
+ }
+
+ if (isComplete) {
+ parentPage.setErrorMessage(null);
+ }
+ return isComplete;
+ }
+
+ public Composite getContributedDriverUI(Composite parent) {
+ if ((parentComposite == null) || parentComposite.isDisposed()) {
+ GridData gd;
+
+ parentComposite = new ScrolledComposite(parent, SWT.H_SCROLL
+ | SWT.V_SCROLL);
+ parentComposite.setExpandHorizontal(true);
+ parentComposite.setExpandVertical(true);
+ parentComposite.setLayout(new GridLayout());
+
+ Composite baseComposite = new Composite(parentComposite, SWT.NULL);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 3;
+ baseComposite.setLayout(layout);
+
+ databaseLabel = new Label(baseComposite, SWT.NONE);
+ databaseLabel.setText(CUI_NEWCW_DATABASE_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ databaseLabel.setLayoutData(gd);
+
+ databaseText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.horizontalAlignment = GridData.FILL;
+ gd.horizontalSpan = 2;
+ databaseText.setLayoutData(gd);
+
+ hostLabel = new Label(baseComposite, SWT.NONE);
+ hostLabel.setText(CUI_NEWCW_HOST_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ hostLabel.setLayoutData(gd);
+
+ hostText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.horizontalSpan = 2;
+ gd.grabExcessHorizontalSpace = true;
+ hostText.setLayoutData(gd);
+
+ portLabel = new Label(baseComposite, SWT.NONE);
+ portLabel.setText(CUI_NEWCW_PORT_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ portLabel.setLayoutData(gd);
+
+ portText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalSpan = 2;
+ portText.setLayoutData(gd);
+
+ usernameLabel = new Label(baseComposite, SWT.NONE);
+ usernameLabel.setText(CUI_NEWCW_USERNAME_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ usernameLabel.setLayoutData(gd);
+
+ usernameText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalSpan = 2;
+ usernameText.setLayoutData(gd);
+
+ passwordLabel = new Label(baseComposite, SWT.NONE);
+ passwordLabel.setText(CUI_NEWCW_PASSWORD_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ passwordLabel.setLayoutData(gd);
+
+ passwordText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER
+ | SWT.PASSWORD);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalSpan = 2;
+ passwordText.setLayoutData(gd);
+
+ urlLabel = new Label(baseComposite, SWT.NONE);
+ urlLabel.setText(CUI_NEWCW_CONNECTIONURL_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ urlLabel.setLayoutData(gd);
+
+ urlText = new Text(baseComposite, SWT.SINGLE | SWT.BORDER
+ | SWT.READ_ONLY);
+ gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.BEGINNING;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalSpan = 2;
+ urlText.setLayoutData(gd);
+
+ catalogLabel = new Label(baseComposite, SWT.NONE);
+ catalogLabel.setText(CATALOG_LBL_UI_);
+ gd = new GridData();
+ gd.verticalAlignment = GridData.BEGINNING;
+ catalogLabel.setLayoutData(gd);
+
+ catalogCombo = new Combo(baseComposite, SWT.SINGLE | SWT.BORDER
+ | SWT.READ_ONLY);
+ gd = new GridData();
+ catalogCombo.setLayoutData(gd);
+
+ parentComposite.setContent(baseComposite);
+ parentComposite.setMinSize(baseComposite.computeSize(SWT.DEFAULT,
+ SWT.DEFAULT));
+
+ initialize();
+ }
+
+ return parentComposite;
+ }
+
+ private void initialize() {
+ catalogCombo.add(ALL_CATALOGS);
+ catalogCombo.add(DBA_CATALOG);
+ catalogCombo.add(USER_CATALOG);
+
+ updateURL();
+ addListeners();
+ }
+
+ private void addListeners() {
+ databaseText.addListener(SWT.Modify, this);
+ hostText.addListener(SWT.Modify, this);
+ portText.addListener(SWT.Modify, this);
+ usernameText.addListener(SWT.Modify, this);
+ passwordText.addListener(SWT.Modify, this);
+ catalogCombo.addListener(SWT.Modify, this);
+ }
+
+ private void removeListeners() {
+ databaseText.removeListener(SWT.Modify, this);
+ hostText.removeListener(SWT.Modify, this);
+ portText.removeListener(SWT.Modify, this);
+ usernameText.removeListener(SWT.Modify, this);
+ passwordText.removeListener(SWT.Modify, this);
+ catalogCombo.removeListener(SWT.Modify, this);
+ }
+
+ private void updateURL() {
+ String url = "jdbc:oracle:thin:@" + hostText.getText() + ":" //$NON-NLS-1$ //$NON-NLS-2$
+ + portText.getText() + ":" + databaseText.getText(); //$NON-NLS-1$
+ urlText.setText(url);
+ }
+
+ public List getSummaryData() {
+ List summaryData = new ArrayList();
+
+ summaryData.add(new String[] { CUI_NEWCW_DATABASE_SUMMARY_DATA_TEXT_,
+ this.databaseText.getText().trim() });
+ summaryData.add(new String[] { CUI_NEWCW_HOST_SUMMARY_DATA_TEXT_,
+ this.hostText.getText().trim() });
+ summaryData.add(new String[] { CUI_NEWCW_PORT_SUMMARY_DATA_TEXT_,
+ this.portText.getText().trim() });
+ summaryData.add(new String[] { CUI_NEWCW_CATALOG_SUMMARY_DATA_TEXT_,
+ this.catalogCombo.getText().trim() });
+ summaryData.add(new String[] { CUI_NEWCW_USERNAME_SUMMARY_DATA_TEXT_,
+ this.usernameText.getText().trim() });
+ summaryData.add(new String[] { CUI_NEWCW_URL_SUMMARY_DATA_TEXT_,
+ this.urlText.getText().trim() });
+
+ return summaryData;
+ }
+
+ public void loadProperties() {
+ removeListeners();
+ OracleJDBCURL url = new OracleJDBCURL(this.properties
+ .getProperty(IDriverDefinitionConstants.URL_PROP_ID));
+ hostText.setText(url.getNode());
+ portText.setText(url.getPort());
+ databaseText.setText(url.getDatabaseName());
+
+ String username = this.properties
+ .getProperty(IDriverDefinitionConstants.USERNAME_PROP_ID);
+ if (username != null) {
+ usernameText.setText(username);
+ }
+ String password = this.properties
+ .getProperty(IDriverDefinitionConstants.PASSWORD_PROP_ID);
+ if (password != null) {
+ passwordText.setText(password);
+ }
+
+ String catalog = USER_CATALOG;
+ String catalogSetting = this.properties
+ .getProperty(IOracleDriverDefinitionConstants.CATALOG_TYPE_PROPERTY_ID);
+ if (catalogSetting
+ .equals(IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_USER)) {
+ catalog = USER_CATALOG;
+ } else if (catalogSetting
+ .equals(IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_DBA)) {
+ catalog = DBA_CATALOG;
+ } else if (catalogSetting
+ .equals(IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_ALL)) {
+ catalog = ALL_CATALOGS;
+ }
+ catalogCombo.select(catalogCombo.indexOf(catalog));
+
+ updateURL();
+ addListeners();
+ setConnectionInformation();
+ }
+
+ public void setDialogPage(DialogPage parentPage) {
+ this.parentPage = parentPage;
+ }
+
+ public void setDriverUIContributorInformation(
+ IDriverUIContributorInformation contributorInformation) {
+ this.contributorInformation = contributorInformation;
+ this.properties = contributorInformation.getProperties();
+ }
+
+ public void handleEvent(Event event) {
+ updateURL();
+ setConnectionInformation();
+ }
+
+ private void setConnectionInformation() {
+ properties.setProperty(
+ IDriverDefinitionConstants.DATABASE_NAME_PROP_ID,
+ this.databaseText.getText().trim());
+ properties.setProperty(IDriverDefinitionConstants.PASSWORD_PROP_ID,
+ this.passwordText.getText());
+ properties.setProperty(
+ IConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, String
+ .valueOf(false));
+ properties.setProperty(IDriverDefinitionConstants.USERNAME_PROP_ID,
+ this.usernameText.getText());
+ properties.setProperty(IDriverDefinitionConstants.URL_PROP_ID,
+ this.urlText.getText().trim());
+
+ String catalog = IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_USER;
+ String catalogSetting = catalogCombo.getText();
+ if (catalogSetting.equals(USER_CATALOG)) {
+ catalog = IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_USER;
+ } else if (catalogSetting.equals(DBA_CATALOG)) {
+ catalog = IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_DBA;
+ } else if (catalogSetting.equals(ALL_CATALOGS)) {
+ catalog = IOracleDriverDefinitionConstants.CATALOG_TYPE_VALUE_ALL;
+ }
+ properties.setProperty(
+ IOracleDriverDefinitionConstants.CATALOG_TYPE_PROPERTY_ID,
+ catalog);
+
+ this.contributorInformation.setProperties(properties);
+ }
+
+ private class OracleJDBCURL {
+ private String subprotocol = ""; //$NON-NLS-1$
+
+ private String node = ""; //$NON-NLS-1$
+
+ private String port = ""; //$NON-NLS-1$
+
+ private String databaseName = ""; //$NON-NLS-1$
+
+ private String properties = ""; //$NON-NLS-1$
+
+ /**
+ * @param url
+ */
+ public OracleJDBCURL(String url) {
+ parseURL(url);
+ }
+
+ /**
+ * @return Returns the databaseName.
+ */
+ public String getDatabaseName() {
+ return databaseName;
+ }
+
+ /**
+ * @return Returns the node.
+ */
+ public String getNode() {
+ return node;
+ }
+
+ /**
+ * @return Returns the subprotocol.
+ */
+ public String getSubprotocol() {
+ return subprotocol;
+ }
+
+ private void parseURL(String url) {
+ try {
+ String remainingURL = url.substring(url.indexOf(':') + 1);
+ this.subprotocol = remainingURL.substring(0, remainingURL
+ .indexOf(':'));
+ remainingURL = remainingURL
+ .substring(remainingURL.indexOf(':') + 1);
+ this.subprotocol = this.subprotocol
+ + remainingURL.substring(0, remainingURL.indexOf(':'));
+ remainingURL = remainingURL
+ .substring(remainingURL.indexOf(':') + 2);
+ this.node = remainingURL
+ .substring(0, remainingURL.indexOf(':'));
+ remainingURL = remainingURL
+ .substring(remainingURL.indexOf(':') + 1);
+
+ this.port = remainingURL
+ .substring(0, remainingURL.indexOf(':'));
+ remainingURL = remainingURL
+ .substring(remainingURL.indexOf(':') + 1);
+ this.databaseName = remainingURL;
+ } catch (Exception e) {
+ }
+ }
+
+ /**
+ * @return Returns the port.
+ */
+ public String getPort() {
+ return port;
+ }
+
+ /**
+ * @return Returns the properties.
+ */
+ public String getProperties() {
+ return properties;
+ }
+ }
+}
diff --git a/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/messages.properties b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/messages.properties
new file mode 100644
index 0000000..d3742f5
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle.ui/src/org/eclipse/datatools/enablement/oracle/internal/ui/drivers/messages.properties
@@ -0,0 +1,37 @@
+###############################################################################
+# Copyright (c) 2007 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+
+#
+## Oracle Driver UI Contributor
+#
+CUI_NEWCW_DATABASE_LBL_UI_ = &SID:
+CUI_NEWCW_HOST_LBL_UI_ = &Host:
+CUI_NEWCW_PORT_LBL_UI_ = Port nu&mber:
+CUI_NEWCW_USERNAME_LBL_UI_ = User name:
+CUI_NEWCW_PASSWORD_LBL_UI_ = Password:
+CUI_NEWCW_CONNECTIONURL_LBL_UI_= Connection UR&L:
+ALL_CATALOGS_OPTION_UI_ = All
+DBA_CATALOG_OPTION_UI_ = DBA
+USER_CATALOG_OPTION_UI_ = User
+CATALOG_LBL_UI_ = Catalo&g:
+
+CUI_NEWCW_DATABASE_SUMMARY_DATA_TEXT_ = SID
+CUI_NEWCW_HOST_SUMMARY_DATA_TEXT_ = Host
+CUI_NEWCW_PORT_SUMMARY_DATA_TEXT_ = Port number
+CUI_NEWCW_CATALOG_SUMMARY_DATA_TEXT_ = Catalog
+CUI_NEWCW_USERNAME_SUMMARY_DATA_TEXT_ = User name
+CUI_NEWCW_URL_SUMMARY_DATA_TEXT_ = URL
+
+CUI_NEWCW_VALIDATE_DATABASE_REQ_UI_ = Enter an SID name.
+CUI_NEWCW_VALIDATE_HOST_REQ_UI_= Enter the host name for the database server.
+CUI_NEWCW_VALIDATE_PORT_REQ_UI_ = Enter the connection port number for the database server.
+CUI_NEWCW_VALIDATE_USERID_REQ_UI_ = Enter a user name.
+CUI_NEWCW_VALIDATE_PASSWORD_REQ_UI_ = Enter a password.
diff --git a/plugins/org.eclipse.datatools.enablement.oracle/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.datatools.enablement.oracle/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..73f4382
--- /dev/null
+++ b/plugins/org.eclipse.datatools.enablement.oracle/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Fri Apr 13 14:14:14 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.4
diff --git a/plugins/org.eclipse.datatools.enablement.oracle/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.enablement.oracle/META-INF/MANIFEST.MF
index 712854a..4ae0bd9 100644
--- a/plugins/org.eclipse.datatools.enablement.oracle/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.enablement.oracle/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.datatools.enablement.oracle;singleton:=true
-Bundle-Version: 1.0.0.200710181
+Bundle-Version: 1.0.0.200712041
Bundle-Localization: plugin
Export-Package: org.eclipse.datatools.enablement.internal.oracle
Require-Bundle: org.eclipse.datatools.connectivity;bundle-version="[1.0.1,2.0.0)",