2009-09-22 5 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 
... 
関連する問題