From 650cafb4ef730f5307d658729cdae4d5a0602868 Mon Sep 17 00:00:00 2001 From: Patric Plitzner
PAGE_NAME="CdmXmlDataSourceWizardPage"
*/
public static final String PAGE_NAME = "CdmXmlDataSourceWizardPage";
@@ -42,8 +42,8 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage {
private FileDialog fileDialog;
private Text text_file;
-
-
+
+
/**
* Constructor for ImportFromFileDataSourceWizardPage.
* @@ -53,14 +53,14 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage { */ protected ImportFromFileDataSourceWizardPage(String title, String description, String[] extensions) { super(PAGE_NAME); - + setTitle(title); - + setDescription(description); - + this.extensions = extensions; } - + /** *XML
* @@ -76,30 +76,31 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage { * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ /** {@inheritDoc} */ - public void createControl(Composite parent) { + @Override + public void createControl(Composite parent) { final Composite composite = new Composite(parent, SWT.NULL); - + setPageComplete(false); - + GridLayout gridLayout = new GridLayout(); gridLayout.numColumns = 3; composite.setLayout(gridLayout); - + Label folderLabel = new Label(composite, SWT.NONE); folderLabel.setText("File"); - + fileDialog = new FileDialog(parent.getShell()); - + fileDialog.setFilterExtensions(extensions); - + text_file = new Text(composite, SWT.BORDER); text_file.setEditable(false); text_file.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); - + Button button = new Button(composite, SWT.PUSH); button.setText("Browse..."); - + button.addSelectionListener(new SelectionAdapter(){ /* (non-Javadoc) @@ -108,12 +109,14 @@ public class ImportFromFileDataSourceWizardPage extends WizardPage { @Override public void widgetSelected(SelectionEvent e) { String path = fileDialog.open(); - text_file.setText(path); - setPageComplete(true); + if(path!=null){ + text_file.setText(path); + setPageComplete(true); + } } - + }); - + setControl(composite); } -- 2.34.1