tags:

views:

51

answers:

1

The JavaCore class includes a create method that allows me to get the ITypeRoot (representation of class file or compilation unit) given a handle identifier that embodies the location of the file.

However, I am trying to find the typeroot (if there is one) that corresponds to a specific fullname.

The only implementation that I can think of is to scan all the types in the system, get the type root on each of them (not even sure how to do that), and then compare FQNs.

Any help would be appreciated.

A: 

From the JavaCore singleton, try:

ITypeHierarchy myHierarchy = newTypeHierarchy(IRegion region, WorkingCopyOwner owner, IProgressMonitor monitor);

Once you have the hierarchy, you can traverse class file hierarchies as ITypes pretty easily.

Steve Moyer
I'm wondering if that is faster than the Eclipse Search Engine type searcher, or going by Project and asking it to seek a type. I wish Eclipse had less ways of accomplishing the same thing...
Uri