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.


Constructor Summary
TreeViewNodeEditor()
           
 
Method Summary
 void cancel()
          Cancels an edit that is in progress by reverting any edits the user has made.
 void edit(TreeView treeView, Sequence.Tree.Path path)
          Notifies the editor that editing should begin.
protected  TextInput getEditor()
          Gets the text input that serves as the editor component.
 boolean isEditing()
          Tells whether or not an edit is currently in progress.
 void save()
          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

getEditor

protected final TextInput getEditor()
Gets the text input that serves as the editor component. This component will only be non-null while editing.

Returns:
This editor's component, or null if an edit is not in progress
See Also:
isEditing()

edit

public void edit(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 choose to call this method when the user executes the appropriate gesture (as defined by the skin).

Specified by:
edit 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()
Description copied from interface: Editor
Tells whether or not an edit is currently in progress.

Specified by:
isEditing in interface Editor

save

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

Specified by:
save in interface Editor

cancel

public void cancel()
Description copied from interface: Editor
Cancels an edit that is in progress by reverting any edits the user has made. It is up to subclasses to define the behavior when isEditing() == false.

Specified by:
cancel in interface Editor