} else {
final Object[] found = new Object[1];
RunInUiThread.sync(new Runnable() {
public void run() {
ProjectSelectionDialog dialog = new ProjectSelectionDialog(PyAction.getShell(),
PythonNature.PYTHON_NATURE_ID);
dialog.setMessage("Choose the project that'll provide the interpreter and\n"
+ "PYTHONPATH to be used in the launch of the file.");
if (dialog.open() == Window.OK) {
Object firstResult = dialog.getFirstResult();
if (firstResult instanceof IProject) {
found[0] = firstResult;
} else {
found[0] = new CoreException(new StatusInfo(IStatus.ERROR,
"Expected project to be selected."));