If was reported that clicking on another row while editing causes
abnormal termination of the session (the incorrect node is updated).
This path fixes the problem explicitly cancelling the editing session,
if required.
2006-04-25 Audrius Meskauskas <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicTreeUI.java (MouseHandler.mousePressed):
If clicked on the other row, cancel the current editing session.
Index: BasicTreeUI.java
===================================================================
RCS file: /sources/classpath/classpath/javax/swing/plaf/basic/BasicTreeUI.java,v
retrieving revision 1.130
diff -u -r1.130 BasicTreeUI.java
--- BasicTreeUI.java 25 Apr 2006 17:02:47 -0000 1.130
+++ BasicTreeUI.java 25 Apr 2006 20:06:24 -0000
@@ -2166,6 +2166,11 @@
{
Rectangle bounds = getPathBounds(tree, path);
int row = getRowForPath(tree, path);
+
+ // Cancel the editing session if clicked on the different row.
+ if (tree.isEditing() && row != editingRow)
+ cancelEditing(tree);
+
boolean cntlClick = isLocationInExpandControl(path, click.x, click.y);
boolean isLeaf = isLeaf(row);