Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » ITypeHierachy problem
ITypeHierachy problem [message #78483] Sun, 20 July 2003 10:27
Eclipse UserFriend
Hello,

I want to access the type hierachy of an IType programmatically with my
plugin.

Here's the code

//create the hierachy from a working copy (tmpNewCopy) of the
//ICompilationUnit (knowing that there is always only one type in the
//compilation unit)
ITypeHierarchy hierachy =
tmpNewCopy.getTypes()[0].newSupertypeHierarchy(
new IWorkingCopy[]{tmpNewCopy},
null);
//get the super-types of the IType
IType[] superTypes = hierachy.getAllSupertypes(tmpNewCopy.getTypes()[0]);
for (int i = 0; i < superTypes.length; i++) {
//do something
}


The problem is that hierachy.getAllSupertypes() always returns an empty
array and the loop is not run through, although the type extends a
superclass and implements some interfaces.

At the time when the statement above is processed the working copy contains
only the type definition (which was created with
ICompilationUnit.createType()) and I can see that the source contains the
type by calling ICompilationUnit.getSource(). But the working copy is not
commited.

What's wrong in my code?

Thanks in advance

Michael Taege

-------------------------------------
Dipl. Ing. Michael T
Previous Topic:Searching for a plugin
Next Topic:"Remote Version" Quickdiff reference provider missing
Goto Forum:
  


Current Time: Tue May 13 01:17:47 EDT 2025

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

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

Back to the top