代码之家  ›  专栏  ›  技术社区  ›  Michael Donohue Reno

在已部署和调试环境之间更改GWT应用程序行为

  •  1
  • Michael Donohue Reno  · 技术社区  · 14 年前

    我想让我的GWT应用程序在调试或开发VS时使用不同的常量。正确的方法是什么?我的网络搜索显示了很多关于调试GWT应用程序的页面,这不是我要找的。

    1 回复  |  直到 14 年前
        1
  •  1
  •   Igor Klimer    14 年前

    这看起来像是一份工作 deferred binding !;)
    它看起来是这样的(将它放在模块XML文件中,我没有实际测试过它,但是您应该了解它的要点):

      <define-property name="debug" values="true,false" />
      <set-property name="debug" value="true" />
    
      <replace-with class="package.Constants">
        <when-type-is class="package.Constants"/>
      </replace-with>
    
      <replace-with class="package.ConstantsDebug">
        <when-type-is class="package.Constants" />
        <when-property-is name="debug" value="true"/>
      </replace-with>
    

    the docs 有关可用参数、规则和其他内容的详细信息。