GWT css资源混淆错误

发布于 2024-12-08 09:04:40 字数 1018 浏览 0 评论 0原文

我的 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 技术交流群。

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

发布评论

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

评论(2

溇涏 2024-12-15 09:04:40

(删除了之前的答案,在这种情况下没有意义)。

看起来这是一个错误(或有意为之?)。 GWT 问题跟踪器中的几份报告有些相关:大写的类名在@ClassName中使用不起作用内联类名称中的非 Java 方法安全字符不起作用 后者的状态已修复,但也有注释以使 ClassName 起作用。此评论是在修复问题之前发表的,因此不清楚它是否打算修复,或者已修复,但不起作用。

ClassName 似乎只能在以下组合中工作:

@ClassName("test-name")
String testName()

在 css 中:

.test-name {
}

可行的方法似乎是在 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:

@ClassName("test-name")
String testName()

and in css:

.test-name {
}

The way to go seems to be use the same name in method/ui:style or use the dash/camelcase combination.

萌酱 2024-12-15 09:04:40

div.dm 选择器中,类名称为 dm,因此 @ClassName("dm")

不幸的是,我不明白 test-name;希望这是第一个错误的副作用;-)

In your div.dm selector, the class name is dm, so @ClassName("dm").

I unfortunately don't understand about the test-name; let's hope it's a side-effect of the first error ;-)

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