[
https://issues.apache.org/jira/browse/NETBEANS-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16441038#comment-16441038
]
Eirik Bakke commented on NETBEANS-403:
--------------------------------------
I've added a pull request on GitHub. Looking further into this,
o.n.editor.ext.ToolTipSupport.filterBindings is _not_ the right place to fix
this. The latter method removes certain actions unconditionally from the popup
whether or not it has focus (originally to prevent the user from being able to
cut text from the popup; see
https://netbeans.org/bugzilla/show_bug.cgi?id=220942 ). Adding for instance
"caret-end" to the filterBindings list is confirmed to prevent the caret-end
action from working even when the popup has focus.
Instead, the patch tweaks the keystroke forwarding logic in
o.n.editor.PopupManager. A comment there already states the intention of the
previous logic, namely to "ignore ToolTipSupport installed actions". Presumably
the comment refers to actions of the kinds of popups created by
ToolTipSupport.setToolTipText or ToolTipSupport.createDefaultTooltip. The
previous logic falls short of this intention, only avoiding forwarding for the
actions listed in filterBindings (as well as the default action). Instead, the
proposed new logic simply checks if the popup component is a JTextComponent.
This covers the standard text tooltips created by
ToolTipSupport.setToolTipText/createDefaultTooltip--and arguably any other
similar JTextComponent tooltips should not have text actions forwarded to them
either.
The original motivation for forwarding actions into tooltips was for use in the
debugger; see https://netbeans.org/bugzilla/show_bug.cgi?id=262311 . In that
case, the tooltip is an instance of
o.n.spi.debugger.ui.ToolTipUI.ExpandableTooltip (set via
ToolTipSupport.setToolTip), which is not an instance of JTextComponent. It
should thus be unaffected by this patch.
> Pressing Home/End scrolls to beginning/end of whole document if tooltip is
> open
> -------------------------------------------------------------------------------
>
> Key: NETBEANS-403
> URL: https://issues.apache.org/jira/browse/NETBEANS-403
> Project: NetBeans
> Issue Type: Bug
> Components: editor - Key bindings
> Affects Versions: 8.2, 9.0
> Reporter: Eirik Bakke
> Priority: Major
> Labels: pull-request-available
> Attachments: HomeEndBug.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> When a tooltip is shown in the Java editor, for instance because the mouse is
> hovering over an error indication, pressing the Home or End keys on the
> keyboard scrolls the entire document all the way to the top or end,
> respectively instead of to the beginning or end of the current line. This is
> extremely disruptive, and likely very confusing to users, as it only happens
> in the stated situation.
> A workaround is to move the mouse pointer away from the editor to close the
> popup after examining an error. Most users will not be able to discover this
> workaround, though--for myself, it took two weeks to discover the correlation
> between the tooltip being open and the bug occurring.
> This bug seems to have been introduced in 8.2, and I justĀ confirmed that it
> is still present on the new Apache NetBeans 9.0 beta release.
> This issue was first reported as issue #270842 by timothyrheider in the old
> BugZilla tracker, on 2017-06-09:
> https://netbeans.org/bugzilla/show_bug.cgi?id=270842
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists