1 package autotest.tko; 2 3 import autotest.common.table.RpcDataSource; 4 5 import com.google.gwt.json.client.JSONObject; 6 import com.google.gwt.json.client.JSONValue; 7 8 import java.util.List; 9 10 class TestViewDataSource extends RpcDataSource { TestViewDataSource()11 public TestViewDataSource() { 12 super("get_test_views", "get_num_test_views"); 13 } 14 15 /** 16 * Add 'id' field, needed by SelectionManager. 17 */ 18 @Override handleJsonResult(JSONValue result)19 protected List<JSONObject> handleJsonResult(JSONValue result) { 20 List<JSONObject> objects = super.handleJsonResult(result); 21 for (JSONObject object : objects) { 22 object.put("id", object.get("test_idx")); 23 } 24 return objects; 25 } 26 } 27