According to http://netbeans.org/bugzilla/show_bug.cgi?id=157725, OutlineView is supposed to honor Node.getPreferredAction() when double clicking a node. This does not work for branch nodes, requiring a context menu entry to fire off the preferred action instead of double click.
This can easily be fixed by introducing a boolean defaultActionAllowed like TreeView does, and checking the boolean state in OutlineViewOutline#editCellAt.
Users are accustomed to double clicking to edit an object even in an Explorer View, ref Windows Explorer, it would be great to have this option for the OutlineView as well!
Created attachment 101960 [details]
Patch to add defaultActionAllowed functionality
The attached patch shows how the functionality could be implemented.
This patch is not much consistent with TreeView.setDefaultActionAllowed().
The problem is that setting OutlineView.setDefaultActionAllowed(true) always tries to invoke the default action, but setting OutlineView.setDefaultActionAllowed(false) does not disable the invocation of default action, it's still invoked for leaf nodes that do not support rename.
The main problem seems to be that the rename in the tree column of OutlineView is not triggered in the same way as in the TreeView. In the TreeView rename is initiated by two clicks on the same node, but in the OutlineView you have to double-click the node, which is identical with the default action invocation.
Created attachment 102000 [details]
API change with change in node rename gesture.
I'm proposing a change in node rename gesture in Outline. Two consecutive clicks are consistent with the rename gesture in trees, the current double-click collides with default action invocation.
Then we're introducing two methods - OutlineView.setDefaultActionAllowed() and OutlineView.isDefaultActionAllowed() that are similar in functionality to TreeView.setDefaultActionAllowed().
I absolutely agree - double clicking to rename has never been a known idiom AFAIK, so changing this makes much sense.
Thanks for the review, I'm going to integrate this change later today.
Pushed in changeset 3586979ee676
Integrated into 'main-golden', will be available in build *201010050000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #190258 Control the allowance of default action and invoke rename via two consecutive clicks.