Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 532009

Summary: Global bindings don't work - Eclipse 4.7 Oxygen
Product: [Eclipse Project] Platform Reporter: Mariano Camrazana <marianocamarzana>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: blocker    
Priority: P3 CC: loskutov, marianocamarzana
Version: 4.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch with the keybinding correction - plugin org.eclipse.e4.ui.bindings none

Description Mariano Camrazana CLA 2018-03-05 06:36:47 EST
Created attachment 273000 [details]
Patch with the keybinding correction - plugin org.eclipse.e4.ui.bindings

I recently completed a successful migration of a complex system divided into several modules developed in Eclipse RCP, moving from Eclipse 3.7 to Eclipse 4.7 usin Compatibility Layer in conjunction with Tycho to make deploy.
While doing a review of the system's functionality I realized that the shortcuts on the global keys did not work correctly.
I explain the scenario a little better


I have an perspective that contain this definition:

    <extension point="org.eclipse.ui.contexts">
           <context
                name="%context.name"
                id="xxx.PerspectiveVentas" 
                parentId="xxx.context.global">
           </context>
    </extension>


And I have another plugin that contains definition to global keybinding

    <extension point="org.eclipse.ui.contexts">
          <context
                 name="%context.name"
                 id="xxx.context.basic"
                 parentId="org.eclipse.ui.contexts.window">
          </context>
          <context
                name="%context.name.0"
                id="xxx.context.global"
                parentId="xxx.context.basic" >
          </context>
          <context
                name="%context.name.2"
                id="xxx.PerspectiveConfiguracion" 
                parentId="xxx.context.global">
          </context>
    </extension>  

When xxx.PerspectiveVentas is activated all key binding that are defined locally works fine but keybindings defined in his parent doesn't work.
After debugging the code I found that class org.eclipse.e4.ui.bindings.internal.BindingTableManager should be modified.

Is there a possibility that a new version will be released in a short period of time with this fix?, I found that these errors were already reported https://bugs.eclipse.org/bugs/show_bug.cgi?id=367816.

I attach the patch with the correction, I have done the tests in the application that I am developing and the key bindings worked fine. The proposed solution is a first version which only considers the parentIds of the active contexts, it does not search in all the parents.


Eclipse 4.7 Oxygen
Spring version 4.3.7
Hibernate 4.3.10.Final
Tycho 1.1.0-SNAPSHOT
Java 1.8
Comment 1 Andrey Loskutov CLA 2018-03-13 17:26:34 EDT
Mariano, thanks for the patch, but it would more help if it would be done via Gerrit.
see https://wiki.eclipse.org/Platform_UI/How_to_Contribute.

Please use bug 367816 to xontinue the discussion and refer to bug 367816 in your Gerrit patch too.

*** This bug has been marked as a duplicate of bug 367816 ***