Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Extending source lookup
Extending source lookup [message #893480] Wed, 04 July 2012 10:21 Go to next message
Juriy Missing name is currently offline Juriy Missing nameFriend
Messages: 2
Registered: July 2012
Junior Member
Hello,

I'm trying to build the plugin that extends the source-lookup flow for Java projects. I want to start with hello-world style project that will display some fake Java source whenever the user "steps into" the class that doesn't have attached sources (or for every class at all). This would be the first step before displaying the actual source code.

Should I use eclipse org.eclipse.debug.core extension points for that? I tried to hook into both
org.eclipse.debug.core.sourceContainerTypes and org.eclipse.debug.core.sourceLocators, but the classes I provide are never got called.

I am somewhat confused what approach should I take to attach custom logic to the Java sources lookup flow. Any help is highly appreciated.

P.S. If you're curious why do I need that - the sources for some classes of my project are generated and compiled at runtime. They are accessible through the classloader, but they do not physically exist in a form of JAR or in folder in a workspace.
Re: Extending source lookup [message #893545 is a reply to message #893480] Wed, 04 July 2012 14:02 Go to previous messageGo to next message
Michael Rennie is currently offline Michael RennieFriend
Messages: 67
Registered: July 2009
Location: Canada
Member
Try looking at ISourceLookupParticipant and ISourceLookupDirector (specifically the JavaSourceLookupDirector). It sound to me like you would want to add your own participant to the Java director, which you can do by calling ISourceLookupDirector #addParticipants(...).

To get the Java director you have to a bit more work, you will need to get the ILaunch from the frame (thread, etc) and ask for its ISourceLocator (in the Java case it is an ISourceLookupDirector). You would probably want to attach your participant to any new and existing Java launches, which you can do with the help of the ILaunchManager.
Re: Extending source lookup [message #893662 is a reply to message #893545] Thu, 05 July 2012 07:36 Go to previous message
Juriy Missing name is currently offline Juriy Missing nameFriend
Messages: 2
Registered: July 2012
Junior Member
Thank you very much! Your advice helped a lot, I was able to build the working plugin in just couple of hours!
Previous Topic:Calling "Refresh using native hooks or polling" programmatically
Next Topic:New Project Wizard Failed
Goto Forum:
  


Current Time: Thu Apr 25 03:54:09 GMT 2024

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

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

Back to the top