[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Filters & colors in Eclipse Console

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_STREAM).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.
>