Issue with KeyBinding containing '+' [message #1402244] |
Wed, 16 July 2014 18:52 |
Arnaud MERGEY Messages: 243 Registered: March 2010 Location: France |
Senior Member |
|
|
Hello,
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--;
}
[Updated on: Wed, 16 July 2014 18:57] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01718 seconds