Examples of IStringVariableManager


Examples of org.eclipse.core.variables.IStringVariableManager

   *
   * @param expression expression with variables
   * @exception CoreException if a variable is specified that does not exist
   */
  private static void validateVaribles(String expression) throws CoreException {
    IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
    manager.validateStringVariables(expression);
  }
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

    private static String getSubstitutedString(String text) throws CoreException {
        if (text == null) {
            return ""; //$NON-NLS-1$
        }

        final IStringVariableManager mgr = VariablesPlugin.getDefault().getStringVariableManager();
        return mgr.performStringSubstitution(text);
    }
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

            String loc;
            if (r.resource != null) {

                if (makeRelative) {
                    IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
                    loc = makeFileRelativeToWorkspace(r.resource, varManager);
                } else {
                    loc = r.resource.getLocation().toOSString();
                }
            } else {
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

        if (type == null) {
            throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Python launch configuration not found",
                    null));
        }

        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();

        String name;
        String baseDirectory;
        String moduleFile;
        int resourceType;

        if (captureOutput) {
            StringBuffer buffer = new StringBuffer(projName);
            buffer.append(" ");
            StringBuffer resourceNames = new StringBuffer();
            for (FileOrResource r : resource) {
                if (resourceNames.length() > 0) {
                    resourceNames.append(" - ");
                }
                if (r.resource != null) {
                    resourceNames.append(r.resource.getName());
                } else {
                    resourceNames.append(r.file.getName());
                }
            }
            buffer.append(resourceNames);
            name = buffer.toString().trim();

            if (resource[0].resource != null) {
                // Build the working directory to a path relative to the workspace_loc
                baseDirectory = resource[0].resource.getFullPath().removeLastSegments(1).makeRelative().toString();
                baseDirectory = varManager.generateVariableExpression("workspace_loc", baseDirectory);

                // Build the location to a path relative to the workspace_loc
                moduleFile = makeFileRelativeToWorkspace(resource, varManager);
                resourceType = resource[0].resource.getType();
            } else {
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

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

Examples of org.eclipse.core.variables.IStringVariableManager

        String fileName = getTextControl().getText();
        fileName = fileName.trim();
        if (fileName.length() == 0 && isEmptyStringAllowed())
          return true;

        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
        String substitutedFileName;
        try {
          substitutedFileName = manager.performStringSubstitution(fileName);
        } catch (CoreException e) {
          // It's apparently invalid
          return false;
        }
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

   *         was an error during substitution.
   */
  public static String getDefaultRepositoryDir() {
    String dir = Activator.getDefault().getPreferenceStore()
        .getString(UIPreferences.DEFAULT_REPO_DIR);
    IStringVariableManager manager = VariablesPlugin.getDefault()
        .getStringVariableManager();
    try {
      return manager.performStringSubstitution(dir);
    } catch (CoreException e) {
      return ""; //$NON-NLS-1$
    }
  }
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

    private void buildProfile(int kind, IProgressMonitor monitor, TeaVMProfile profile, ClassLoader classLoader)
            throws CoreException {
        if ((kind == AUTO_BUILD || kind == INCREMENTAL_BUILD) && !shouldBuild(profile)) {
            return;
        }
        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
        TeaVMTool tool = new TeaVMTool();
        tool.setClassLoader(classLoader);
        tool.setDebugInformationGenerated(profile.isDebugInformationGenerated());
        tool.setSourceMapsFileGenerated(profile.isSourceMapsGenerated());
        tool.setSourceFilesCopied(profile.isSourceFilesCopied());
        String targetDir = profile.getTargetDirectory();
        tool.setTargetDirectory(new File(varManager.performStringSubstitution(targetDir, false)));
        tool.setTargetFileName(profile.getTargetFileName());
        tool.setMinifying(profile.isMinifying());
        tool.setRuntime(mapRuntime(profile.getRuntimeMode()));
        tool.setMainClass(profile.getMainClass());
        tool.getProperties().putAll(profile.getProperties());
        tool.setIncremental(profile.isIncremental());
        String cacheDir = profile.getCacheDirectory();
        tool.setCacheDirectory(!cacheDir.isEmpty() ?
                new File(varManager.performStringSubstitution(cacheDir, false)) : null);
        for (ClassHolderTransformer transformer : instantiateTransformers(profile, classLoader)) {
            tool.getTransformers().add(transformer);
        }
        for (Map.Entry<String, String> entry : profile.getClassAliases().entrySet()) {
            ClassAlias classAlias = new ClassAlias();
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

                name = NEW_PROFILE_NAME + " (" + i++ + ")";
            } while (profileMap.containsKey(name));
        }
        ProfileImpl profile = new ProfileImpl();
        profile.name = name;
        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
        profile.setEnabled(true);
        profile.setTargetDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
        profile.setTargetFileName("classes.js");
        profile.setMinifying(true);
        profile.setIncremental(false);
        profile.setCacheDirectory(varManager.generateVariableExpression("workspace_loc", "/" + projectName));
        profile.setSourceMapsGenerated(true);
        profile.setDebugInformationGenerated(true);
        profiles.add(profile);
        profileMap.put(name, profile);
        return profile;
View Full Code Here

Examples of org.eclipse.core.variables.IStringVariableManager

        }
        return aliases;
    }

    private String getProjectBuildDirectory() throws CoreException {
        IStringVariableManager varManager = VariablesPlugin.getDefault().getStringVariableManager();
        if (!project.hasNature(JavaCore.NATURE_ID)) {
            return varManager.generateVariableExpression("workspace_loc", "/" + project.getName());
        }
        IJavaProject javaProject = JavaCore.create(project);
        String path = javaProject.getOutputLocation().toString();
        return varManager.generateVariableExpression("workspace_loc", path);
    }
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.