]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added simple setValue command for Table and fixed Column vs Property typo
authorArtur Signell <artur.signell@itmill.com>
Mon, 25 Jul 2011 14:05:22 +0000 (14:05 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 25 Jul 2011 14:05:22 +0000 (14:05 +0000)
svn changeset:19926/svn branch:6.7

tests/src/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
tests/src/com/vaadin/tests/components/table/Tables.java

index 79ec0d1bf64e0f29e7875ca18c9954b607b6352b..1c8e728908c9e8df5ca5bfe4f5be9ddf2fdfb8b9 100644 (file)
@@ -156,7 +156,7 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
             }\r
         }\r
     };\r
-    private Command<T, Object> setValueCommand = new Command<T, Object>() {\r
+    protected Command<T, Object> setValueCommand = new Command<T, Object>() {\r
 \r
         public void execute(T c, Object value, Object data) {\r
             c.setValue(value);\r
index a128879e2175cc9364060cd7577eeb48f756829e..dc11022027b6d0e923674a124ad0f0592818bb8f 100644 (file)
@@ -87,7 +87,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
 \r
         public void execute(Table c, Integer value, Object data) {\r
             if (value == Table.ROW_HEADER_MODE_PROPERTY) {\r
-                c.setItemCaptionPropertyId("Column 3");\r
+                c.setItemCaptionPropertyId("Property 3");\r
             }\r
             c.setRowHeaderMode(value);\r
         }\r
@@ -150,6 +150,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
         createPageLengthSelect(CATEGORY_SIZE);\r
 \r
         createSelectionModeSelect(CATEGORY_SELECTION);\r
+        createValueSelection(CATEGORY_SELECTION);\r
 \r
         createItemClickListener(CATEGORY_LISTENERS);\r
         createColumnResizeListenerCheckbox(CATEGORY_LISTENERS);\r
@@ -172,6 +173,16 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
 \r
     }\r
 \r
+    private void createValueSelection(String categorySelection) {\r
+        LinkedHashMap<String, Object> options = new LinkedHashMap<String, Object>();\r
+        options.put("null", null);\r
+        for (int i = 1; i <= 10; i++) {\r
+            options.put("Item " + i, "Item " + i);\r
+        }\r
+        createSelectAction("Value", categorySelection, options, null,\r
+                setValueCommand);\r
+    }\r
+\r
     private void createContextMenuAction(String category) {\r
         LinkedHashMap<String, ContextMenu> options = new LinkedHashMap<String, ContextMenu>();\r
         options.put("None", null);\r
@@ -243,7 +254,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
         options.put("Id", Table.ROW_HEADER_MODE_ID);\r
         options.put("Index", Table.ROW_HEADER_MODE_INDEX);\r
         options.put("Item", Table.ROW_HEADER_MODE_ITEM);\r
-        options.put("'Column 3' property", Table.ROW_HEADER_MODE_PROPERTY);\r
+        options.put("'Property 3' property", Table.ROW_HEADER_MODE_PROPERTY);\r
 \r
         createSelectAction("Row header mode", category, options, "Hidden",\r
                 rowHeaderModeCommand);\r