Community
Participate
Working Groups
The current API is: public <T> List<T> findElements(MApplicationElement searchRoot, int searchFlags, Selector matcher); As you can see there is no <T> to use to define the type of the returned list. We should add the 'Class<T> clazz' parameter to this method. Note that this can also be used to optimize the search tree in the future.
Dani, this method which was introduced in M6 is not quite correct: It should have been: public <T> List<T> findElements(MApplicationElement searchRoot, Class<T> clazz, int searchFlags, Selector matcher); Where Class<T> serves to both help scope what's being searched and provide the generic information for the List<T> returned. I'd like permission to add this argument now in M7. We'll announce it on the lists. PW
I've pushed the following patch to Gerrit: https://git.eclipse.org/r/24279 This the new API take a 'Class<T> clazz' parameter and adjusts the other API that funnel into this one to match. It also add the parameter directly to the internal 'findElementsRecursive' to make everything symmetric.
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=14a935490c7453d16701de51c89fb4c475c02d6f PW
Fixed Javadoc problems in org.eclipse.e4.ui.workbench.modeling.EModelService.findElements(MUIElement, String, Class<T>, List<String>, int) again: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=888ba032283fcbb21ef8291847ad07b1c8892456
Verified in 4.4.0.I20140428-2000.