GWT css资源混淆错误
我的 uibinder 中有这种样式:
<ui:style type="com.mycompany.MyApp.MyStyle">
.something {
width: 50em;
}
div.dm {
float: left;
display: inline-block;
width: 50em;
}
.test-name {
margin: 10px 10px;
}
</ui:style>
这是资源的界面:
interface MyStyle extends CssResource {
@ClassName("something ") //This doesn't work either
String somethingClass();
// String something(); //This works!
@ClassName("div.dm")
String divClass();
@ClassName("test-name")
String testNameClass();
}
但后来我收到此错误:
[ERROR] div.dm: Fix by adding .something{}
[ERROR] div.dm: Fix by adding .div.dm{}
[ERROR] test-name: Fix by adding .test-name{}
[ERROR] Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding
有人知道吗?我正在使用 GWT 2.4。
I have this style in my uibinder:
<ui:style type="com.mycompany.MyApp.MyStyle">
.something {
width: 50em;
}
div.dm {
float: left;
display: inline-block;
width: 50em;
}
.test-name {
margin: 10px 10px;
}
</ui:style>
This is the interface for the resource:
interface MyStyle extends CssResource {
@ClassName("something ") //This doesn't work either
String somethingClass();
// String something(); //This works!
@ClassName("div.dm")
String divClass();
@ClassName("test-name")
String testNameClass();
}
But then i get this error:
[ERROR] div.dm: Fix by adding .something{}
[ERROR] div.dm: Fix by adding .div.dm{}
[ERROR] test-name: Fix by adding .test-name{}
[ERROR] Generator 'com.google.gwt.resources.rebind.context.InlineClientBundleGenerator' threw an exception while rebinding
Anybody have any idea? I am using GWT 2.4.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
(删除了之前的答案,在这种情况下没有意义)。
看起来这是一个错误(或有意为之?)。 GWT 问题跟踪器中的几份报告有些相关:大写的类名在@ClassName中使用不起作用和内联类名称中的非 Java 方法安全字符不起作用 后者的状态已修复,但也有注释以使 ClassName 起作用。此评论是在修复问题之前发表的,因此不清楚它是否打算修复,或者已修复,但不起作用。
ClassName 似乎只能在以下组合中工作:
在 css 中:
可行的方法似乎是在 method/ui:style 中使用相同的名称或使用破折号/驼峰组合。
(Deleted previous answer, didn't make sense in this context).
It looks like this is a bug (or intended?). In the GWT issue tracker are several reports somewhat related: Capitalized classnames used in @ClassName within doesn't work and Non-Java method safe characters in inline class names doesn't work the latter has state fixed, but also has a comment remarking to make ClassName work. This comment was before the fixed issue, so it's not clear if it was intended to be fixed, or it was fixed, but doesn't work.
ClassName only seems to work in the following combination:
and in css:
The way to go seems to be use the same name in method/ui:style or use the dash/camelcase combination.
在
div.dm
选择器中,类名称为dm
,因此@ClassName("dm")
。不幸的是,我不明白
test-name
;希望这是第一个错误的副作用;-)In your
div.dm
selector, the class name isdm
, so@ClassName("dm")
.I unfortunately don't understand about the
test-name
; let's hope it's a side-effect of the first error ;-)