开发者

GWT css resources obfuscation error

开发者 https://www.devze.com 2023-04-10 06:28 出处:网络
I have this style in my uibinder: 开发者_开发问答<ui:style type=\"com.mycompany.MyApp.MyStyle\">

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.


(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.


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 ;-)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号