Package org.python.pydev.ui.dialogs

Examples of org.python.pydev.ui.dialogs.PythonModulePickerDialog


                    if (folder != null) {

                        if (requireFile) {
                            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];
                                    }
                                }
                            }
View Full Code Here


                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 + "}");
View Full Code Here

TOP

Related Classes of org.python.pydev.ui.dialogs.PythonModulePickerDialog

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.