IDEA-113175 Expanding nodes in Variables(Debug tools window) while debug application throws exception

This commit is contained in:
Konstantin Bulenkov
2013-09-04 13:42:13 +02:00
parent 9733cb8636
commit d40c1f8ee5
@@ -72,7 +72,6 @@ public class WideSelectionTreeUI extends BasicTreeUI {
boolean handled = false;
public void mousePressed(@NotNull final MouseEvent e) {
handled = false;
if (!(e.getSource() instanceof JTree)) return;
if (!isSelected(e)) {
handled = true;
handle(e);
@@ -81,7 +80,6 @@ public class WideSelectionTreeUI extends BasicTreeUI {
@Override
public void mouseReleased(@NotNull final MouseEvent e) {
if (!(e.getSource() instanceof JTree)) return;
if (!handled) {
handle(e);
}
@@ -90,9 +88,12 @@ public class WideSelectionTreeUI extends BasicTreeUI {
private boolean isSelected(MouseEvent e) {
final JTree tree = (JTree)e.getSource();
final int selected = tree.getClosestRowForLocation(e.getX(), e.getY());
for (int row : tree.getSelectionRows()) {
if (row == selected) {
return true;
final int[] rows = tree.getSelectionRows();
if (rows != null) {
for (int row : rows) {
if (row == selected) {
return true;
}
}
}