Community
Participate
Working Groups
My use case is that I want to filter types that implement a certain interface, I can't do this now because the only think I can look at is the name of the type (using the filter extension mechanism). However in looking at the code, the IType is actually available and could easily be passed to the filter extension.
You are talking about a/your custom 'Open Type' dialog, right? And you are referring to 'ITypeInfoRequestor'? >My use case is that I want to filter types that implement a certain interface Do you want to "filter" those or actually only "show" those?
(In reply to comment #1) > You are talking about a/your custom 'Open Type' dialog, right? And you are > referring to 'ITypeInfoRequestor'? I'm using only the documented API, getting the dialog from JavaUI.createTypeDialog(), and I'm providing an implementation of TypeSelectionExtension which has a getFilterExtension() method and in that it gets an ITypeInfoFilterTextension whose select() method uses the ITypeInfoRequestor. > > >My use case is that I want to filter types that implement a certain interface > Do you want to "filter" those or actually only "show" those? I want to show them and exclude everything that does not implement the interfaces. I noticed that the open type used to PDE is able to do that (to get classes where certain interfaces are implemented), though I did not look at their source code to find out what's going on. So I'm hoping there is some API that allows me to do this.
They create a hierarchy scope and pass it in when creating the dialog. See org.eclipse.pde.internal.ui.util.PDEJavaHelperUI.selectType(IResource, int, String, String) for example.