// Filename: NotamDataSource.java
//
// Jeppesen Sanderson, Inc. Confidential & Proprietary
//
// This work contains valuable confidential and proprietary
// information.  Disclosure, use or reproduction outside of
// Jeppesen Sanderson, Inc. is prohibited, except as authorized
// in writing.  This unpublished work is protected by the laws
// of the United States and other countries.  In the event of
// publication, the following notice shall apply:
//
// Copyright 2010  Jeppesen Sanderson, Inc.  All Rights Reserved
//
// Revision History: 
//   ron May 11, 2010
//     Created class.

package com.smartgwt.sample.client;


import java.util.TreeMap;

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.widgets.form.fields.ComboBoxItem;


public class CustomFilterDataSource extends DataSource
{
	final DataSourceField field1;

	final DataSourceField field2;

	public CustomFilterDataSource()
	{
		setShowPrompt( false );

		ComboBoxItem comboBoxItem = new ComboBoxItem();
		comboBoxItem.setType( "comboBox" );
		comboBoxItem.setWidth( 300 );

		field1 = new DataSourceTextField( "field1", "Field 1", 50 );
		field1.setEditorType( comboBoxItem );
		field1.setValueMap( new String[ ]
		{
			"AA", "AB"
		} );
		addField( field1 );

		field2 = new DataSourceEnumField( "field2", "Field 2", 50 );
		field2.setEditorType( comboBoxItem );
		TreeMap<String, String> map = new TreeMap<String, String>();
		map.put("v1", "value 1");
		map.put("v2", "value 2");
		field2.setValueMap( map );
		addField( field2 );

		setClientOnly( true );
	}

}
