IFile currentFile = getMainModuleFile();
IResource resource = workspace.getRoot().findMember(fProjectName);
if (resource instanceof IProject) {
IProject project = (IProject) resource;
PythonModulePickerDialog dialog = new PythonModulePickerDialog(lParent.getShell(), "Main Module",
"Choose Python module which starts execution", project);
// Fixed request 1407469: main module browse button forgets path
dialog.setInitialSelection(currentFile);
int result = dialog.open();
if (result == PythonModulePickerDialog.OK) {
Object results[] = dialog.getResult();
if ((results != null) && (results.length > 0) && (results[0] instanceof IFile)) {
IFile file = (IFile) results[0];
IPath path = file.getFullPath();
String containerName = path.makeRelative().toString();
fMainModuleText.setText("${workspace_loc:" + containerName + "}");