Package org.eclipse.ui.console

Examples of org.eclipse.ui.console.MessageConsoleStream


        }
    }

    private void logEvent(Event event, MessageConsole console) {

        MessageConsoleStream messageStream = console.newMessageStream();
        try {

            Long start = (Long) event.getProperty(CommandExecutionProperties.TIMESTAMP_START);
            Long end = (Long) event.getProperty(CommandExecutionProperties.TIMESTAMP_END);
            String type = (String) event.getProperty(CommandExecutionProperties.ACTION_TYPE);
            String target = (String) event.getProperty(CommandExecutionProperties.ACTION_TARGET);
            String result = (String) event.getProperty(CommandExecutionProperties.RESULT_TEXT);
            Throwable t = (Throwable) event.getProperty(CommandExecutionProperties.RESULT_THROWABLE);

            StringBuilder message = new StringBuilder();
            DateFormat format = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
            message.append("[").append(format.format(new Date(start))).append("] ").append(type).append(" -> ")
                    .append(target);
            message.append(" : ").append(result).append(" (").append(end - start).append(" ms)").append('\n');

            messageStream.write(message.toString());
            if (t != null) {
                t.printStackTrace(new PrintStream(messageStream));
            }
        } catch (IOException e) {
            Activator.getDefault().getPluginLogger().warn("Failed writing to the console", e);
View Full Code Here


        {
            @Override
            protected IStatus run(IProgressMonitor arg0)
            {
                BuildConsole console = findConsole();
                MessageConsoleStream stream = console.getMessageStream();
                stream.println(message);
                return Status.OK_STATUS;
            }
        };
        job.schedule();
    }
View Full Code Here

  public void write(String line) {
    if (console == null)
      console = findConsole(CONSOLE_NAME);

    MessageConsoleStream out = console.newMessageStream();
    out.println(line);
    try {
      out.close();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
View Full Code Here

    end = false;
   
    if (console == null)
      console = findConsole(CONSOLE_NAME);

    MessageConsoleStream out = console.newMessageStream();
    String line = null;
   
    try {
      while ((line = input.readLine()) != null) {
        out.println(line);
      }

    } catch (IOException e) {
      if ( !end )
        e.printStackTrace();
    } finally {
      try {
        out.close();
        input.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
View Full Code Here

    testCaseOpener = new TestCaseOpener(ServiceLocator.getService(LoadedSourceFileLibrary.class));

    IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
    MessageConsole messageConsole = new MessageConsole("JSTestDriver", null);
    messageConsole.activate();
    messageConsoleStream = new MessageConsoleStream(messageConsole);
    consoleManager.addConsoles(new IConsole[] {messageConsole});
    setLayout(new GridLayout(3, true));
    GridData layoutData = new GridData();
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.grabExcessVerticalSpace = true;
View Full Code Here

      final String jarFile) throws JSchException {
    final ChannelExec channel = (ChannelExec) session.openChannel("exec");

    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);
View Full Code Here

                COLOR_BLACK = Display.getDefault().getSystemColor(SWT.COLOR_BLACK);
            }
        });

        this.setTabWidth(4);
        MessageConsoleStream internalStream = newMessageStream();
        internal = new PrintStream(internalStream, true);
        internalStream.setColor(COLOR_BLACK);
        MessageConsoleStream errorStream = newMessageStream();
        err = new PrintStream(errorStream, true);
        errorStream.setColor(COLOR_RED);
        MessageConsoleStream outputStream = newMessageStream();
        out = new PrintStream(outputStream, true);
        outputStream.setColor(COLOR_BLACK);
    }
View Full Code Here

    }

    private static class OutputMessageThread implements Runnable {
        public void run() {
            OutputConsole console = EclipsePlugin.getDefault().getConsole();
            MessageConsoleStream outputStream = console.newMessageStream();
            outputStream.setColor(_color);
            console.show();
            outputStream.print(_message + "\n");
        }
View Full Code Here

    doRunImpl(config, launch, this.config, monitor);
  }

  private static Handler initConsoleLink(String module) {
    final MessageConsole console;
    final MessageConsoleStream out;
    console = findConsole(module);
    out = console.newMessageStream();

    Handler handler = new Handler() {

      @Override
      public void publish(LogRecord record) {
        String message = record.getMessage();
        if (message.equals("\\n")) {
          out.println();
        }
        String[] split = message.split("\\\\n");
        for (String string : split) {
          out.println(string);
        }
        console.activate();
      }

      @Override
View Full Code Here

        }
      });
      classFile_return result = parser.classFile();
      if (parser.getNumberOfSyntaxErrors() > 0){
        MessageConsole console = ToolModelActivator.findConsole(ToolModelActivator.TOOL_PARSER_OUTPUT);
        MessageConsoleStream msgStream = console.newMessageStream();
        msgStream.println(parser.getNumberOfSyntaxErrors() + " Syntax error(s) in class " + file.getName() + "\n"
            + parseErrors.toString());
      }

      tree = (CommonTree) result.getTree();
      System.out.println(tree.toStringTree());
View Full Code Here

TOP

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

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.