I've been playing around with this for a couple of days, to great
frustration. Can't get it to work.
I followed the example here:
http://code.google.com/p/google-web-toolkit/wiki/ClientBundle#Examples
That doesn't work either. The call to Window.Alert to print out the
css shows no text.
I also noticed a few other things.
1) I took to naming my styles with hyphens, just like in all the GWT
examples. Hyphens are not allowed.
2) The app won't start. An error message appears and the fix was to
add "@external" to the front of my styles. But WHY? Nothing I did
was any different from the GWT samples and none of them used
@external. So, I just did something for which I have no understanding
(the documentation is not helpful). I'd like to know, when is
@external not needed?
3) I am using uibinder and removed my css file from the war directory
and moved it someplace where the CssResource can access it (in the
class hierarchy). Now those styles are not being picked up. Probably
because the enjureInjected() isn't working. Or maybe ensureInjected()
doesn't work with uibinder. Haven't been able to get far enough to
determine.
I would like to see some decent documentation. It is nice to have
step by step just-do-it-this-way instructions. But when that doesn't
work, I have no idea why I am doing what I am doing. Seems like the
docs are written for those who already understand GWT, which kind of
defeats the purpose.
Mike
On Sep 8, 1:23 pm, Ernesto Oltra <
ernestoka...@gmail.com> wrote:
> Sorry, I meant if you use the CssResource to bundle your stylesheets
> together with your app, it has a method ensureInjected(). The load process
> would be something like that:
>
> Host page -> GWT code -> standard.css -> Your code -> Your CSS file injected
>
> So it's easier to overwrite styles in this way.
>
> Sample code:
>
> public interface Resources extends ClientBundle {
>
> public static final Resources INSTANCE = GWT.create(Resources.class);
>
> public interface Style extends CssResource {
> String myCssClassHere();
> String myCssClassHere2();
> }
>
> @ClientBundle.Source("Style.css")
> @CssResource.NotStrict // If a class is present in the css file,
> Style css(); //but not in the interface, don't
> // return any compiler errors
>
> ImageResource blahBlah();
> // Othere resources....
>
> }
>
> public class MyApp implements EntryPoint {
>
> public void onModuleLoadSafe() {
> Resources.INSTANCE.css().ensureInjected();
> }
>
> }
>
> 2011/9/8 Tobias <
to.s...@gmail.com>
>
>
>
>
>
>
>
> > I am currently also struggling with that issue, see:
>
> >
http://groups.google.com/group/google-web-toolkit/browse_thread/threa...