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 198684 - ActionEvent modifiers lost when Action is performed in an OutlineView
Summary: ActionEvent modifiers lost when Action is performed in an OutlineView
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 17:25 UTC by nicklas.lof
Modified: 2011-05-21 08:49 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nicklas.lof 2011-05-17 17:25:05 UTC
When a user doubleclicks on a Node in an Outlineview it will execute the action returned from getPreferredAction().

Unfortunately the Outlineview creates a new ActionEvent without passing in the modifiers from the original event so it's not possible to check for if any keys was hold down at the same time as the double click which makes it impossible to create actions that can behave differently depending on if the user did hold down, for example, shift or not.

in the 6.9.1 source code this is done at line 1307 in OutlineView.java:

a.actionPerformed (new ActionEvent (node, ActionEvent.ACTION_PERFORMED, ""));

one way to patch it would be:

a.actionPerformed (new ActionEvent (node, ActionEvent.ACTION_PERFORMED, "",((MouseEvent)e).getModifiers()));
Comment 1 nicklas.lof 2011-05-18 10:17:30 UTC
Changed Version to 7.0 since it exists there too but on line 1399 in OutlineView.java
Comment 2 Martin Entlicher 2011-05-20 12:25:14 UTC
Thanks, I'll add the modifiers.
Comment 3 Martin Entlicher 2011-05-20 14:37:17 UTC
Fixed by changeset:   194348:53ea41a1170c
http://hg.netbeans.org/main/rev/53ea41a1170c

And merged into 7.0.1:
http://hg.netbeans.org/releases/rev/77049f577884
Comment 4 Quality Engineering 2011-05-21 08:49:37 UTC
Integrated into 'main-golden', will be available in build *201105210400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/53ea41a1170c
User: mentlicher@netbeans.org
Log: #198684 Add the modifiers to the default action.