GXT主题替换停止工作

时间:2018-06-21 08:06:27

标签: java gwt gxt

由于某种原因,我的自定义外观不再用于替换gxt类(昨天工作)。

我所做的只是注释掉这部分,重新​​编译应用程序,然后还原它并再次重新编译:

<replace-with class='com.test.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
    <when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
</replace-with> 

相关代码:

<module>
    <inherits name="com.sencha.gxt.theme.base.Base" />

    <replace-with class='com.acdlabs.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
        <when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
    </replace-with> 
</module>

public class TestColumnHeaderAppearance extends ColumnHeaderDefaultAppearance {

    public interface TestColumnHeaderResources extends ColumnHeaderResources {
        @Override
        @Source({ "com/sencha/gxt/theme/base/client/grid/ColumnHeader.gss", "TestColumnHeader.gss" })
        public TestColumnHeaderStyle style();
    }

    public interface TestColumnHeaderStyle extends DefaultColumnHeaderStyles {
        String filterIcon();
    }

    public TestColumnHeaderAppearance() {
        super(GWT.<ColumnHeaderResources> create(TestColumnHeaderResources.class));
    }

}

public class TestColumnHeader<M> extends ColumnHeader<M> {

    public TestColumnHeader(Grid<M> container, ColumnModel<M> cm, ColumnHeaderAppearance appearance) {
        super(container, cm, appearance);
        if (appearance.styles() instanceof TestColumnHeaderStyle) {  
            styles = (TestColumnHeaderStyle) appearance.styles(); // <-- this is never reached and I that's why I get exceptions like "Cannot read property 'filterIcon_0_g$' of undefined"
        }
    }
}

我的浏览器可以缓存主题并忽略TestColumnHeaderAppearance吗? 在TestColumnHeader中添加了一条注释,该注释表明没有加载TestColumnHeaderAppearance。

有什么想法吗?

编辑

它在不同的浏览器(Firefox)中运行,因此看起来确实像是缓存问题。尽管我清除了无法运行的浏览器缓存(Chrome浏览器),但仍然没有任何更改。删除/ target后,重新编译所有内容,仍然没有更改。

编辑2

当应用程序以.war格式构建并部署到tomcat时,一切正常(我可以看到样式已更改)。那么超级开发模式或它的配置可能是一个问题。

WeblibTheme.gwt.xml

<module>

    <inherits name="com.sencha.gxt.theme.base.Base" />

    <!-- Buttons -->

    <replace-with class="com.test.Test_portal.web.theme.client.button.TestWebButtonCellAppearance">
        <when-type-is class="com.sencha.gxt.cell.core.client.ButtonCell.ButtonCellAppearance" />
    </replace-with> 

    <replace-with class="com.test.Test_portal.web.theme.client.field.TestWebDualListFieldAppearance">
        <when-type-is class="com.sencha.gxt.widget.core.client.form.DualListField.DualListFieldAppearance" />
    </replace-with>    

    <replace-with class='com.test.Test_portal.web.theme.client.header.TestColumnHeaderAppearance'>
        <when-type-is class='com.sencha.gxt.widget.core.client.grid.ColumnHeader.ColumnHeaderAppearance' />
    </replace-with>

    <!-- Slider -->
    <replace-with class="com.test.Test_portal.web.theme.client.slider.TestWebSliderAppearance">
    <any>
      <when-type-is class="com.sencha.gxt.cell.core.client.SliderCell.SliderAppearance" />
      <when-type-is class="com.sencha.gxt.cell.core.client.SliderCell.HorizontalSliderAppearance" />
    </any>
    </replace-with> 

    <!-- TreeAppearance -->
    <replace-with class="com.test.Test_portal.web.theme.client.tree.TestTreeAppearance">
        <when-type-is class="com.sencha.gxt.widget.core.client.tree.Tree.TreeAppearance"/>
    </replace-with>

    <!-- DatePicker -->
    <replace-with class="com.test.Test_portal.web.theme.client.datepicker.TestDatePickerAppearance">
        <when-type-is class="com.sencha.gxt.widget.core.client.DatePicker.DatePickerAppearance"/>
    </replace-with>
