简体   繁体   English

GWT 中的 UIBinder 和 MVP

[英]UIBinder and MVP in GWT

When using the MVP pattern as described here in GWT, how do you create a presenter associated with a view when the view is part of another uibinder-defined view.当使用 GWT 中描述MVP 模式时,当视图是另一个 uibinder 定义的视图的一部分时,如何创建与视图关联的演示者。

You instantiate it yourself via:您通过以下方式自己实例化它:

  1. @UiFactory method: @UiFactory方法:

     @UiFactory public Widget getMyView(){ // here you instantiate your view & activity... // your view contais a widget or is a widget return widget }
  2. @UiField(provided=true) field: @UiField(provided=true)字段:

     @UiField(provided=true) public Widget myView; // then instantiate it in constructor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM