if (folder instanceof IProject) {
Shell parent = PyAction.getShell();
PythonModulePickerDialog dialog = new PythonModulePickerDialog(parent,
"Select python file", "Select the python file to be launched.",
(IProject) folder);
int result = dialog.open();
if (result == PythonModulePickerDialog.OK) {
Object results[] = dialog.getResult();
if ((results != null) && (results.length > 0) && (results[0] instanceof IFile)) {
resource = (IResource) results[0];
}