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

Bug 378992

Summary: "Failed to map binding" written to console for certain custom key bindings
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, ob1.eclipse, pwebster
Version: 4.2Flags: ob1.eclipse: review+
Target Milestone: 4.2 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Markus Keller CLA 2012-05-09 10:44:04 EDT
4.2 M7

- new workspace
- bind command "Copy from Right to Left" to Ctrl+Alt+Shift+Left and "Copy from Left to Right" to Ctrl+Alt+Shift+Right.
- restart

=> The following is printed to the console (but not written to the log):

Failed to map binding: org.eclipse.e4.ui.model.application.commands.impl.KeyBindingImpl@186ed7a (elementId: null, tags: [type:user], contributorURI: null) (keySequence: Ctrl+Alt+Shift+Left)
Failed to map binding: org.eclipse.e4.ui.model.application.commands.impl.KeyBindingImpl@150f0a7 (elementId: null, tags: [type:user], contributorURI: null) (keySequence: Ctrl+Alt+Shift+Right)

Despite these messages, the key bindings do work in compare editors.
Comment 1 Oleg Besedin CLA 2012-05-09 13:16:46 EDT
See also bug 378685.
Comment 2 Paul Webster CLA 2012-05-10 14:37:32 EDT
Oleg, could you check my fix in pwebster/bug378992 ?

The problem was we were writing the key sequence to the model using sequence.format() which is (apparently) for displaying shortcuts to the user.  We need to simply use toString(), same as org.eclipse.ui.internal.keys.BindingPersistence.writeBindingToPreferences(IMemento, Binding)

PW
Comment 3 Oleg Besedin CLA 2012-05-11 10:24:20 EDT
+1, looks good.
Comment 5 Paul Webster CLA 2012-05-11 14:54:05 EDT
*** Bug 378685 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2012-05-24 03:06:07 EDT
Verified in 4.2-I20120523-1900.