package com.dreamer.devcentre.client.xletProfiling.view;

import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.data.DataSourceField;
import com.smartgwt.client.data.fields.DataSourceEnumField;
import com.smartgwt.client.data.fields.DataSourceTextField;
import com.smartgwt.client.types.FieldType;

/**
 * 
 * @author M.Kim
 * 
 */
public class CompanyDataSource extends DataSource {
	public CompanyDataSource(String id) {
		setID(id);
//		DataSourceDateField date = new DataSourceDateField("date", "Date");
//		date.setPrimaryKey(true);
		DataSourceTextField date = new DataSourceTextField("date", "Date");
		date.setPrimaryKey(true);
		date.setRequired(true);
		DataSourceTextField alias = new DataSourceTextField("alias", "Alias");
		DataSourceTextField xletName = new DataSourceTextField("xletName",
				"Xlet Name");
		DataSourceTextField timeStamp = new DataSourceTextField("timeStamp",
				"TimeStamp");
		DataSourceTextField iteration = new DataSourceTextField("iteration",
				"Iteration");
		DataSourceTextField status = new DataSourceTextField("status", "Status");
//		DataSourceTextField actions = new DataSourceTextField("actions","Actions");
		DataSourceEnumField actions = new DataSourceEnumField("actions", "Actions", 10);
//		actions.setType(FieldType.ENUM);
//		DataSourceField actions = new DataSourceField("actions", FieldType.ENUM);
//		DataSourceEnumField actions = new DataSourceEnumField("actions", "Actions");
//		DataSourceTextField actions = new DataSourceTextField("valueMap",
//		"Actions");
//		actions.setAttribute("actions", new String[]{"Choose Action", "Delete", "View Result"});
		actions.setValueMap("Choose Action", "Delete", "View Result");
		actions.setCanEdit(true);
		setFields(date, alias, xletName, timeStamp, iteration, status, actions);
		setClientOnly(true);
		
	}
}
