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 198695 - In an OutlineView the multiselection + Enter don't open the editors of the selected nodes
Summary: In an OutlineView the multiselection + Enter don't open the editors of the se...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Outline&TreeTable (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-18 06:38 UTC by Yann_Dameron
Modified: 2011-05-21 08:48 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 Yann_Dameron 2011-05-18 06:38:26 UTC
Create an OutlineView with many nodes.
* Select 1 node and press Enter => Editor is opened
* Select some node and press Enter => nothing is performed

In a BeanTreeView multiselection + Enter open the editors
Comment 1 Yann_Dameron 2011-05-19 20:23:51 UTC
In the constructor of org.openide.explorer.view.OutlineView

        defaultTreeActionListener = new DefaultTreeAction (outline);
        outline.registerKeyboardAction(
            defaultTreeActionListener, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED
        );

In the class org.openide.explorer.view.OutlineView$DefaultTreeAction

        /**
         * Invoked when an action occurs.
         */
        public void actionPerformed (ActionEvent e) {
            if (outline.getSelectedColumn () != 0) {
                return;
            }

            Node[] nodes = manager.getSelectedNodes ();

            if (nodes.length == 1) {
                Action a = nodes[0].getPreferredAction ();

                if (a != null) {
                    if (a.isEnabled ()) {
                        a.actionPerformed (new ActionEvent (nodes[0], ActionEvent.ACTION_PERFORMED, "")); // NOI18N
                    } else {
                        Logger.getLogger (OutlineView.class.getName ()).info ("Action " + a + " on node " + nodes [0] + " is disabled");
                    }
                }
            }
        }

=> Nothing is performed if the nodes length is not 1
Comment 2 Martin Entlicher 2011-05-20 12:35:51 UTC
I see. Enter should be processed in the same way as it is in BeanTreeView.
Comment 3 Martin Entlicher 2011-05-20 14:38:44 UTC
Fixed by changeset:   194349:6d1fbd444ae9
http://hg.netbeans.org/main/rev/6d1fbd444ae9

And merged into 7.0.1:
http://hg.netbeans.org/releases/rev/17fc0d98d4ff
Comment 4 Quality Engineering 2011-05-21 08:48:36 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/6d1fbd444ae9
User: mentlicher@netbeans.org
Log: #198695 Perform the default action in the same way in TreeView and in OutlineView. It needs to take all selected nodes into account.