A somewhat convoluted way of doing this is as follows. The resulting
javascript code is actually very good and 99% of the time just the string
literal for the def will be included.
@def COLOR_ONE #3B5998;
@def COLOR_TWO #DFE4EE;
@def COLOR_THREE #FFFFFF;
@def COLOR_FOUR #6792AB;
@def COLOR_FIVE #000000;
----CommonBundle----
package com.somepackage
public interface CommonBundle extends ClientBundle {
@Source("definitions.css")
Definitions definitions();
@Shared
public interface Definitions extends CssResource {
String COLOR_ONE();
String COLOR_TWO();
String COLOR_THREE();
String COLOR_FOUR();
String COLOR_FIVE();
}
public static final CommonBundle INSTANCE =
GWT.create(CommonBundle.class);
public static final Definitions CSS = INSTANCE.css();
}
---- UiBinder ----
<ui:style>
@eval COLOR_THREE com.somepackage.CommonBundle.CSS.COLOR_THREE();
.outerLabel {
color: COLOR_THREE;
}
</ui:style>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/Ma2mfE2DX4oJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.