
package com.smartgwt.sample.client;


import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.util.KeyCallback;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.Label;
import com.smartgwt.client.widgets.form.FilterBuilder;
import com.smartgwt.client.widgets.layout.VStack;


/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class CustomDS implements EntryPoint
{

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad()
	{

		KeyIdentifier debugKey = new KeyIdentifier();
		debugKey.setCtrlKey( true );
		debugKey.setKeyName( "D" );

		Page.registerKey( debugKey, new KeyCallback()
		{
			public void execute(String keyName)
			{
				SC.showConsole();
			}
		} );

		VStack vStack = new VStack();
		vStack.setLeft( 175 );
		vStack.setTop( 75 );
		vStack.setWidth( "70%" );
		vStack.setMembersMargin( 20 );

		Label label = new Label();
		label.setContents( "<ul>" + "<li>The Combo Boxes for Field 1 and 2 should have values in their picklists</li>"
				+ "</ul>" );
		vStack.addMember( label );

		DataSource ds = new CustomFilterDataSource();

		FilterBuilder filterBuilder = new FilterBuilder();
		filterBuilder.setDataSource( ds );

		vStack.setMembers( label, filterBuilder );

		vStack.draw();

	}

}
