Examples of OSProcessHandler


Examples of com.intellij.execution.process.OSProcessHandler

        try {
            String[] command = {goExecName, "fmt", fileName};

            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(command, goEnv);
            OSProcessHandler handler = new OSProcessHandler(proc, null);
            toolWindow.attachConsoleViewToProcess(handler);
            toolWindow.printNormalMessage(String.format("%s%n", StringUtil.join(command, " ")));
            handler.startNotify();

            if (proc.waitFor() == 0) {
                VirtualFileManager.getInstance().syncRefresh();
                selectedFile.refresh(false, false);
            }
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

            }
            String[] command = GoSdkUtil.computeGoBuildCommand(goExecName, m_configuration.runBuilderArguments, execName, scriptOrPackage);

            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(command, goEnv, new File(projectDir));
            OSProcessHandler handler = new OSProcessHandler(proc, null);
            toolWindow.attachConsoleViewToProcess(handler);
            toolWindow.printNormalMessage(String.format("%s%n", StringUtil.join(command, " ")));
            toolWindow.showAndCreate(m_project);
            handler.startNotify();

            if (proc.waitFor() == 0) {
                VirtualFileManager.getInstance().syncRefresh();
                toolWindow.printNormalMessage(String.format("%nFinished building project %s%n", execName));
            } else {
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

                            Map<String, String> projectEnv = GoSdkUtil.getExtendedSysEnv(sdkData, projectDir, "", false, false);
                            String[] goEnv = GoSdkUtil.convertEnvMapToArray(projectEnv);
                            String[] command = GoSdkUtil.computeGoGetCommand(goExecName, "-u -v", packageURL);
                            Runtime rt = Runtime.getRuntime();
                            Process proc = rt.exec(command, goEnv, new File(projectDir));
                            OSProcessHandler handler = new OSProcessHandler(proc, null);
                            toolWindow.attachConsoleViewToProcess(handler);
                            toolWindow.printNormalMessage(String.format("%s%n", StringUtil.join(command, " ")));
                            toolWindow.show();
                            handler.startNotify();
                            if (proc.waitFor() == 0) {
                                toolWindow.printNormalMessage(String.format("%nFinished go get package %s%n", packageURL));
                            } else {
                                toolWindow.printErrorMessage(String.format("%nCould't go get package %s%n", packageURL));
                            }
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

                    goExecName
            );

            Runtime rt = Runtime.getRuntime();
            Process proc = rt.exec(command, goEnv, new File(projectDir));
            OSProcessHandler handler = new OSProcessHandler(proc, null);
            toolWindow.attachConsoleViewToProcess(handler);
            toolWindow.printNormalMessage(String.format("%s%n", command));
            toolWindow.showAndCreate(myProject);
            handler.startNotify();

            if (proc.waitFor() == 0) {
                ApplicationManager.getApplication().invokeLater(new Runnable() {
                    @Override
                    public void run() {
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

                        goExecName
                );

                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec(command, goEnv, new File(projectDir));
                OSProcessHandler handler = new OSProcessHandler(proc, null);
                consoleView.attachToProcess(handler);
                consoleView.print(String.format("%s%n", command), ConsoleViewContentType.NORMAL_OUTPUT);
                handler.startNotify();

                if (proc.waitFor() == 0) {
                    VirtualFileManager.getInstance().syncRefresh();
                    consoleView.print(String.format("%nFinished running go vet on project %s%n", projectDir), ConsoleViewContentType.NORMAL_OUTPUT);
                } else {
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

        ConsoleView consoleView = GoCommonConsoleView.consoleView;

        try {

            Process proc = rt.exec(command, goEnv);
            OSProcessHandler handler = new OSProcessHandler(proc, null);
            consoleView.attachToProcess(handler);

            handler.startNotify();

            if (proc.waitFor() == 0) {
                VirtualFileManager.getInstance().syncRefresh();

                consoleView.print(String.format("%nFinished installing %s%n", packagesToImport), ConsoleViewContentType.NORMAL_OUTPUT);
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

        ConsoleView consoleView = GoCommonConsoleView.consoleView;

        try {

            Process proc = rt.exec(command, goEnv);
            OSProcessHandler handler = new OSProcessHandler(proc, null);
            consoleView.attachToProcess(handler);

            handler.startNotify();

            if (proc.waitFor() == 0) {
                VirtualFileManager.getInstance().syncRefresh();

                consoleView.print(String.format("%nFinished installing %s%n", packagesToImport), ConsoleViewContentType.NORMAL_OUTPUT);
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

      finally {
        outputStream.close();
      }
    }

    OSProcessHandler handler = new OSProcessHandler(clientProcess, "") {
      public Charset getCharset() {
        return CharsetToolkit.getDefaultSystemCharset();
      }
    };
    handler.addProcessListener(new ProcessAdapter() {
      public void onTextAvailable(final ProcessEvent event, final Key outputType) {
        if (outputType == ProcessOutputTypes.STDOUT) {
          result.stdOut += event.getText();
        }
        else if (outputType == ProcessOutputTypes.STDERR) {
          result.stdErr += event.getText();
        }
      }
    });
    handler.startNotify();
    handler.waitFor();
    result.exitCode = clientProcess.exitValue();
    return result;
  }
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

    @NotNull
    @Override
    protected OSProcessHandler startProcess() throws ExecutionException {
        GeneralCommandLine commandLine = generateCommandLine();
        OSProcessHandler osProcessHandler = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
        ProcessTerminatedListener.attach(osProcessHandler);
        return osProcessHandler;
    }
View Full Code Here

Examples of com.intellij.execution.process.OSProcessHandler

    return commandLine;
  }

  public static OSProcessHandler runRebar(Project project, GeneralCommandLine commandLine) throws ExecutionException {
    try {
      return new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
    } catch (ExecutionException e) {
      String message = e.getMessage();
      boolean isEmpty = message.equals("Executable is not specified");
      boolean notCorrect = message.startsWith("Cannot run program");
      if (isEmpty || notCorrect) {
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.