Examples of IInterpreterInstall


Examples of org.eclipse.dltk.launching.IInterpreterInstall

        file, envVars, libs, new NullProgressMonitor());
    if (!status.isOK()){
      throw new RuntimeException(status.getMessage());
    }

    IInterpreterInstall deflt =
      ScriptRuntime.getDefaultInterpreterInstall(
          new ScriptRuntime.DefaultInterpreterEntry(nature, env.getId()));
    if (deflt != null && deflt.getInstallLocation().equals(file)){
      throw new RuntimeException(
          Services.getMessage("interpreter.already.exists", interpreterPath));
    }

    ArrayList<IInterpreterInstall> interpreters =
      new ArrayList<IInterpreterInstall>();
    IInterpreterInstallType[] types =
      ScriptRuntime.getInterpreterInstallTypes(nature);

    for (IInterpreterInstallType iit : types){
      IInterpreterInstall[] installs = iit.getInterpreterInstalls();
      for (IInterpreterInstall install : installs){
        if (install.getInstallLocation().equals(file)){
          throw new RuntimeException(
              Services.getMessage("interpreter.already.exists", interpreterPath));
        }
        interpreters.add(install);
      }
    }

    String name = commandLine.getValue(Options.NAME_OPTION);
    if (name == null){
      name = generateInterpreterName(file, nature);
    }

    String id = null;
    do {
      id = String.valueOf(System.currentTimeMillis());
    } while (type.findInterpreterInstall(id) != null);

    IInterpreterInstall install = new InterpreterStandin(type, id);
    install.setInstallLocation(
        new LazyFileHandle(env.getId(), new Path(interpreterPath)));
    install.setName(name);
    install.setLibraryLocations(libs);
    install.setInterpreterArgs(null); // future use
    install = ((InterpreterStandin)install).convertToRealInterpreter();
    interpreters.add(install);

    if(deflt == null){
      deflt = install;
View Full Code Here

Examples of org.eclipse.dltk.launching.IInterpreterInstall

  protected boolean validateGeneratedName(String name, String nature)
  {
    IInterpreterInstallType[] types =
      ScriptRuntime.getInterpreterInstallTypes(nature);
    for (IInterpreterInstallType type : types){
      IInterpreterInstall install = type.findInterpreterInstallByName(name);
      if (install != null) {
        return false;
      }
    }
    return true;
View Full Code Here

Examples of org.eclipse.dltk.launching.IInterpreterInstall

    }

    ArrayList<HashMap<String,Object>> interpreters =
      new ArrayList<HashMap<String,Object>>();
    for (String natureId : natures){
      IInterpreterInstall deflt =
        ScriptRuntime.getDefaultInterpreterInstall(
            new ScriptRuntime.DefaultInterpreterEntry(natureId, env.getId()));
      if (deflt != null){
        HashMap<String,Object> defaultInt = new HashMap<String,Object>();
        defaultInt.put("nature", ProjectNatureFactory.getAliasForNature(natureId));
        defaultInt.put("name", deflt.getName());
        defaultInt.put("path", deflt.getInstallLocation().getPath().toOSString());
        defaultInt.put("default", true);
        interpreters.add(defaultInt);
      }

      IInterpreterInstallType[] types =
View Full Code Here

Examples of org.eclipse.dltk.launching.IInterpreterInstall

    IEnvironment env = EnvironmentManager.getLocalEnvironment();
    IFileHandle file = PlatformFileUtils
      .findAbsoluteOrEclipseRelativeFile(env, new Path(interpreterPath));

    IInterpreterInstall deflt =
      ScriptRuntime.getDefaultInterpreterInstall(
          new ScriptRuntime.DefaultInterpreterEntry(nature, env.getId()));
    if (deflt != null && deflt.getInstallLocation().equals(file)){
      deflt = null;
    }

    IInterpreterInstallType[] types =
      ScriptRuntime.getInterpreterInstallTypes(nature);
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.