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) {
} 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);
+ }
+ }
}