Hi all,
We're starting using UiBinder quite intensively and one thing we
haven't been able to do is to declare some constants in a CssResource
and reuse them in our ui.xml (I believe this is unrelated to UiBinder
actually, as I don't know how it could be made to work with plain old
CssResources only).
Our use case is I believe very common: declare constants for common
colors to be shared thoughout the app (namely some kind of orange and
grays for use with borders, fore color and back color). I suspect we
might have the need for font sizes too.
As a last resort, I tried the following (which forces me to have the
common CSS file in the same package as my ui.xml file):
<!-- mystyle.css has @def yellow red -->
<!-- and MyStyle has a String yellow() method -->
<ui:style field='common' src='mystyle.css'
type='com.my.app.client.MyStyle' />
<ui:style>
@def yellow value('common.yellow');
.foo { color: yellow; }
</ui:style>
but it fails with:
Scanning for additional dependencies: ...\gen\com\my\app\client
\Test_MyBinderImpl.java
Computing all possible rebind results for
'com.my.app.client.Test_MyBinderImpl_GenBundle'
Rebinding com.my.app.client.Test_MyBinderImpl_GenBundle
Invoking <generate-with
class='com.google.gwt.resources.rebind.context.InlineClientBundleGenerator'/
>
Creating assignment for style()
Performing substitution in node color : .....
;
[ERROR] Could not find no-arg method named yellow
in type com.my.app.client.Test_MyBinderImpl_GenCss_common
Is there a way to reuse @def-s in other CssResource-s? (in other
ClientBundle-s!) and which one?
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---