Source links in console [message #1829221] |
Mon, 29 June 2020 02:14  |
Eclipse User |
|
|
|
This is not a new topic. I have found messages back to 2006 where people are asking this question, and it always seems that they have invested time and effort in finding solutions that don't work.
All of my output goes through a pair of functions, DebugOptions.print() and DebugOptions.println(). So I would like a library class that would handle all this for me, either before or after the text is put into the console window. All of the references are based on local files, either source files or data files.
And before somebody complains: that is my real name. If you don't believe me, google my name. I leave it as an Exercise For The Reader to figure out which of the many hits is the real me.
|
|
|
|
|
|
|
Re: Source links in console [message #1829258 is a reply to message #1829251] |
Mon, 29 June 2020 14:14   |
Eclipse User |
|
|
|
You'll find several resources on the internet; I can personally recommend Eclipse IDE Plug-in Development: Plug-ins, Features, Update Sites and IDE Extensions on Vogella.
Roughly (and off the top of my head), here are the steps to create the plug-in:
- Download the latest Eclipse IDE for RCP and RAP developers release (it features tools for plug-in development)
- File > New > Plug-in Project
- Fill a project name > Next > Finish
- The MANIFEST.MF should open. Otherwise, open it (it's in the META-INF folder).
- Go to the Extensions tab > Add... > Uncheck "Show only extension points from the required plug-ins" > Select "org.eclipse.ui.console.consolePatternMatchListeners" > Finish
- A dialog will show up to warn about a missing dependency, say "Yes"
- Still in the MANIFEST.MF editor, you should see a few fields to the right. Fill regex with the regex you want to match.
- Click on class to open the Java class creation wizard, then Finish. This class, linked by the StackOverflow comment I referenced above, demonstrates how to match a regex and adds an hyperlink on it.
Complete the class and... you'll be done!
You can test the plug-in by right-click on the project > Run As > Eclipse Application.
|
|
|
Re: Source links in console [message #1829965 is a reply to message #1829258] |
Tue, 14 July 2020 18:08  |
Eclipse User |
|
|
|
I am considering the idea of putting some regex recognition hooks in my output; life would be easier if I could do something like markdown output to get colors, font changes, hyperlinks, etc. Is there any way to tell if I am running under the IDE, or should I just add a -decorate option to my command line? My centralized logging code and option infrastructure would make this truly trivial to do, once I have the plugin working (in fact, if there is a console Markdown plugin, that would be heavenly). But thank you for the detailed set of steps. I am, of course, familiar with the notion of plugins, and even have delivered products that support plugins, but the details of how to get one written are where the devil is residing.
I also don't understand the "Eclipse for..." model. If I download the latest version of Eclipse RCP and RAP, is that a completely different Eclipse than the one I am using for Java? Do I now have to manage two eclipse installations?
|
|
|
Powered by
FUDForum. Page generated in 0.38279 seconds