This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 21197 - shortcuts should not appear on submenus
Summary: shortcuts should not appear on submenus
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: UI
Depends on:
Blocks: 26619
  Show dependency tree
 
Reported: 2002-03-05 16:07 UTC by Rochelle Raccah
Modified: 2008-12-22 17:50 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Probably working solution (3.02 KB, patch)
2002-05-09 13:36 UTC, Petr Nejedly
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rochelle Raccah 2002-03-05 16:07:40 UTC
In certain cases, Paste ends up with a submenu instead of a single action.  In
that case, the  shortcut ctrl-v still appears on Paste (the menu).  According to
Jesse, this results in the first action in the submenu being performed, but it
was agreed on nbui that this is incorrect behavior and the shortcut should show
up on the menu item in the submenu.

Paste is just an example, but the code should be checked for other examples of
this.
Comment 1 _ ttran 2002-03-29 08:29:13 UTC
> Paste is just an example, but the code should be checked for other
> examples of this

The opposite is true.  Paste action is very special.
Comment 2 _ ttran 2002-05-03 22:58:06 UTC
assigning to pnejedly, our menu expert
Comment 3 Petr Nejedly 2002-05-07 12:59:53 UTC
OK, I'll look at it
Comment 4 Petr Nejedly 2002-05-09 13:36:02 UTC
Created attachment 5683 [details]
Probably working solution
Comment 5 Petr Nejedly 2002-05-09 13:40:33 UTC
I have solution that works for Paste, but it is completly unrelated
to PasteAction, it fixes the behaviour generally for any SubMenuBridge
that oscilates between 1/more items.

As I maybe a Menu expert but certainly not Actions/Bridge expert,
I'd like someone to review my changes.
Yarda/Jesse?
Comment 6 Jaroslav Tulach 2002-05-09 15:36:21 UTC
I see no reason why this should not work.
Comment 7 Jesse Glick 2002-05-09 17:06:47 UTC
The patch doesn't make any sense to me. How do you know the shortcut
will in fact invoke the equivalent of the first submenu item?! This is
true for PasteAction, but there is no guarantee it will be true for
other cases, other than a feeling that it sounds like good UI for it
to be true.
Comment 8 Petr Nejedly 2002-05-13 12:23:31 UTC
Hmm, then how'd you like to fix it?
The Ctrl-V will invoke PasteAction without any way of specifying
which kind of Paste it will perform.

The SubMenuBridge shoud never display a shortcut for a submenu
invoking item, this is easy and is already part of the patch.

I don't know how to easily propagate the shortcut to the
PROPER (it don't have to be the first, according to Jesse)
item in the submenu except enhancing the Actions.SubMenuModel
inteface.

Comment 9 Jesse Glick 2002-05-13 16:13:27 UTC
Since Actions.SubMenuModel is an interface and cannot be compatibly
extended, perhaps we can just use the above patch even though it is
known to not be necessarily accurate. It should at least be an
improvement, and if some action appears later for which the default
submenu choice is not in fact the first one, we can reopen this and
consider how to fix the SubMenuModel interface - or simply deprecate
SubMenuModel and SubMenuBridge and ask people to write their own menu
presenters to begin with, which may well be simpler.
Comment 10 Petr Nejedly 2002-05-13 16:36:08 UTC
OK, I'll commit it tomorrow.
In fact, I don't like the implementation of Bridges as they try
to be too smart instead of being short-living Presenters.
Is this "problem" covered by the Commands API already or should
I start pushing it in The Right Direction(tm)?
Comment 11 Petr Nejedly 2002-05-14 11:16:42 UTC
Integrated.
Comment 12 Marian Mirilovic 2002-05-30 14:54:50 UTC
verified in [nb_dev](20020530)
Comment 13 Quality Engineering 2003-07-01 16:26:57 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.