Package org.eclipse.dltk.core.environment

Examples of org.eclipse.dltk.core.environment.IFileHandle


  }

  private static List deployExecute(IExecutionEnvironment exeEnv, String installLocation,
          String[] arguments, EnvironmentVariable[] env) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            env);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$
View Full Code Here


    deployment.dispose();
    return output;
  }

  private static IFileHandle deploy(IDeployment deployment) {
    IFileHandle script;
    try {
      IPath path = deployment.add(RutaIdePlugin.getDefault().getBundle(), DLTK_TM);
      script = deployment.getFile(path);
    } catch (IOException e) {
      if (DLTKCore.DEBUG) {
View Full Code Here

  }

  public static RutaPackage[] getSrcs(IExecutionEnvironment exeEnv, IFileHandle installLocation,
          EnvironmentVariable[] environment, String packageName) {
    IDeployment deployment = exeEnv.createDeployment();
    IFileHandle script = deploy(deployment);
    if (script == null) {
      return null;
    }

    IFileHandle workingDir = script.getParent();
    InterpreterConfig config = ScriptLaunchUtil.createInterpreterConfig(exeEnv, script, workingDir,
            environment);
    String names = packageName;
    ByteArrayInputStream bais = new ByteArrayInputStream(names.getBytes());
    IPath packagesPath = null;
    try {
      packagesPath = deployment.add(bais, "packages.txt"); //$NON-NLS-1$
    } catch (IOException e1) {
      if (DLTKCore.DEBUG) {
        e1.printStackTrace();
      }
      return null;
    }
    IFileHandle file = deployment.getFile(packagesPath);
    // For wish
    config.removeEnvVar("DISPLAY"); //$NON-NLS-1$
    String[] arguments = new String[] { "get-srcs", "-fpkgs", //$NON-NLS-1$ //$NON-NLS-2$
        file.toOSString() };

    config.addScriptArgs(arguments);

    Process process = null;
    try {
View Full Code Here

  private void checkRutaInterpreter() throws IOException, CoreException {
    IEnvironment localEnv = LocalEnvironment.getInstance();
    DefaultInterpreterEntry defaultInterpreterEntry = new DefaultInterpreterEntry(
            RutaNature.NATURE_ID, localEnv.getId());
    IInterpreterInstall defaultInterpreterInstall = ScriptRuntime.getDefaultInterpreterInstall(defaultInterpreterEntry);
    IFileHandle rawInstallLocation = defaultInterpreterInstall.getRawInstallLocation();
    if(!rawInstallLocation.exists()) {
      String pluginIdToJarPath = pluginIdToJarPath(RutaIdePlugin.PLUGIN_ID);
      FileAsFileHandle fh = new FileAsFileHandle(new File(pluginIdToJarPath));
      defaultInterpreterInstall.setInstallLocation(fh);
      ScriptRuntime.setDefaultInterpreterInstall(defaultInterpreterInstall, new NullProgressMonitor());
     
View Full Code Here

    if (fUseDltkRadio.getSelection()) {
      configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, (String) null);

      configuration.setAttribute(ScriptLaunchConfigurationConstants.ATTR_DLTK_CONSOLE_ID,
              Long.toString(System.currentTimeMillis()));
      IFileHandle proxyFile;
      try {
        IExecutionEnvironment exeEnv = (IExecutionEnvironment) EnvironmentManager
                .getLocalEnvironment().getAdapter(IExecutionEnvironment.class);
        proxyFile = RutaIdePlugin.getDefault().getConsoleProxy(exeEnv);
        configuration.setAttribute("environmentId", proxyFile.getEnvironment().getId());
        configuration.setAttribute("proxy_path", proxyFile.toOSString());
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
View Full Code Here

    String[] args = new String[] { "127.0.0.1", port, id };

    IExecutionEnvironment exeEnv = (IExecutionEnvironment) EnvironmentManager.getLocalEnvironment()
            .getAdapter(IExecutionEnvironment.class);
    IFileHandle scriptFile = RutaIdePlugin.getDefault().getConsoleProxy(exeEnv);
    ScriptLaunchUtil.runScript(RutaNature.NATURE_ID, scriptFile, null, null, args, null);
  }
View Full Code Here

        if (!isValidProjectName(fGroupName.getName())) {
          fDetect = false;
        } else {
          IEnvironment environment = fPHPLocationGroup
              .getEnvironment();
          final IFileHandle directory = environment.getFile(location
              .append(fGroupName.getName()));
          fDetect = directory.isDirectory();
        }
      } else {
        IEnvironment environment = fPHPLocationGroup.getEnvironment();
        if (location.toPortableString().length() > 0) {
          final IFileHandle directory = environment.getFile(location);
          fDetect = directory.isDirectory()
              && directory.getPath().toFile().exists();
        }
      }
      if (oldDetectState != fDetect) {
        setChanged();
        notifyObservers();
View Full Code Here

      throw new RuntimeException(
          Services.getMessage("interpreter.type.not.found"));
    }

    IEnvironment env = EnvironmentManager.getLocalEnvironment();
    IFileHandle file = PlatformFileUtils
      .findAbsoluteOrEclipseRelativeFile(env, new Path(interpreterPath));
    if (!file.exists()){
      throw new RuntimeException(
          Services.getMessage("interpreter.path.not.found", interpreterPath));
    }

    EnvironmentVariableContentProvider envVarsProvider =
View Full Code Here

    }

    String interpreterPath = commandLine.getValue(Options.PATH_OPTION);

    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);

    boolean removed = false;
    ArrayList<IInterpreterInstall> interpreters =
      new ArrayList<IInterpreterInstall>();
    for (IInterpreterInstallType iit : types){
      IInterpreterInstall[] installs = iit.getInterpreterInstalls();
      for (IInterpreterInstall install : installs){
        if (!install.getInstallLocation().toOSString().equals(file.toOSString())){
          interpreters.add(install);
        }else{
          removed = true;
        }
      }
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.core.environment.IFileHandle

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.