Try adding a call to resources.css.ensureInjected(). I've seen that problem
before and I think the call ensureInjected() fixed it.

-- Brian


On Thu, Jul 7, 2011 at 1:15 PM, Lars <[email protected]> wrote:

> So, I've had success using UiBinder to declare styles in <ui:style> blocks
> and then accessing them in my .java file via:
>
> interface Styles extends CssResource {
>    String hideAdditionalFilters();
>    String showAdditionalFilters();
> }
>
> Now I have a class that does NOT have an associated UiBinder file and am
> attempting to access styles in a .css file like the example shown here:
>
> http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#CssResourceCookbook
>
> So, in my .css file (LinkBox.css) I have:
> .TwistyPanel {
>     margin-top: 25px;
>     background-color: orange;
> }
>
> Then in my .java file, I have:
> interface LinkBoxCss extends CssResource {
>    String TwistyPanel();
> }
> interface MyResources extends ClientBundle {
>     @Source("LinkBox.css")
>     LinkBoxCss css();
> }
> MyResources resources = GWT.create(MyResources.class);
>
> ...
>
> VerticalPanel root = new VerticalPanel();
> root.addStyleName(resources.css().TwistyPanel());
>
> Now, when I run this in debug mode I can see the obfuscated class name on
> the <table> tag representing the VerticalPanel. However, the styles
> associated with .TwistyPanel (i.e. the background color and margin) are not
> applied... Its as if the obfuscated class name has no rules defined in it at
> all...
>
> Am I missing something here?  Am I supposed to call "ensureInjected"
> somewhere? Am I supposed to inherit a module somewhere?
>
> Thanks for your time.
>
> --
> 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/-/NUGIkufQUkwJ.
> 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.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
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.

Reply via email to