Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Issue with KeyBinding containing '+'
Issue with KeyBinding containing '+' [message #1402244] Wed, 16 July 2014 18:52 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
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

Re: Issue with KeyBinding containing '+' [message #1402247 is a reply to message #1402244] Wed, 16 July 2014 18:56 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Arnaud,
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

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Issue with KeyBinding containing '+' [message #1402908 is a reply to message #1402244] Fri, 18 July 2014 10:01 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
The issue is fixed in master (RAP 3.0M1).
Best,
Ivan

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:java.lang.NullPointerException: The parameter 'contextDirectory' must not be null.
Next Topic:Automated UI testing for RAP : which tool ?
Goto Forum:
  


Current Time: Tue Mar 19 08:01:05 GMT 2024

Powered by FUDForum. Page generated in 0.02122 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top