在 Gwt WindowBuilder 中编辑 CSS

发布于 2024-11-17 04:48:07 字数 522 浏览 2 评论 0原文

我在一个项目中使用 GWT,最近开始在 Eclipse 中使用 WindowBuilder。我在 WindowBuilder 中创建了一个新类并添加了一些小部件。所有有效的东西。但是,当我尝试编辑某些面板的 CSS 并单击编辑“styleName”字段时,我收到一条错误消息,其中显示:

"There are no CSS files referenced from modules HTML."

我已尝试在基本 html 文件和中添加指向样式表的链接Web.gwt.xml 文件,但这似乎不起作用。我得到同样的错误。

在其他类中,我使用了 UiBinder 并在 XML 文件中添加了样式,但该类不使用 UiBinder。那么如何将 CSS 文件与类关联起来,以便 WindowBuilder 允许我编辑样式呢?

在这个项目中,我没有或使用“war”目录。该项目是一个 couchapp,因此我将其编译到另一个目录并将其从那里推送到 CouchDB。似乎在其他项目中,如果原始项目设置有一个 war 目录,则此功能可以正常工作。

I am using GWT in a project and recently started using the WindowBuilder in Eclipse. I created a new class and in the WindowBuilder and added some widgets. All that works and everything. However, when I try to edit the CSS for some of the panels and I click to edit the "styleName" field I get an error message which says:

"There are no CSS files referenced from modules HTML."

I've tried adding a link to a style sheet in my base html file and in the Web.gwt.xml file, but that does not seem to work. I get the same error.

In other classes I have used UiBinder and added the style in the XML file, but this class doesn't use UiBinder. So how do I associate a CSS file with the class so that the WindowBuilder allows me to edit the style?

In this project I don't have or use a "war" directory. The project is a couchapp, so I compile it to another directory and push it to CouchDB from there. It seems that in other projects, where there is the original project setup with a war directory, this feature works properly.

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

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

发布评论

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

评论(2

终陌 2024-11-24 04:48:07

我遇到了同样的问题,并且能够通过将 CSS 资源从 war 目录移动到类路径来解决它,特别是在通过“”。

项目布局(由于 Eclipse 插件错误,模块描述符位置奇怪):

src
|- main
   |- java
   |  |- demo
   |     |- client
   |     |  |- MyWidget.java
   |     |  |- MyWidget.ui.xml
   |     |- Demo.gwt.xml
   |- resources
      |- demo
         |- css
            |- Demo.css

演示.gwt.xml:

<module>
         ...
    <source path="client" />
         ...
    <public path="css" />
    <stylesheet src="Demo.css" />
         ...
</module>

I had the same problem and was able to work around it by moving my CSS-resources from the war-directory to the classpath, specifically inside a package that is declared as a "public path" inside the GWT module descriptior via "<public path='...' />".

Project layout (odd location for module descriptor because of Eclipse Plugin Bug):

src
|- main
   |- java
   |  |- demo
   |     |- client
   |     |  |- MyWidget.java
   |     |  |- MyWidget.ui.xml
   |     |- Demo.gwt.xml
   |- resources
      |- demo
         |- css
            |- Demo.css

Demo.gwt.xml:

<module>
         ...
    <source path="client" />
         ...
    <public path="css" />
    <stylesheet src="Demo.css" />
         ...
</module>
最单纯的乌龟 2024-11-24 04:48:07

要解决此问题:
在模块文件 gwt.xml 中,输入:

<stylesheet src="example.css"/>

菜单中的下一步:Project ->干净。

To fix this problem:
In module file gwt.xml type:

<stylesheet src="example.css"/>

Next in menu: Project -> clean.

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