Add a console view in RCP(eclipse indigo-3.7) [message #1234081] |
Tue, 21 January 2014 02:40  |
Eclipse User |
|
|
|
hello,
I'm using Eclipse Indigo-3.7. I want to add a console view in my RCP APplication.
I added it using the following command in my "Perspective.java" file.
layout.addView(IConsoleConstants.ID_CONSOLE_VIEW, IPageLayout.BOTTOM, .2f, editorArea);
Now i can see the console view part in my application, but how to print a "MessageStream" in my console view part?? I want to transfer my Eclipse's Console messages to my RCP's console. Kindly help me out.
Thnakyou!!!
|
|
|
Re: Add a console view in RCP(eclipse indigo-3.7) [message #1257226 is a reply to message #1234081] |
Wed, 26 February 2014 02:30  |
Eclipse User |
|
|
|
To enable the log in the Console view, you have to create your console instance to write in it.
For example, here is a piece of code to help you.
/**
* Reroute default output streams to a new console, added to console view.
*/
public static void linkDefaultOutStreamToConsole() {
// Create a msg console
final MessageConsole console = new MessageConsole("Console", null);
// Add it to console manager
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] {vConsole });
PrintStream printStream = new PrintStream(console.newMessageStream());
// Link standard output stream to the console
System.setOut(printStream);
// Link error output stream to the console
System.setErr(printStream);
}
/**
* Reset output stream to system ones.
*/
public static void unlinkDefaultOutStreamToConsole() {
System.setOut(System.out);
System.setErr(System.err);
}
|
|
|
Powered by
FUDForum. Page generated in 0.24406 seconds