Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368087 - [open type] Allow access to IType during filtering
Summary: [open type] Allow access to IType during filtering
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-01-07 12:29 EST by Francis Upton IV CLA
Modified: 2012-01-09 04:29 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francis Upton IV CLA 2012-01-07 12:29:06 EST
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.
Comment 1 Dani Megert CLA 2012-01-09 03:59:18 EST
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?
Comment 2 Francis Upton IV CLA 2012-01-09 04:17:53 EST
(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.
Comment 3 Dani Megert CLA 2012-01-09 04:29:41 EST
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.