Examples of StringSubstitution


Examples of org.python.pydev.core.docutils.StringSubstitution

                }
                String value = (String) entry.getValue();
                // translate any string substitution variables
                String translated = value;
                try {
                    StringSubstitution stringSubstitution = new StringSubstitution(nature);
                    translated = stringSubstitution.performStringSubstitution(value, false);
                } catch (Exception e) {
                    Log.log(e);
                }
                env.put(key, translated);
            }
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

        if (project == null || nature == null) {
            return "";
        }

        //Substitute with variables!
        StringSubstitution stringSubstitution = new StringSubstitution(nature);

        source = getProjectSourcePath(true);
        if (addExternal) {
            external = getProjectExternalSourcePath(true);
        }
        contributed = stringSubstitution.performPythonpathStringSubstitution(getContributedSourcePath(project));

        if (source == null) {
            source = "";
        }
        //we have to work on this one to resolve to full files, as what is stored is the position
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

     */
    private String trimAndReplaceVariablesIfNeeded(boolean replace, String projectSourcePath, PythonNature nature)
            throws CoreException {
        String ret = StringUtils.leftAndRightTrim(projectSourcePath, '|');
        if (replace) {
            StringSubstitution substitution = new StringSubstitution(nature);
            ret = substitution.performPythonpathStringSubstitution(ret);
        }
        return ret;
    }
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

        String path = fMainModuleText.getText();
        IFile file = null;
        if (path.length() > 0) {
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();

            StringSubstitution stringSubstitution = getStringSubstitution(root);
            try {
                path = stringSubstitution.performStringSubstitution(path, false);
                IFile[] files = root.findFilesForLocationURI(new File(path).toURI());
                if (files.length > 0) {
                    file = files[0];
                }
            } catch (CoreException e) {
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

        IPythonNature nature = null;
        if (resource instanceof IProject) {
            nature = PythonNature.getPythonNature(resource);
        }

        StringSubstitution stringSubstitution = new StringSubstitution(nature);
        return stringSubstitution;
    }
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

        if (result) {
            setMessage(null);
            setErrorMessage(null);

            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            StringSubstitution stringSubstitution = getStringSubstitution(root);

            String location = fMainModuleText.getText();
            try {

                String identifier = launchConfig.getType().getIdentifier();
                if (identifier.equals(Constants.ID_PYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_JYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_IRONPYTHON_UNITTEST_LAUNCH_CONFIGURATION_TYPE)
                        || identifier.equals(Constants.ID_PYTHON_COVERAGE_LAUNCH_CONFIGURATION_TYPE)) {

                    //may have  multiple files selected for the run for unitest and code-coverage
                    for (String loc : StringUtils.splitAndRemoveEmptyTrimmed(location, '|')) {
                        String expandedLocation = stringSubstitution.performStringSubstitution(loc);
                        File file = new File(expandedLocation);
                        if (!file.exists()) {
                            setErrorMessage(com.aptana.shared_core.string.StringUtils.format("The file \"%s\" does not exist.", file));
                            result = false;
                            break;
                        }

                    }
                } else {
                    String expandedLocation = stringSubstitution.performStringSubstitution(location);
                    File file = new File(expandedLocation);
                    if (!file.exists()) {
                        setErrorMessage(com.aptana.shared_core.string.StringUtils.format("The file \"%s\" does not exist.", file));
                        result = false;
View Full Code Here

Examples of org.python.pydev.core.docutils.StringSubstitution

    protected IContainer getContainer() {
        String path = getWorkingDirectoryText();
        if (path.length() > 0) {
            IResource res = null;
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            StringSubstitution stringSubstitution = this.mainModuleTab.fMainModuleBlock.getStringSubstitution(root);
            try {
                path = stringSubstitution.performStringSubstitution(path, false);
                IContainer[] containers = root.findContainersForLocation(new Path(path));
                if (containers.length > 0) {
                    res = containers[0];
                }
            } catch (CoreException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.