classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches]: Patch: JTree editing


From: Lillian Angel
Subject: [cp-patches]: Patch: JTree editing
Date: Tue, 30 Aug 2005 16:03:14 -0400

More of editing is working now. Still more to implement.
1) If you click 3 times on a node, a text box will appear.
2) If you click-pause-click on a node, a text box will appear.
3) If you want to stop editing, click on another node or click on the
icon (or even the control icon, if using MetalL&F).

- The text box features are not working yet. The caret is not updating
as it should, the text is not scrolling in the text box. The text box is
not repainting with a timer just yet. Therefore, the actual editing is
not yet working very well... Soon!
- Also, the key handling for the editing needs to be implemented. You
should be able to press F2 to start, and enter to stop editing. Or even
pressing an arrow key should stop the editing.

2005-08-30  Lillian Angel  <address@hidden>

        * 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.

Attachment: patch.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]