Reputation: 255
I'm writing an eclipse plugin, and I want to get all the types that are available in my workspace,
like when pressing Ctrl+Shift+T,
but in a list or array.
How can I do it?
Upvotes: 3
Views: 406
Reputation: 84038
The relevant code is referenced from the org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog (which the OpenTypeSelectionDialog triggered by ctrl-shift-T inherits from).
If you inspect the fillContentProvider() method you'll see it the org.eclipse.jdt.core.search.SearchEngine, which is passed a TypeSearchRequestor and TypeItemsFilter to match the required types.
If you look at the Javadoc for SearchEngine.searchAllTypeNames() and/or debug its execution, you should have a pretty clear idea how to obtain the workspace types into a requestor, and process them accordingly.
Upvotes: 1