From 014d3bab76a3e634b46085efd23cd5204301b18d Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Mon, 16 Dec 2013 17:03:07 -0500 Subject: [PATCH] tmf: Enable the finish button when default target project is selected The previous fix for the batch import "target project" page introduces a default selection but the user still has to click on the list again to enable the finish button. Change-Id: I492cc1ff115d6208aa577a721f04d96ebd2a4e2c Signed-off-by: Marc-Andre Laperle Reviewed-on: https://git.eclipse.org/r/19881 Reviewed-by: Matthew Khouzam --- .../ImportTraceWizardPageOptions.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPageOptions.java b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPageOptions.java index 0281f28b83..f1b6c9848c 100644 --- a/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPageOptions.java +++ b/org.eclipse.linuxtools.tmf.ui/src/org/eclipse/linuxtools/tmf/ui/project/wizards/importtrace/ImportTraceWizardPageOptions.java @@ -77,28 +77,14 @@ public class ImportTraceWizardPageOptions extends AbstractImportTraceWizardPage fProjects.getSelection(); fProjects.addSelectionListener(new SelectionListener() { - private static final String TRACE = "Traces"; //$NON-NLS-1$ - @Override public void widgetSelected(SelectionEvent e) { - handleSelected(); + updateWithSelection(); } @Override public void widgetDefaultSelected(SelectionEvent e) { - handleSelected(); - } - - private void handleSelected() { - String[] selection = fProjects.getSelection(); - if (selection.length > 0) { - final String listItem = selection[0]; - IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); - getBatchWizard().setTraceFolder(folder); - ImportTraceWizardPageOptions.this.setErrorMessage(null); - } else { - ImportTraceWizardPageOptions.this.setErrorMessage(Messages.SharedSelectProject); - } + updateWithSelection(); } }); if (proj != null) { @@ -106,7 +92,21 @@ public class ImportTraceWizardPageOptions extends AbstractImportTraceWizardPage } else if (fProjects.getItemCount() > 0) { fProjects.setSelection(0); } + updateWithSelection(); setMessage(Messages.SharedSelectProject); this.setTitle(Messages.ImportTraceWizardPageOptionsTitle); } + + private void updateWithSelection() { + final String TRACE = "Traces"; //$NON-NLS-1$ + String[] selection = fProjects.getSelection(); + if (selection.length > 0) { + final String listItem = selection[0]; + IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); + getBatchWizard().setTraceFolder(folder); + ImportTraceWizardPageOptions.this.setErrorMessage(null); + } else { + ImportTraceWizardPageOptions.this.setErrorMessage(Messages.SharedSelectProject); + } + } } -- 2.34.1