Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
(provide=true)在GWT中做什么?_Gwt - Fatal编程技术网

(provide=true)在GWT中做什么?

(provide=true)在GWT中做什么?,gwt,Gwt,在xml文件中,我有一些字段,如: <ui:with field="f1" type="t1"/> 这样我的项目就不会失败。那么在GWT中provide=true做什么呢?为什么我们需要在Jave文件中手动写入provided=true?提供的参数表示字段的小部件不能由UIBinder创建,而是由您的代码提供 @UIField Button btnUIbinder; @UIField(provided=true) Button btnYourCode; public YourCl

在xml文件中,我有一些字段,如:

<ui:with field="f1" type="t1"/>
这样我的项目就不会失败。那么在GWT中provide=true做什么呢?为什么我们需要在Jave文件中手动写入provided=true?

提供的参数表示字段的小部件不能由UIBinder创建,而是由您的代码提供

@UIField Button btnUIbinder;
@UIField(provided=true) Button btnYourCode;

public YourClassConstructor() {
    btnYourCode = new Button(...); // required!

    // init uibinder here 

}
提供的关键字支持具有复杂创建过程的小部件。或者,您已经从另一个源获得了小部件的情况

@UIField Button btnUIbinder;
@UIField(provided=true) Button btnYourCode;

public YourClassConstructor() {
    btnYourCode = new Button(...); // required!

    // init uibinder here 

}