vendredi 8 juillet 2016

Eclipse MessageConsole: cannot generate clickable link as (Filename.java:LineNumber)

I am using a MessageConsole in Eclipse to display output information. The output is formatted into Error 1 - (MyClass.java:10), which is expected to generate a clickable link to code (MyClass.java line 10, in this case), since the console should be able to parse the pattern (FileName.java:LineNumber) automatically as suggested in this post.

However, it failed to work this way. But when I use System.out.println() to output this pattern directly in the plugin Eclipse, the link can be generated.

I also considered the possibility of multiple consoles in the plugin, but streaming the patterned text to other consoles did not work either. Any insights?

My code is like below:

ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
MessageConsole myConsole = new MessageConsole( name, null );
conMan.addConsoles( new IConsole[]{myConsole} );
MessageConsoleStream out = myConsole.newMessageStream();
out.println("Error 1 - (MyClass.java:10)");

Aucun commentaire:

Enregistrer un commentaire