Implementing extended Find Usages

I am working on a plugin that searches for java api usages that aren't visible to intellij (it will query an index over a network connection).

Is there any way I can use the open api to leverage the Find Usages GUI that is built into intellij? I've looked around and it seems like I have to build all the of the GUI functionality (e.g. goodies like multiple subtabs, pinning tabs, expand-all button) from swing on my own.

Any pointers or tips appreciated.

4 comments

Hello Greg,

GW> I am working on a plugin that searches for java api usages that
GW> aren't visible to intellij (it will query an index over a network
GW> connection).
GW>
GW> Is there any way I can use the open api to leverage the Find Usages
GW> GUI that is built into intellij? I've looked around and it seems
GW> like I have to build all the of the GUI functionality (e.g. goodies
GW> like multiple subtabs, pinning tabs, expand-all button) from swing
GW> on my own.
GW>
GW> Any pointers or tips appreciated.

I'm not sure that you'll be able to reuse the find dialog UI, but at least
the UI for displaying found usages is easy to reuse. See the com.intellij.usages
package (which contains complete source code of the IDEA usage view component).

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com
"Develop with pleasure!"


0

I'd actually like to do something similar, and am wondering if it's doable right now in IDEA. For ejb3, I have:

@NamedQuery(name="all.documents", query="select d from Document d")
public class Document
{
...
}

I'd like to find usages of the query, which would find all calls to:

EntityManager.createNamedQuery("all.documents")

Is this at all possible?

0

I'm afraid now it is not possible, but as part of ejb3 support (hehe, we are
also doing ejb:) we are currently working on this plugging of find usages
logic.

Eugene.
"Hani Suleiman" <hani@formicary.net> wrote in message
news:2973395.1129659712832.JavaMail.itn@is.intellij.net...

I'd actually like to do something similar, and am wondering if it's doable

right now in IDEA. For ejb3, I have:
>

@NamedQuery(name="all.documents", query="select d from Document d")
public class Document
{
..
}

>

I'd like to find usages of the query, which would find all calls to:

>

EntityManager.createNamedQuery("all.documents")

>

Is this at all possible?



0

com.intellij.usageView sounds like just what I want, thanks!

Is there a code snippet I can see that would show me how to leverage this? Or could you just briefly describe which APIs I need to call to show the find results panel and to fill it with some results?

It looks like I want to call UsageViewManager.getInstance(project), then call the non-deprecated usageView.addContent() method, although I am not sure what meaning is associated with contentName. Also, what should I do with the returned Content instance, if anything? It doesn't appear to have any way for me to attach find results.

0

Please sign in to leave a comment.