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(RutaIdeCorePlugin.getDefault().getBundle(), DLTK_RUTA);
      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

    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 = RutaIdeUIPlugin.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

    }
    if(defaultInterpreterInstall == null) {
      // initialized too early
      return;
    }
    IFileHandle rawInstallLocation = defaultInterpreterInstall.getRawInstallLocation();
    if (!rawInstallLocation.exists()) {
      String pluginIdToJarPath = pluginIdToJarPath(RutaIdeUIPlugin.PLUGIN_ID);
      FileAsFileHandle fh = new FileAsFileHandle(new File(pluginIdToJarPath));
      defaultInterpreterInstall.setInstallLocation(fh);
      ScriptRuntime.setDefaultInterpreterInstall(defaultInterpreterInstall,
              new NullProgressMonitor());
View Full Code Here

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

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

      "include/d/dmd/druntime/import", "include/d/dmd/phobos")
  }
 
  public static LibraryLocation[] getLibraryLocations(CommonInstallType dmdInstallType, Path compilerPath) {
    IEnvironment env = LocalEnvironment.getInstance();
    IFileHandle file = PlatformFileUtils.findAbsoluteOrEclipseRelativeFile(env, compilerPath);
    return dmdInstallType.getDefaultLibraryLocations(file);
  }
View Full Code Here

      return;
    }
   
    // Make sure we get the real install type instances, so we can get installs
    for (CommonInstallType compilerInstallType : getDeeInstallTypes()) {
      IFileHandle compilerInstallLocation = compilerInstallType.directoryHasCompilerPresent(path);
      if(compilerInstallLocation != null) {
        addCompilerInstall(compilerInstallType, compilerInstallLocation);
      }
    }
  }
View Full Code Here

  @Override
  protected void beginValidation() throws ValidationException {
   
    IPath fileLocation = firstPage.PHPLocationGroup.getLocation();
    if (fileLocation.toPortableString().length() > 0) {
      final IFileHandle directory = environment.getFile(fileLocation);
      IPath futurepath = directory.getPath().append(firstPage.nameGroup.getName());
      File futureFile = futurepath.toFile();
      if ((futureFile.exists() && futureFile.isFile()) || (futureFile.exists() && futureFile.isDirectory() && futureFile.list().length > 0)) {
        throw new ValidationException("The target directory is not empty. Unable to run \"create-project\" with a target directory containing files.", Severity.ERROR);
      }
    }
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

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.