package it.issue.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
import com.google.gwt.user.client.ui.RootPanel;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.tab.Tab;
import com.smartgwt.client.widgets.tab.TabSet;

public class Issue implements EntryPoint {
	
	public void onModuleLoad() {
		TabSet set = new TabSet();
		
		Tab a = new Tab("A");
		
		Tab b = new Tab("B");
		
		
		DynamicForm formA = new DynamicForm();		
		DynamicForm formB = new DynamicForm();

		MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
		oracle.add("Cat");
		oracle.add("Dog");
		oracle.add("Horse");
		oracle.add("Canary");		
		SuggestBoxItem item = new SuggestBoxItem("suggestionbox", "Box", oracle);		
		
		//Exchange to see suggestBox on the first tab
		//formA.setItems(item);
		formB.setItems(item);
		
		
		a.setPane(formA);
		b.setPane(formB);
		set.setTabs(a,b);
		
		Canvas canvas = new Canvas();
		canvas.addChild(set);
		set.setSize("400", "500");
		canvas.setSize("400", "500");
		RootPanel.get("myId").add(canvas);
	}
}

