the style write in ui.xml does not work

21 views
Skip to first unread message

wahaha

unread,
Oct 12, 2011, 3:31:16 AM10/12/11
to Google Web Toolkit
i write a style class in ui.xml:

.test{
color:red;
}


then,i set a button's className as "test":

btn.setStyleName("test",true);

now,in the browser the button''s text is not red.

Sarjith Pullithodi

unread,
Oct 12, 2011, 3:46:06 AM10/12/11
to google-we...@googlegroups.com
have you followed this way??


--
Sarjith
          



--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.


wahaha

unread,
Oct 12, 2011, 4:38:01 AM10/12/11
to Google Web Toolkit
ok,thanks,now i have made a mistake that we can not access style rules
directly in java code,we must use cssResource interface.
but there is another question:
------------------------------------------------
interface MyStyle extends CssResource {
String enabled();
String disabled();
}
------------------------------------------------
if the class name in ui.xml is "a-b-c",then how should we write the
method name?


On Oct 12, 3:46 pm, Sarjith Pullithodi <sarji...@gmail.com> wrote:
> have you followed this way??
>
> http://code.google.com/webtoolkit/doc/latest/DevGuideUiBinder.html#Pr...

wahaha

unread,
Oct 13, 2011, 5:47:34 AM10/13/11
to Google Web Toolkit
anybody knows?

Colin Alworth

unread,
Oct 13, 2011, 8:06:09 PM10/13/11
to google-we...@googlegroups.com
The @ClassName annotation can be used "if you have class names in your css file that are not legal Java identifiers"

wahaha

unread,
Oct 21, 2011, 6:23:09 AM10/21/11
to Google Web Toolkit
ok,thanks ,i found it

`````````````````````````````````````````````````````
If you have class names in your css file that are not legal Java
identifiers, you can use the @ClassName annotation on the accessor
method:

interface MyCss extends CssResource {
@ClassName("some-other-name")
String someOtherName();
}
`````````````````````````````````````````````````````
On Oct 14, 8:06 am, Colin Alworth <niloc...@gmail.com> wrote:
> The @ClassName annotation can be used "if you have class names in your css
> file that are not legal Java identifiers"
>
> fromhttp://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.htm...
Reply all
Reply to author
Forward
0 new messages