diff --git a/openide.explorer/src/org/openide/explorer/view/OutlineView.java b/openide.explorer/src/org/openide/explorer/view/OutlineView.java --- a/openide.explorer/src/org/openide/explorer/view/OutlineView.java +++ b/openide.explorer/src/org/openide/explorer/view/OutlineView.java @@ -856,6 +856,15 @@ return p; } + + /** Enable/disable double click to invoke default action on branch nodes. + * If defaultAction is not enabled double click expand/collapse node. + * @param defaultActionAllowed true to enable + */ + public void setDefaultActionAllowed(boolean defaultActionAllowed) { + outline.setDefaultActionAllowed(defaultActionAllowed); + } + /** * Action registered in the component's action map. */ @@ -1187,6 +1196,7 @@ private int treePositionX = 0; private int[] rowWidths; private RequestProcessor.Task changeTask; + private boolean defaultActionAllowed = false; //private int maxRowWidth; public OutlineViewOutline(final OutlineModel mdl, PropertiesRowModel rowModel) { @@ -1331,7 +1341,7 @@ // Default action. Node node = Visualizer.findNode (o); if (node != null) { - if (node.isLeaf () && !node.canRename()) { + if ((node.isLeaf() && !node.canRename()) || defaultActionAllowed) { Action a = TreeView.takeAction (node.getPreferredAction (), node); if (a != null) { @@ -1462,6 +1472,10 @@ } } + public void setDefaultActionAllowed(boolean defaultActionAllowed) { + this.defaultActionAllowed = defaultActionAllowed; + } + /**