expand breakpoint groups on double click

This commit is contained in:
Egor.Ushakov
2015-02-26 14:02:59 +03:00
parent 217df5bd33
commit 42b0bd5bce
2 changed files with 16 additions and 4 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -189,7 +189,7 @@ class CheckboxTreeHelper {
return true;
}
}
else if (clickCount > 1) {
else if (clickCount > 1 && clickCount % 2 == 0) {
myEventDispatcher.getMulticaster().mouseDoubleClicked(node);
return true;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,6 +55,7 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
import java.awt.*;
import java.util.*;
import java.util.List;
@@ -235,7 +236,18 @@ public class BreakpointsDialog extends DialogWrapper {
final JTree tree = new BreakpointsCheckboxTree(myProject, myTreeController) {
@Override
protected void onDoubleClick(CheckedTreeNode node) {
navigate(false);
if (node instanceof BreakpointsGroupNode) {
TreePath path = TreeUtil.getPathFromRoot(node);
if (isExpanded(path)) {
collapsePath(path);
}
else {
expandPath(path);
}
}
else {
navigate(false);
}
}
};