package de.smartgwttest.client;

import java.util.Date;

import com.smartgwt.client.widgets.grid.ListGridRecord;

public class ListGridSampleData {

    private static ListGridRecord[] records;  
	  
    public static ListGridRecord[] getRecords() {
        if (records == null) {
            records = getNewRecords();  
        }  
        return records;  
    }  
  
    public static ListGridRecord createRecord(String name, String sort, Date date) {
        ListGridRecord record = new ListGridRecord();
    	record.setAttribute("name", name);
    	record.setAttribute("sort", sort);
    	record.setAttribute("date", date);
        return record;
    }

    public static ListGridRecord[] getNewRecords() {
        return new ListGridRecord[]{
                createRecord("a", "1", new Date(2015 - 1900, 4, 27)),  
                createRecord("b", "3", new Date(2015 - 1900, 4, 27)),  
                createRecord("c", "2", new Date(2015 - 1900, 4, 27)),  
         };
    }
}
