Source:
<code>public void createControl(Composite parent) { super.createControl(parent); IFolder originalFolder = getBatchWizard().getTargetFolder(); IProject proj= null; <START> if( originalFolder != null ) { <END> proj = originalFolder.getProject(); } Composite optionPane = (Composite) this.getControl(); optionPane.setLayout(new GridLayout()); optionPane.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); fProjects = new List(optionPane, SWT.NONE); fProjects.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); for (IProject project : projects) { try { if (project.getNature(TmfProjectNature.ID) != null) { final String name = project.getName(); fProjectsMap.put(name, project); fProjects.add(name); } } catch (CoreException e) { } } fProjects.getSelection(); fProjects.addSelectionListener(new SelectionListener() { final static String TRACE = "Traces"; @Override public void widgetSelected(SelectionEvent e) { final String listItem = fProjects.getSelection()[0]; IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); getBatchWizard().setTraceFolder(folder); ImportTraceWizardPageOptions.this.setErrorMessage(null); } @Override public void widgetDefaultSelected(SelectionEvent e) { final String listItem = fProjects.getSelection()[0]; IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); getBatchWizard().setTraceFolder(folder); ImportTraceWizardPageOptions.this.setErrorMessage(null); } }); if( proj != null ){ getBatchWizard().setTraceFolder(originalFolder); fProjects.setSelection(fProjects.indexOf(proj.getName())); this.setErrorMessage(null); }else{ this.setErrorMessage(Messages.ImportTraceWizardPageOptions_NoProjectSelected); } }</code><technical_language>ctrl+shift+F</technical_language>

Target:
public void createControl(Composite parent) { super.createControl(parent); IFolder originalFolder = getBatchWizard().getTargetFolder(); IProject proj = null; if (originalFolder != null) { proj = originalFolder.getProject(); } Composite optionPane = (Composite) this.getControl(); optionPane.setLayout(new GridLayout()); optionPane.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true)); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); fProjects = new List(optionPane, SWT.NONE); fProjects.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); for (IProject project : projects) { try { if (project.getNature(TmfProjectNature.ID) != null) { final String name = project.getName(); fProjectsMap.put(name, project); fProjects.add(name); } } catch (CoreException e) { } } fProjects.getSelection(); fProjects.addSelectionListener(new SelectionListener() { static final String TRACE = "Traces"; @Override public void widgetSelected(SelectionEvent e) { final String listItem = fProjects.getSelection()[0]; IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); getBatchWizard().setTraceFolder(folder); ImportTraceWizardPageOptions.this.setErrorMessage(null); } @Override public void widgetDefaultSelected(SelectionEvent e) { final String listItem = fProjects.getSelection()[0]; IFolder folder = fProjectsMap.get(listItem).getFolder(TRACE); getBatchWizard().setTraceFolder(folder); ImportTraceWizardPageOptions.this.setErrorMessage(null); } }); if (proj != null) { fProjects.setSelection(fProjects.indexOf(proj.getName())); this.setErrorMessage(null); } else { this.setErrorMessage(Messages.Shared_selectProject); } }