summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLillian Angel <langel@redhat.com>2005-08-30 20:05:53 +0000
committerLillian Angel <langel@redhat.com>2005-08-30 20:05:53 +0000
commitf8804e7a2f22aaee5028be45b11f728375acb6b4 (patch)
tree2c1f342fd08e9268735905f7afda5eeafc3df761 /examples
parent94af80ed56848cc7cef1ab776c9f24184f4b7023 (diff)
downloadclasspath-f8804e7a2f22aaee5028be45b11f728375acb6b4.tar.gz
2005-08-30 Lillian Angel <langel@redhat.com>
* examples/gnu/classpath/examples/swing/Demo.java (mkTreeWorld): Made tree editable. * javax/swing/DefaultCellEditor.java (isCellEditable): Added in check for number of mouse clicks. (DefaultCellEditor): To start editing a textfield, number of clicks is 3. * javax/swing/plaf/basic/BasicTreeUI.java: Took out unneeded fields (isEditing): Fixed to check boolean. (updateCellEditor): Made more efficent. (installUI): Created cell editor for initialization. (editingStopped): Added in check to prevent a NPE. (editingCanceled): Likewise. (keyPressed): Added in check for pressing Enter. Enter should stop editing and complete it, when in the process of editing. (mousePressed): Optimized by using MouseEvent's getClickCount. The clicking on nodes works better. Also, added in code to start the editing. (valueChanged): Implemented. (selectPath): Took out code to remove an already selected path. A node should remain selected if clicked on more than once. Works like JDK. * javax/swing/tree/DefaultTreeCellEditor.java: Added a helper field. (paint): Took out redundant code. (DefaultTreeCellEditor): Added class to listener list. (configureEditingComponent): Updated since listener was added to list. (isCellEditable): Finished implementation. (stopCellEditing): Added a check for editingComponent to prevent a NPE. (cancelCellEditing): Likewise. (valueChanged): Took out redundant code. (actionPerformed): Added code in to implement click-pause-click editing. (shouldStartTimer): Fixed check. (canEditImmediately): Took out redunant code. (inHitRegion): Changed region to be text area only (not icon). (createTreeCellEditor): No need to use canEdit here, removed.
Diffstat (limited to 'examples')
-rw-r--r--examples/gnu/classpath/examples/swing/Demo.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/gnu/classpath/examples/swing/Demo.java b/examples/gnu/classpath/examples/swing/Demo.java
index 14ad01435..d7cbc1d3a 100644
--- a/examples/gnu/classpath/examples/swing/Demo.java
+++ b/examples/gnu/classpath/examples/swing/Demo.java
@@ -493,6 +493,7 @@ public class Demo
final JTree tree = new JTree(root);
tree.setLargeModel(true);
+ tree.setEditable(true);
DefaultTreeSelectionModel dtsm = new DefaultTreeSelectionModel();
dtsm.setSelectionMode(DefaultTreeSelectionModel.SINGLE_TREE_SELECTION);
tree.setSelectionModel(dtsm);