Interface ConsoleService


public interface ConsoleService
Generic console interface allowing any plugin to print messages to console window.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addErrorMessage(String originator, String message)
    Appends an error message to the console text area.
    void
    addException(String originator, Exception exc)
    Appends an exception to the console text area.
    void
    addMessage(String originator, String message)
    Appends message to the console text area.
    void
    Clears all messages from the console.
    Returns a print writer object to use as standard error.
    Returns a print writer object to use as standard output.
    getText(int offset, int length)
    Fetches the text contained within the given portion of the console.
    int
    Returns number of characters of currently in the console.
    void
    Prints the message into the console.
    void
    Prints the error message into the console.
    void
    Prints the messages into the console followed by a line feed.
    void
    Prints the error message into the console followed by a line feed.
  • Method Details

    • addMessage

      void addMessage(String originator, String message)
      Appends message to the console text area. For example: "originator> message"
      Parameters:
      originator - a descriptive name of the message creator
      message - the message to appear in the console
    • addErrorMessage

      void addErrorMessage(String originator, String message)
      Appends an error message to the console text area. The message should be rendered is such a way as to denote that it is an error. For example, display in "red".
      Parameters:
      originator - a descriptive name of the message creator
      message - the message to appear in the console
    • addException

      void addException(String originator, Exception exc)
      Appends an exception to the console text area.
      Parameters:
      originator - a descriptive name of the message creator
      exc - the exception
    • clearMessages

      void clearMessages()
      Clears all messages from the console.
    • print

      void print(String msg)
      Prints the message into the console.
      Parameters:
      msg - the messages to print into the console
    • println

      void println(String msg)
      Prints the messages into the console followed by a line feed.
      Parameters:
      msg - the message to print into the console
    • printError

      void printError(String errmsg)
      Prints the error message into the console. It will be displayed in red.
      Parameters:
      errmsg - the error message to print into the console
    • printlnError

      void printlnError(String errmsg)
      Prints the error message into the console followed by a line feed. It will be displayed in red.
      Parameters:
      errmsg - the error message to print into the console
    • getStdOut

      PrintWriter getStdOut()
      Returns a print writer object to use as standard output.
      Returns:
      a print writer object to use as standard output
    • getStdErr

      PrintWriter getStdErr()
      Returns a print writer object to use as standard error.
      Returns:
      a print writer object to use as standard error
    • getTextLength

      int getTextLength()
      Returns number of characters of currently in the console. If the console is cleared, this number is reset. Please note: Support for this method is optional based on the underlying console implementation. If this method cannot be supported, please throw UnsupportedOperationException.
      Returns:
      number of characters >= 0
      Throws:
      UnsupportedOperationException
    • getText

      String getText(int offset, int length)
      Fetches the text contained within the given portion of the console. Please note: Support for this method is optional based on the underlying console implementation. If this method cannot be supported, please throw UnsupportedOperationException.
      Parameters:
      offset - the offset into the console representing the desired start of the text >= 0
      length - the length of the desired string >= 0
      Returns:
      the text, in a String of length >= 0
      Throws:
      UnsupportedOperationException