Make component editors fire events
----------------------------------

                 Key: PIVOT-299
                 URL: https://issues.apache.org/jira/browse/PIVOT-299
             Project: Pivot
          Issue Type: New Feature
          Components: wtk
    Affects Versions: 1.3
            Reporter: Todd Volkert
            Assignee: Todd Volkert
             Fix For: 1.3.1


There are several use cases that call for event notifications from the editors 
(TableViewRowEditor, TreeViewNodeEditor, and ListViewItemEditor).  These 
include preview events as well.  Here's the associated API change:

public interface Editor {
    public boolean isEditing();
-    public void save();
+    public void saveChanges();
-    public void cancel();
+    public void cancelEdit();
}

TableView {
    public interface RowEditor extends Editor {
-        public void edit(TableView tableView, int rowIndex, int columnIndex);
+        public void editRow(TableView tableView, int rowIndex, int 
columnIndex);
+        public ListenerList<RowEditorListener> getRowEditorListeners();
    }

    public interface RowEditorListener {
        public Vote previewEditRow(RowEditor rowEditor, TableView tableView, 
int rowIndex, int columnIndex);
        public void editRowVetoed(RowEditor rowEditor, Vote reason);
        public void rowEditing(RowEditor rowEditor, TableView tableView, int 
rowIndex, int columnIndex);
        public Vote previewSaveChanges(RowEditor rowEditor, TableView 
tableView, int rowIndex, int columnIndex, Dictionary<String, Object> changes);
        public void saveChangesVetoed(RowEditor rowEditor, Vote reason);
        public void changesSaved(RowEditor rowEditor, TableView tableView, int 
rowIndex, int columnIndex);
        public void editCancelled(RowEditor rowEditor, TableView tableView, int 
rowIndex, int columnIndex);
    }
}

TreeView {
    public interface NodeEditor extends Editor {
-        public void edit(TreeView treeView, Path path);
+        public void editNode(TreeView treeView, Path path);
+        public ListenerList<NodeEditorListener> getNodeEditorListeners();
    }

    public interface NodeEditorListener {
        public Vote previewEditNode(NodeEditor nodeEditor, TreeView treeView, 
Path path);
        public void editNodeVetoed(NodeEditor nodeEditor, Vote reason);
        public void nodeEditing(NodeEditor nodeEditor, TreeView treeView, Path 
path);
        public Vote previewSaveChanges(NodeEditor nodeEditor, TreeView 
treeView, Path path, Object changes);
        public void saveChangesVetoed(NodeEditor nodeEditor, Vote reason);
        public void changesSaved(NodeEditor nodeEditor, TreeView treeView, Path 
path);
        public void editCancelled(NodeEditor nodeEditor, TreeView treeView, 
Path path);
    }
}

ListView {
    public interface ItemEditor extends Editor {
-        public void edit(ListView listView, int index);
+        public void editItem(ListView listView, int index);
+        public ListenerList<ItemEditorListener> getItemEditorListeners();
    }

    public interface ItemEditorListener {
        public Vote previewEditItem(ItemEditor itemEditor, ListView listView, 
int index);
        public void editItemVetoed(ItemEditor itemEditor, Vote reason);
        public void itemEditing(ItemEditor itemEditor, ListView listView, int 
index);
        public Vote previewSaveChanges(ItemEditor itemEditor, ListView 
listView, int index, Object changes);
        public void saveChangesVetoed(ItemEditor itemEditor, Vote reason);
        public void changesSaved(ItemEditor itemEditor, ListView listView, int 
index);
        public void editCancelled(ItemEditor itemEditor, ListView listView, int 
index);
    }
}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to