Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 87290 Details for
Bug 203158
Need strict separation between UI and non-UI enablement plug-ins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for HSQLDB refactoring
patch_hsqldb.txt (text/plain), 135.00 KB, created by
Larry Dunnell
on 2008-01-18 14:45:18 EST
(
hide
)
Description:
Patch for HSQLDB refactoring
Filename:
MIME Type:
Creator:
Larry Dunnell
Created:
2008-01-18 14:45:18 EST
Size:
135.00 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.datatools.enablement.hsqldb >Index: icons/new_db_element.gif >=================================================================== >RCS file: icons/new_db_element.gif >diff -N icons/new_db_element.gif >Binary files /tmp/cvsJ0mggh and /dev/null differ >Index: src/org/eclipse/datatools/enablement/hsqldb/catalog/HSQLDBPipelineTreeContentProvider.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/catalog/HSQLDBPipelineTreeContentProvider.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/catalog/HSQLDBPipelineTreeContentProvider.java >--- src/org/eclipse/datatools/enablement/hsqldb/catalog/HSQLDBPipelineTreeContentProvider.java 22 Mar 2007 19:46:53 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,114 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb.catalog; >- >-import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.Iterator; >-import java.util.Set; >- >-import org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.providers.content.virtual.StoredProcedureNode; >-import org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.impl.ServerExplorerContentProviderNav; >-import org.eclipse.ui.IMemento; >-import org.eclipse.ui.navigator.ICommonContentExtensionSite; >-import org.eclipse.ui.navigator.IPipelinedTreeContentProvider; >-import org.eclipse.ui.navigator.PipelinedShapeModification; >-import org.eclipse.ui.navigator.PipelinedViewerUpdate; >- >-/** >- * @author brianf >- * >- */ >-public class HSQLDBPipelineTreeContentProvider extends ServerExplorerContentProviderNav implements IPipelinedTreeContentProvider { >- >- /** >- * >- */ >- public HSQLDBPipelineTreeContentProvider() { >- super(); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set) >- */ >- public void getPipelinedChildren(Object aParent, Set theCurrentChildren) { >- Object[] children = getChildren(aParent); >- ArrayList kids = new ArrayList(Arrays.asList(children)); >- theCurrentChildren.clear(); >- for (Iterator iter = kids.iterator(); iter.hasNext();) { >- if (iter.next() instanceof StoredProcedureNode) >- iter.remove(); >- } >- theCurrentChildren.addAll(kids); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedElements(java.lang.Object, java.util.Set) >- */ >- public void getPipelinedElements(Object anInput, Set theCurrentElements) { >- Object[] children = getElements(anInput); >- >- theCurrentElements.addAll(Arrays.asList(children)); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedParent(java.lang.Object, java.lang.Object) >- */ >- public Object getPipelinedParent(Object anObject, Object aSuggestedParent) { >- return getParent(anObject); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptAdd(org.eclipse.ui.navigator.PipelinedShapeModification) >- */ >- public PipelinedShapeModification interceptAdd( >- PipelinedShapeModification anAddModification) { >- return anAddModification; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRefresh(org.eclipse.ui.navigator.PipelinedViewerUpdate) >- */ >- public boolean interceptRefresh( >- PipelinedViewerUpdate aRefreshSynchronization) { >- return true; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRemove(org.eclipse.ui.navigator.PipelinedShapeModification) >- */ >- public PipelinedShapeModification interceptRemove( >- PipelinedShapeModification aRemoveModification) { >- return aRemoveModification; >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptUpdate(org.eclipse.ui.navigator.PipelinedViewerUpdate) >- */ >- public boolean interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization) { >- return true; >- } >- /* (non-Javadoc) >- * @see org.eclipse.jface.viewers.IContentProvider#dispose() >- */ >- public void dispose() { >- super.dispose(); >- } >- >- public void init(ICommonContentExtensionSite aConfig) { >- } >- >- public void restoreState(IMemento aMemento) { >- } >- >- public void saveState(IMemento aMemento) { >- } >-} >Index: build.properties >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb/build.properties,v >retrieving revision 1.8 >diff -u -r1.8 build.properties >--- build.properties 7 Jun 2007 16:09:53 -0000 1.8 >+++ build.properties 18 Jan 2008 19:44:25 -0000 >@@ -5,8 +5,7 @@ > about.html,\ > META-INF/,\ > .,\ >- icons/,\ >- runtime/ >+ icons/ > jars.compile.order = . > output.. = bin/ > source.. = src/ >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb/plugin.xml,v >retrieving revision 1.5 >diff -u -r1.5 plugin.xml >--- plugin.xml 29 Oct 2007 21:48:15 -0000 1.5 >+++ plugin.xml 18 Jan 2008 19:44:25 -0000 >@@ -2,17 +2,6 @@ > <?eclipse version="3.2"?> > <plugin> > <extension >- point="org.eclipse.datatools.connectivity.sqm.core.databaseDefinition"> >- <definition >- description="%product.display.description" >- file="runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi" >- product="HSQLDB" >- productDisplayString="%product.display.string" >- version="1.8" >- versionDisplayString="%product.display.version.string"/> >- </extension> >- >- <extension > point="org.eclipse.datatools.connectivity.driverExtension"> > <category > description="%driver.category.description" >@@ -92,31 +81,8 @@ > id="org.eclipse.datatools.enablement.hsqldb.connectionProfile" > name="%connection.profile" > pingFactory="org.eclipse.datatools.enablement.hsqldb.connection.HSQLDBJDBCConnectionFactory"/> >- <newWizard >- class="org.eclipse.datatools.enablement.hsqldb.ui.wizard.NewHSQLDBConnectionProfileWizard" >- icon="icons/new_db_element.gif" >- id="org.eclipse.datatools.enablement.hsqldb.connectionProfile.NewConnectionProfileWizard" >- name="%connection.profile.newwizard" >- description = "%connection.profile.newwizard.description" >- profile="org.eclipse.datatools.enablement.hsqldb.connectionProfile"/> > </extension> > >- <extension >- point="org.eclipse.ui.propertyPages"> >- <page >- class="org.eclipse.datatools.enablement.hsqldb.ui.properties.HSQLDBPropertyPage" >- id="org.eclipse.datatools.enablement.hsqldb.connectionProfile.profileProperties" >- name="%profile.page.name"> >- <filter >- name="org.eclipse.datatools.profile.property.id" >- value="org.eclipse.datatools.enablement.hsqldb.connectionProfile"/> >- <enabledWhen> >- <instanceof >- value="org.eclipse.datatools.connectivity.IConnectionProfile"> >- </instanceof> >- </enabledWhen> >- </page> >- </extension> > <!-- > <extension > point="org.eclipse.datatools.connectivity.sqm.core.catalog"> >@@ -126,32 +92,5 @@ > product="HSQLDB" > version="1.8"/> > </extension> >- >- <extension >- point="org.eclipse.ui.navigator.viewer"> >- <viewerContentBinding viewerId="org.eclipse.datatools.connectivity.DataSourceExplorerNavigator"> >- <includes> >- <contentExtension pattern="org.eclipse.datatools.enablement.hsqldb.navigatorContent"/> >- </includes> >- </viewerContentBinding> >- </extension> >- >- <extension >- point="org.eclipse.ui.navigator.navigatorContent"> >- <navigatorContent >- activeByDefault="true" >- contentProvider="org.eclipse.datatools.enablement.hsqldb.catalog.HSQLDBPipelineTreeContentProvider" >- id="org.eclipse.datatools.enablement.hsqldb.navigatorContent" >- labelProvider="org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.SQLModelLabelProviderExtension" >- name="%navigator.content.name" >- priority="highest"> >- <override >- policy="InvokeAlwaysRegardlessOfSuppressedExt" >- suppressedExtensionId="org.eclipse.datatools.connectivity.db.sqlModelContent"/> >- <triggerPoints> >- <instanceof value="org.eclipse.datatools.enablement.hsqldb.catalog.HSQLDBCatalogSchema"/> >- </triggerPoints> >- </navigatorContent> >- </extension> > --> > </plugin> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb/plugin.properties,v >retrieving revision 1.5 >diff -u -r1.5 plugin.properties >--- plugin.properties 30 Oct 2007 00:36:48 -0000 1.5 >+++ plugin.properties 18 Jan 2008 19:44:25 -0000 >@@ -1,28 +1,8 @@ >-DRIVER_CLASS_PROPERTY_NAME=Driver Class >-VENDOR_PROPERTY_NAME=Vendor >-VERSION_PROPERTY_NAME=Version >-DATABASE_NAME_PROPERTY_NAME=Database Name >-CONNECTION_URL_PROPERTY_NAME=Connection URL >-USER_ID_PROPERTY_NAME=User ID >-PASSWORD_PROPERTY_NAME=Password >- > Bundle-Vendor = Eclipse.org > Bundle-Name = Eclipse Data Tools Platform HSQLDB Enablement Plug-in >-profile.page.name = HSQLDB Profile Properties >-navigator.content.name = HSQLDB Profile Content Extension >- >-product.display.string = HSQLDB >-product.display.version.string = 1.8 >-product.display.description = HSQLDB Connection Profile > >-driver.category.name = HSQLDB >-driver.category.description = HSQLDB JDBC Drivers >-driver.version.category.name = 1.8 >-driver.version.category.description = HSQLDB JDBC Drivers for Version 1.8 >-driver.name = HSQLDB JDBC Driver >-driver.description = JDBC driver for HSQLDB >+navigator.content.name = HSQLDB Profile Content Extension > > connection.factory = HSQLDB Connection Factory > connection.profile = HSQLDB Connection Profile >-connection.profile.newwizard = HSQLDB >-connection.profile.newwizard.description = Create an HSQLDB connection profile. >\ No newline at end of file >+ >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >--- src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java 19 Mar 2007 16:37:01 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,479 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb.ui.properties; >- >-import java.io.File; >-import java.util.Properties; >-import java.util.StringTokenizer; >- >-import javax.swing.event.ChangeEvent; >-import javax.swing.event.ChangeListener; >- >-import org.eclipse.core.runtime.Path; >-import org.eclipse.datatools.connectivity.ConnectionProfileConstants; >-import org.eclipse.datatools.connectivity.IConnectionProfile; >-import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants; >-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants; >-import org.eclipse.datatools.connectivity.drivers.DriverInstance; >-import org.eclipse.datatools.connectivity.internal.ui.DelimitedStringList; >-import org.eclipse.datatools.connectivity.internal.ui.DriverListCombo; >-import org.eclipse.datatools.connectivity.ui.wizards.ProfileDetailsPropertyPage; >-import org.eclipse.datatools.enablement.hsqldb.ui.IHSQLDBConnectionProfileConstants; >-import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >-import org.eclipse.jface.preference.PreferencePage; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.ModifyEvent; >-import org.eclipse.swt.events.ModifyListener; >-import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.events.SelectionListener; >-import org.eclipse.swt.layout.GridData; >-import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.DirectoryDialog; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Text; >- >-/** >- * Property page for HSQLDB profiles >- * >- */ >-public class HSQLDBPropertyPage extends ProfileDetailsPropertyPage { >- >- private static final String EMPTY_STRING = new String(); >- >- // UI components >- private Text mDatabaseNameText; >- private Text mDBUIDText; >- private Text mDBPWDText; >- private Text mURLText; >- private Button mSaveDBPWDCheckbox; >- private Text mDBFilePathText; >- private Button mBrowseFilePathButton; >- final DriverListCombo combo = new DriverListCombo(); >- private DelimitedStringList mDBConnProps; >- >- // other components >- private DriverInstance mDriverInstance; >- private String mDriverCategory; >- >- /** >- * Constructor >- */ >- public HSQLDBPropertyPage() { >- super(); >- noDefaultAndApplyButton(); >- setDriverCategory(IHSQLDBConnectionProfileConstants.HSQLDB_CATEGORY_ID); >- } >- >- /** >- * @see PreferencePage#createContents(Composite) >- */ >- protected void createCustomContents(Composite parent) { >- Composite content = new Composite(parent, SWT.NULL); >- GridLayout layout = new GridLayout(2, false); >- content.setLayout(layout); >- >- this.combo.setLabelText(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.driverCombo.label")); //$NON-NLS-1$ >- this.combo.setCategory(getDriverCategory()); >- this.combo.setNullDriverIsValid(false); >- this.combo.createContents(content); >- >- this.mDatabaseNameText = (Text) createLabelTextPair( >- content, >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.databaseName.label"), //$NON-NLS-1$ >- this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- >- Label label = new Label(content, SWT.NULL); >- label.setLayoutData(new GridData()); >- label.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.0")); //$NON-NLS-1$ >- >- Composite textAndBrowseComposite = new Composite(content, SWT.NULL); >- GridLayout subCompositeLayout = new GridLayout(2, false); >- subCompositeLayout.marginLeft = -5; >- subCompositeLayout.marginRight = -5; >- subCompositeLayout.marginTop = -5; >- subCompositeLayout.marginBottom = -5; >- textAndBrowseComposite.setLayout(subCompositeLayout); >- textAndBrowseComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- this.mDBFilePathText = new Text(textAndBrowseComposite, SWT.BORDER); >- this.mDBFilePathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- this.mBrowseFilePathButton = new Button(textAndBrowseComposite, SWT.PUSH); >- this.mBrowseFilePathButton.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.1")); //$NON-NLS-1$ >- this.mBrowseFilePathButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); >- >- this.mURLText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.url.label"), //$NON-NLS-1$ >- this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- this.mDBUIDText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.userName.label"), //$NON-NLS-1$ >- this.mDBUIDText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- >- this.mDBPWDText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.password.label"), //$NON-NLS-1$, >- this.mDBPWDText, SWT.BORDER | SWT.PASSWORD, GridData.FILL_HORIZONTAL); >- >- this.mSaveDBPWDCheckbox = new Button(content, SWT.CHECK); >- this.mSaveDBPWDCheckbox.setText(Messages >- .getString( >- "HSQLDBProfileDetailsWizardPage.persistpassword.label")); //$NON-NLS-1$ >- this.mSaveDBPWDCheckbox.setLayoutData(new GridData(GridData.BEGINNING, >- GridData.CENTER, true, false, 2, 1)); >- >- Composite spacer = new Composite(content, SWT.NULL); >- GridData gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- gdata.heightHint = 20; >- spacer.setLayoutData(gdata); >- >- label = new Label(content, SWT.NULL); >- gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- label.setLayoutData(gdata); >- label.setText(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.optionalProps.label")); //$NON-NLS-1$ >- >- this.mDBConnProps = new DelimitedStringList(content, SWT.NONE); >- gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- this.mDBConnProps.setLayoutData(gdata); >- >- this.mDBConnProps.addChangeListener(new ChangeListener() { >- >- public void stateChanged(ChangeEvent arg0) { >- setErrorMessage(null); >- if (HSQLDBPropertyPage.this.mDBConnProps.getWarning() != null) { >- setErrorMessage(HSQLDBPropertyPage.this.mDBConnProps >- .getWarning()); >- } >- } >- >- }); >- >- this.combo.addChangeListener(new ChangeListener() { >- >- public void stateChanged(ChangeEvent arg0) { >- HSQLDBPropertyPage.this.mDriverInstance = HSQLDBPropertyPage.this.combo >- .getSelectedDriverInstance(); >- setErrorMessage(null); >- if (HSQLDBPropertyPage.this.combo.getErrorMessage() != null) { >- setErrorMessage(HSQLDBPropertyPage.this.combo >- .getErrorMessage()); >- } >- else >- HSQLDBPropertyPage.this.mURLText >- .setText(getDriverURL()); >- String username = HSQLDBPropertyPage.this >- .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.USERNAME_PROP_ID); >- if (username == null || username.trim().length() == 0) >- username = new String(); >- String oldUsername = HSQLDBPropertyPage.this.mDBUIDText >- .getText(); >- if (oldUsername == null || oldUsername.trim().length() == 0) >- oldUsername = new String(); >- if (oldUsername.length() == 0) >- HSQLDBPropertyPage.this.mDBUIDText >- .setText(username); >- >- String password = HSQLDBPropertyPage.this >- .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >- if (password == null || password.trim().length() == 0) >- password = new String(); >- String oldPassword = HSQLDBPropertyPage.this.mDBPWDText >- .getText(); >- if (oldPassword == null || oldPassword.trim().length() == 0) >- oldPassword = new String(); >- if (oldPassword.length() == 0) >- HSQLDBPropertyPage.this.mDBPWDText >- .setText(password); >- } >- >- }); >- >- initControls(); >- >- this.mDBFilePathText.addModifyListener(new ModifyListener() { >- public void modifyText(ModifyEvent e) { >- HSQLDBPropertyPage.this.updateURLFromProps(); >- } >- }); >- >- this.mBrowseFilePathButton.addSelectionListener( new SelectionListener() { >- >- public void widgetDefaultSelected(SelectionEvent e) { >- HSQLDBPropertyPage.this.browseForDBFolder(); >- } >- >- public void widgetSelected(SelectionEvent e) { >- HSQLDBPropertyPage.this.browseForDBFolder(); >- } >- }); >- >- // return content; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.jface.preference.IPreferencePage#performOk() >- */ >- protected Properties collectProperties() { >- Properties props = new Properties(); >- >- String driverID = EMPTY_STRING; >- >- if (this.combo.getSelectedDriverInstance() != null) { >- DriverInstance instance = this.combo.getSelectedDriverInstance(); >- driverID = instance.getId(); >- } >- >- props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, >- driverID); >- props.setProperty( >- IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, >- this.mDBConnProps.getSelection()); >- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID)); >- props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID)); >- props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID)); >- props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.mDatabaseNameText >- .getText()); >- props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.mDBPWDText >- .getText()); >- props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.mDBUIDText >- .getText()); >- props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, >- this.mURLText.getText()); >- props.setProperty( >- IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, String >- .valueOf(this.mSaveDBPWDCheckbox.getSelection())); >- >- return props; >- } >- >- /** >- * >- */ >- private void initControls() { >- IConnectionProfile profile = getConnectionProfile(); >- String driverID = profile.getBaseProperties().getProperty( >- ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID); >- if (driverID != null) { >- this.combo.setSelectionToID(driverID); >- } >- >- String connectionProps = profile.getBaseProperties().getProperty( >- IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID); >- if (connectionProps != null) { >- this.mDBConnProps.setSelection(connectionProps); >- } >- >- String databaseName = profile.getBaseProperties().getProperty( >- IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID); >- if (databaseName != null) { >- this.mDatabaseNameText.setText(databaseName); >- } >- >- String databasePwd = profile.getBaseProperties().getProperty( >- IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >- if (databasePwd != null) { >- this.mDBPWDText.setText(databasePwd); >- } >- >- String databaseUid = profile.getBaseProperties().getProperty( >- IDBDriverDefinitionConstants.USERNAME_PROP_ID); >- if (databaseUid != null) { >- this.mDBUIDText.setText(databaseUid); >- } >- >- String urlText = profile.getBaseProperties().getProperty( >- IDBDriverDefinitionConstants.URL_PROP_ID); >- if (urlText != null) { >- this.mURLText.setText(urlText); >- this.mURLText.setEnabled(false); >- } >- >- this.mSaveDBPWDCheckbox.setSelection(Boolean.valueOf( >- profile.getBaseProperties().getProperty( >- IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, >- Boolean.FALSE.toString())).booleanValue()); >- >- this.updatePropsFromURL(); >- >- setErrorMessage(null); >- if (this.combo.getErrorMessage() != null) { >- setErrorMessage(this.combo.getErrorMessage()); >- } >- } >- >- /** >- * Browse for a DB folder >- */ >- private void browseForDBFolder() { >- DirectoryDialog dialog = new DirectoryDialog(getShell()); >- dialog.setText(Messages >- .getString("HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse")); //$NON-NLS-1$ >- dialog.setMessage(Messages >- .getString("HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse")); //$NON-NLS-1$ >- >- String dirName = mDBFilePathText.getText(); >- >- File path = new File(dirName); >- if (path.exists()) { >- dialog.setFilterPath(new Path(dirName).toOSString()); >- } >- >- String selectedDirectory = dialog.open(); >- if (selectedDirectory != null) { >- this.mDBFilePathText.setText(selectedDirectory); >- } >- } >- >- /** >- * Based on the URL, update the UI components accordingly >- */ >- private void updatePropsFromURL() { >- if (this.mDBFilePathText != null && this.mURLText != null) { >- String url = this.mURLText.getText(); >- String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >- if (chunks.length > 0) { >- String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >- if (chunks2.length > 2) { >- String filepath = chunks2[2]; >- if (chunks2.length > 3) { >- filepath = filepath + ":" + chunks2[3]; //$NON-NLS-1$ >- } >- this.mDBFilePathText.setText(filepath); >- } >- } >- } >- } >- >- /** >- * Based on the state of the UI components, reset the URL >- */ >- private void updateURLFromProps() { >- if (this.mDBFilePathText != null && this.mURLText != null) { >- String url = this.mURLText.getText(); >- String filePath = this.mDBFilePathText.getText(); >- //jdbc:derby:C:\DerbyDatabases\MyDB;create=true >- String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >- if (chunks.length > 0) { >- String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >- if (chunks2.length > 2) { >- url = chunks2[0] + ":" + chunks2[1] + ":" + filePath; //$NON-NLS-1$ //$NON-NLS-2$ >- this.mURLText.setText(url); >- } >- } >- } >- } >- >- /** >- * Parse a string into an array based on a token >- * @param str_list >- * @param token >- * @return >- */ >- private String[] parseString(String str_list, String token) { >- StringTokenizer tk = new StringTokenizer(str_list, token); >- String[] pieces = new String[tk.countTokens()]; >- int index = 0; >- while (tk.hasMoreTokens()) >- pieces[index++] = tk.nextToken(); >- return pieces; >- } >- >- /** >- * @param propertyID >- * @return >- */ >- private String getPropertyFromDriverInstance(String propertyID) { >- String returnStr = new String(); >- if (this.mDriverInstance != null >- && this.mDriverInstance.getProperty(propertyID) != null) { >- returnStr = this.mDriverInstance.getProperty(propertyID); >- } >- return returnStr; >- } >- >- /** >- * @param parent >- * @param labelText >- * @param ctl >- * @param style >- * @param gData >- * @return >- */ >- private Control createLabelTextPair(Composite parent, String labelText, >- Control ctl, int style, int gData) { >- Label label = new Label(parent, SWT.NULL); >- label.setLayoutData(new GridData()); >- label.setText(labelText); >- >- ctl = new Text(parent, style); >- ctl.setLayoutData(new GridData(gData)); >- >- return ctl; >- } >- >- /** >- * @return >- */ >- public String getDriverURL() { >- return this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID); >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.jface.preference.IPreferencePage#isValid() >- */ >- public boolean isValid() { >- if (getErrorMessage() != null) { >- return false; >- } >- return super.isValid(); >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.jface.dialogs.DialogPage#setErrorMessage(java.lang.String) >- */ >- public void setErrorMessage(String newMessage) { >- super.setErrorMessage(newMessage); >- isValid(); >- } >- >- /** >- * @return >- */ >- public String getDriverCategory() { >- return mDriverCategory; >- } >- >- >- /** >- * Sets the driver category that should be used for displaying available >- * driver defnitions. >- * >- * @param driverCategory >- */ >- public void setDriverCategory(String driverCategory) { >- mDriverCategory = driverCategory; >- if (combo != null) { >- combo.setCategory(mDriverCategory); >- } >- } >-} >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >--- src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java 12 Mar 2007 19:57:29 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,576 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb.ui.wizard; >- >-import java.io.File; >-import java.util.ArrayList; >-import java.util.List; >-import java.util.StringTokenizer; >- >-import javax.swing.event.ChangeEvent; >-import javax.swing.event.ChangeListener; >- >-import org.eclipse.core.runtime.Path; >-import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants; >-import org.eclipse.datatools.connectivity.drivers.DriverInstance; >-import org.eclipse.datatools.connectivity.internal.ui.DelimitedStringList; >-import org.eclipse.datatools.connectivity.internal.ui.DriverListCombo; >-import org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage; >-import org.eclipse.datatools.enablement.hsqldb.ui.IHSQLDBConnectionProfileConstants; >-import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.events.ModifyEvent; >-import org.eclipse.swt.events.ModifyListener; >-import org.eclipse.swt.events.SelectionEvent; >-import org.eclipse.swt.events.SelectionListener; >-import org.eclipse.swt.layout.GridData; >-import org.eclipse.swt.layout.GridLayout; >-import org.eclipse.swt.widgets.Button; >-import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Control; >-import org.eclipse.swt.widgets.DirectoryDialog; >-import org.eclipse.swt.widgets.Label; >-import org.eclipse.swt.widgets.Text; >- >-/** >- * This class gathers the properties for the HSQLDB connection profile. >- * >- * @author brianf >- */ >-public class HSQLDBProfileDetailsWizardPage extends ConnectionProfileDetailsPage { >- >- // ui pieces >- private Text mDatabaseNameText; >- >- private Text mURLText; >- >- private Text mDBUIDText; >- >- private Text mDBPWDText; >- >- private Button mSaveDBPWDCheckbox; >- >- private DelimitedStringList mDBConnProps; >- >- final DriverListCombo combo = new DriverListCombo(); >- >- private Text mDBFilePathText; >- >- private Button mBrowseFilePathButton; >- >- // stashed driver instance >- private DriverInstance mDriverInstance; >- >- private String mDriverCategory; >- >- /** >- * Constructor >- * >- * @param pageName >- */ >- public HSQLDBProfileDetailsWizardPage(String pageName) { >- super(pageName); >- setTitle(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.title")); //$NON-NLS-1$ >- setDescription(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.msg")); //$NON-NLS-1$ >- setDriverCategory(IHSQLDBConnectionProfileConstants.HSQLDB_CATEGORY_ID); >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) >- */ >- public void createCustomControl(Composite parent) { >- Composite content = new Composite(parent, SWT.NULL); >- GridLayout layout = new GridLayout(2, false); >- content.setLayout(layout); >- >- // set up the drivers combo >- this.combo.setLabelText(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.driverCombo.label")); //$NON-NLS-1$ >- this.combo.setCategory(getDriverCategory()); >- this.combo.setNullDriverIsValid(false); >- this.combo.createContents(content); >- if (this.combo.getErrorMessage() != null) { >- setErrorMessage(this.combo.getErrorMessage()); >- } >- >- // set up the fields >- this.mDatabaseNameText = (Text) createLabelTextPair( >- content, >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.databaseName.label"), //$NON-NLS-1$ >- this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- >- Label label = new Label(content, SWT.NULL); >- label.setLayoutData(new GridData()); >- label.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.0")); //$NON-NLS-1$ >- >- Composite textAndBrowseComposite = new Composite(content, SWT.NULL); >- GridLayout subCompositeLayout = new GridLayout(2, false); >- subCompositeLayout.marginLeft = -5; >- subCompositeLayout.marginRight = -5; >- subCompositeLayout.marginTop = -5; >- subCompositeLayout.marginBottom = -5; >- textAndBrowseComposite.setLayout(subCompositeLayout); >- textAndBrowseComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- this.mDBFilePathText = new Text(textAndBrowseComposite, SWT.BORDER); >- this.mDBFilePathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >- this.mBrowseFilePathButton = new Button(textAndBrowseComposite, SWT.PUSH); >- this.mBrowseFilePathButton.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.1")); //$NON-NLS-1$ >- this.mBrowseFilePathButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); >- >- this.mDBUIDText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.userName.label"), //$NON-NLS-1$ >- this.mDBUIDText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- >- this.mDBPWDText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.password.label"), //$NON-NLS-1$ >- this.mDBPWDText, SWT.BORDER | SWT.PASSWORD, GridData.FILL_HORIZONTAL); >- >- this.mURLText = (Text) createLabelTextPair(content, Messages.getString( >- "HSQLDBProfileDetailsWizardPage.url.label"), //$NON-NLS-1$ >- this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >- >- this.mSaveDBPWDCheckbox = new Button(content, SWT.CHECK); >- this.mSaveDBPWDCheckbox.setText(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.persistpassword.label")); //$NON-NLS-1$ >- this.mSaveDBPWDCheckbox.setLayoutData(new GridData(GridData.BEGINNING, >- GridData.CENTER, true, false, 2, 1)); >- >- // spacer >- Composite spacer = new Composite(content, SWT.NULL); >- GridData gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- gdata.heightHint = 20; >- spacer.setLayoutData(gdata); >- >- // followed by the optional properties >- label = new Label(content, SWT.NULL); >- gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- label.setLayoutData(gdata); >- label.setText(Messages.getString( >- "HSQLDBProfileDetailsWizardPage.optionalProps.label")); //$NON-NLS-1$ >- >- this.mDBConnProps = new DelimitedStringList(content, SWT.NONE); >- gdata = new GridData(GridData.FILL_HORIZONTAL); >- gdata.horizontalSpan = 2; >- this.mDBConnProps.setLayoutData(gdata); >- >-// // now set up the initial instance >-// if (this.mDriverInstance == null) >-// this.mDriverInstance = this.combo.getSelectedDriverInstance(); >- >- this.mDBConnProps.addChangeListener(new ChangeListener() { >- >- public void stateChanged(ChangeEvent arg0) { >- setErrorMessage(null); >- if (HSQLDBProfileDetailsWizardPage.this.mDBConnProps.getWarning() != null) { >- setErrorMessage(HSQLDBProfileDetailsWizardPage.this.mDBConnProps >- .getWarning()); >- } >- } >- >- }); >- >- // add a change listener to the combo box so >- // we know when a new driver has been selected >- this.combo.addChangeListener(new ChangeListener() { >- >- public void stateChanged(ChangeEvent arg0) { >- HSQLDBProfileDetailsWizardPage.this.mDriverInstance = HSQLDBProfileDetailsWizardPage.this.combo >- .getSelectedDriverInstance(); >- setErrorMessage(null); >- if (HSQLDBProfileDetailsWizardPage.this.combo.getErrorMessage() != null) { >- setErrorMessage(HSQLDBProfileDetailsWizardPage.this.combo >- .getErrorMessage()); >- } >- HSQLDBProfileDetailsWizardPage.this.mDatabaseNameText >- .setText(getDriverDatabaseName()); >- >- HSQLDBProfileDetailsWizardPage.this.mURLText >- .setText(getDriverURL()); >- HSQLDBProfileDetailsWizardPage.this.updatePropsFromURL(); >- >- String username = HSQLDBProfileDetailsWizardPage.this >- .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.USERNAME_PROP_ID); >- if (username == null || username.trim().length() == 0) >- username = new String(); >- HSQLDBProfileDetailsWizardPage.this.mDBUIDText.setText(username); >- >- String password = HSQLDBProfileDetailsWizardPage.this >- .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >- if (password == null || password.trim().length() == 0) >- password = new String(); >- HSQLDBProfileDetailsWizardPage.this.mDBPWDText.setText(password); >- >- setPageComplete(isValid()); >- } >- >- }); >- >- this.mDBFilePathText.addModifyListener(new ModifyListener() { >- public void modifyText(ModifyEvent e) { >- HSQLDBProfileDetailsWizardPage.this.updateURLFromProps(); >- } >- }); >- this.mBrowseFilePathButton.addSelectionListener( new SelectionListener() { >- >- public void widgetDefaultSelected(SelectionEvent e) { >- HSQLDBProfileDetailsWizardPage.this.browseForDBFolder(); >- } >- >- public void widgetSelected(SelectionEvent e) { >- HSQLDBProfileDetailsWizardPage.this.browseForDBFolder(); >- } >- }); >- >- this.combo.selectFirstItem(); >- // now set up the initial instance >- if (this.mDriverInstance == null) >- this.mDriverInstance = this.combo.getSelectedDriverInstance(); >- if (this.mDriverInstance != null) { >- this.mURLText.setText(getDriverURL()); >- } >- this.mURLText.setEnabled(false); >- >- } >- >- /** >- * Browse for the database folder >- */ >- private void browseForDBFolder() { >- DirectoryDialog dialog = new DirectoryDialog(getShell()); >- dialog.setText(Messages >- .getString("HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse")); //$NON-NLS-1$ >- dialog.setMessage(Messages >- .getString("HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse")); //$NON-NLS-1$ >- >- String dirName = mDBFilePathText.getText(); >- >- File path = new File(dirName); >- if (path.exists()) { >- dialog.setFilterPath(new Path(dirName).toOSString()); >- } >- >- String selectedDirectory = dialog.open(); >- if (selectedDirectory != null) { >- this.mDBFilePathText.setText(selectedDirectory); >- } >- } >- >- /** >- * Update the UI components from the URL >- */ >- private void updatePropsFromURL() { >- if (this.mDBFilePathText != null && this.mURLText != null) { >- String url = this.mURLText.getText(); >- String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >- if (chunks.length > 0) { >- String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >- if (chunks2.length > 2) { >- String filepath = chunks2[2]; >- if (chunks2.length > 3) { >- filepath = filepath + ":" + chunks2[3]; //$NON-NLS-1$ >- } >- this.mDBFilePathText.setText(filepath); >- } >- } >- } >- } >- >- /** >- * Update the URL from the UI components >- */ >- private void updateURLFromProps() { >- if (this.mDBFilePathText != null && this.mURLText != null) { >- String url = this.mURLText.getText(); >- String filePath = this.mDBFilePathText.getText(); >- //jdbc:derby:C:\DerbyDatabases\MyDB;create=true >- String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >- if (chunks.length > 0) { >- String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >- if (chunks2.length > 2) { >- url = chunks2[0] + ":" + chunks2[1] + ":" + filePath; //$NON-NLS-1$ //$NON-NLS-2$ >- this.mURLText.setText(url); >- } >- } >- } >- } >- >- /** >- * Parse a string into a string array based on a token >- * @param str_list >- * @param token >- * @return >- */ >- private String[] parseString(String str_list, String token) { >- StringTokenizer tk = new StringTokenizer(str_list, token); >- String[] pieces = new String[tk.countTokens()]; >- int index = 0; >- while (tk.hasMoreTokens()) >- pieces[index++] = tk.nextToken(); >- return pieces; >- } >- >- /** >- * @param propertyID >- * @return >- */ >- private String getPropertyFromDriverInstance(String propertyID) { >- String returnStr = new String(); >- if (this.mDriverInstance != null >- && this.mDriverInstance.getProperty(propertyID) != null) { >- returnStr = this.mDriverInstance.getProperty(propertyID); >- } >- return returnStr; >- } >- >- /** >- * Get the sample URL from the driver instance. >- * >- * @return >- */ >- public String getDriverURL() { >- if (this.mDriverInstance != null >- && this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID) != null) >- return this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID); >- return new String(); >- } >- >- /** >- * Get the sample database name from the driver instance. >- * >- * @return >- */ >- public String getDriverDatabaseName() { >- if (this.mDriverInstance != null >- && this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID) != null) >- return this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID); >- return new String(); >- } >- >- /** >- * Get the vendor >- * >- * @return >- */ >- public String getVendor() { >- String vendor = ""; //$NON-NLS-1$ >- if (this.mDriverInstance != null) { >- vendor = this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID); >- } >- return vendor; >- } >- >- /** >- * Get the version >- * >- * @return >- */ >- public String getVersion() { >- String version = ""; //$NON-NLS-1$ >- if (this.mDriverInstance != null) { >- version = this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID); >- } >- return version; >- } >- >- /** >- * Get the driver class >- * >- * @return >- */ >- public String getDriverClass() { >- String driverClass = ""; //$NON-NLS-1$ >- if (this.mDriverInstance != null) { >- driverClass = this.mDriverInstance >- .getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID); >- } >- return driverClass; >- } >- >- /** >- * Get the user name >- * >- * @return >- */ >- public String getDBUID() { >- return this.mDBUIDText.getText(); >- } >- >- /** >- * Get the password >- * >- * @return >- */ >- public String getDBPWD() { >- return this.mDBPWDText.getText(); >- } >- >- /** >- * Get the password >- * >- * @return >- */ >- public boolean getSaveDBPWD() { >- return this.mSaveDBPWDCheckbox.getSelection(); >- } >- >- /** >- * Get the optional connection properties >- * >- * @return >- */ >- public String getDBConnProps() { >- return this.mDBConnProps.getSelection(); >- } >- >- /** >- * Get the database name >- * >- * @return >- */ >- public String getDatabaseName() { >- return this.mDatabaseNameText.getText(); >- } >- >- /** >- * Get the URL for the CP >- * >- * @return >- */ >- public String getURL() { >- return this.mURLText.getText(); >- } >- >- /** >- * Get the driver ID >- * >- * @return >- */ >- public String getDriverID() { >- return this.mDriverInstance.getId(); >- } >- >- /* >- * Create a label and a text box side by side. >- */ >- private Control createLabelTextPair(Composite parent, String labelText, >- Control ctl, int style, int gData) { >- Label label = new Label(parent, SWT.NULL); >- label.setLayoutData(new GridData()); >- label.setText(labelText); >- >- ctl = new Text(parent, style); >- ctl.setLayoutData(new GridData(gData)); >- >- return ctl; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see com.sybase.suade.common.ui.wizards.ISummaryDataSource#getSummaryData() >- */ >- public List getSummaryData() { >- List data = new ArrayList(); >- >- data >- .add(new String[] { >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.summary.driverName.label"), //$NON-NLS-1$ >- mDriverInstance.getName() }); >- >- data >- .add(new String[] { >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.summary.connProps.label"), //$NON-NLS-1$ >- getDBConnProps() }); >- >- data >- .add(new String[] { >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.summary.userName.label"), //$NON-NLS-1$ >- getDBUID() }); >- >- StringBuffer pwdMask = new StringBuffer(); >- if (getDBPWD() != null && getDBPWD().length() > 0) { >- for (int i = 0, count = getDBPWD().length(); i < count; ++i) { >- pwdMask = pwdMask.append('*'); >- } >- } >- >- data >- .add(new String[] { >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.summary.password.label"), //$NON-NLS-1$ >- pwdMask.toString() }); >- >- data.add(new String[] { >- Messages.getString( >- "HSQLDBProfileDetailsWizardPage.summary.url.label"), //$NON-NLS-1$ >- getURL() }); >- >- return data; >- } >- >- private boolean isValid() { >- if (getErrorMessage() != null) { >- setPageComplete(false); >- return false; >- } >- >- return true; >- } >- >- /* >- * (non-Javadoc) >- * >- * @see org.eclipse.jface.dialogs.DialogPage#setErrorMessage(java.lang.String) >- */ >- public void setErrorMessage(String newMessage) { >- super.setErrorMessage(newMessage); >- isValid(); >- } >- >- >- /** >- * @return >- */ >- public String getDriverCategory() { >- return mDriverCategory; >- } >- >- >- /** >- * Sets the driver category that should be used for displaying available >- * driver defnitions. >- * >- * @param driverCategory >- */ >- public void setDriverCategory(String driverCategory) { >- mDriverCategory = driverCategory; >- if (combo != null) { >- combo.setCategory(mDriverCategory); >- } >- } >- >-} >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >--- src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java 12 Mar 2007 19:57:29 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,77 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb.ui.wizard; >- >-import java.util.Properties; >- >-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; >-import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >-import org.eclipse.jface.wizard.Wizard; >- >-/** >- * @author brianf >- * @see Wizard >- * >- */ >-public class NewHSQLDBConnectionProfileWizard extends >- NewConnectionProfileWizard { >- >- protected HSQLDBProfileDetailsWizardPage mPropPage; >- >- /** >- * >- */ >- public NewHSQLDBConnectionProfileWizard() { >- setWindowTitle(Messages.getString("NewHSQLDBConnectionProfileWizard.HSQLDBWizardTitle")); //$NON-NLS-1$ >- } >- >- /** >- * @see org.eclipse.datatools.connectivity.ui.wizards.NewHSQLDBConnectionProfileWizard#addCustomPages() >- */ >- public void addCustomPages() { >- mPropPage = new HSQLDBProfileDetailsWizardPage("detailsPage"); //$NON-NLS-1$ >- addPage(mPropPage); >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard#getProfileProperties() >- */ >- 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; >- } >- >-} >\ No newline at end of file >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb/META-INF/MANIFEST.MF,v >retrieving revision 1.10 >diff -u -r1.10 MANIFEST.MF >--- META-INF/MANIFEST.MF 30 Oct 2007 00:36:48 -0000 1.10 >+++ META-INF/MANIFEST.MF 18 Jan 2008 19:44:25 -0000 >@@ -3,27 +3,17 @@ > Bundle-Name: %Bundle-Name > Bundle-SymbolicName: org.eclipse.datatools.enablement.hsqldb;singleton:=true > Bundle-Version: 1.0.0.200710293 >-Bundle-Activator: org.eclipse.datatools.enablement.hsqldb.HSQLDBActivator > Bundle-Vendor: %Bundle-Vendor > Bundle-Localization: plugin >-Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.datatools.connectivity;bundle-version="[1.0.0,1.5.0)", >+Require-Bundle: org.eclipse.datatools.connectivity;bundle-version="[1.0.0,1.5.0)", > org.eclipse.datatools.connectivity.sqm.core;bundle-version="[1.0.0,1.5.0)", > org.eclipse.datatools.modelbase.sql;bundle-version="[1.0.0,1.5.0)", > org.eclipse.datatools.modelbase.dbdefinition;bundle-version="[1.0.0,1.5.0)", >- org.eclipse.datatools.connectivity.ui;bundle-version="[1.0.0,1.5.0)", >- org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,1.5.0)", >- org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.0,1.5.0)", >- org.eclipse.datatools.connectivity.sqm.server.ui;bundle-version="[1.0.0,1.5.0)", >- org.eclipse.datatools.connectivity.sqm.core.ui;bundle-version="[1.0.0,1.5.0)" >+ org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,1.5.0)" > Eclipse-LazyStart: true >-Export-Package: org.eclipse.datatools.enablement.hsqldb, >- org.eclipse.datatools.enablement.hsqldb.catalog, >+Export-Package: org.eclipse.datatools.enablement.hsqldb.catalog, > org.eclipse.datatools.enablement.hsqldb.connection, > org.eclipse.datatools.enablement.hsqldb.internal, >- org.eclipse.datatools.enablement.hsqldb.ui, >- org.eclipse.datatools.enablement.hsqldb.ui.properties, >- org.eclipse.datatools.enablement.hsqldb.ui.wizard >+ org.eclipse.datatools.enablement.hsqldb.ui > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >+ >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >--- src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties 12 Mar 2007 19:57:29 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,23 +0,0 @@ >-NewHSQLDBConnectionProfileWizard.HSQLDBWizardTitle=HSQLDB Database >- >-HSQLDBProfileDetailsWizardPage.title = Specify a Driver and Connection Details >-HSQLDBProfileDetailsWizardPage.msg = Select a driver from the drop-down and provide login details for the connection. >-HSQLDBProfileDetailsWizardPage.0=Database location: >-HSQLDBProfileDetailsWizardPage.1=Browse... >-HSQLDBProfileDetailsWizardPage.2=Create database (if required) >-HSQLDBProfileDetailsWizardPage.3=Upgrade database to current version >-HSQLDBProfileDetailsWizardPage.driverCombo.label = Select a driver from the drop-down: >-HSQLDBProfileDetailsWizardPage.databaseName.label = Database: >-HSQLDBProfileDetailsWizardPage.url.label = URL: >-HSQLDBProfileDetailsWizardPage.PingButton=Test connection >-HSQLDBProfileDetailsWizardPage.userName.label = User name: >-HSQLDBProfileDetailsWizardPage.password.label = Password: >-HSQLDBProfileDetailsWizardPage.persistpassword.label = Save Password >-HSQLDBProfileDetailsWizardPage.optionalProps.label = Optional properties: >-HSQLDBProfileDetailsWizardPage.summary.driverName.label = Driver name >-HSQLDBProfileDetailsWizardPage.summary.connProps.label = Connection properties >-HSQLDBProfileDetailsWizardPage.summary.userName.label = User name >-HSQLDBProfileDetailsWizardPage.summary.password.label = Password >-HSQLDBProfileDetailsWizardPage.summary.url.label = URL >-HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse = Browse for Database Folder >-HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse = Select the folder that corresponds to your HSQLDB database. >\ No newline at end of file >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >--- src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java 12 Mar 2007 19:57:29 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,44 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb.ui; >- >-import java.util.MissingResourceException; >-import java.util.ResourceBundle; >- >-/** >- * @author brianf >- * >- */ >-public class Messages { >- >- private static final String BUNDLE_NAME = "org.eclipse.datatools.enablement.hsqldb.ui.messages"; //$NON-NLS-1$ >- >- private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle >- .getBundle(BUNDLE_NAME); >- >- /** >- * >- */ >- private Messages() { >- } >- >- /** >- * @param key >- * @return >- */ >- public static String getString(String key) { >- try { >- return RESOURCE_BUNDLE.getString(key); >- } catch (MissingResourceException e) { >- return '!' + key + '!'; >- } >- } >-} >Index: runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >=================================================================== >RCS file: runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >diff -N runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >--- runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi 22 Mar 2007 19:46:53 -0000 1.2 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,102 +0,0 @@ >-<?xml version="1.0" encoding="ASCII"?> >-<DBDefinition:DatabaseVendorDefinition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:DBDefinition="http:///org/eclipse/datatools/modelbase/dbdefinition/dbdefinition.ecore" vendor="HSQLDB" version="1.8" maximumIdentifierLength="64" maximumCommentLength="64" sequenceSupported="true" aliasSupported="true" storedProcedureSupported="false"> >- <predefinedDataTypeDefinitions xmi:id="INTEGER_1" keyConstraintSupported="true" identitySupported="true" primitiveType="INTEGER" jdbcEnumType="4" javaClassName="int"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>INTEGER</name> >- <name>INT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="DOUBLE_PRECISION_1" keyConstraintSupported="true" primitiveType="DOUBLE_PRECISION" jdbcEnumType="8" javaClassName="double"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>DOUBLE</name> >- <name>DOUBLE PRECISION</name> >- <name>FLOAT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="CHARACTER_2" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="12" javaClassName="java.lang.String"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>VARCHAR</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="CHARACTER_3" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="12" javaClassName="java.lang.String"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>VARCHAR_IGNORECASE</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="CHARACTER_1" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="1" javaClassName="java.lang.String"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>CHAR</name> >- <name>CHARACTER</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="CHARACTER_4" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="-1" javaClassName="java.lang.String"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>LONGVARCHAR</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="DATE_1" keyConstraintSupported="true" identitySupported="true" primitiveType="DATE" jdbcEnumType="91" javaClassName="java.sql.Date"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>DATE</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="TIME_1" keyConstraintSupported="true" identitySupported="true" primitiveType="TIME" jdbcEnumType="92" javaClassName="java.sql.Time"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>TIME</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="TIMESTAMP_1" keyConstraintSupported="true" identitySupported="true" primitiveType="TIMESTAMP" jdbcEnumType="93" javaClassName="java.sql.Timestamp"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>TIMESTAMP</name> >- <name>DATETIME</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="DECIMAL_1" scaleSupported="true" precisionSupported="true" keyConstraintSupported="true" identitySupported="true" primitiveType="DECIMAL" jdbcEnumType="3" javaClassName="java.math.BigDecimal"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>DECIMAL</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="NUMERIC_1" scaleSupported="true" precisionSupported="true" keyConstraintSupported="true" primitiveType="NUMERIC" jdbcEnumType="2" javaClassName="java.math.BigDecimal"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>NUMERIC</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BOOLEAN_1" keyConstraintSupported="true" identitySupported="true" primitiveType="BOOLEAN" jdbcEnumType="16" javaClassName="boolean"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>BOOLEAN</name> >- <name>BIT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="SMALLINT_2" keyConstraintSupported="true" identitySupported="true" primitiveType="SMALLINT" jdbcEnumType="-6" javaClassName="byte"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>TINYINT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="SMALLINT_1" keyConstraintSupported="true" identitySupported="true" primitiveType="SMALLINT" jdbcEnumType="5" javaClassName="short"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>SMALLINT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BIGINT_1" keyConstraintSupported="true" identitySupported="true" primitiveType="BIGINT" jdbcEnumType="-5" javaClassName="long"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>BIGINT</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="REAL_1" keyConstraintSupported="true" primitiveType="REAL" jdbcEnumType="7" javaClassName="double"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>REAL</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BINARY_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY" jdbcEnumType="-2" javaClassName="byte[]"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>BINARY</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BINARY_VARYING_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_VARYING" jdbcEnumType="-3" javaClassName="byte[]"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>VARBINARY</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BINARY_VARYING_2" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_VARYING" jdbcEnumType="-4" javaClassName="byte[]"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>LONGVARBINARY</name> >- </predefinedDataTypeDefinitions> >- <predefinedDataTypeDefinitions xmi:id="BINARY_LARGE_OBJECT_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_LARGE_OBJECT" jdbcEnumType="1111" javaClassName="java.lang.Object"> >- <defaultValueTypes>NULL</defaultValueTypes> >- <name>OTHER</name> >- <name>OBJECT</name> >- </predefinedDataTypeDefinitions> >- <columnDefinition identitySupported="true" computedSupported="false" identityStartValueSupported="true" identityIncrementSupported="true" identityMinimumSupported="true" identityMaximumSupported="true" identityCycleSupported="true"/> >- <constraintDefinition clusteredPrimaryKeySupported="true" clusteredUniqueConstraintSupported="true"> >- <parentUpdateDRIRuleType>RESTRICT</parentUpdateDRIRuleType> >- <parentUpdateDRIRuleType>NO_ACTION</parentUpdateDRIRuleType> >- <parentDeleteDRIRuleType>RESTRICT</parentDeleteDRIRuleType> >- <parentDeleteDRIRuleType>CASCADE</parentDeleteDRIRuleType> >- <parentDeleteDRIRuleType>SET_NULL</parentDeleteDRIRuleType> >- <parentDeleteDRIRuleType>NO_ACTION</parentDeleteDRIRuleType> >- <checkOption>NONE</checkOption> >- <checkOption>LOCAL</checkOption> >- <checkOption>CASCADE</checkOption> >- </constraintDefinition> >-</DBDefinition:DatabaseVendorDefinition> >Index: src/org/eclipse/datatools/enablement/hsqldb/HSQLDBActivator.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/HSQLDBActivator.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/HSQLDBActivator.java >--- src/org/eclipse/datatools/enablement/hsqldb/HSQLDBActivator.java 12 Mar 2007 19:57:29 -0000 1.1 >+++ /dev/null 1 Jan 1970 00:00:00 -0000 >@@ -1,60 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2007 Sybase, Inc. >- * >- * 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: Brian Fitzpatrick - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.datatools.enablement.hsqldb; >- >-import org.eclipse.ui.plugin.AbstractUIPlugin; >-import org.osgi.framework.BundleContext; >- >-/** >- * The activator class controls the plug-in life cycle >- */ >-public class HSQLDBActivator extends AbstractUIPlugin { >- >- // The plug-in ID >- public static final String PLUGIN_ID = "org.eclipse.datatools.enablement.hsqldb"; //$NON-NLS-1$ >- >- // The shared instance >- private static HSQLDBActivator plugin; >- >- /** >- * The constructor >- */ >- public HSQLDBActivator() { >- plugin = this; >- } >- >- /* >- * (non-Javadoc) >- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) >- */ >- public void start(BundleContext context) throws Exception { >- super.start(context); >- } >- >- /* >- * (non-Javadoc) >- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) >- */ >- public void stop(BundleContext context) throws Exception { >- plugin = null; >- super.stop(context); >- } >- >- /** >- * Returns the shared instance >- * >- * @return the shared instance >- */ >- public static HSQLDBActivator getDefault() { >- return plugin; >- } >- >-} >#P org.eclipse.datatools.enablement.hsqldb.dbdefinition >Index: build.properties >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb.dbdefinition/build.properties,v >retrieving revision 1.2 >diff -u -r1.2 build.properties >--- build.properties 8 Jan 2008 19:21:29 -0000 1.2 >+++ build.properties 18 Jan 2008 19:44:26 -0000 >@@ -1,7 +1,10 @@ >-bin.includes = META-INF/ >+bin.includes = META-INF/,\ >+ runtime/,\ >+ plugin.properties,\ >+ plugin.xml > src.dir = src/ > plugin.version = 1.0.0.200801041 > javadoc.dir = doc/api/ > download.dir = ./download/ > javac.source = 1.4 >-javac.target = 1.4 >\ No newline at end of file >+javac.target = 1.4 >Index: .cvsignore >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb.dbdefinition/.cvsignore,v >retrieving revision 1.1 >diff -u -r1.1 .cvsignore >--- .cvsignore 8 Jan 2008 19:03:31 -0000 1.1 >+++ .cvsignore 18 Jan 2008 19:44:26 -0000 >@@ -1,2 +1 @@ > bin >-build.xml >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb.dbdefinition/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 8 Jan 2008 19:03:30 -0000 1.1 >+++ META-INF/MANIFEST.MF 18 Jan 2008 19:44:26 -0000 >@@ -1,9 +1,9 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 >-Bundle-Name: HSQLDB Dbdefinition Plug-in >+Bundle-Name: %Bundle-Name > Bundle-SymbolicName: org.eclipse.datatools.enablement.hsqldb.dbdefinition; singleton:=true > Bundle-Version: 1.0.0.200801041 >-Bundle-Vendor: Eclipse.org >+Bundle-Vendor: %Bundle-Vendor > Bundle-Localization: plugin > Eclipse-AutoStart: true > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >=================================================================== >RCS file: runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >diff -N runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,102 @@ >+<?xml version="1.0" encoding="ASCII"?> >+<DBDefinition:DatabaseVendorDefinition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:DBDefinition="http:///org/eclipse/datatools/modelbase/dbdefinition/dbdefinition.ecore" vendor="HSQLDB" version="1.8" maximumIdentifierLength="64" maximumCommentLength="64" sequenceSupported="true" aliasSupported="true" storedProcedureSupported="false"> >+ <predefinedDataTypeDefinitions xmi:id="INTEGER_1" keyConstraintSupported="true" identitySupported="true" primitiveType="INTEGER" jdbcEnumType="4" javaClassName="int"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>INTEGER</name> >+ <name>INT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="DOUBLE_PRECISION_1" keyConstraintSupported="true" primitiveType="DOUBLE_PRECISION" jdbcEnumType="8" javaClassName="double"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>DOUBLE</name> >+ <name>DOUBLE PRECISION</name> >+ <name>FLOAT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="CHARACTER_2" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="12" javaClassName="java.lang.String"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>VARCHAR</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="CHARACTER_3" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="12" javaClassName="java.lang.String"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>VARCHAR_IGNORECASE</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="CHARACTER_1" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="1" javaClassName="java.lang.String"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>CHAR</name> >+ <name>CHARACTER</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="CHARACTER_4" lengthSupported="true" keyConstraintSupported="true" maximumLength="2147483647" jdbcEnumType="-1" javaClassName="java.lang.String"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>LONGVARCHAR</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="DATE_1" keyConstraintSupported="true" identitySupported="true" primitiveType="DATE" jdbcEnumType="91" javaClassName="java.sql.Date"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>DATE</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="TIME_1" keyConstraintSupported="true" identitySupported="true" primitiveType="TIME" jdbcEnumType="92" javaClassName="java.sql.Time"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>TIME</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="TIMESTAMP_1" keyConstraintSupported="true" identitySupported="true" primitiveType="TIMESTAMP" jdbcEnumType="93" javaClassName="java.sql.Timestamp"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>TIMESTAMP</name> >+ <name>DATETIME</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="DECIMAL_1" scaleSupported="true" precisionSupported="true" keyConstraintSupported="true" identitySupported="true" primitiveType="DECIMAL" jdbcEnumType="3" javaClassName="java.math.BigDecimal"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>DECIMAL</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="NUMERIC_1" scaleSupported="true" precisionSupported="true" keyConstraintSupported="true" primitiveType="NUMERIC" jdbcEnumType="2" javaClassName="java.math.BigDecimal"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>NUMERIC</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BOOLEAN_1" keyConstraintSupported="true" identitySupported="true" primitiveType="BOOLEAN" jdbcEnumType="16" javaClassName="boolean"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>BOOLEAN</name> >+ <name>BIT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="SMALLINT_2" keyConstraintSupported="true" identitySupported="true" primitiveType="SMALLINT" jdbcEnumType="-6" javaClassName="byte"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>TINYINT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="SMALLINT_1" keyConstraintSupported="true" identitySupported="true" primitiveType="SMALLINT" jdbcEnumType="5" javaClassName="short"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>SMALLINT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BIGINT_1" keyConstraintSupported="true" identitySupported="true" primitiveType="BIGINT" jdbcEnumType="-5" javaClassName="long"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>BIGINT</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="REAL_1" keyConstraintSupported="true" primitiveType="REAL" jdbcEnumType="7" javaClassName="double"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>REAL</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BINARY_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY" jdbcEnumType="-2" javaClassName="byte[]"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>BINARY</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BINARY_VARYING_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_VARYING" jdbcEnumType="-3" javaClassName="byte[]"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>VARBINARY</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BINARY_VARYING_2" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_VARYING" jdbcEnumType="-4" javaClassName="byte[]"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>LONGVARBINARY</name> >+ </predefinedDataTypeDefinitions> >+ <predefinedDataTypeDefinitions xmi:id="BINARY_LARGE_OBJECT_1" keyConstraintSupported="true" maximumValue="2147483647" primitiveType="BINARY_LARGE_OBJECT" jdbcEnumType="1111" javaClassName="java.lang.Object"> >+ <defaultValueTypes>NULL</defaultValueTypes> >+ <name>OTHER</name> >+ <name>OBJECT</name> >+ </predefinedDataTypeDefinitions> >+ <columnDefinition identitySupported="true" computedSupported="false" identityStartValueSupported="true" identityIncrementSupported="true" identityMinimumSupported="true" identityMaximumSupported="true" identityCycleSupported="true"/> >+ <constraintDefinition clusteredPrimaryKeySupported="true" clusteredUniqueConstraintSupported="true"> >+ <parentUpdateDRIRuleType>RESTRICT</parentUpdateDRIRuleType> >+ <parentUpdateDRIRuleType>NO_ACTION</parentUpdateDRIRuleType> >+ <parentDeleteDRIRuleType>RESTRICT</parentDeleteDRIRuleType> >+ <parentDeleteDRIRuleType>CASCADE</parentDeleteDRIRuleType> >+ <parentDeleteDRIRuleType>SET_NULL</parentDeleteDRIRuleType> >+ <parentDeleteDRIRuleType>NO_ACTION</parentDeleteDRIRuleType> >+ <checkOption>NONE</checkOption> >+ <checkOption>LOCAL</checkOption> >+ <checkOption>CASCADE</checkOption> >+ </constraintDefinition> >+</DBDefinition:DatabaseVendorDefinition> >Index: plugin.xml >=================================================================== >RCS file: plugin.xml >diff -N plugin.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,14 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?> >+<plugin> >+ <extension >+ point="org.eclipse.datatools.connectivity.sqm.core.databaseDefinition"> >+ <definition >+ description="%product.display.description" >+ file="runtime/vendors/HSQLDB_1.8/HSQLDB_1.8.xmi" >+ product="HSQLDB" >+ productDisplayString="%product.display.string" >+ version="1.8" >+ versionDisplayString="%product.display.version.string"/> >+ </extension> >+</plugin> >Index: plugin.properties >=================================================================== >RCS file: plugin.properties >diff -N plugin.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,6 @@ >+Bundle-Vendor = Eclipse.org >+Bundle-Name = Eclipse Data Tools Platform HSQLDB Database Definition Enablement Plug-in >+ >+product.display.string = HSQLDB >+product.display.version.string = 1.8 >+product.display.description = HSQLDB Connection Profile >#P org.eclipse.datatools.enablement.hsqldb.ui >Index: src/placeholder.txt >=================================================================== >RCS file: src/placeholder.txt >diff -N src/placeholder.txt >Index: build.properties >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb.ui/build.properties,v >retrieving revision 1.2 >diff -u -r1.2 build.properties >--- build.properties 8 Jan 2008 19:21:28 -0000 1.2 >+++ build.properties 18 Jan 2008 19:44:27 -0000 >@@ -1,7 +1,9 @@ > source.. = src/ > output.. = bin/ > bin.includes = META-INF/,\ >- . >+ .,\ >+ plugin.xml,\ >+ plugin.properties > > jars.compile.order = . > output.. = bin/ >@@ -11,4 +13,4 @@ > javadoc.dir = doc/api/ > download.dir = ./download/ > javac.source = 1.4 >-javac.target = 1.4 >\ No newline at end of file >+javac.target = 1.4 >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/datatools/org.eclipse.datatools.enablement/plugins/org.eclipse.datatools.enablement.hsqldb.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.1 >diff -u -r1.1 MANIFEST.MF >--- META-INF/MANIFEST.MF 8 Jan 2008 19:03:31 -0000 1.1 >+++ META-INF/MANIFEST.MF 18 Jan 2008 19:44:27 -0000 >@@ -1,9 +1,24 @@ > Manifest-Version: 1.0 > Bundle-ManifestVersion: 2 >-Bundle-Name: HSQLDB Ui Plug-in >-Bundle-SymbolicName: org.eclipse.datatools.enablement.hsqldb.ui >+Bundle-Name: %Bundle-Name >+Bundle-SymbolicName: org.eclipse.datatools.enablement.hsqldb.ui;singleton:=true > Bundle-Version: 1.0.0.200801041 >-Bundle-Vendor: Eclipse.org >+Bundle-Vendor: %Bundle-Vendor >+Bundle-Activator: org.eclipse.datatools.enablement.hsqldb.ui.HSQLDBActivator > Bundle-Localization: plugin >-Eclipse-AutoStart: true >+Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >+ org.eclipse.datatools.connectivity.sqm.core;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.connectivity;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.connectivity.ui;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.connectivity.db.generic;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.enablement.hsqldb;bundle-version="[1.0.0,2.0.0)", >+ org.eclipse.datatools.connectivity.sqm.server.ui;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.datatools.connectivity.sqm.core.ui;bundle-version="[1.0.0,1.5.0)", >+ org.eclipse.ui.navigator;bundle-version="[3.2.0,4.0.0)" >+Eclipse-LazyStart: true >+Export-Package: org.eclipse.datatools.enablement.hsqldb.ui, >+ org.eclipse.datatools.enablement.hsqldb.ui.properties, >+ org.eclipse.datatools.enablement.hsqldb.ui.wizard > Bundle-RequiredExecutionEnvironment: J2SE-1.4 >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/HSQLDBActivator.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/HSQLDBActivator.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/HSQLDBActivator.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/HSQLDBActivator.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,61 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui; >+ >+import org.eclipse.ui.plugin.AbstractUIPlugin; >+import org.osgi.framework.BundleContext; >+ >+/** >+ * The activator class controls the plug-in life cycle >+ */ >+public class HSQLDBActivator extends AbstractUIPlugin { >+ >+ // The plug-in ID >+ public static final String PLUGIN_ID = "org.eclipse.datatools.enablement.hsqldb"; //$NON-NLS-1$ >+ >+ // The shared instance >+ private static HSQLDBActivator plugin; >+ >+ /** >+ * The constructor >+ */ >+ public HSQLDBActivator() { >+ plugin = this; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) >+ */ >+ public void start(BundleContext context) throws Exception { >+ super.start(context); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) >+ */ >+ public void stop(BundleContext context) throws Exception { >+ plugin = null; >+ super.stop(context); >+ } >+ >+ /** >+ * Returns the shared instance >+ * >+ * @return the shared instance >+ */ >+ public static HSQLDBActivator getDefault() { >+ return plugin; >+ } >+ >+} >Index: about.html >=================================================================== >RCS file: about.html >diff -N about.html >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ about.html 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,28 @@ >+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" >+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> >+<html xmlns="http://www.w3.org/1999/xhtml"> >+<head> >+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> >+<title>About</title> >+</head> >+<body lang="EN-US"> >+<h2>About This Content</h2> >+ >+<p>June 2, 2006</p> >+<h3>License</h3> >+ >+<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise >+indicated below, the Content is provided to you under the terms and conditions of the >+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available >+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. >+For purposes of the EPL, "Program" will mean the Content.</p> >+ >+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is >+being redistributed by another party ("Redistributor") and different terms and conditions may >+apply to your use of any object code in the Content. Check the Redistributor's license that was >+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise >+indicated below, the terms and conditions of the EPL still apply to any source code in the Content >+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> >+ >+</body> >+</html> >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/NewHSQLDBConnectionProfileWizard.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,78 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui.wizard; >+ >+import java.util.Properties; >+ >+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; >+import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >+import org.eclipse.jface.wizard.Wizard; >+ >+/** >+ * @author brianf >+ * @see Wizard >+ * >+ */ >+public class NewHSQLDBConnectionProfileWizard extends >+ NewConnectionProfileWizard { >+ >+ protected HSQLDBProfileDetailsWizardPage mPropPage; >+ >+ /** >+ * >+ */ >+ public NewHSQLDBConnectionProfileWizard() { >+ setWindowTitle(Messages.getString("NewHSQLDBConnectionProfileWizard.HSQLDBWizardTitle")); //$NON-NLS-1$ >+ } >+ >+ /** >+ * @see org.eclipse.datatools.connectivity.ui.wizards.NewHSQLDBConnectionProfileWizard#addCustomPages() >+ */ >+ public void addCustomPages() { >+ mPropPage = new HSQLDBProfileDetailsWizardPage("detailsPage"); //$NON-NLS-1$ >+ addPage(mPropPage); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard#getProfileProperties() >+ */ >+ 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; >+ } >+ >+} >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/wizard/HSQLDBProfileDetailsWizardPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,577 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui.wizard; >+ >+import java.io.File; >+import java.util.ArrayList; >+import java.util.List; >+import java.util.StringTokenizer; >+ >+import javax.swing.event.ChangeEvent; >+import javax.swing.event.ChangeListener; >+ >+import org.eclipse.core.runtime.Path; >+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants; >+import org.eclipse.datatools.connectivity.drivers.DriverInstance; >+import org.eclipse.datatools.connectivity.internal.ui.DelimitedStringList; >+import org.eclipse.datatools.connectivity.internal.ui.DriverListCombo; >+import org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage; >+import org.eclipse.datatools.enablement.hsqldb.ui.IHSQLDBConnectionProfileConstants; >+import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.ModifyEvent; >+import org.eclipse.swt.events.ModifyListener; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.DirectoryDialog; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * This class gathers the properties for the HSQLDB connection profile. >+ * >+ * @author brianf >+ */ >+public class HSQLDBProfileDetailsWizardPage extends ConnectionProfileDetailsPage { >+ >+ // ui pieces >+ private Text mDatabaseNameText; >+ >+ private Text mURLText; >+ >+ private Text mDBUIDText; >+ >+ private Text mDBPWDText; >+ >+ private Button mSaveDBPWDCheckbox; >+ >+ private DelimitedStringList mDBConnProps; >+ >+ final DriverListCombo combo = new DriverListCombo(); >+ >+ private Text mDBFilePathText; >+ >+ private Button mBrowseFilePathButton; >+ >+ // stashed driver instance >+ private DriverInstance mDriverInstance; >+ >+ private String mDriverCategory; >+ >+ /** >+ * Constructor >+ * >+ * @param pageName >+ */ >+ public HSQLDBProfileDetailsWizardPage(String pageName) { >+ super(pageName); >+ setTitle(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.title")); //$NON-NLS-1$ >+ setDescription(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.msg")); //$NON-NLS-1$ >+ setDriverCategory(IHSQLDBConnectionProfileConstants.HSQLDB_CATEGORY_ID); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) >+ */ >+ public void createCustomControl(Composite parent) { >+ Composite content = new Composite(parent, SWT.NULL); >+ GridLayout layout = new GridLayout(2, false); >+ content.setLayout(layout); >+ >+ // set up the drivers combo >+ this.combo.setLabelText(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.driverCombo.label")); //$NON-NLS-1$ >+ this.combo.setCategory(getDriverCategory()); >+ this.combo.setNullDriverIsValid(false); >+ this.combo.createContents(content); >+ if (this.combo.getErrorMessage() != null) { >+ setErrorMessage(this.combo.getErrorMessage()); >+ } >+ >+ // set up the fields >+ this.mDatabaseNameText = (Text) createLabelTextPair( >+ content, >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.databaseName.label"), //$NON-NLS-1$ >+ this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ >+ Label label = new Label(content, SWT.NULL); >+ label.setLayoutData(new GridData()); >+ label.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.0")); //$NON-NLS-1$ >+ >+ Composite textAndBrowseComposite = new Composite(content, SWT.NULL); >+ GridLayout subCompositeLayout = new GridLayout(2, false); >+ subCompositeLayout.marginLeft = -5; >+ subCompositeLayout.marginRight = -5; >+ subCompositeLayout.marginTop = -5; >+ subCompositeLayout.marginBottom = -5; >+ textAndBrowseComposite.setLayout(subCompositeLayout); >+ textAndBrowseComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ this.mDBFilePathText = new Text(textAndBrowseComposite, SWT.BORDER); >+ this.mDBFilePathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ this.mBrowseFilePathButton = new Button(textAndBrowseComposite, SWT.PUSH); >+ this.mBrowseFilePathButton.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.1")); //$NON-NLS-1$ >+ this.mBrowseFilePathButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); >+ >+ this.mDBUIDText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.userName.label"), //$NON-NLS-1$ >+ this.mDBUIDText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ >+ this.mDBPWDText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.password.label"), //$NON-NLS-1$ >+ this.mDBPWDText, SWT.BORDER | SWT.PASSWORD, GridData.FILL_HORIZONTAL); >+ >+ this.mURLText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.url.label"), //$NON-NLS-1$ >+ this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ >+ this.mSaveDBPWDCheckbox = new Button(content, SWT.CHECK); >+ this.mSaveDBPWDCheckbox.setText(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.persistpassword.label")); //$NON-NLS-1$ >+ this.mSaveDBPWDCheckbox.setLayoutData(new GridData(GridData.BEGINNING, >+ GridData.CENTER, true, false, 2, 1)); >+ >+ // spacer >+ Composite spacer = new Composite(content, SWT.NULL); >+ GridData gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ gdata.heightHint = 20; >+ spacer.setLayoutData(gdata); >+ >+ // followed by the optional properties >+ label = new Label(content, SWT.NULL); >+ gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ label.setLayoutData(gdata); >+ label.setText(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.optionalProps.label")); //$NON-NLS-1$ >+ >+ this.mDBConnProps = new DelimitedStringList(content, SWT.NONE); >+ gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ this.mDBConnProps.setLayoutData(gdata); >+ >+// // now set up the initial instance >+// if (this.mDriverInstance == null) >+// this.mDriverInstance = this.combo.getSelectedDriverInstance(); >+ >+ this.mDBConnProps.addChangeListener(new ChangeListener() { >+ >+ public void stateChanged(ChangeEvent arg0) { >+ setErrorMessage(null); >+ if (HSQLDBProfileDetailsWizardPage.this.mDBConnProps.getWarning() != null) { >+ setErrorMessage(HSQLDBProfileDetailsWizardPage.this.mDBConnProps >+ .getWarning()); >+ } >+ } >+ >+ }); >+ >+ // add a change listener to the combo box so >+ // we know when a new driver has been selected >+ this.combo.addChangeListener(new ChangeListener() { >+ >+ public void stateChanged(ChangeEvent arg0) { >+ HSQLDBProfileDetailsWizardPage.this.mDriverInstance = HSQLDBProfileDetailsWizardPage.this.combo >+ .getSelectedDriverInstance(); >+ setErrorMessage(null); >+ if (HSQLDBProfileDetailsWizardPage.this.combo.getErrorMessage() != null) { >+ setErrorMessage(HSQLDBProfileDetailsWizardPage.this.combo >+ .getErrorMessage()); >+ } >+ HSQLDBProfileDetailsWizardPage.this.mDatabaseNameText >+ .setText(getDriverDatabaseName()); >+ >+ HSQLDBProfileDetailsWizardPage.this.mURLText >+ .setText(getDriverURL()); >+ HSQLDBProfileDetailsWizardPage.this.updatePropsFromURL(); >+ >+ String username = HSQLDBProfileDetailsWizardPage.this >+ .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.USERNAME_PROP_ID); >+ if (username == null || username.trim().length() == 0) >+ username = new String(); >+ HSQLDBProfileDetailsWizardPage.this.mDBUIDText.setText(username); >+ >+ String password = HSQLDBProfileDetailsWizardPage.this >+ .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >+ if (password == null || password.trim().length() == 0) >+ password = new String(); >+ HSQLDBProfileDetailsWizardPage.this.mDBPWDText.setText(password); >+ >+ setPageComplete(isValid()); >+ } >+ >+ }); >+ >+ this.mDBFilePathText.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ HSQLDBProfileDetailsWizardPage.this.updateURLFromProps(); >+ } >+ }); >+ this.mBrowseFilePathButton.addSelectionListener( new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ HSQLDBProfileDetailsWizardPage.this.browseForDBFolder(); >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ HSQLDBProfileDetailsWizardPage.this.browseForDBFolder(); >+ } >+ }); >+ >+ this.combo.selectFirstItem(); >+ // now set up the initial instance >+ if (this.mDriverInstance == null) >+ this.mDriverInstance = this.combo.getSelectedDriverInstance(); >+ if (this.mDriverInstance != null) { >+ this.mURLText.setText(getDriverURL()); >+ } >+ this.mURLText.setEnabled(false); >+ >+ } >+ >+ /** >+ * Browse for the database folder >+ */ >+ private void browseForDBFolder() { >+ DirectoryDialog dialog = new DirectoryDialog(getShell()); >+ dialog.setText(Messages >+ .getString("HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse")); //$NON-NLS-1$ >+ dialog.setMessage(Messages >+ .getString("HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse")); //$NON-NLS-1$ >+ >+ String dirName = mDBFilePathText.getText(); >+ >+ File path = new File(dirName); >+ if (path.exists()) { >+ dialog.setFilterPath(new Path(dirName).toOSString()); >+ } >+ >+ String selectedDirectory = dialog.open(); >+ if (selectedDirectory != null) { >+ this.mDBFilePathText.setText(selectedDirectory); >+ } >+ } >+ >+ /** >+ * Update the UI components from the URL >+ */ >+ private void updatePropsFromURL() { >+ if (this.mDBFilePathText != null && this.mURLText != null) { >+ String url = this.mURLText.getText(); >+ String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >+ if (chunks.length > 0) { >+ String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >+ if (chunks2.length > 2) { >+ String filepath = chunks2[2]; >+ if (chunks2.length > 3) { >+ filepath = filepath + ":" + chunks2[3]; //$NON-NLS-1$ >+ } >+ this.mDBFilePathText.setText(filepath); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Update the URL from the UI components >+ */ >+ private void updateURLFromProps() { >+ if (this.mDBFilePathText != null && this.mURLText != null) { >+ String url = this.mURLText.getText(); >+ String filePath = this.mDBFilePathText.getText(); >+ //jdbc:derby:C:\DerbyDatabases\MyDB;create=true >+ String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >+ if (chunks.length > 0) { >+ String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >+ if (chunks2.length > 2) { >+ url = chunks2[0] + ":" + chunks2[1] + ":" + filePath; //$NON-NLS-1$ //$NON-NLS-2$ >+ this.mURLText.setText(url); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Parse a string into a string array based on a token >+ * @param str_list >+ * @param token >+ * @return >+ */ >+ private String[] parseString(String str_list, String token) { >+ StringTokenizer tk = new StringTokenizer(str_list, token); >+ String[] pieces = new String[tk.countTokens()]; >+ int index = 0; >+ while (tk.hasMoreTokens()) >+ pieces[index++] = tk.nextToken(); >+ return pieces; >+ } >+ >+ /** >+ * @param propertyID >+ * @return >+ */ >+ private String getPropertyFromDriverInstance(String propertyID) { >+ String returnStr = new String(); >+ if (this.mDriverInstance != null >+ && this.mDriverInstance.getProperty(propertyID) != null) { >+ returnStr = this.mDriverInstance.getProperty(propertyID); >+ } >+ return returnStr; >+ } >+ >+ /** >+ * Get the sample URL from the driver instance. >+ * >+ * @return >+ */ >+ public String getDriverURL() { >+ if (this.mDriverInstance != null >+ && this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID) != null) >+ return this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID); >+ return new String(); >+ } >+ >+ /** >+ * Get the sample database name from the driver instance. >+ * >+ * @return >+ */ >+ public String getDriverDatabaseName() { >+ if (this.mDriverInstance != null >+ && this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID) != null) >+ return this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID); >+ return new String(); >+ } >+ >+ /** >+ * Get the vendor >+ * >+ * @return >+ */ >+ public String getVendor() { >+ String vendor = ""; //$NON-NLS-1$ >+ if (this.mDriverInstance != null) { >+ vendor = this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID); >+ } >+ return vendor; >+ } >+ >+ /** >+ * Get the version >+ * >+ * @return >+ */ >+ public String getVersion() { >+ String version = ""; //$NON-NLS-1$ >+ if (this.mDriverInstance != null) { >+ version = this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID); >+ } >+ return version; >+ } >+ >+ /** >+ * Get the driver class >+ * >+ * @return >+ */ >+ public String getDriverClass() { >+ String driverClass = ""; //$NON-NLS-1$ >+ if (this.mDriverInstance != null) { >+ driverClass = this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID); >+ } >+ return driverClass; >+ } >+ >+ /** >+ * Get the user name >+ * >+ * @return >+ */ >+ public String getDBUID() { >+ return this.mDBUIDText.getText(); >+ } >+ >+ /** >+ * Get the password >+ * >+ * @return >+ */ >+ public String getDBPWD() { >+ return this.mDBPWDText.getText(); >+ } >+ >+ /** >+ * Get the password >+ * >+ * @return >+ */ >+ public boolean getSaveDBPWD() { >+ return this.mSaveDBPWDCheckbox.getSelection(); >+ } >+ >+ /** >+ * Get the optional connection properties >+ * >+ * @return >+ */ >+ public String getDBConnProps() { >+ return this.mDBConnProps.getSelection(); >+ } >+ >+ /** >+ * Get the database name >+ * >+ * @return >+ */ >+ public String getDatabaseName() { >+ return this.mDatabaseNameText.getText(); >+ } >+ >+ /** >+ * Get the URL for the CP >+ * >+ * @return >+ */ >+ public String getURL() { >+ return this.mURLText.getText(); >+ } >+ >+ /** >+ * Get the driver ID >+ * >+ * @return >+ */ >+ public String getDriverID() { >+ return this.mDriverInstance.getId(); >+ } >+ >+ /* >+ * Create a label and a text box side by side. >+ */ >+ private Control createLabelTextPair(Composite parent, String labelText, >+ Control ctl, int style, int gData) { >+ Label label = new Label(parent, SWT.NULL); >+ label.setLayoutData(new GridData()); >+ label.setText(labelText); >+ >+ ctl = new Text(parent, style); >+ ctl.setLayoutData(new GridData(gData)); >+ >+ return ctl; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see com.sybase.suade.common.ui.wizards.ISummaryDataSource#getSummaryData() >+ */ >+ public List getSummaryData() { >+ List data = new ArrayList(); >+ >+ data >+ .add(new String[] { >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.summary.driverName.label"), //$NON-NLS-1$ >+ mDriverInstance.getName() }); >+ >+ data >+ .add(new String[] { >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.summary.connProps.label"), //$NON-NLS-1$ >+ getDBConnProps() }); >+ >+ data >+ .add(new String[] { >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.summary.userName.label"), //$NON-NLS-1$ >+ getDBUID() }); >+ >+ StringBuffer pwdMask = new StringBuffer(); >+ if (getDBPWD() != null && getDBPWD().length() > 0) { >+ for (int i = 0, count = getDBPWD().length(); i < count; ++i) { >+ pwdMask = pwdMask.append('*'); >+ } >+ } >+ >+ data >+ .add(new String[] { >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.summary.password.label"), //$NON-NLS-1$ >+ pwdMask.toString() }); >+ >+ data.add(new String[] { >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.summary.url.label"), //$NON-NLS-1$ >+ getURL() }); >+ >+ return data; >+ } >+ >+ private boolean isValid() { >+ if (getErrorMessage() != null) { >+ setPageComplete(false); >+ return false; >+ } >+ >+ return true; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.dialogs.DialogPage#setErrorMessage(java.lang.String) >+ */ >+ public void setErrorMessage(String newMessage) { >+ super.setErrorMessage(newMessage); >+ isValid(); >+ } >+ >+ >+ /** >+ * @return >+ */ >+ public String getDriverCategory() { >+ return mDriverCategory; >+ } >+ >+ >+ /** >+ * Sets the driver category that should be used for displaying available >+ * driver defnitions. >+ * >+ * @param driverCategory >+ */ >+ public void setDriverCategory(String driverCategory) { >+ mDriverCategory = driverCategory; >+ if (combo != null) { >+ combo.setCategory(mDriverCategory); >+ } >+ } >+ >+} >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/messages.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,23 @@ >+NewHSQLDBConnectionProfileWizard.HSQLDBWizardTitle=HSQLDB Database >+ >+HSQLDBProfileDetailsWizardPage.title = Specify a Driver and Connection Details >+HSQLDBProfileDetailsWizardPage.msg = Select a driver from the drop-down and provide login details for the connection. >+HSQLDBProfileDetailsWizardPage.0=Database location: >+HSQLDBProfileDetailsWizardPage.1=Browse... >+HSQLDBProfileDetailsWizardPage.2=Create database (if required) >+HSQLDBProfileDetailsWizardPage.3=Upgrade database to current version >+HSQLDBProfileDetailsWizardPage.driverCombo.label = Select a driver from the drop-down: >+HSQLDBProfileDetailsWizardPage.databaseName.label = Database: >+HSQLDBProfileDetailsWizardPage.url.label = URL: >+HSQLDBProfileDetailsWizardPage.PingButton=Test connection >+HSQLDBProfileDetailsWizardPage.userName.label = User name: >+HSQLDBProfileDetailsWizardPage.password.label = Password: >+HSQLDBProfileDetailsWizardPage.persistpassword.label = Save Password >+HSQLDBProfileDetailsWizardPage.optionalProps.label = Optional properties: >+HSQLDBProfileDetailsWizardPage.summary.driverName.label = Driver name >+HSQLDBProfileDetailsWizardPage.summary.connProps.label = Connection properties >+HSQLDBProfileDetailsWizardPage.summary.userName.label = User name >+HSQLDBProfileDetailsWizardPage.summary.password.label = Password >+HSQLDBProfileDetailsWizardPage.summary.url.label = URL >+HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse = Browse for Database Folder >+HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse = Select the folder that corresponds to your HSQLDB database. >Index: plugin.xml >=================================================================== >RCS file: plugin.xml >diff -N plugin.xml >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.xml 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,60 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<?eclipse version="3.2"?> >+<plugin> >+ <extension >+ point="org.eclipse.datatools.connectivity.connectionProfile"> >+ <newWizard >+ class="org.eclipse.datatools.enablement.hsqldb.ui.wizard.NewHSQLDBConnectionProfileWizard" >+ icon="icons/new_db_element.gif" >+ id="org.eclipse.datatools.enablement.hsqldb.connectionProfile.NewConnectionProfileWizard" >+ name="%connection.profile.newwizard" >+ description = "%connection.profile.newwizard.description" >+ profile="org.eclipse.datatools.enablement.hsqldb.connectionProfile"/> >+ </extension> >+ >+ <extension >+ point="org.eclipse.ui.propertyPages"> >+ <page >+ class="org.eclipse.datatools.enablement.hsqldb.ui.properties.HSQLDBPropertyPage" >+ id="org.eclipse.datatools.enablement.hsqldb.connectionProfile.profileProperties" >+ name="%profile.page.name"> >+ <filter >+ name="org.eclipse.datatools.profile.property.id" >+ value="org.eclipse.datatools.enablement.hsqldb.connectionProfile"/> >+ <enabledWhen> >+ <instanceof >+ value="org.eclipse.datatools.connectivity.IConnectionProfile"> >+ </instanceof> >+ </enabledWhen> >+ </page> >+ </extension> >+ >+<!-- >+ <extension >+ point="org.eclipse.ui.navigator.viewer"> >+ <viewerContentBinding viewerId="org.eclipse.datatools.connectivity.DataSourceExplorerNavigator"> >+ <includes> >+ <contentExtension pattern="org.eclipse.datatools.enablement.hsqldb.navigatorContent"/> >+ </includes> >+ </viewerContentBinding> >+ </extension> >+ >+ <extension >+ point="org.eclipse.ui.navigator.navigatorContent"> >+ <navigatorContent >+ activeByDefault="true" >+ contentProvider="org.eclipse.datatools.enablement.hsqldb.catalog.HSQLDBPipelineTreeContentProvider" >+ id="org.eclipse.datatools.enablement.hsqldb.navigatorContent" >+ labelProvider="org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.SQLModelLabelProviderExtension" >+ name="%navigator.content.name" >+ priority="highest"> >+ <override >+ policy="InvokeAlwaysRegardlessOfSuppressedExt" >+ suppressedExtensionId="org.eclipse.datatools.connectivity.db.sqlModelContent"/> >+ <triggerPoints> >+ <instanceof value="org.eclipse.datatools.enablement.hsqldb.catalog.HSQLDBCatalogSchema"/> >+ </triggerPoints> >+ </navigatorContent> >+ </extension> >+--> >+</plugin> >Index: plugin.properties >=================================================================== >RCS file: plugin.properties >diff -N plugin.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ plugin.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,21 @@ >+DRIVER_CLASS_PROPERTY_NAME=Driver Class >+VENDOR_PROPERTY_NAME=Vendor >+VERSION_PROPERTY_NAME=Version >+DATABASE_NAME_PROPERTY_NAME=Database Name >+CONNECTION_URL_PROPERTY_NAME=Connection URL >+USER_ID_PROPERTY_NAME=User ID >+PASSWORD_PROPERTY_NAME=Password >+ >+Bundle-Vendor = Eclipse.org >+Bundle-Name = Eclipse Data Tools Platform HSQLDB UI Enablement Plug-in >+profile.page.name = HSQLDB Profile Properties >+ >+driver.category.name = HSQLDB >+driver.category.description = HSQLDB JDBC Drivers >+driver.version.category.name = 1.8 >+driver.version.category.description = HSQLDB JDBC Drivers for Version 1.8 >+driver.name = HSQLDB JDBC Driver >+driver.description = JDBC driver for HSQLDB >+ >+connection.profile.newwizard = HSQLDB >+connection.profile.newwizard.description = Create an HSQLDB connection profile. >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/properties/HSQLDBPropertyPage.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,480 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui.properties; >+ >+import java.io.File; >+import java.util.Properties; >+import java.util.StringTokenizer; >+ >+import javax.swing.event.ChangeEvent; >+import javax.swing.event.ChangeListener; >+ >+import org.eclipse.core.runtime.Path; >+import org.eclipse.datatools.connectivity.ConnectionProfileConstants; >+import org.eclipse.datatools.connectivity.IConnectionProfile; >+import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants; >+import org.eclipse.datatools.connectivity.db.generic.IDBDriverDefinitionConstants; >+import org.eclipse.datatools.connectivity.drivers.DriverInstance; >+import org.eclipse.datatools.connectivity.internal.ui.DelimitedStringList; >+import org.eclipse.datatools.connectivity.internal.ui.DriverListCombo; >+import org.eclipse.datatools.connectivity.ui.wizards.ProfileDetailsPropertyPage; >+import org.eclipse.datatools.enablement.hsqldb.ui.IHSQLDBConnectionProfileConstants; >+import org.eclipse.datatools.enablement.hsqldb.ui.Messages; >+import org.eclipse.jface.preference.PreferencePage; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.ModifyEvent; >+import org.eclipse.swt.events.ModifyListener; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.events.SelectionListener; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.DirectoryDialog; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * Property page for HSQLDB profiles >+ * >+ */ >+public class HSQLDBPropertyPage extends ProfileDetailsPropertyPage { >+ >+ private static final String EMPTY_STRING = new String(); >+ >+ // UI components >+ private Text mDatabaseNameText; >+ private Text mDBUIDText; >+ private Text mDBPWDText; >+ private Text mURLText; >+ private Button mSaveDBPWDCheckbox; >+ private Text mDBFilePathText; >+ private Button mBrowseFilePathButton; >+ final DriverListCombo combo = new DriverListCombo(); >+ private DelimitedStringList mDBConnProps; >+ >+ // other components >+ private DriverInstance mDriverInstance; >+ private String mDriverCategory; >+ >+ /** >+ * Constructor >+ */ >+ public HSQLDBPropertyPage() { >+ super(); >+ noDefaultAndApplyButton(); >+ setDriverCategory(IHSQLDBConnectionProfileConstants.HSQLDB_CATEGORY_ID); >+ } >+ >+ /** >+ * @see PreferencePage#createContents(Composite) >+ */ >+ protected void createCustomContents(Composite parent) { >+ Composite content = new Composite(parent, SWT.NULL); >+ GridLayout layout = new GridLayout(2, false); >+ content.setLayout(layout); >+ >+ this.combo.setLabelText(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.driverCombo.label")); //$NON-NLS-1$ >+ this.combo.setCategory(getDriverCategory()); >+ this.combo.setNullDriverIsValid(false); >+ this.combo.createContents(content); >+ >+ this.mDatabaseNameText = (Text) createLabelTextPair( >+ content, >+ Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.databaseName.label"), //$NON-NLS-1$ >+ this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ >+ Label label = new Label(content, SWT.NULL); >+ label.setLayoutData(new GridData()); >+ label.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.0")); //$NON-NLS-1$ >+ >+ Composite textAndBrowseComposite = new Composite(content, SWT.NULL); >+ GridLayout subCompositeLayout = new GridLayout(2, false); >+ subCompositeLayout.marginLeft = -5; >+ subCompositeLayout.marginRight = -5; >+ subCompositeLayout.marginTop = -5; >+ subCompositeLayout.marginBottom = -5; >+ textAndBrowseComposite.setLayout(subCompositeLayout); >+ textAndBrowseComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ this.mDBFilePathText = new Text(textAndBrowseComposite, SWT.BORDER); >+ this.mDBFilePathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ this.mBrowseFilePathButton = new Button(textAndBrowseComposite, SWT.PUSH); >+ this.mBrowseFilePathButton.setText(Messages.getString("HSQLDBProfileDetailsWizardPage.1")); //$NON-NLS-1$ >+ this.mBrowseFilePathButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); >+ >+ this.mURLText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.url.label"), //$NON-NLS-1$ >+ this.mURLText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ this.mDBUIDText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.userName.label"), //$NON-NLS-1$ >+ this.mDBUIDText, SWT.BORDER, GridData.FILL_HORIZONTAL); >+ >+ this.mDBPWDText = (Text) createLabelTextPair(content, Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.password.label"), //$NON-NLS-1$, >+ this.mDBPWDText, SWT.BORDER | SWT.PASSWORD, GridData.FILL_HORIZONTAL); >+ >+ this.mSaveDBPWDCheckbox = new Button(content, SWT.CHECK); >+ this.mSaveDBPWDCheckbox.setText(Messages >+ .getString( >+ "HSQLDBProfileDetailsWizardPage.persistpassword.label")); //$NON-NLS-1$ >+ this.mSaveDBPWDCheckbox.setLayoutData(new GridData(GridData.BEGINNING, >+ GridData.CENTER, true, false, 2, 1)); >+ >+ Composite spacer = new Composite(content, SWT.NULL); >+ GridData gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ gdata.heightHint = 20; >+ spacer.setLayoutData(gdata); >+ >+ label = new Label(content, SWT.NULL); >+ gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ label.setLayoutData(gdata); >+ label.setText(Messages.getString( >+ "HSQLDBProfileDetailsWizardPage.optionalProps.label")); //$NON-NLS-1$ >+ >+ this.mDBConnProps = new DelimitedStringList(content, SWT.NONE); >+ gdata = new GridData(GridData.FILL_HORIZONTAL); >+ gdata.horizontalSpan = 2; >+ this.mDBConnProps.setLayoutData(gdata); >+ >+ this.mDBConnProps.addChangeListener(new ChangeListener() { >+ >+ public void stateChanged(ChangeEvent arg0) { >+ setErrorMessage(null); >+ if (HSQLDBPropertyPage.this.mDBConnProps.getWarning() != null) { >+ setErrorMessage(HSQLDBPropertyPage.this.mDBConnProps >+ .getWarning()); >+ } >+ } >+ >+ }); >+ >+ this.combo.addChangeListener(new ChangeListener() { >+ >+ public void stateChanged(ChangeEvent arg0) { >+ HSQLDBPropertyPage.this.mDriverInstance = HSQLDBPropertyPage.this.combo >+ .getSelectedDriverInstance(); >+ setErrorMessage(null); >+ if (HSQLDBPropertyPage.this.combo.getErrorMessage() != null) { >+ setErrorMessage(HSQLDBPropertyPage.this.combo >+ .getErrorMessage()); >+ } >+ else >+ HSQLDBPropertyPage.this.mURLText >+ .setText(getDriverURL()); >+ String username = HSQLDBPropertyPage.this >+ .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.USERNAME_PROP_ID); >+ if (username == null || username.trim().length() == 0) >+ username = new String(); >+ String oldUsername = HSQLDBPropertyPage.this.mDBUIDText >+ .getText(); >+ if (oldUsername == null || oldUsername.trim().length() == 0) >+ oldUsername = new String(); >+ if (oldUsername.length() == 0) >+ HSQLDBPropertyPage.this.mDBUIDText >+ .setText(username); >+ >+ String password = HSQLDBPropertyPage.this >+ .getPropertyFromDriverInstance(IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >+ if (password == null || password.trim().length() == 0) >+ password = new String(); >+ String oldPassword = HSQLDBPropertyPage.this.mDBPWDText >+ .getText(); >+ if (oldPassword == null || oldPassword.trim().length() == 0) >+ oldPassword = new String(); >+ if (oldPassword.length() == 0) >+ HSQLDBPropertyPage.this.mDBPWDText >+ .setText(password); >+ } >+ >+ }); >+ >+ initControls(); >+ >+ this.mDBFilePathText.addModifyListener(new ModifyListener() { >+ public void modifyText(ModifyEvent e) { >+ HSQLDBPropertyPage.this.updateURLFromProps(); >+ } >+ }); >+ >+ this.mBrowseFilePathButton.addSelectionListener( new SelectionListener() { >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ HSQLDBPropertyPage.this.browseForDBFolder(); >+ } >+ >+ public void widgetSelected(SelectionEvent e) { >+ HSQLDBPropertyPage.this.browseForDBFolder(); >+ } >+ }); >+ >+ // return content; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.preference.IPreferencePage#performOk() >+ */ >+ protected Properties collectProperties() { >+ Properties props = new Properties(); >+ >+ String driverID = EMPTY_STRING; >+ >+ if (this.combo.getSelectedDriverInstance() != null) { >+ DriverInstance instance = this.combo.getSelectedDriverInstance(); >+ driverID = instance.getId(); >+ } >+ >+ props.setProperty(ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID, >+ driverID); >+ props.setProperty( >+ IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID, >+ this.mDBConnProps.getSelection()); >+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID)); >+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DATABASE_VERSION_PROP_ID)); >+ props.setProperty(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, getPropertyFromDriverInstance(IDBDriverDefinitionConstants.DRIVER_CLASS_PROP_ID)); >+ props.setProperty(IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.mDatabaseNameText >+ .getText()); >+ props.setProperty(IDBDriverDefinitionConstants.PASSWORD_PROP_ID, this.mDBPWDText >+ .getText()); >+ props.setProperty(IDBDriverDefinitionConstants.USERNAME_PROP_ID, this.mDBUIDText >+ .getText()); >+ props.setProperty(IDBDriverDefinitionConstants.URL_PROP_ID, >+ this.mURLText.getText()); >+ props.setProperty( >+ IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, String >+ .valueOf(this.mSaveDBPWDCheckbox.getSelection())); >+ >+ return props; >+ } >+ >+ /** >+ * >+ */ >+ private void initControls() { >+ IConnectionProfile profile = getConnectionProfile(); >+ String driverID = profile.getBaseProperties().getProperty( >+ ConnectionProfileConstants.PROP_DRIVER_DEFINITION_ID); >+ if (driverID != null) { >+ this.combo.setSelectionToID(driverID); >+ } >+ >+ String connectionProps = profile.getBaseProperties().getProperty( >+ IDBConnectionProfileConstants.CONNECTION_PROPERTIES_PROP_ID); >+ if (connectionProps != null) { >+ this.mDBConnProps.setSelection(connectionProps); >+ } >+ >+ String databaseName = profile.getBaseProperties().getProperty( >+ IDBDriverDefinitionConstants.DATABASE_NAME_PROP_ID); >+ if (databaseName != null) { >+ this.mDatabaseNameText.setText(databaseName); >+ } >+ >+ String databasePwd = profile.getBaseProperties().getProperty( >+ IDBDriverDefinitionConstants.PASSWORD_PROP_ID); >+ if (databasePwd != null) { >+ this.mDBPWDText.setText(databasePwd); >+ } >+ >+ String databaseUid = profile.getBaseProperties().getProperty( >+ IDBDriverDefinitionConstants.USERNAME_PROP_ID); >+ if (databaseUid != null) { >+ this.mDBUIDText.setText(databaseUid); >+ } >+ >+ String urlText = profile.getBaseProperties().getProperty( >+ IDBDriverDefinitionConstants.URL_PROP_ID); >+ if (urlText != null) { >+ this.mURLText.setText(urlText); >+ this.mURLText.setEnabled(false); >+ } >+ >+ this.mSaveDBPWDCheckbox.setSelection(Boolean.valueOf( >+ profile.getBaseProperties().getProperty( >+ IDBConnectionProfileConstants.SAVE_PASSWORD_PROP_ID, >+ Boolean.FALSE.toString())).booleanValue()); >+ >+ this.updatePropsFromURL(); >+ >+ setErrorMessage(null); >+ if (this.combo.getErrorMessage() != null) { >+ setErrorMessage(this.combo.getErrorMessage()); >+ } >+ } >+ >+ /** >+ * Browse for a DB folder >+ */ >+ private void browseForDBFolder() { >+ DirectoryDialog dialog = new DirectoryDialog(getShell()); >+ dialog.setText(Messages >+ .getString("HSQLDBProfileDetailsWizardPage.FileDialog.title.filebrowse")); //$NON-NLS-1$ >+ dialog.setMessage(Messages >+ .getString("HSQLDBProfileDetailsWizardPage.FileDialog.msg.filebrowse")); //$NON-NLS-1$ >+ >+ String dirName = mDBFilePathText.getText(); >+ >+ File path = new File(dirName); >+ if (path.exists()) { >+ dialog.setFilterPath(new Path(dirName).toOSString()); >+ } >+ >+ String selectedDirectory = dialog.open(); >+ if (selectedDirectory != null) { >+ this.mDBFilePathText.setText(selectedDirectory); >+ } >+ } >+ >+ /** >+ * Based on the URL, update the UI components accordingly >+ */ >+ private void updatePropsFromURL() { >+ if (this.mDBFilePathText != null && this.mURLText != null) { >+ String url = this.mURLText.getText(); >+ String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >+ if (chunks.length > 0) { >+ String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >+ if (chunks2.length > 2) { >+ String filepath = chunks2[2]; >+ if (chunks2.length > 3) { >+ filepath = filepath + ":" + chunks2[3]; //$NON-NLS-1$ >+ } >+ this.mDBFilePathText.setText(filepath); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Based on the state of the UI components, reset the URL >+ */ >+ private void updateURLFromProps() { >+ if (this.mDBFilePathText != null && this.mURLText != null) { >+ String url = this.mURLText.getText(); >+ String filePath = this.mDBFilePathText.getText(); >+ //jdbc:derby:C:\DerbyDatabases\MyDB;create=true >+ String[] chunks = parseString(url, ";"); //$NON-NLS-1$ >+ if (chunks.length > 0) { >+ String[] chunks2 = parseString(chunks[0], ":"); //$NON-NLS-1$ >+ if (chunks2.length > 2) { >+ url = chunks2[0] + ":" + chunks2[1] + ":" + filePath; //$NON-NLS-1$ //$NON-NLS-2$ >+ this.mURLText.setText(url); >+ } >+ } >+ } >+ } >+ >+ /** >+ * Parse a string into an array based on a token >+ * @param str_list >+ * @param token >+ * @return >+ */ >+ private String[] parseString(String str_list, String token) { >+ StringTokenizer tk = new StringTokenizer(str_list, token); >+ String[] pieces = new String[tk.countTokens()]; >+ int index = 0; >+ while (tk.hasMoreTokens()) >+ pieces[index++] = tk.nextToken(); >+ return pieces; >+ } >+ >+ /** >+ * @param propertyID >+ * @return >+ */ >+ private String getPropertyFromDriverInstance(String propertyID) { >+ String returnStr = new String(); >+ if (this.mDriverInstance != null >+ && this.mDriverInstance.getProperty(propertyID) != null) { >+ returnStr = this.mDriverInstance.getProperty(propertyID); >+ } >+ return returnStr; >+ } >+ >+ /** >+ * @param parent >+ * @param labelText >+ * @param ctl >+ * @param style >+ * @param gData >+ * @return >+ */ >+ private Control createLabelTextPair(Composite parent, String labelText, >+ Control ctl, int style, int gData) { >+ Label label = new Label(parent, SWT.NULL); >+ label.setLayoutData(new GridData()); >+ label.setText(labelText); >+ >+ ctl = new Text(parent, style); >+ ctl.setLayoutData(new GridData(gData)); >+ >+ return ctl; >+ } >+ >+ /** >+ * @return >+ */ >+ public String getDriverURL() { >+ return this.mDriverInstance >+ .getProperty(IDBDriverDefinitionConstants.URL_PROP_ID); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.preference.IPreferencePage#isValid() >+ */ >+ public boolean isValid() { >+ if (getErrorMessage() != null) { >+ return false; >+ } >+ return super.isValid(); >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.jface.dialogs.DialogPage#setErrorMessage(java.lang.String) >+ */ >+ public void setErrorMessage(String newMessage) { >+ super.setErrorMessage(newMessage); >+ isValid(); >+ } >+ >+ /** >+ * @return >+ */ >+ public String getDriverCategory() { >+ return mDriverCategory; >+ } >+ >+ >+ /** >+ * Sets the driver category that should be used for displaying available >+ * driver defnitions. >+ * >+ * @param driverCategory >+ */ >+ public void setDriverCategory(String driverCategory) { >+ mDriverCategory = driverCategory; >+ if (combo != null) { >+ combo.setCategory(mDriverCategory); >+ } >+ } >+} >Index: icons/new_db_element.gif >=================================================================== >RCS file: icons/new_db_element.gif >diff -N icons/new_db_element.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ icons/new_db_element.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+GIF89a÷ZcZcZc{{{µ9µ9½½½½ÞÞÆ½ÆÖÖÖÞÞ½çÎÿÿÿÞÞÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ!ù,t° Áh?@$8A!C&8¢2näh & >+8 #ÇJP¹rÀrPÒ?`D¢Ü >+ ÀP àgÍ-u²´i5èТG¥.]ÙôiTS«å5çÖ±"5À´$ >+Uª¼èeIpàÃ; >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/Messages.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui; >+ >+import java.util.MissingResourceException; >+import java.util.ResourceBundle; >+ >+/** >+ * @author brianf >+ * >+ */ >+public class Messages { >+ >+ private static final String BUNDLE_NAME = "org.eclipse.datatools.enablement.hsqldb.ui.messages"; //$NON-NLS-1$ >+ >+ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle >+ .getBundle(BUNDLE_NAME); >+ >+ /** >+ * >+ */ >+ private Messages() { >+ } >+ >+ /** >+ * @param key >+ * @return >+ */ >+ public static String getString(String key) { >+ try { >+ return RESOURCE_BUNDLE.getString(key); >+ } catch (MissingResourceException e) { >+ return '!' + key + '!'; >+ } >+ } >+} >Index: src/org/eclipse/datatools/enablement/hsqldb/ui/catalog/HSQLDBPipelineTreeContentProvider.java >=================================================================== >RCS file: src/org/eclipse/datatools/enablement/hsqldb/ui/catalog/HSQLDBPipelineTreeContentProvider.java >diff -N src/org/eclipse/datatools/enablement/hsqldb/ui/catalog/HSQLDBPipelineTreeContentProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/datatools/enablement/hsqldb/ui/catalog/HSQLDBPipelineTreeContentProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,115 @@ >+/******************************************************************************* >+ * Copyright (c) 2007, 2008 Sybase, Inc. >+ * >+ * 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: Brian Fitzpatrick - initial API and implementation >+ * IBM Corporation - refactored plug-in >+ ******************************************************************************/ >+package org.eclipse.datatools.enablement.hsqldb.ui.catalog; >+ >+import java.util.ArrayList; >+import java.util.Arrays; >+import java.util.Iterator; >+import java.util.Set; >+ >+import org.eclipse.datatools.connectivity.sqm.core.internal.ui.explorer.providers.content.virtual.StoredProcedureNode; >+import org.eclipse.datatools.connectivity.sqm.server.internal.ui.explorer.providers.content.impl.ServerExplorerContentProviderNav; >+import org.eclipse.ui.IMemento; >+import org.eclipse.ui.navigator.ICommonContentExtensionSite; >+import org.eclipse.ui.navigator.IPipelinedTreeContentProvider; >+import org.eclipse.ui.navigator.PipelinedShapeModification; >+import org.eclipse.ui.navigator.PipelinedViewerUpdate; >+ >+/** >+ * @author brianf >+ * >+ */ >+public class HSQLDBPipelineTreeContentProvider extends ServerExplorerContentProviderNav implements IPipelinedTreeContentProvider { >+ >+ /** >+ * >+ */ >+ public HSQLDBPipelineTreeContentProvider() { >+ super(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set) >+ */ >+ public void getPipelinedChildren(Object aParent, Set theCurrentChildren) { >+ Object[] children = getChildren(aParent); >+ ArrayList kids = new ArrayList(Arrays.asList(children)); >+ theCurrentChildren.clear(); >+ for (Iterator iter = kids.iterator(); iter.hasNext();) { >+ if (iter.next() instanceof StoredProcedureNode) >+ iter.remove(); >+ } >+ theCurrentChildren.addAll(kids); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedElements(java.lang.Object, java.util.Set) >+ */ >+ public void getPipelinedElements(Object anInput, Set theCurrentElements) { >+ Object[] children = getElements(anInput); >+ >+ theCurrentElements.addAll(Arrays.asList(children)); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedParent(java.lang.Object, java.lang.Object) >+ */ >+ public Object getPipelinedParent(Object anObject, Object aSuggestedParent) { >+ return getParent(anObject); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptAdd(org.eclipse.ui.navigator.PipelinedShapeModification) >+ */ >+ public PipelinedShapeModification interceptAdd( >+ PipelinedShapeModification anAddModification) { >+ return anAddModification; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRefresh(org.eclipse.ui.navigator.PipelinedViewerUpdate) >+ */ >+ public boolean interceptRefresh( >+ PipelinedViewerUpdate aRefreshSynchronization) { >+ return true; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptRemove(org.eclipse.ui.navigator.PipelinedShapeModification) >+ */ >+ public PipelinedShapeModification interceptRemove( >+ PipelinedShapeModification aRemoveModification) { >+ return aRemoveModification; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#interceptUpdate(org.eclipse.ui.navigator.PipelinedViewerUpdate) >+ */ >+ public boolean interceptUpdate(PipelinedViewerUpdate anUpdateSynchronization) { >+ return true; >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.viewers.IContentProvider#dispose() >+ */ >+ public void dispose() { >+ super.dispose(); >+ } >+ >+ public void init(ICommonContentExtensionSite aConfig) { >+ } >+ >+ public void restoreState(IMemento aMemento) { >+ } >+ >+ public void saveState(IMemento aMemento) { >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203158
:
78235
|
79770
|
79771
|
79782
|
79783
|
79784
|
79840
|
80178
|
80254
|
80269
|
80612
|
80613
| 87290