Community
Participate
Working Groups
the binding service not working as exprected when getting active binding, i.e. in in : IBindingService#getBestActiveBindingFor(); To reproduce: 1. Fetch the following change from Gerrit: https://git.eclipse.org/r/#/c/70577/6/bundles/org.eclipse.ui.workbench/Eclipse+UI/org/eclipse/ui/internal/quickaccess/SearchField.java 2. Edit the method updateQuickAccessTriggerSequenceFormat as follows: protected void updateQuickAccessTriggerSequenceFormat() { TriggerSequence triggerSequence = bindingService.getBestActiveBindingFor(QUICK_ACCESS_COMMAND_ID); this.quickAccessTriggerSequenceFormat = triggerSequence.format(); } 3. Launch and observe the buggy behavior: getBestActiveBindingFor(QUICK_ACCESS_COMMAND_ID) returns null. The expected behavior is: getBestActiveBindingFor(QUICK_ACCESS_COMMAND_ID) will return a non null triggerSequence, as the QuickAccess KeyBinding is active at the moment when the method is called.
Brian, hope you don't mind if I ask feedback to you As a caller, I expect IBindingService#getBestActiveBindingFor() returns the best binding by searching in all the contexts of the application. With the current behavior the method is searching for the binding only in the active context. This is unclear, as is often unclear which is the active context. My plan is to simply change the implementation of getBestActiveBindingFor() to see the logic that searches in all the contexts, that I think should be replaced as you can see in the current method: ParameterizedCommand cmd = eCommandService.createCommand(MY_COMMAND_ID, null); ContextSet contextSet = manager.createContextSet(Arrays.asList(contextService.getDefinedContexts())); Binding binding = manager.getBestSequenceFor(contextSet, cmd); triggerSequence = binding.getTriggerSequence();
If we search through all contexts then it's not returning the active binding!
I'm unable to reproduce this issue on Windows and Linux-GTK.
Verified under Windows 10 and Ubuntu 14.04 with the patch at https://git.eclipse.org/r/70706
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Still relevant in parts of Eclipse Platform (eg Quick Access)