2009-09-22 41 views

回答

2

This answer显示如何获取特定类型的类型层次结构。您可以使用类似的处理来获取接口的TypeHierarchy,然后用结果类型填充列表。

IProject project; //currently selected project 

//get the java project and locate the interface type 
JavaProject javaProject = JavaCore.create(project); 
IType myInterface = 
    javaProject.findType("MyInterface","name.seller.rich"); 

//get the sub types from the interface's type hierarchy 
ITypeHierarchy hierarchy = 
    myInterface .newTypeHierarchy(new NullProgressMonitor()); 

IType[] subTypes = hierarchy.getAllSubtypes(myInterface); 

//do something with the sub types 
... 
相关问题