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: Thu, 01 Sep 2005 11:15:06 -0400

Editing for the JTree works. 
Clicking on a node 3 times, or click-pause-click starts editing.
Clicking on any node while editing (or icon), cancels editing.

I am going to start working on implementing the key handling. So far,
editing completion cannot be tested. Editing can only be completed when
'ENTER' is pressed. But, I have tested that it does work so far.

2005-09-01  Lillian Angel  <address@hidden>

        * javax/swing/plaf/basic/BasicTreeUI.java:
        Added new field to keep track of contents in newly edited cell.
        (isEditing): Made more intuitive.
        (stopEditing): Changed because it was causing an infinite loop.
        (installUI): Should be set to true when set.
        (completeEditing): Passed newVal to valueForPathChanged instead.
        (EditorTimerUpdate): Made timer faster because was not working 
        well.
        (actionPerformed): No need for 'BasicTreeUI.this.'
        (update): Likewise.
        (editingStopped): Likewise. Also, set newVal to appropriate 
        value.
        (editingCanceled): Likewise.
        (keyPressed): Likewise.
        (mousePressed): Likewise.
        (treeExpanded): Likewise.
        (treeCollapsed): Likewise.
        (treeNodesChanged): Likewise.
        (TreeNodesInserted): Likewise.
        (treeNodesRemoved): Likewise.
        (treeStructureChanged): Likewise.
        (valueChanged): Editing is canceled when a new cell is clicked.
        (getCellBounds): Initialized row for path.
        * javax/swing/tree/DefaultTreeCellEditor.java
        (startEditingTimer): No need to start timer if it is already 
        set.
        * javax/swing/tree/DefaultTreeModel.java
        (valueForPathChanged): Fixed so value of node is changed only 
        if it is a MutableTreeNode. Otherwise, it cannot be changed. 
        Also, implemented with check if root node is the node being 
        changed.
        (nodeChanged): Should get the path of the node, not the parent.

Attachment: patch.diff
Description: Text Data


reply via email to

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