Class MessageConsole

  • All Implemented Interfaces:
    IConsole

    public class MessageConsole
    extends IOConsole
    A console that displays messages. A message console may have one or more streams connected to it (MessageConsoleStream). Text written to streams is buffered and processed in a Job by the console's document partitioner.

    Clients may instantiate this class.

    Since:
    3.0
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • MessageConsole

        public MessageConsole​(String name,
                              ImageDescriptor imageDescriptor)
        Constructs a message console with the given name and image.
        Parameters:
        name - console name
        imageDescriptor - console image descriptor or null
      • MessageConsole

        public MessageConsole​(String name,
                              ImageDescriptor imageDescriptor,
                              boolean autoLifecycle)
        Constructs a message console.
        Parameters:
        name - console name
        imageDescriptor - console image descriptor or null
        autoLifecycle - whether lifecycle methods should be called automatically when added and removed from the console manager
        Since:
        3.1
      • MessageConsole

        public MessageConsole​(String name,
                              String consoleType,
                              ImageDescriptor imageDescriptor,
                              boolean autoLifecycle)
        Constructs a message console with the given name, type, image, and lifecycle.
        Parameters:
        name - console name
        consoleType - console type identifier or null
        imageDescriptor - console image descriptor or null
        autoLifecycle - whether lifecycle methods should be called automatically when added and removed from the console manager
        Since:
        3.4
      • MessageConsole

        public MessageConsole​(String name,
                              String consoleType,
                              ImageDescriptor imageDescriptor,
                              String encoding,
                              boolean autoLifecycle)
        Constructs a message console with the given name, type, image, encoding, and lifecycle specification.
        Parameters:
        name - the name to display for this console
        consoleType - console type identifier or null
        imageDescriptor - console image descriptor or null
        encoding - the encoding that should be used to render the text, or null if the system default encoding should be used
        autoLifecycle - whether lifecycle methods should be called automatically when added and removed from the console manager
        Since:
        3.5
    • Method Detail

      • newMessageStream

        public MessageConsoleStream newMessageStream()
        Returns a new message stream connected to this console.

        Clients should avoid writing large amounts of output to this stream in the UI thread. The console needs to process the output in the UI thread and if the client hogs the UI thread writing output to the console, the console will not be able to process the output.

        Returns:
        a new message stream connected to this console
      • createPage

        public IPageBookViewPage createPage​(IConsoleView view)
        Description copied from interface: IConsole
        Creates and returns a new page for this console. The page is displayed for this console in the console given view.
        Specified by:
        createPage in interface IConsole
        Overrides:
        createPage in class IOConsole
        Parameters:
        view - the view in which the page is to be created
        Returns:
        a page book view page representation of this console
      • appendToDocument

        @Deprecated
        protected void appendToDocument​(String text,
                                        MessageConsoleStream stream)
        Deprecated.
        since 3.1, this method should no longer be called, and has no effect. Writing to a message console stream updates the document
        Appends the given message to this console, from the specified stream.
        Parameters:
        text - message
        stream - stream the message belongs to