我想用eclipse jdt FilteredTypesSelectionDialog过滤工作区中所有实现特定接口的类。有什么方法可以实现吗?
IJavaElement[] elements = new IJavaElement[] { javaproject };
IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
FilteredTypesSelectionDialog dialog = new FilteredTypesSelectionDialog(root.getShell(), false, null, scope, IJavaSearchConstants.CLASS);
//filter classes which implements an interface
对于给定类型的子类型,使用
org.eclipse.jdt.core.search.SearchEngine.createStrictHierarchyScope(IJavaProject, IType, boolean, boolean, WorkingCopyOwner)
要在类型选择对话框中使用此功能,请参考《类型选择对话框》。
org.eclipse.jdt.ui.JavaUI.createTypeDialog(Shell, IRunnableContext, IJavaSearchScope, int, boolean, String, TypeSelectionExtension)