Package org.eclipse.core.variables

Examples of org.eclipse.core.variables.IStringVariableManager


    confWc.doSave();
  }

  public void setOrCreateVariable(final String value) throws CoreException
  {
    IStringVariableManager varMan = VariablesPlugin.getDefault().getStringVariableManager();
    IValueVariable var = varMan.getValueVariable(JunitLaunchListener.JMOCKIT_VAR_NAME);

    if (var == null)
    {
      var = varMan.newValueVariable(JunitLaunchListener.JMOCKIT_VAR_NAME, value, false, value);
      varMan.addVariables(new IValueVariable[]{var});
    }
    else
    {
      var.setValue(value);
      var.setDescription(value);
View Full Code Here


        if (path.length() > 0)
        {
            IResource res = null;
            IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
            if (path.startsWith("${workspace_loc:")) { //$NON-NLS-1$
                IStringVariableManager manager = VariablesPlugin.getDefault()
                    .getStringVariableManager();
                try
                {
                    path = manager.performStringSubstitution(path, false);
                    IContainer[] containers = root
                        .findContainersForLocation(new Path(path));
                    if (containers.length > 0)
                    {
                        res = containers[0];
View Full Code Here

        setMessage(null);

        // if variables are present, we cannot resolve the directory
        String workingDirPath = fWorkingDirText.getText().trim();
        if (workingDirPath.indexOf("${") >= 0) { //$NON-NLS-1$
            IStringVariableManager manager = VariablesPlugin.getDefault()
                .getStringVariableManager();
            try
            {
                manager.validateStringVariables(workingDirPath);
            }
            catch (CoreException e)
            {
                setErrorMessage(e.getMessage());
                return false;
View Full Code Here

            IvyDEMessage.debug("No file retrieving configured");
            return Status.OK_STATUS;
        }

        // Perform variable substition on the pattern.
        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
        String pattern;
        try {
            pattern = varManager.performStringSubstitution(retrievePattern, false);
        } catch (CoreException e) {
            return new Status(IStatus.ERROR, IvyPlugin.ID, IStatus.ERROR,
                    "Incorrect use of variables in retrievePattern '" + retrievePattern + "'."
                            + e.getMessage(), e);
        }
View Full Code Here

        return resolvedPath;
    }

    private void resolvePath(String inputPath, IProject project) throws CoreException,
            MalformedURLException {
        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
        if (project != null) {
            resolvedPath = inputPath.replaceAll("\\$\\{ivyproject_loc\\}", "\\${workspace_loc:"
                    + project.getName() + "}");
        } else {
            resolvedPath = inputPath;
        }
        resolvedPath = manager.performStringSubstitution(resolvedPath, false);
        resolvedPath = resolvedPath.trim();
        if (resolvedPath.length() == 0) {
            // no file or url to set
            return;
        }
View Full Code Here

        return propertyFiles;
    }

    public List getResolvedPropertyFiles() throws IvyDEException {
        List resolvedProps = new ArrayList();
        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
        try {
            Iterator it = propertyFiles.iterator();
            while (it.hasNext()) {
                String propFile = (String) it.next();
                String resolvedProp = manager.performStringSubstitution(propFile, false);
                resolvedProps.add(resolvedProp);
            }
        } catch (CoreException e) {
            throw new IvyDEException("Unrecognized variables",
                    "Unrecognized variables in the Ivy settings file " + ivySettingsPath, e);
View Full Code Here

    {
        String perlExe = PerlEditorPlugin.getDefault().getPerlExecutable();
       
        try
        {
            IStringVariableManager varMgr =
                VariablesPlugin.getDefault().getStringVariableManager();
           
            perlExe = varMgr.performStringSubstitution(perlExe);
        }
        catch (CoreException e)
        {
            PerlEditorPlugin.getDefault().getLog().log(
                new Status(Status.ERROR,
View Full Code Here

                // No validation
                SAXBuilder builder = new SAXBuilder(false);
                Document doc = builder.build(file);

                // Get the variable manager for substitution
                IStringVariableManager varMgr = VariablesPlugin.getDefault()
                    .getStringVariableManager();

                // Get root element
                Element root = doc.getRootElement();

                List entries = root.getChildren("includepathentry");

                Iterator iter = entries.iterator();

                while (iter.hasNext())
                {
                    Element element = (Element) iter.next();
                    String path = element.getAttributeValue("path");

                    if (replaceVariables)
                    {
                        try
                        {
                            // TODO: variable substitution is buggy/unsuitable
                            // for our purposes, as it only works in context of
                            // a selected resource (see ResourceResolver.java:40);
                            // however, we don't guarantee that there is any resource
                            // selected, leading to exceptions (or the selected resource
                            // may be something accidental, leading to erratic behavior)
                            String expandedPath = varMgr
                                .performStringSubstitution(path);
                            path = expandedPath;
                        }
                        catch (CoreException e)
                        {
View Full Code Here

     * @param expression expression
     * @return substituted string
     * @throws CoreException if substitution fails
     */
    protected String performStringSubstitution(String expression) throws CoreException {
        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
        return varManager.performStringSubstitution(expression);
    }
View Full Code Here

            if (fileOrResource.resource == null) {
                reportError("The grinder.properties cannot be set for a run. "
                                + "Project cannot be located.", null);
            }
            String projName = fileOrResource.resource.getProject().getName();
            IStringVariableManager varManager = VariablesPlugin.getDefault()
                            .getStringVariableManager();
            String location = varManager.generateVariableExpression(GrinderConstants.WORKSPACE_LOC,
                            projName + File.separator
                                            + GrinderConstants.GRINDER_PROPERTIES_FILE_NAME);
            try {
                ILaunchConfigurationWorkingCopy workingCopy = conf.copy(conf.getName());
                workingCopy.setAttribute(GrinderConstants.ATTR_GRINDER_PROPERTIES_LOCATION,
View Full Code Here

TOP

Related Classes of org.eclipse.core.variables.IStringVariableManager

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.