[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/25205] JTree editing
From: |
audriusa at bluewin dot ch |
Subject: |
[Bug classpath/25205] JTree editing |
Date: |
25 Jan 2006 09:23:49 -0000 |
------- Comment #3 from audriusa at bluewin dot ch 2006-01-25 09:23 -------
Created an attachment (id=10727)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10727&action=view)
Should fix the bug
This patch should fix the editing support for JTree. After double clicking on
the tree node, the editing text component appears under right place. It is
possible to edit text. The node is updated after finishing the session with
ENTER.
2006-01-25 Audrius Meskauskas <address@hidden>
* javax/swing/DefaultCellEditor.java (getTreeCellEditorComponent):
Rewritten.
* javax/swing/JTree.java (stopEditing, cancelEditing): Return without
action if not editing.
* javax/swing/plaf/basic/BasicTreeUI.java
(CellEditorHandler.editingCancelled): Delegate to cancelEditing.
(CellEditorHandler.editingStopped): Delegate to stopEditing.
(EditorUpdateTimer): Removed.
(TreeAction.actionPerformed): Stop and not cancel the current editing
when starting editing another node.
(editorTimer, newVal): Removed.
(cancelEditing): Do not send the cancel message.
(completeEditing): Obtain the edited value from the editor.
(finish): New method.
(paintRow): Do not paint the editing component here.
(startEditing, stopEditing): Rewritten.
* javax/swing/tree/DefaultTreeCellEditor.java
(DefaultTextField): Added SVUID.
(EditorContainer): Rewritten.
(RealEditorListener): New inner class.
(ICON_TEXT_GAP, TREE_ICON_GAP: New constants).
(constructor): Add cell editor listener. Do not instantiate timer.
(actionPerformed): Return without action.
(cancelCellEditing): Rewritten.
(createTreeCellEditor): Add cell editor listener to the editor.
(getCellEditorValue): Request the value from the realEditor.
(isCellEditable): Removed timer management.
(prepareForEditing): Remove all components befor adding the
editingComponent.
(startEditingTimer): Start only if it is not null.
(stopCellEditing): Rewritten.
(stopEditingTimer): New method.
(valueChanged): Do not configure editing component here.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25205