大佬教程收集整理的这篇文章主要介绍了使用自定义css与gwt,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
>问题是我无法让gwt检测我在lorum.gwt.xml文件中声明的css文件,当我启动调试模式时,jetty在启动时在日志输出中给出以下错误:
:
00:00:00.811 [WARN] 404 - GET /lorum/stylesheet.css (127.0.0.1) 1418 bytes 00:00:00.811 [INFO] request headers 00:00:00.811 [INFO] Host: 127.0.0.1:8888 00:00:00.811 [INFO] Connection: keep-alive 00:00:00.811 [INFO] User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.19 (KHTML,like Gecko) Ubuntu/11.10 Chromium/18.0.1025.168 Chrome/18.0.1025.168 Safari/535.19 00:00:00.811 [INFO] Accept: text/css,*/*;q=0.1 00:00:00.811 [INFO] Referer: http://127.0.0.1:8888/Home.html?gwt.codesvr=127.0.0.1:9997 00:00:00.812 [INFO] Accept-Encoding: gzip,deflate,sdch 00:00:00.812 [INFO] Accept-Language: en-US,en;q=0.8 00:00:00.812 [INFO] Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 00:00:00.812 [INFO] Cookie: JSESSIONID=ywoku1zfjs0b 00:00:00.812 [INFO] Response headers 00:00:00.812 [INFO] Content-Type: text/html; charset=iso-8859-1 00:00:00.812
而且它没有加载我的CSs.
lorum.gwt.xml来源:
l version="1.0" encoding="UTF-8"?> <module rename-to='lorum'> <!-- Inherit the core Web Toolkit stuff. --> <inherits name='com.google.gwt.user.User'/> <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> <inherits name="com.google.gwt.resources.resources" /> <inherits name="com.company.lorum.gwt.client.stylesheet.css"/> <entry-point class='com.company.lorum.gwt.client.LoadModuleLorum'/> <stylesheet src='stylesheet.css' /> <servlet path="/AuthenticationImpl" class="com.company.lorum.gwt.server.implementations.Authentication@R_772_9260@ceImpl" /> <servlet path="/GeneralImpl" class="com.company.lorum.gwt.server.implementations.General@R_772_9260@ceImpl" /> <servlet path="/Projectimpl" class="com.company.lorum.gwt.server.implementations.Project@R_772_9260@ceImpl" /> </module>
>我尝试在欢迎文件(Home.html)中继承我的css文件,该文件有效;但它不会将样式规则应用于我的小部件.我不喜欢这种方法,因为不同的浏览器对css语法的行为不同.如果你知道如何让它工作我会使用它.这是我的Home.html来源
:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf8"/> <link href="stylesheet.css" rel="stylesheet" type="text/css"> <title>lorum</title> </head> <body> <script language="javascript" src="lorum/lorum.nocache.js"></script> </body> </html>
CSS(stylesheet.css)源码(它很简单,因为我只想测试它是否有效):
.gwt-MenuBar { color:green; } .gwt-Button { font-size: 200%; }
子问题:
我在哪里存储我的css文件,以便我的lorum.gwt.xml文件使用以下语法检测和使用它:< stylesheet src ='stylesheet.css'/>
或者您可以在YourName.java中定义它
public interface CellTabelresources extends CellTable.resources { public interface CellTableStyle extends CellTable.Style { }; @source({ "style.css" }) CellTableStyle cellTableStyle(); }
这使得你的style.css成为最重要的,所以它会覆盖其他所有风格.
以上是大佬教程为你收集整理的使用自定义css与gwt全部内容,希望文章能够帮你解决使用自定义css与gwt所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。