Package org.eclipse.ui.console
Class MessageConsole
- java.lang.Object
-
- org.eclipse.ui.console.AbstractConsole
-
- org.eclipse.ui.console.TextConsole
-
- org.eclipse.ui.console.IOConsole
-
- org.eclipse.ui.console.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.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_TAB_SIZEDeprecated.static StringP_FONTDeprecated.static StringP_STREAM_COLORDeprecated.static StringP_TAB_SIZEDeprecated.
-
Constructor Summary
Constructors Constructor Description MessageConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle)Constructs a message console with the given name, type, image, and lifecycle.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.MessageConsole(String name, ImageDescriptor imageDescriptor)Constructs a message console with the given name and image.MessageConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle)Constructs a message console.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidappendToDocument(String text, MessageConsoleStream stream)Deprecated.since 3.1, this method should no longer be called, and has no effect.IPageBookViewPagecreatePage(IConsoleView view)Creates and returns a new page for this console.IOConsoleInputStreamgetInputStream()Returns the input stream connected to the keyboard.MessageConsoleStreamnewMessageStream()Returns a new message stream connected to this console.-
Methods inherited from class org.eclipse.ui.console.IOConsole
clearConsole, dispose, getCharset, getEncoding, getHighWaterMark, getLowWaterMark, getPartitioner, isCarriageReturnAsControlCharacter, isHandleControlCharacters, newOutputStream, setCarriageReturnAsControlCharacter, setHandleControlCharacters, setInputStream, setWaterMarks
-
Methods inherited from class org.eclipse.ui.console.TextConsole
addHyperlink, addPatternMatchListener, getAttribute, getBackground, getConsoleWidth, getDocument, getFont, getHyperlink, getHyperlinks, getRegion, getSchedulingRule, getTabWidth, init, isConsoleAutoScrollLock, matcherFinished, partitionerFinished, removePatternMatchListener, setAttribute, setBackgrond, setBackground, setConsoleAutoScrollLock, setConsoleWidth, setFont, setTabWidth
-
Methods inherited from class org.eclipse.ui.console.AbstractConsole
activate, addPropertyChangeListener, destroy, firePropertyChange, getHelpContextId, getImageDescriptor, getName, getType, initialize, removePropertyChangeListener, setImageDescriptor, setName, setType
-
-
-
-
Field Detail
-
P_FONT
@Deprecated public static final String P_FONT
Deprecated.Property constant indicating the font of this console has changed.
-
P_STREAM_COLOR
@Deprecated public static final String P_STREAM_COLOR
Deprecated.Property constant indicating the color of a stream has changed.
-
P_TAB_SIZE
@Deprecated public static final String P_TAB_SIZE
Deprecated.Property constant indicating tab size has changed
-
DEFAULT_TAB_SIZE
@Deprecated public static final int DEFAULT_TAB_SIZE
Deprecated.The default tab size- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MessageConsole
public MessageConsole(String name, ImageDescriptor imageDescriptor)
Constructs a message console with the given name and image.- Parameters:
name- console nameimageDescriptor- console image descriptor ornull
-
MessageConsole
public MessageConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle)
Constructs a message console.- Parameters:
name- console nameimageDescriptor- console image descriptor ornullautoLifecycle- 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 nameconsoleType- console type identifier ornullimageDescriptor- console image descriptor ornullautoLifecycle- 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 consoleconsoleType- console type identifier ornullimageDescriptor- console image descriptor ornullencoding- the encoding that should be used to render the text, ornullif the system default encoding should be usedautoLifecycle- 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:IConsoleCreates and returns a new page for this console. The page is displayed for this console in the console given view.- Specified by:
createPagein interfaceIConsole- Overrides:
createPagein classIOConsole- Parameters:
view- the view in which the page is to be created- Returns:
- a page book view page representation of this console
-
getInputStream
public IOConsoleInputStream getInputStream()
Description copied from class:IOConsoleReturns the input stream connected to the keyboard.Note: It returns the stream connected to keyboard. There is no guarantee to get the stream last set with
IOConsole.setInputStream(InputStream). The return value might benullif the current input stream is not connected to the keyboard.- Overrides:
getInputStreamin classIOConsole- Returns:
- the input stream connected to the keyboard.
-
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 documentAppends the given message to this console, from the specified stream.- Parameters:
text- messagestream- stream the message belongs to
-
-