private void writeTo(final IOConsoleOutputStream outputStream, final String message) {
   try {
     outputStream.write(message);
     outputStream.flush();
   } catch (final IOException e) {
     // Do nothing
   }
 }
Exemple #2
0
 public void print(String message, MessageType type) {
   IOConsoleOutputStream newMessageStream = getNewMessageConsoleStream(type);
   try {
     newMessageStream.write(message);
   } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
Exemple #3
0
  private IOConsoleOutputStream getNewMessageConsoleStream(final MessageType type) {
    final IOConsoleOutputStream newMessageStream = this.newOutputStream();
    newMessageStream.setActivateOnWrite(true);
    Display.getDefault()
        .asyncExec(
            new Runnable() {

              @Override
              public void run() {
                newMessageStream.setColor(getColor(type));
              }
            });

    return newMessageStream;
  }
  public String write(IProgressMonitor monitor) throws CoreException {

    final String content = getContent(monitor);

    if (content != null && content.length() > 0) {

      try {
        outputStream.write(content);
      } catch (IOException e) {
        throw CloudErrorUtil.toCoreException(e);
      }
    }

    return null;
  }
 public void close() throws IOException {
   if (outputStream != null) {
     outputStream.close();
   }
 }