views:

24

answers:

1

I am trying to write an Eclipse plugin which needs to read the std error inside eclipse. E.g. the red text that appears in the console.

I cannot find the correct extension point for something like this. The best I could find was org.eclipse.ui.console.consolePatternMatchListeners but this just matches console lines regardless of their origin.

Anyone know a method to do this or the correct extension point?

+1  A: 

Using internal code you can add listner to ErrorStream

ProcessConsole con = ...
con.getProcess().getStreamsProxy().getErrorStreamMonitor().addListener(new IStreamListener() {
    @Override
    public void streamAppended(String text, IStreamMonitor monitor) {
        System.out.println("text=" + text);
    }
});
01
Cool, this is exactly what I was looking for. Not familiar with using eclipse internal code from a plugin. Is it safe to just wrap that code with a try/catch and expect some kind of classpath exception to be thrown if someone is using a version of eclipse where the internal code has changed?
Gordon
ProcessConsole is since 3.0 and they dont delete internal code too often(since many things you can only do with internal code). they say that is you need to use internal code you should make bug report about it and they will try to make it public.
01