Package org.python.pydev.debug.ui.launching

Examples of org.python.pydev.debug.ui.launching.AbstractLaunchShortcut


            arguments = buf.toString();
        } else {
            arguments = "";
        }

        AbstractLaunchShortcut shortcut = new AbstractLaunchShortcut() {

            @Override
            protected String getLaunchConfigurationType() {
                return launchConfigurationTypeAndInterpreterManager.o1;
            }

            @Override
            protected IInterpreterManager getInterpreterManager(IProject project) {
                return launchConfigurationTypeAndInterpreterManager.o2;
            }

            @Override
            public ILaunchConfigurationWorkingCopy createDefaultLaunchConfigurationWithoutSaving(
                    FileOrResource[] resource) throws CoreException {
                ILaunchConfigurationWorkingCopy workingCopy = super
                        .createDefaultLaunchConfigurationWithoutSaving(resource);
                if (arguments.length() > 0) {
                    workingCopy.setAttribute(Constants.ATTR_UNITTEST_TESTS, arguments);
                }
                return workingCopy;
            }

            @Override
            protected List<ILaunchConfiguration> findExistingLaunchConfigurations(FileOrResource[] file) {
                List<ILaunchConfiguration> ret = new ArrayList<ILaunchConfiguration>();

                List<ILaunchConfiguration> existing = super.findExistingLaunchConfigurations(file);
                for (ILaunchConfiguration launch : existing) {
                    boolean matches = false;
                    try {
                        matches = launch.getAttribute(Constants.ATTR_UNITTEST_TESTS, "").equals(arguments);
                    } catch (CoreException e) {
                        //ignore
                    }
                    if (matches) {
                        ret.add(launch);
                    }
                }
                return ret;
            }
        };

        shortcut.launch(pyEdit, "run");
    }
View Full Code Here


        PyEdit pyEdit = getPyEdit();
        final Tuple<String, IInterpreterManager> launchConfigurationTypeAndInterpreterManager = this
                .getLaunchConfigurationTypeAndInterpreterManager(pyEdit, false);

        AbstractLaunchShortcut shortcut = new AbstractLaunchShortcut() {

            @Override
            protected String getLaunchConfigurationType() {
                return launchConfigurationTypeAndInterpreterManager.o1;
            }

            @Override
            protected IInterpreterManager getInterpreterManager(IProject project) {
                return launchConfigurationTypeAndInterpreterManager.o2;
            }

        };
        shortcut.launch(pyEdit, "run");
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.debug.ui.launching.AbstractLaunchShortcut

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.