mgwt定制造型

时间:2013-03-24 14:08:24

标签: gwt styling mgwt

我正在尝试使用此处显示的自定义样式(https://code.google.com/p/mgwt/wiki/Styling):

public class MGWTColorTheme implements MGWTTheme {

                private MGWTClientBundle bundle;

                public MGWTColorTheme() {
                        if (MGWT.getOsDetection().isIOs()) {
                                if (MGWT.getOsDetection().isRetina()) {
                                        bundle = (MGWTColorBundleRetina) GWT.create(MGWTColorBundleRetina.class);
                                } else {
                                        bundle = (MGWTColorBundleNonRetina) GWT.create(MGWTColorBundleNonRetina.class);
                                }
                        } else {
                                bundle = (MGWTColorBundleNonRetina) GWT.create(MGWTColorBundleNonRetina.class);
                        }

                }

                @Override
                public MGWTClientBundle getMGWTClientBundle() {
                        return bundle;
                }

        }

MGWTStyle.setTheme(new MGWTColorTheme());

当我加载我的应用时,我收到以下错误:

Rebinding com.googlecode.mgwt.ui.client.theme.mgwt.MGWTColorBundleNonRetina
Invoking generator com.google.gwt.resources.rebind.context.InlineClientBundleGenerator
Creating assignment for getButtonBarCss()
Replacing CSS class names
The following unobfuscated classes were present in a strict CssResource:
text
Fix by adding String accessor method(s) to the CssResource interface for obfuscated classes, or using an @external declaration for unobfuscated classes.

1 个答案:

答案 0 :(得分:3)

这看起来像是在使用一个破坏的主题,它在css文件中存在css类,而这些css类没有在java接口中声明。

如果您想开始使用mgwt样式,您可以轻松克隆主题库项目并从那里开始:

https://code.google.com/p/mgwt/source/checkout?repo=themebase