2009-09-22 9 views

Répondre

2

This answer montre comment obtenir la hiérarchie de types pour un type particulier. Vous pouvez utiliser un traitement similaire pour obtenir TypeHierarchy pour l'interface, puis remplir la liste avec les types résultants.

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 
... 
Questions connexes