本文整理匯總了Java中com.smartgwt.client.widgets.form.fields.CanvasItem類的典型用法代碼示例。如果您正苦於以下問題:Java CanvasItem類的具體用法?Java CanvasItem怎麽用?Java CanvasItem使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
CanvasItem類屬於com.smartgwt.client.widgets.form.fields包,在下文中一共展示了CanvasItem類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: create
import com.smartgwt.client.widgets.form.fields.CanvasItem; //導入依賴的package包/類
public FormItem create() {
final Img image = new Img();
image.setMaxHeight(200);
image.setMaxWidth(300);
image.setShowDisabled(false);
CanvasItem imgItem = new CanvasItem() {
public void setValue(String value) {
image.setSrc(value);
}
};
imgItem.setCanvas(image);
return new EnableToggleFormItem(new TextItem(), imgItem);
}
示例2: dumpChildren
import com.smartgwt.client.widgets.form.fields.CanvasItem; //導入依賴的package包/類
private static String dumpChildren(FormItem formItem) {
if (formItem instanceof CanvasItem) {
CanvasItem canvasItem = (CanvasItem) formItem;
Canvas canvas = canvasItem.getCanvas();
return ClientUtils.format("\n {tab: %s, focus: %s, %s, %s, %s}",
canvas.getTabIndex(), canvas.getCanFocus(), canvas.getID(), canvas.getClass(), dumpChildren(canvas, " "));
} else {
return "";
}
}