- This topic has 4 replies, 3 voices, and was last updated 19 years ago by Brian Fernandes.
-
AuthorPosts
-
Antonio CasqueiroMemberHello!
I need to interact with the “Call Hierarchy Plugin/Feature” of Eclipse (I must have control over the input and output, to glue my code).
The idea is to use it in the following way:
– Input: class name and method name
– Output: list of classes and methods that call the input oneI’m asking in this forum because I can’t find a “easy” tutorial to do something similar.
I read the “Rich Client Tutorial” from the Eclipse website but it doesn’t help.Since “MyEclipse” are experts in interacting with “Eclipse”, can you point me in the right direction?
Thanks
Riyad KallaMemberThe right direction would definately be the Eclipse JDT dev list. Those are the guys who wrote it, so they can probably give you pointers to get you coding right away.
Brian FernandesModeratorJDT newsgroup is the best place to ask –
Do you want to interact with Eclipse’s Call Hierarchy view? Or you just want to know how it picks up the hierarchy and display it in your own view / editor?Best,
Brian.
Antonio CasqueiroMemberI have a java package where I put some special classes that I would like to get the “Hierarchy” for several method (almost all of them).
So the in the end my plug-in should be invoked by clicking a package, or class .
I will get all the methods for a class and return the some “hierarchy” object that I can process for references. I know the pattern of the caller I want to find (it must implement some interface), so somehow I “just” need to get the list.I thought of a plung-in, but it could really be a standalone application.
Right now, I parsing the “javap” result from my classes to get the hierarchy (parsing + build a list of references + analyse the references).
I does what I want almost all the time. But since I’m the one controlling the parser I is not 100% accurate. Another problem is the “javap” result changes from JDK versions…Thanks for the help, meanwhile I will try the “JDT newsgroup”.
Brian FernandesModeratorYou should have a look at the SearchEngine class (in org.eclipse.jdt.core.search).
If you can’t find this class, just import all the JDT projects into your workspace and you should be fine. Be advised, your plugin will need to depend on the jdt plugin(s).
SearchEngine most probably requires that the element it’s parsing / searching be a member of a JDT Java project, but I’m not too sure if that rule can be broken or bent. Just look for references to the method you’re interested in and you should see examples of how it’s being used.
HTH,
Best,
Brian. -
AuthorPosts