为什么我的应用程序中没有显示任何 GWT 主题,仅显示标准主题?

发布于 2024-10-12 18:45:22 字数 3641 浏览 1 评论 0原文

我有这样的 xml 模块:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='sapepass'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.visualization.Visualization'/>
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name='com.google.gwt.json.JSON'/>
<inherits name='com.google.gwt.requestfactory.RequestFactory'/>
<extend-property name="locale" values="es_CO" />
<set-property-fallback name="locale" value="es_CO" />
<inherits name='com.google.gwt.user.theme.chrome.Chrome'/>
<entry-point class='co.ibm.spms.sap.epass.client.SAPePass' />
<inherits name="co.ibm.spms.ui.utils.Utils" />
<inherits name="eu.maydu.gwt.validation.ValidationLibrary"/>
<source path='client' />
<source path='shared' />
</module>

Html

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />

<!--                                                               -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!--                                                               -->
<link type="text/css" rel="stylesheet" href="SAPePass.css">

<!--                                           -->
<!-- Any title is fine                         -->
<!--                                           -->
<title>SAP ePass</title>

<!--                                           -->
<!-- This script loads your compiled module.   -->
<!-- If you add any GWT meta tags, they must   -->
<!-- be added before this line.                -->
<!--                                           -->
<script type="text/javascript" language="javascript" src="sapepass/sapepass.nocache.js"></script>
</head>

但是当我运行应用程序时,结果是颜色对应于标准主题。那是因为standrd css的导入是在chrome css之后(生成的html):

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">

<!--                                                               -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!--                                                               -->
<link type="text/css" rel="stylesheet" href="SAPePass.css">

<!--                                           -->
<!-- Any title is fine                         -->
<!--                                           -->
<title>SAP ePass</title>

<!--                                           -->
<!-- This script loads your compiled module.   -->
<!-- If you add any GWT meta tags, they must   -->
<!-- be added before this line.                -->
<!--                                           -->
<script type="text/javascript" language="javascript" src="sapepass/sapepass.nocache.js">   </script>
<script defer="defer">sapepass.onInjectionDone('sapepass')</script>
<link rel="stylesheet" href="http://127.0.0.1:8888/sapepass/gwt/chrome/chrome.css">
<link rel="stylesheet" href="http://127.0.0.1:8888/sapepass/gwt/standard/standard.css">
</head>

我能做什么?

注意:

我正在使用 GWT 2.1.1 蚀

I have the xml module like that:

<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='sapepass'>
<inherits name='com.google.gwt.user.User' />
<inherits name='com.google.gwt.visualization.Visualization'/>
<inherits name="com.google.gwt.i18n.I18N"/>
<inherits name='com.google.gwt.json.JSON'/>
<inherits name='com.google.gwt.requestfactory.RequestFactory'/>
<extend-property name="locale" values="es_CO" />
<set-property-fallback name="locale" value="es_CO" />
<inherits name='com.google.gwt.user.theme.chrome.Chrome'/>
<entry-point class='co.ibm.spms.sap.epass.client.SAPePass' />
<inherits name="co.ibm.spms.ui.utils.Utils" />
<inherits name="eu.maydu.gwt.validation.ValidationLibrary"/>
<source path='client' />
<source path='shared' />
</module>

Html:

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />

<!--                                                               -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!--                                                               -->
<link type="text/css" rel="stylesheet" href="SAPePass.css">

<!--                                           -->
<!-- Any title is fine                         -->
<!--                                           -->
<title>SAP ePass</title>

<!--                                           -->
<!-- This script loads your compiled module.   -->
<!-- If you add any GWT meta tags, they must   -->
<!-- be added before this line.                -->
<!--                                           -->
<script type="text/javascript" language="javascript" src="sapepass/sapepass.nocache.js"></script>
</head>

But when I run de app, the result is that the colors correspond to Standard theme. That because the import of standrd css is after chrome css (generated html):

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="icon" href="favicon.ico" type="image/x-icon">

<!--                                                               -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!--                                                               -->
<link type="text/css" rel="stylesheet" href="SAPePass.css">

<!--                                           -->
<!-- Any title is fine                         -->
<!--                                           -->
<title>SAP ePass</title>

<!--                                           -->
<!-- This script loads your compiled module.   -->
<!-- If you add any GWT meta tags, they must   -->
<!-- be added before this line.                -->
<!--                                           -->
<script type="text/javascript" language="javascript" src="sapepass/sapepass.nocache.js">   </script>
<script defer="defer">sapepass.onInjectionDone('sapepass')</script>
<link rel="stylesheet" href="http://127.0.0.1:8888/sapepass/gwt/chrome/chrome.css">
<link rel="stylesheet" href="http://127.0.0.1:8888/sapepass/gwt/standard/standard.css">
</head>

What can I do?

Note:

I´m using GWT 2.1.1
Eclipse

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

皇甫轩 2024-10-19 18:45:22

为什么要在 html 中显式注入 chrome 和标准 css?适当的 css 将根据您的模块 xml 自动注入。

Why are you explicitly injecting the chrome and standard css in your html? The appropriate css will automatically injected based on your module xml.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文