summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxwu2012-04-11 05:39:05 (EDT)
committer mwu2012-04-11 05:39:05 (EDT)
commit88d913585eae4afb9a1f3b09b297db04f50eaaf5 (patch)
tree141f2f03c4a60465aa4fd427b139af54cebe0f56
parent16e08a8ad52f3588bd2cc4329f2c156cfa419dd6 (diff)
downloadorg.eclipse.birt-88d913585eae4afb9a1f3b09b297db04f50eaaf5.zip
org.eclipse.birt-88d913585eae4afb9a1f3b09b297db04f50eaaf5.tar.gz
org.eclipse.birt-88d913585eae4afb9a1f3b09b297db04f50eaaf5.tar.bz2
Summary:
Fix an issue 44346: Incorrect message when Driver Class and JNDI URL is deleted. Description of Issue: Incorrect message when Driver Class and JNDI URL is deleted. Description of Resolution: Modified the logic to correctly validate the Test button status as well as the page status. BUG(s) Resolved: 44346 Regression ( Yes/No ): No Reviewer: Bin Feng Manual Test Description: Manual Test
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/nls/JdbcPluginResources.properties3
-rw-r--r--data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java78
2 files changed, 46 insertions, 35 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/nls/JdbcPluginResources.properties b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/nls/JdbcPluginResources.properties
index bc6439e..44f0f9e 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/nls/JdbcPluginResources.properties
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/nls/JdbcPluginResources.properties
@@ -65,8 +65,7 @@ exceptionHandler.title.error=Error
error.emptyDatasourceName=Data source name must not be empty.
error.upgradingConnection=Error upgrading JDBC connection information.
error.duplicateName=The new name is a duplicate of an existing name in the same name space.
-error.emptyDriverclass=Driver class must not be empty.
-error.emptyDatabaseUrl=URL must not be empty.
+error.emptyDriverclassOrURL=Driver class and URL must not be empty.
joins.page.warning=Please make sure to specify at least one join.\n Do you want to continue ?
joins.menu.edit=Edit Join
joins.menu.delete=Delete Join
diff --git a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
index 3dd2a1f..525b6fa 100644
--- a/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
+++ b/data/org.eclipse.birt.report.data.oda.jdbc.ui/src/org/eclipse/birt/report/data/oda/jdbc/ui/profile/JDBCSelectionPageHelper.java
@@ -89,7 +89,7 @@ public class JDBCSelectionPageHelper
private String DEFAULT_MESSAGE;
// constant string
- final private static String EMPTY_URL = JdbcPlugin.getResourceString( "error.emptyDatabaseUrl" );//$NON-NLS-1$
+ final private static String EMPTY_DRIVER_CLASS_OR_URL = JdbcPlugin.getResourceString( "error.emptyDriverclassOrURL" );//$NON-NLS-1$
private final String JDBC_EXTENSION_ID = "org.eclipse.birt.report.data.oda.jdbc"; //$NON-NLS-1$
@@ -570,6 +570,20 @@ public class JDBCSelectionPageHelper
*/
private void addControlListeners( )
{
+ driverChooserCombo.getCombo( ).addModifyListener( new ModifyListener( ) {
+
+ public void modifyText( ModifyEvent e )
+ {
+ if ( !driverChooserCombo.getCombo( ).isFocusControl( )
+ && driverChooserCombo.getCombo( ).getText( ).trim( ).length( ) == 0 )
+ {
+ return;
+ }
+ verifyJDBCProperties( );
+ updateTestButton( );
+ }
+ } );
+
jdbcUrl.addModifyListener( new ModifyListener( ) {
public void modifyText( ModifyEvent e )
@@ -809,11 +823,20 @@ public class JDBCSelectionPageHelper
*/
private void updateTestButton( )
{
- if ( isDriverClassBlank( ) || ( isURLBlank( ) && isJNDIBlank( ) ) )
+ // Jdbc Url cannot be blank
+ if ( isDriverClassBlank( ) || isURLBlank( ) )
{
- // Jdbc Url cannot be blank
- setMessage( EMPTY_URL, IMessageProvider.ERROR );
- testButton.setEnabled( false );
+ if( isJNDIBlank( ) )
+ {
+ setMessage( EMPTY_DRIVER_CLASS_OR_URL, IMessageProvider.ERROR );
+ testButton.setEnabled( false );
+ }
+ else
+ {
+ setMessage( DEFAULT_MESSAGE );
+ if ( !testButton.isEnabled( ) )
+ testButton.setEnabled( true );
+ }
}
else
{
@@ -828,20 +851,28 @@ public class JDBCSelectionPageHelper
*/
protected void resetTestAndMngButton( )
{
- if ( isURLBlank( ) && isJNDIBlank( ) )
+ updateTestButton( );
+ manageButton.setEnabled( true );
+ enableParent( manageButton );
+ }
+
+ private void verifyJDBCProperties( )
+ {
+ if ( isDriverClassBlank( ) || isURLBlank( ) )
{
- // Jdbc Url cannot be blank
- setMessage( EMPTY_URL, IMessageProvider.ERROR );
- testButton.setEnabled( false );
+ if ( !isJNDIBlank( ) )
+ {
+ setPageComplete( true );
+ }
+ else
+ {
+ setPageComplete( false );
+ }
}
else
{
- setMessage( DEFAULT_MESSAGE );
- if ( !testButton.isEnabled( ) )
- testButton.setEnabled( true );
+ setPageComplete( true );
}
- manageButton.setEnabled( true );
- enableParent( manageButton );
}
/**
@@ -861,25 +892,6 @@ public class JDBCSelectionPageHelper
enableParent( parent );
}
- private void verifyJDBCProperties( )
- {
- if ( !isDriverClassBlank( ) )
- {
- if ( !isJNDIBlank( ) )
- {
- setPageComplete( true );
- }
- else if ( !isURLBlank( ) )
- {
- setPageComplete( true );
- }
- else
- setPageComplete( false );
- }
- else
- setPageComplete( false );
- }
-
/**
* get the Shell from DialogPage
*