pivot.wtk.content
Class TableViewRowEditor

java.lang.Object
  extended by pivot.wtk.content.TableViewRowEditor
All Implemented Interfaces:
Editor, TableView.RowEditor

public class TableViewRowEditor
extends Object
implements TableView.RowEditor

Default table view row editor.

Author:
tvolkert

Constructor Summary
TableViewRowEditor()
          Creates a new TableViewRowEditor.
 
Method Summary
 void cancel()
          Cancels an edit that is in progress by reverting any edits the user has made.
 void edit(TableView tableView, int rowIndex, int columnIndex)
          Notifies the editor that editing should begin.
 Dictionary<String,Component> getCellEditors()
          Gets this row editor's cell editor dictionary.
 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

TableViewRowEditor

public TableViewRowEditor()
Creates a new TableViewRowEditor. This object should only be associated with one table view at a time.

Method Detail

getCellEditors

public Dictionary<String,Component> getCellEditors()
Gets this row editor's cell editor dictionary. The caller may specify explicit editor components and place them in this dictionary by their table view column names. Any column that does not have an entry in this dictionary will have a TextInput implicitly associated with it during editing.

This row editor uses data binding to populate the cell editor components and to get the data back out of those components, so it is the caller's responsibility to set up the data binding keys in each component they specify in this dictionary. The data binding key should equal the column name that the cell editor serves.

Returns:
The cell editor dictionary.

edit

public void edit(TableView tableView,
                 int rowIndex,
                 int columnIndex)
Description copied from interface: TableView.RowEditor
Notifies the editor that editing should begin. If the editor is currently installed on the table 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 TableView.RowEditor
Parameters:
tableView - The table view
rowIndex - The row index of the cell to edit
columnIndex - The column index of the cell to edit
See Also:
TableView.setRowEditor(RowEditor)

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()
Description copied from interface: Editor
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