Community
Participate
Working Groups
Bug 383403 had the purpose to define a generic find API. Current we cannot find handlers and commands.
Finding a Command is trivial to write. Handlers are more complex as are KeyBindings since they may be contained in MParts (MWindows ?) as well as in the application. Perhaps we can extend the scope of our search iterator by adding some more 'searchFlags' like BINDING_CONTAINERS and HANDLER_CONTAINERS ?
Note: I've opened bug 431738 to track the necessity of adding a Class<T> parameter to the new find API to allow for typing the returned list. This can also be used to optimize the search tree. For example if I'm searching for an MHandler we could start by using findElements to find all the MHandlerContainers first and then iterate only over those.
Created attachment 241496 [details] ModelServiceImpl @Eric: Let me know if this what you are looking for. It works on my side. Another comment: For me semantically the code bellow will return all MHandler in all parts findElements = service.findElements(application, null, MHandler.class, null, EModelService.IN_PART); But according to the javadocs, it will never return elements, because this only navigate in menu and toolbar of a part. In the patch there is some code in comments (if you uncomment it, the example code will return all handlers in parts)
Louis, can you create a Gerrit review instead of a patch?
Louis, can you create a Gerrit review instead of a patch?(In reply to Louis-Michel Mathurin from comment #3) > Created attachment 241496 [details] > ModelServiceImpl > > @Eric: Let me know if this what you are looking for. It works on my side. > > Another comment: > For me semantically the code bellow will return all MHandler in all parts > > findElements = service.findElements(application, null, MHandler.class, null, > EModelService.IN_PART); > > But according to the javadocs, it will never return elements, because this > only navigate in menu and toolbar of a part. > > In the patch there is some code in comments (if you uncomment it, the > example code will return all handlers in parts) +1 for returning all handlers and adjusting the Javadoc
(In reply to Louis-Michel Mathurin from comment #3) > Created attachment 241496 [details] > ModelServiceImpl Review: https://git.eclipse.org/r/#/c/24315/ (please remember to add this to the bug). Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=cf7be5c8f93e003afa54c4928cda1d57130ce10f Thanks Louis-Michel. PW
We reverted most of the commits. The final 2 commits are http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=0dc562609c7455760ef99d0f0e629d1c3eb83e87 and http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=0a9ee0c99a7196e2f0256a68473ce9c9e287bca1 PW
In 4.4.0.I20140501-0200 PW