Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsProgrammatically update all tooltips when context changes?
https://www.eclipse.org/forums/index.php/mv/msg/1094366/1792722/#msg_1792722
I'm using the compatiblity layer under e4.
When switching contexts, the keybindings in tooltips of commands are not updated.
For example:
Two different editors with the same command are side-by-side.
The command has two keybindings for different contexts.
A part listener switches context when the editor is activated.
Although the keybindings are changed correctly, they are not displayed in the tooltips of the command.
MLocalizable#updateLocalization only updates the localization but not the keybinding.
HandledContributionItem#updateMenuItem seems to update a tooltip with the keybinding,
but I have no idea how to obtain all these items using the ModelService#findElements to call this method.
Could you please hint me at what to update when switching the context?]]>Sascha Becher2018-07-23T08:49:58-00:00Re: Programmatically update all tooltips when context changes?
https://www.eclipse.org/forums/index.php/mv/msg/1094366/1792731/#msg_1792731
Did you try EContextService#activateContext(contextId) when creating the part?
In E4 with compat layer you would use org.eclipse.ui.contexts.IContextService.activateContext(String)]]>Erdal Karaca2018-07-23T09:54:17-00:00Re: Programmatically update all tooltips when context changes?
https://www.eclipse.org/forums/index.php/mv/msg/1094366/1792735/#msg_1792735
final IContextService contextService = PlatformUI.getWorkbench().getService(IContextService.class);
contextService.activateContext(contextId);
The problem is that the keybindings in the tooltip are not updated. It shows the old keybinding although the new one is active already.
I want to trigger the update of all tooltips programmatically. How can this be achieved?]]>Sascha Becher2018-07-23T10:41:40-00:00Re: Programmatically update all tooltips when context changes?
https://www.eclipse.org/forums/index.php/mv/msg/1094366/1792737/#msg_1792737