IntelliJ gwt插件 - 为什么我得到“未知的css类”错误? [英] IntelliJ gwt plugin - why do I get "unknown css class" errors?

查看:227
本文介绍了IntelliJ gwt插件 - 为什么我得到“未知的css类”错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正走过gwtStockWatcher的例子。尝试这个IntelliJ虽然我有一个奇怪的问题;看来IntelliJ找不到我的css类。

I'm walking through the gwt "StockWatcher" example at the moment. Trying this on IntelliJ though I've got a bit of a strange problem; It seems IntelliJ doesn't find my css classes.

我已经添加这行到StockWatcher.gwt.xml:

I've added this line to StockWatcher.gwt.xml:

<stylesheet src="css/stockwatcher.css"/>

我的网络模块有StockWatcher / css / stockwatcher.css:

And my web module has StockWatcher/css/stockwatcher.css:

body {
  padding: 10px;
}
.watchListHeader {
  background-color: #2062b8;
  color: white;
  font-style: italic;
}
.watchList {
  border: 1px solid silver;
  padding: 2px;
  margin-bottom: 6px;
}
.watchListNumericColumn {
  color: red;
}



在StockWatcher类中:

In the StockWatcher class:

stockFlexTable.getRowFormatter().addStyleName(0,"watchListHeader");
// no error, but I can't "go to"  ----------------^
stockFlexTable.addStyleName("watchList");
// ----------------------------^
stockFlexTable.getCellFormatter().addStyleName(0, 1, "watchListNumericColumn");
// ----------------------------------------------------^
stockFlexTable.getCellFormatter().addStyleName(0, 2, "watchListNumericColumn");
// ----------------------------------------------------^
// On these lines I get "Unknown CSS class"


$ b b

我如何解决这个问题?我应该告诉IntelliJ在哪里寻找这些CSS类?如果是,如何?或者IntelliJ只看一些固定的css文件?

How can I resolve this? Am I supposed to tell IntelliJ where to look for these css classes? If so, how? Or does IntelliJ only look in some fixed css file? The only "resolution" that the inspection offers is to suppress the warning, which I'd rather not do unless there's no other way.

推荐答案

只有检查提供的解决方案才能抑制警告,除非没有其他方法。

在您的HTML / JSP文件中尝试这一个。

Try this one in your HTML/JSP file

<link type="text/css" rel="stylesheet" href="css/stockwatcher.css">

无需添加 stylesheet gwt.xml

code> gwt.xml

Try this one in your gwt.xml

<stylesheet src="/css/stockwatcher.css"/>

这篇关于IntelliJ gwt插件 - 为什么我得到“未知的css类”错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