org.apache.pivot.wtk.content
Class TreeViewNodeEditor

java.lang.Object
  extended by org.apache.pivot.wtk.content.TreeViewNodeEditor
All Implemented Interfaces:
Editor, TreeView.NodeEditor

public class TreeViewNodeEditor
extends Object
implements TreeView.NodeEditor

Default tree view node editor, which allows the user to edit the text of a tree node in a TextInput. It is only intended to work with TreeNode data and TreeViewNodeRenderer renderers.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TreeView.NodeEditor
TreeView.NodeEditor.NodeEditorListenerList
 
Constructor Summary
TreeViewNodeEditor()
           
 
Method Summary
 void cancelEdit()
          Cancels an edit that is in progress by reverting any edits the user has made.
 void editNode(TreeView treeView, Sequence.Tree.Path path)
          Notifies the editor that editing should begin.
 ListenerList<TreeView.NodeEditorListener> getNodeEditorListeners()
          Gets the node editor listener list.
 boolean isEditing()
          Tells whether or not an edit is currently in progress.
 boolean saveChanges()
          Saves an edit that is in progress by updating the appropriate data object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeViewNodeEditor

public TreeViewNodeEditor()
Method Detail

editNode

public void editNode(TreeView treeView,
                     Sequence.Tree.Path path)
Notifies the editor that editing should begin. If the editor is currently installed on the tree view, the skin may call this method when the user executes the appropriate gesture (as defined by the skin).

Specified by:
editNode in interface TreeView.NodeEditor
Parameters:
treeView - The tree view containing the node to be edited.
path - The path to the node to edit.
See Also:
TreeView.setNodeEditor(NodeEditor)

isEditing

public boolean isEditing()
Tells whether or not an edit is currently in progress.

Specified by:
isEditing in interface Editor

saveChanges

public boolean saveChanges()
Saves an edit that is in progress by updating the appropriate data object. It is up to implementations to define the behavior when isEditing() == false.

Specified by:
saveChanges in interface Editor
Returns:
true if the changes were successfully saved; false otherwise.

cancelEdit

public void cancelEdit()
Cancels an edit that is in progress by reverting any edits the user has made. It is up to implementations to define the behavior when isEditing() == false.

Specified by:
cancelEdit in interface Editor

getNodeEditorListeners

public ListenerList<TreeView.NodeEditorListener> getNodeEditorListeners()
Gets the node editor listener list.

Specified by:
getNodeEditorListeners in interface TreeView.NodeEditor