summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAudrius Meskauskas <audriusa@Bioinformatics.org>2006-07-04 10:07:47 +0000
committerAudrius Meskauskas <audriusa@Bioinformatics.org>2006-07-04 10:07:47 +0000
commit83777343b465fb3feb87d3bbfe636aefcc21f4c6 (patch)
tree63376b201cb821c5258d5b78d10938bd5c01e07c
parent4bc1bb5d999bf15d435960caffed85f53f4b6ea6 (diff)
downloadclasspath-83777343b465fb3feb87d3bbfe636aefcc21f4c6.tar.gz
2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>
PR 28061 * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed): Always cancel the current editing session before doing anything else, return immediately if this fails. (TreeHomeAction): Ensure that the lead selection path is visible after the action is performed. TreeIncrementAction: Likewise. TreeToggleAction: Likewise. TreeTraverseAction: Likewise.
-rw-r--r--ChangeLog10
-rw-r--r--javax/swing/plaf/basic/BasicTreeUI.java24
2 files changed, 29 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e39548a5b..54bed67ff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
PR 28061
* javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed):
+ Always cancel the current editing session before doing anything else,
+ return immediately if this fails.
+ (TreeHomeAction): Ensure that the lead selection path is visible after
+ the action is performed. TreeIncrementAction: Likewise. TreeToggleAction:
+ Likewise. TreeTraverseAction: Likewise.
+
+2006-07-04 Audrius Meskauskas <AudriusA@Bioinformatics.org>
+
+ PR 28061
+ * javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed):
Returned back the code to handle the start of the click-pause-click
editing initiation, explained about this code.
(TreeStartEditingAction): New inner class.
diff --git a/javax/swing/plaf/basic/BasicTreeUI.java b/javax/swing/plaf/basic/BasicTreeUI.java
index 221bc2557..ac3e9b719 100644
--- a/javax/swing/plaf/basic/BasicTreeUI.java
+++ b/javax/swing/plaf/basic/BasicTreeUI.java
@@ -2392,11 +2392,13 @@ public class BasicTreeUI
if (tree != null && tree.isEnabled())
{
- // Maybe stop editing and return.
- if (isEditing(tree) && tree.getInvokesStopCellEditing()
- && ! stopEditing(tree))
- return;
-
+ // Always end the current editing session if clicked on the
+ // tree and outside the bounds of the editing component.
+ if (isEditing(tree))
+ if (!stopEditing(tree))
+ // Return if we have failed to cancel the editing session.
+ return;
+
int x = e.getX();
int y = e.getY();
TreePath path = getClosestPathForLocation(tree, x, y);
@@ -2911,6 +2913,9 @@ public class BasicTreeUI
}
}
}
+
+ // Ensure that the lead path is visible after the increment action.
+ tree.scrollPathToVisible(tree.getLeadSelectionPath());
}
/**
@@ -3026,6 +3031,9 @@ public class BasicTreeUI
tree.setAnchorSelectionPath(newPath);
tree.setLeadSelectionPath(newPath);
}
+
+ // Ensure that the lead path is visible after the increment action.
+ tree.scrollPathToVisible(tree.getLeadSelectionPath());
}
/**
@@ -3330,6 +3338,9 @@ public class BasicTreeUI
// and anchor.
tree.setLeadSelectionPath(leadPath);
tree.setAnchorSelectionPath(anchorPath);
+
+ // Ensure that the lead path is visible after the increment action.
+ tree.scrollPathToVisible(tree.getLeadSelectionPath());
}
}
@@ -3417,6 +3428,9 @@ public class BasicTreeUI
tree.expandPath(current);
}
}
+
+ // Ensure that the lead path is visible after the increment action.
+ tree.scrollPathToVisible(tree.getLeadSelectionPath());
}
/**