Package org.eclipse.ui.console

Examples of org.eclipse.ui.console.IOConsoleOutputStream


    }

    // Convert it to a CloudLog that contains the appropriate log content
    // type
    CloudLog log = getCloudlog(appLog);
    IOConsoleOutputStream activeOutStream = getOutputStream(log.getLogType());

    if (activeOutStream != null && log.getMessage() != null) {
      try {
        activeOutStream.write(log.getMessage());
      }
      catch (IOException e) {
        throw CloudErrorUtil.toCoreException(e);
      }
    }
View Full Code Here


    }
    return jobs;
  }

  protected IConsoleJob createConsoleJob(ICloudFoundryConsoleStream stream) {
    IOConsoleOutputStream outputStream = console.newOutputStream();
    IConsoleJob job = null;
    if (outputStream != null) {
      job = new ConsoleStreamJob(app.getDeployedApplicationName() + " - " + stream.getContentType().getId(), //$NON-NLS-1$
          stream);
      stream.initialiseStream(outputStream);
View Full Code Here

      case STD_OUT:
        stdContent = new LocalStdOutConsoleStream();
        break;
      }
      if (stdContent != null) {
        IOConsoleOutputStream outputStream = console.newOutputStream();
        if (outputStream != null) {
          stdContent.initialiseStream(outputStream);

          job = new StdConsoleStreamJob(stdContent);
          getActiveStreams().addJob(job);
View Full Code Here

  public synchronized void write(CloudLog log) throws CoreException {
    if (log == null || log.getMessage() == null) {
      return;
    }
    IOConsoleOutputStream outStream = getOutputStream(log.getLogType());

    if (outStream != null) {
      try {
        outStream.write(log.getMessage());
      }
      catch (IOException e) {
        throw CloudErrorUtil.toCoreException(e);
      }
    }
View Full Code Here

    }

    streams = new HashMap<LogContentType, TraceConsoleStream>();

    for (TraceUIType type : TRACE_TYPES) {
      IOConsoleOutputStream outStream = getMessageConsole().newOutputStream();

      if (outStream != null) {
        TraceConsoleStream stream = new TraceConsoleStream(type);
        stream.initialiseStream(outStream);
        streams.put(type.getTraceType(), stream);
View Full Code Here

    public synchronized void write(String message) {
      if (message == null) {
        return;
      }
      IOConsoleOutputStream outStream = getActiveOutputStream();
      if (outStream != null) {
        try {
          outStream.write(message);
        }
        catch (IOException e) {
          CloudFoundryPlugin.logError(e);
          close();
        }
View Full Code Here

    return write(content);
  }

  public synchronized String write(String content) throws CoreException {
    IOConsoleOutputStream activeOutStream = getActiveOutputStream();

    if (activeOutStream != null && content != null && content.length() > 0) {
      try {
        activeOutStream.write(content);
        return content;
      }
      catch (IOException e) {
        throw CloudErrorUtil.toCoreException(e);
      }
View Full Code Here

    final MessageConsole console = new MessageConsole("Hadoop: " + command,
        null);
    final MessageConsoleStream stream = console.newMessageStream();

    final IOConsoleOutputStream out = console.newOutputStream();
    final IOConsoleOutputStream err = console.newOutputStream();

    out.setColor(black);
    err.setColor(red);

    ConsolePlugin.getDefault().getConsoleManager().addConsoles(
        new IConsole[] { console });
    ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);

    channel.setCommand(command);
    channel.setInputStream(null);

    channel.connect();
    new Thread() {
      @Override
      public void run() {
        try {

          BufferedReader hadoopOutput = new BufferedReader(
              new InputStreamReader(channel.getInputStream()));

          String stdoutLine;
          while ((stdoutLine = hadoopOutput.readLine()) != null) {
            out.write(stdoutLine);
            out.write('\n');
            continue;
          }

          channel.disconnect();

          // meaningless call meant to prevent console from being
          // garbage collected -- eyhung
          console.getName();
          ChannelExec channel2 = (ChannelExec) session.openChannel("exec");
          channel2.setCommand("rm -rf "
              + jarFile.substring(0, jarFile.lastIndexOf("/")));
          log.fine("Removing temp file "
              + jarFile.substring(0, jarFile.lastIndexOf("/")));
          channel2.connect();
          channel2.disconnect();

        } catch (Exception e) {
        }
      }
    }.start();

    new Thread() {
      @Override
      public void run() {
        try {

          BufferedReader hadoopErr = new BufferedReader(new InputStreamReader(
              channel.getErrStream()));

          // String stdoutLine;
          String stderrLine;
          while ((stderrLine = hadoopErr.readLine()) != null) {
            err.write(stderrLine);
            err.write('\n');
            continue;
          }

        } catch (Exception e) {
        }
View Full Code Here

            return;
        }
        if (FindBugsConsole.getConsole() == null) {
            return;
        }
        IOConsoleOutputStream out = FindBugsConsole.getConsole().newOutputStream();
        PrintWriter pw = new PrintWriter(out);

        ProjectStats stats = bugCollection.getProjectStats();
        Footprint footprint = new Footprint(stats.getBaseFootprint());
        Profiler profiler = stats.getProfiler();
View Full Code Here

  public static Writer getErrorWriter() {
    MessageConsole console = getConsole();
    if (console == lastConsole && lastConsoleErrorWriter != null) {
      return lastConsoleErrorWriter;
    } else {
      IOConsoleOutputStream stream = console.newOutputStream();
      stream.setColor(new Color(Display.getCurrent(), 255, 0, 0));
      lastConsoleErrorWriter = new AutoFlushOutputStreamWriter(stream);
      lastConsole = console;
      return lastConsoleErrorWriter;
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.console.IOConsoleOutputStream

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.