【问题标题】:UIBinder and MVP in GWTGWT 中的 UIBinder 和 MVP
【发布时间】:2011-06-11 01:53:53
【问题描述】:

当使用 GWT 中 here 描述的 MVP 模式时,当视图是另一个 uibinder 定义的视图的一部分时,如何创建与视图关联的演示者。

【问题讨论】:

    标签: java gwt mvp uibinder


    【解决方案1】:

    您自己通过以下方式实例化它:

    1. @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) 字段:

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

    【讨论】:

      猜你喜欢
      • 2011-11-27
      • 2013-04-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多