Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsIssue with KeyBinding containing '+'
https://www.eclipse.org/forums/index.php/mv/msg/795472/1402244/#msg_1402244
facing an issue caused by a Key Binding declared in GEF, I think there is a bug in the way key bindings are parsed.
GEF declare a keybinding specific to German language CTRL++ for zoom in action.
This binding crash RAP with exception given above, because of that
int lastPlusIndex = keySequence.lastIndexOf( "+" ); if '+' is part of the binding.
I guess CTRL++ is a valid binding, otherwise it would not have been there in GEF code
The issue is easily reproducible by declaring a 'CTRL++' binding in a RAP application
java.lang.IllegalArgumentException: Unrecognized key:
at org.eclipse.rap.rwt.internal.util.ActiveKeysUtil.getKeyCode(ActiveKeysUtil.java:326)
at org.eclipse.rap.rwt.internal.util.ActiveKeysUtil.translateKeySequence(ActiveKeysUtil.java:289)
at org.eclipse.rap.rwt.internal.util.ActiveKeysUtil.translateKeySequences(ActiveKeysUtil.java:267)
at org.eclipse.rap.rwt.internal.util.ActiveKeysUtil.renderActiveKeys(ActiveKeysUtil.java:131)
at org.eclipse.swt.internal.widgets.displaykit.DisplayLCA.render(DisplayLCA.java:105)
at org.eclipse.rap.rwt.internal.lifecycle.Render.execute(Render.java:30)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.continueLifeCycle(RWTLifeCycle.java:150)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.sleep(RWTLifeCycle.java:224)
at org.eclipse.swt.widgets.Display.sleep(Display.java:1253)
at org.eclipse.ui.application.WorkbenchAdvisor.eventLoopIdle(WorkbenchAdvisor.java:361)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2734)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:701)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:684)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at com.semarchy.ui.platform.product.BaseWorkbenchApplication.createUI(BaseWorkbenchApplication.java:79)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:172)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:284)
at java.lang.Thread.run(Unknown Source)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:105)7
I guess a fix could be to check if previous char of last '+' is also a '+'
int lastPlusIndex = keySequence.lastIndexOf( "+" )
if(keySequence.chatAt(lastPlusIndex-1) == '+'){
lastPlusIndex--;
}]]>Arnaud MERGEY2014-07-16T18:52:13-00:00Re: Issue with KeyBinding containing '+'
https://www.eclipse.org/forums/index.php/mv/msg/795472/1402247/#msg_1402247
this is a known issue. See this bug report:
438277: IllegalArgumentException when using CTRL + (ZoomIn) as key binding https://bugs.eclipse.org/bugs/show_bug.cgi?id=438277
Pending change is here:
29907: Fix key sequence parsing code in ActiveKeysUtil [I7059dd27] https://git.eclipse.org/r/#/c/29907/
Will be merge to master soon.
Best,
Ivan
Professional services for RAP and RCP? http://eclipsesource.com/services/rap/]]>Ivan Furnadjiev2014-07-16T18:56:42-00:00Re: Issue with KeyBinding containing '+'
https://www.eclipse.org/forums/index.php/mv/msg/795472/1402908/#msg_1402908
Best,
Ivan