diff options
author | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-07-04 10:07:47 +0000 |
---|---|---|
committer | Audrius Meskauskas <audriusa@Bioinformatics.org> | 2006-07-04 10:07:47 +0000 |
commit | 83777343b465fb3feb87d3bbfe636aefcc21f4c6 (patch) | |
tree | 63376b201cb821c5258d5b78d10938bd5c01e07c /javax/swing/plaf/basic/BasicTreeUI.java | |
parent | 4bc1bb5d999bf15d435960caffed85f53f4b6ea6 (diff) | |
download | classpath-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.
Diffstat (limited to 'javax/swing/plaf/basic/BasicTreeUI.java')
-rw-r--r-- | javax/swing/plaf/basic/BasicTreeUI.java | 24 |
1 files changed, 19 insertions, 5 deletions
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()); } /** |