| author | pshi | 2012-05-09 02:54:07 (EDT) |
|---|---|---|
| committer | mwu | 2012-05-09 02:54:07 (EDT) |
| commit | 760156f96512ef694eafc5d8f3cbf2c07528661c (patch) (side-by-side diff) | |
| tree | b3e533ad38344cc6c4d8d7507162cceed5e6e241 | |
| parent | 9c51ebbeee695350d351c0331b9c0246f8dbffb7 (diff) | |
| download | org.eclipse.birt-760156f96512ef694eafc5d8f3cbf2c07528661c.zip org.eclipse.birt-760156f96512ef694eafc5d8f3cbf2c07528661c.tar.gz org.eclipse.birt-760156f96512ef694eafc5d8f3cbf2c07528661c.tar.bz2 | |
fix 49697 No error message if the Excel Data Source worksheet is not
available.
| -rw-r--r-- | data/org.eclipse.birt.report.data.oda.excel.ui/src/org/eclipse/birt/report/data/oda/excel/ui/wizards/ExcelFileSelectionWizardPage.java | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/data/org.eclipse.birt.report.data.oda.excel.ui/src/org/eclipse/birt/report/data/oda/excel/ui/wizards/ExcelFileSelectionWizardPage.java b/data/org.eclipse.birt.report.data.oda.excel.ui/src/org/eclipse/birt/report/data/oda/excel/ui/wizards/ExcelFileSelectionWizardPage.java index 5bbeae8..e94bc55 100644 --- a/data/org.eclipse.birt.report.data.oda.excel.ui/src/org/eclipse/birt/report/data/oda/excel/ui/wizards/ExcelFileSelectionWizardPage.java +++ b/data/org.eclipse.birt.report.data.oda.excel.ui/src/org/eclipse/birt/report/data/oda/excel/ui/wizards/ExcelFileSelectionWizardPage.java @@ -857,10 +857,7 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements { if (selectedColumnsViewer.getTable().getItemCount() == 0) { - String errMsg = currentSheetName == null ? - Messages.getString("error.selectWorksheet") : //$NON-NLS-1$ - Messages.getString("error.selectColumns"); //$NON-NLS-1$ - setMessage( errMsg, ERROR ); + setMessage( getEmptyColumnErrMsg( ), ERROR ); } else { @@ -880,6 +877,13 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements } + + private String getEmptyColumnErrMsg() + { + return this.currentSheetName == null + ? Messages.getString( "error.selectWorksheet" ) : + Messages.getString( "error.selectColumns" ); + } /** * Load the custom properties */ @@ -1333,10 +1337,7 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements if (selectedColumnsViewer.getTable().getItemCount() == 0) { setPageComplete(false); - String errMsg = currentSheetName == null ? - Messages.getString("error.selectWorksheet") : //$NON-NLS-1$ - Messages.getString("error.selectColumns"); //$NON-NLS-1$ - setMessage( errMsg, ERROR ); + setMessage( getEmptyColumnErrMsg(), ERROR ); } } @@ -1347,10 +1348,7 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements this.getControl( ).getShell( ).getText( ).startsWith( "Edit" )) //$NON-NLS-1$ { setPageComplete(false); - String errMsg = currentSheetName == null ? - Messages.getString("error.selectWorksheet") : //$NON-NLS-1$ - Messages.getString("error.selectColumns"); //$NON-NLS-1$ - setMessage( errMsg, ERROR ); + setMessage( getEmptyColumnErrMsg( ), ERROR ); return false; } @@ -1534,10 +1532,7 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements if (selectedColumnsViewer.getTable().getItemCount() == 0) { setPageComplete(false); - String errMsg = currentSheetName == null ? - Messages.getString("error.selectWorksheet") : //$NON-NLS-1$ - Messages.getString("error.selectColumns"); //$NON-NLS-1$ - setMessage( errMsg, ERROR ); + setMessage( getEmptyColumnErrMsg( ), ERROR ); } } @@ -1779,5 +1774,7 @@ public class ExcelFileSelectionWizardPage extends DataSetWizardPage implements worksheetsCombo.setSelection(new StructuredSelection( currentSheetName)); } + if ( worksheetsCombo.getSelection( ).isEmpty( ) ) + this.currentSheetName = null; } } |

