Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Filters & colors in Eclipse Console
Filters & colors in Eclipse Console [message #334533] Mon, 16 February 2009 14:27 Go to next message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Hello,


I have created a working Eclipse plugin which implements the
org.eclipse.debug.core.launchConfigurationTypes extension.
It works fine and I can run my customized java projects using the Run menu.
The eclipse console appears and everythings works fine. However, the output
logs from the JVM uses some sort of ANSI escape codes. I've been looking for
any useful extension point in the Eclipse API for parsing and enhancing the
color support without success. (org.eclipse.debug.ui.consoleColorProviders
can only change the color for standard streams and
org.eclipse.debug.ui.consoleLineTrackers cannot be used to send strings back
to the console)

I need to filter the outputs of the JVM so I can substitute the escape codes
and then I need a way to colorize the output of the console.

It seems this cannot be done simply... do you know some possible workaround
for this problem?

Is it possible to subclass and then substitute the ProcessConsole easily
from the debug plugin? Any ideas?


Thanks for your help.

J.
Re: Filters & colors in Eclipse Console [message #334548 is a reply to message #334533] Tue, 17 February 2009 10:34 Go to previous message
Eclipse UserFriend
Originally posted by: j4r0d.hotmail.com

Hi again,

I have found a solution to my problem!
Indeed, interesting extension points exist for my issue and unfortunately in
my first attempt of modifying the console behavior I have neglected
the most important one : org.eclipse.debug.core.processFactories
Implementing the IProcessFactory allow you to create your own RuntimeProcess
which in the ends allow you to override the createStreamsProxy(). From here,
you can provide an implementation for your own OutputStreamMonitor which
grant you access to the stream. Parsing could be done at this level.

And finally, colorizing the console may be done with the
org.eclipse.debug.ui.consoleColorProviders extension point. Adding a
listener to your ConsoleColorProvider can be done like this:
streamsProxy.getOutputStreamMonitor().addListener(this);
(assuming your ConsoleColorProvider class implements some sort of
IStreamListener)
Using
console.getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREA M).setColor(...)
the output color of the console can be changed easily.

If you have a better solution, please let me know,
Anyway, I hope this will help you ;)

J.


> Hello,
>
>
> I have created a working Eclipse plugin which implements the
> org.eclipse.debug.core.launchConfigurationTypes extension.
> It works fine and I can run my customized java projects using the Run
> menu. The eclipse console appears and everythings works fine. However, the
> output logs from the JVM uses some sort of ANSI escape codes. I've been
> looking for any useful extension point in the Eclipse API for parsing and
> enhancing the color support without success.
> (org.eclipse.debug.ui.consoleColorProviders can only change the color for
> standard streams and org.eclipse.debug.ui.consoleLineTrackers cannot be
> used to send strings back to the console)
>
> I need to filter the outputs of the JVM so I can substitute the escape
> codes and then I need a way to colorize the output of the console.
>
> It seems this cannot be done simply... do you know some possible
> workaround for this problem?
>
> Is it possible to subclass and then substitute the ProcessConsole easily
> from the debug plugin? Any ideas?
>
>
> Thanks for your help.
>
> J.
>
Previous Topic:Synchronizing open editors on the same file
Next Topic:Dynamically setting the TableViewer row height
Goto Forum:
  


Current Time: Thu Apr 25 22:29:41 GMT 2024

Powered by FUDForum. Page generated in 0.02898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top