package it.issue.client;
import com.smartgwt.client.widgets.form.fields.CanvasItem ;
import com.smartgwt.client.widgets.Canvas;
import com.google.gwt.user.client.ui.SuggestBox;
import com.google.gwt.user.client.ui.SuggestOracle;

public class SuggestBoxItem extends CanvasItem {

public static final int HEIGHT = 20;
private Canvas canvas = new Canvas();
private SuggestBox suggestBoxField;

public SuggestBoxItem(String name, String title, SuggestOracle suggestOracle) {
super(name, title);

suggestBoxField = new SuggestBox(suggestOracle);

suggestBoxField.setStyleName("gwt-SuggestBox");
suggestBoxField.setHeight(getHeight() + "px");

canvas.setHeight(getHeight());
canvas.setStyleName("gwt-SuggestBoxCanvas");
canvas.addChild(suggestBoxField);

setCanvas(canvas);
}

public Canvas getCanvas() {
return canvas;
}

public int getHeight() {
return HEIGHT;
}
}