summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormianrui2013-01-17 04:33:46 (EST)
committermwu2013-01-17 04:33:46 (EST)
commit1f22c0998f627bb551948955e84434b082a9ba8f (patch)
tree604149d64a33d3e6f3612e6b744d5ca77ff4568c
parentee95b84260c17f4b54ab598432490d1f3f50b8da (diff)
downloadorg.eclipse.datatools.enablement.oda-1f22c0998f627bb551948955e84434b082a9ba8f.zip
org.eclipse.datatools.enablement.oda-1f22c0998f627bb551948955e84434b082a9ba8f.tar.gz
org.eclipse.datatools.enablement.oda-1f22c0998f627bb551948955e84434b082a9ba8f.tar.bz2
'Finish' button is enabled when check 'Select home folder' again with
invalid path during creating Flat File Data Source.(T56048) URI parsing format isn't correct when using 'Absolute Path' URI as create flat file datasource.(T56001)
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java63
1 files changed, 46 insertions, 17 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
index 5897980..c58b2c2 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
@@ -423,6 +423,14 @@ public class FolderSelectionPageHelper
public void widgetSelected( SelectionEvent e )
{
switchFileSelectionMode( true );
+ if ( getFolderLocationString( ).trim( ).length( ) > 0 )
+ {
+ verifyFileLocation( );
+ }
+ else
+ {
+ setMessage( DEFAULT_MESSAGE, IMessageProvider.NONE );
+ }
}
public void widgetDefaultSelected( SelectionEvent e )
@@ -441,7 +449,14 @@ public class FolderSelectionPageHelper
public void modifyText( ModifyEvent e )
{
- verifyFileLocation( );
+ if ( getFolderLocationString( ).trim( ).length( ) > 0 )
+ {
+ verifyFileLocation( );
+ }
+ else
+ {
+ setMessage( DEFAULT_MESSAGE, IMessageProvider.NONE );
+ }
}
} );
@@ -483,6 +498,14 @@ public class FolderSelectionPageHelper
public void widgetSelected( SelectionEvent e )
{
switchFileSelectionMode( false );
+ if ( getFileURIString( ).trim( ).length( ) > 0 )
+ {
+ verifyFileURILocation( );
+ }
+ else
+ {
+ setMessage( DEFAULT_MESSAGE, IMessageProvider.NONE );
+ }
}
public void widgetDefaultSelected( SelectionEvent e )
@@ -502,17 +525,13 @@ public class FolderSelectionPageHelper
public void modifyText( ModifyEvent e )
{
- String fileURIValue = getFileURIString( ).trim( );
- fileURIValue = fileURIValue.length( ) > 0 ? fileURIValue : null;
- if ( fileURIValue == null )
+ if ( getFileURIString( ).trim( ).length( ) > 0 )
{
- setMessage( Messages.getString( "error.invalidFlatFilePath" ), IMessageProvider.ERROR ); //$NON-NLS-1$?
- setPageComplete( false );
+ verifyFileURILocation( );
}
else
{
- setPageComplete( true );
- setMessage( Messages.getString( "Connection.warning.untested" ), IMessageProvider.WARNING ); //$NON-NLS-1$
+ setMessage( DEFAULT_MESSAGE, IMessageProvider.NONE );
}
}
@@ -603,15 +622,7 @@ public class FolderSelectionPageHelper
if ( filePath != null )
{
- try
- {
- setFileURIString( new File( filePath ).toURI( )
- .toURL( )
- .toExternalForm( ) );
- }
- catch ( MalformedURLException e1 )
- {
- }
+ setFileURIString( filePath );
}
}
}
@@ -638,6 +649,24 @@ public class FolderSelectionPageHelper
browseLocalFileButton.setEnabled( !homeFolder );
fileURIChoice.setSelection( !homeFolder );
}
+
+
+
+ private void verifyFileURILocation( )
+ {
+ String fileURIValue = getFileURIString( ).trim( );
+ fileURIValue = fileURIValue.length( ) > 0 ? fileURIValue : null;
+ if ( fileURIValue == null )
+ {
+ setMessage( Messages.getString( "error.invalidFlatFilePath" ), IMessageProvider.ERROR ); //$NON-NLS-1$?
+ setPageComplete( false );
+ }
+ else
+ {
+ setPageComplete( true );
+ setMessage( Messages.getString( "Connection.warning.untested" ), IMessageProvider.WARNING ); //$NON-NLS-1$
+ }
+ }
/**
*