Community
Participate
Working Groups
Open a Java file and invoke content assist anywhere in the code. Once the content assist pop up is activated, if user press END key, it is expected that the last option in the content assist pop up gets selected, similar behavior is expected for HOME key where it selects the first option available in the content assist pop up window. This works in Eclipse 3.8.1, but from Eclipse 4.2 this seems broken.
(In reply to Manju Mathew from comment #0) > Once the content assist pop up is activated [..] "is activated" here means "is shown". Once you give focus to the popup, then the END key works fine. The END key should be handled in org.eclipse.jface.text.contentassist.CompletionProposalPopup#verifyKey(VerifyEvent), but we're not getting the keyDown event because the text editor has registered an END command that is not handled in this scenario. org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher#executeCommand(ParameterizedCommand, Event) seems to think the command is handled but in the end doesn't find an active handler. org.eclipse.e4.core.commands.internal.HandlerServiceImpl#executeHandler(ParameterizedCommand, IEclipseContext) catches and stores the NotHandledException, but executeCommand doesn't seem to consult the stored exception and returns true, which means "eat the keyDown" (similar to to bug 358018). A fix is to add the following in executeCommand, but I'm not sure if that's the correct fix: if (staticContext.get(HandlerServiceImpl.HANDLER_EXCEPTION) != null) { commandHandled = false; }
Markus, thanks for the pointer. The entire try/catch around org.eclipse.e4.core.commands.internal.HandlerServiceImpl#executeHandler(ParameterizedCommand, IEclipseContext) is suspect. I've re-worked that and incorporated your suggestion. This is, I think, the desired behavior: the key dispatcher tries to find a handler for HOME/END, fails to do and so passes the key onto the active widget, which handles it. Change submitted to Gerrit for review: https://git.eclipse.org/r/16773
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=c709c69a1d36db1e781dcf3a6545986c9d403ffc PW
Verified in N20131001-2000.