</module>

TestWeb.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='TestWeb'>

    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name='com.google.gwt.user.User' />
    <inherits name='com.google.gwt.inject.Inject' />
    <inherits name='com.google.gwt.resources.Resources' />

    <!-- Other module inherits -->
    <inherits name='com.gwtplatform.mvp.Mvp' />
    <inherits name='com.gwtplatform.dispatch.Dispatch' />
    <inherits name="org.atmosphere.gwt20.AtmosphereGwt20" />
    <inherits name='com.sencha.gxt.chart.Chart' />
    <inherits name='com.sencha.gxt.ui.GXT' />
    <inherits name="com.google.gwt.logging.Logging" />
    <inherits name="com.google.gwt.uibinder.UiBinder" />
    <inherits name="com.googlecode.gwt.crypto.Crypto" />
    <inherits name="com.test.chemwidgets.ChemWidgets" />
    <inherits name="com.test.gxt_widgets.GxtWidgets" />
    <inherits name="com.test.Test_portal.web.theme.WeblibTheme" />

    <collapse-property name="user.agent.os" values="*" />
    <collapse-property name="gxt.user.agent" values="air, safari*, chrome" />
    <collapse-property name="gxt.user.agent" values="ie9, ie10" />
    <collapse-property name="gxt.user.agent" values="gecko*" />

    <replace-with class='com.sencha.gxt.chart.client.draw.engine.VML'>
        <when-type-is class='com.sencha.gxt.chart.client.draw.Surface' />
        <any>
            <when-property-is name='user.agent' value='ie8' />
        </any>
    </replace-with>

    <!-- Specify the app entry point class. -->
    <entry-point class='com.test.Test_portal.web.client.TestWeb' />

    <!-- Specify the paths for translatable code -->
    <source path='client' />
    <source path='shared' />

    <set-property name="gwt.logging.logLevel" value="INFO" />

    <set-configuration-property name='gin.ginjector'
        value='com.test.Test_portal.web.client.gin.ClientGinjector' />


    <set-configuration-property name='gin.ginjector'
        value='com.test.Test_portal.web.client.gin.ClientGinjector' />

    <!-- By default (GWT 2.7.0) CssResources uses CSS instead of GSS -->
    <set-configuration-property name="CssResource.enableGss"
        value="true" />


    <!-- GWT Compiler converts all .css files to .gss, if value for CssResource.enableGss 
        is true -->
    <set-configuration-property name="CssResource.conversionMode"
        value="strict" />


    <!-- The default for GSS in UiBinder -->
    <set-configuration-property name="CssResource.gssDefaultInUiBinder"
        value="true" />

    <set-property name="compiler.stackMode" value="emulated" />
     <set-configuration-property name="compiler.emulatedStack.recordFileNames"
      value="true" />
     <set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
      value="true" />

    <set-property name="compiler.stackMode" value="emulated" />
    <set-configuration-property name="compiler.emulatedStack.recordFileNames"
        value="true" />
    <set-configuration-property name="compiler.emulatedStack.recordLineNumbers"
        value="true" />
</module>

TestWeb-dev.gwt.xml

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='TestWeb'>

    <!-- Inherit the core Web Toolkit stuff. -->
    <inherits name="com.test.Test_portal.web.TestWeb" />

    <!-- Collapsing all permutations into one. -->
    <collapse-all-properties />

</module>

编辑(固定,不知道为什么):

清除我的AppData \ Local \ Temp \文件夹,然后重新编译该应用程序。也许超级开发人员模式会忽略对模块所做的更改,直到temp文件夹保留以前的版本为止?

0 个答案:

没有答案