package com.ibm.smartgwt.defect.shared;

import com.smartgwt.client.data.DataSource;  
import com.smartgwt.client.data.fields.DataSourceDateField;  
import com.smartgwt.client.data.fields.DataSourceFloatField;  
import com.smartgwt.client.data.fields.DataSourceIntegerField;  
import com.smartgwt.client.data.fields.DataSourceSequenceField;  
import com.smartgwt.client.data.fields.DataSourceTextField;  
  
public class OrderItemLocalDS extends DataSource {  
  
    private static OrderItemLocalDS instance = null;  
  
    public static OrderItemLocalDS getInstance() {  
        if (instance == null) {  
            instance = new OrderItemLocalDS("orderItemLocalDS");  
        }  
        return instance;  
    }  
  
    public OrderItemLocalDS(String id) {  
  
        setID(id);  
  
        DataSourceSequenceField pkField = new DataSourceSequenceField("pk");  
        pkField.setHidden(true);  
        pkField.setPrimaryKey(true);  
  
        DataSourceIntegerField orderIdField = new DataSourceIntegerField("orderID", "Order ID");  
        orderIdField.setCanEdit(false);  
        orderIdField.setPluralTitle("Orders");  
  
        DataSourceTextField itemDescriptionField = new DataSourceTextField("itemDescription", "Description");  
        DataSourceTextField categoryField = new DataSourceTextField("category", "Category");  
  
        DataSourceDateField shipDateField = new DataSourceDateField("shipDate", "Ship Date");  
        DataSourceIntegerField quantityField = new DataSourceIntegerField("quantity", "Quantity");  
        DataSourceFloatField unitPriceField = new DataSourceFloatField("unitPrice", "Price");  
  
        setFields(pkField, orderIdField, itemDescriptionField, categoryField, shipDateField, quantityField, unitPriceField);  
  
        setTestData(OrderItemData.getRecords());  
        setClientOnly(true);          
    }  
}  