You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/10/27 04:02:04 UTC

svn commit: r1027800 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java

Author: gbrown
Date: Wed Oct 27 02:02:04 2010
New Revision: 1027800

URL: http://svn.apache.org/viewvc?rev=1027800&view=rev
Log:
Resolve some implementation issues with TableViewRowEditor.

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java?rev=1027800&r1=1027799&r2=1027800&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java Wed Oct 27 02:02:04 2010
@@ -316,15 +316,18 @@ public class TableViewRowEditor extends 
         boolean valid = true;
 
         if (result) {
-            // Update the row data
-            List<Object> tableData = (List<Object>)tableView.getTableData();
+            // Preview the changes
+            HashMap previewTableRow = new HashMap<String, Object>();
+            tablePane.store(previewTableRow);
 
-            Object tableRow = tableData.get(rowIndex);
-            tablePane.store(tableRow);
-
-            valid = validate(tableRow);
+            valid = validate(previewTableRow, rowIndex);
 
             if (valid) {
+                // Update the row data
+                List<Object> tableData = (List<Object>)tableView.getTableData();
+                Object tableRow = tableData.get(rowIndex);
+                tablePane.store(tableRow);
+
                 if (tableData.getComparator() == null) {
                     tableData.update(rowIndex, tableRow);
                 } else {
@@ -365,7 +368,7 @@ public class TableViewRowEditor extends 
         }
     }
 
-    protected boolean validate(Object tableRow) {
+    protected boolean validate(Object tableRow, int rowIndex) {
         return true;
     }