2010-05-30 23 views

回答

1

这看起来像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上可用的参数,规则和whatnot。

+0

正是我想要的。谢谢。 – 2010-05-31 03:31:59

+0

为了增加,GWT已经有一个调试标志--gwt.enableDebugId来控制'ensureDebugId()'方法。你可以使用它作为参考实现,或者更好 - 可以重用相同的标志。 – 2010-05-31 05:11:08

相关问题