Just like to reiterate what Thomas Broyer said: Use DataResource with @url. It works a treat and, IMO, is a much easier solution.
http://code.google.com/webtoolkit/doc/latest/DevGuideClientBundle.html#References_to_Data_Resources On Mar 15, 3:33 pm, davidroe <roe.da...@gmail.com> wrote: > yes, sorry, I missed that line. > > StyleInjector.inject(Resources.INSTANCE.whateverCss().getText(),true); > > On Mar 14, 4:04 pm, Michael <michael.guy...@gmail.com> wrote: > > > Ah... simply calling the .ensureInjected method from the EntryPoint is > > enough - got it. Thanks! > > > Mike > > > On Mar 14, 10:46 pm, MH <mhaligow...@googlemail.com> wrote: > > > > Found the solution. The problem is that the style is _not_ injected. I > > > solved this by adding the proper ensureInjected in the widget's class. > > > > 2010/3/14 Michael <michael.guy...@gmail.com> > > > > > I've also tried this approach and while theCSSis compiled and the > > > > obfuscated selector-name is used in the generated HTML, the the > > > > selector definition is not included in the page. You could access the > > > > definition by calling the .getText() method of the generated > > > > ClientBundle implementation - but surely GWT should do the inclusion > > > > for you? > > > > > On Mar 11, 8:30 am, MH <mhaligow...@googlemail.com> wrote: > > > > > Well, the problem does not seem to be the image. > > > > > > The CssResource interface I wrote is compiled properly, the XML I made > > > > for > > > > > thew widget works fine as well. It look like if the ui:with does not > > > > throw > > > > > ensureInjected or something. The styles are applied, but they are > > > > > empty. > > > > > > Regards, > > > > > mh > > > > > > 2010/3/11 davidroe <roe.da...@gmail.com> > > > > > > > I forgot this part - does that help? > > > > > > > �...@source("com/whoever/client/resources/myImage.png") > > > > > > publicImageResourcemyImage(); > > > > > > > On Mar 10, 2:16 pm, MH <mhaligow...@googlemail.com> wrote: > > > > > > > I'm afraid this one does not work for me. > > > > > > > > I did exactly as mentioned, and my widget seems to be not using > > > > > > > style > > > > at > > > > > > > all. Shall I also add anything to the class itself? > > > > > > > > 2010/3/10 davidroe <roe.da...@gmail.com> > > > > > > > > > this is how I did it. > > > > > > > > > in whatever.css: > > > > > > > > > @sprite .myClass { > > > > > > > > gwt-image: "myImage"; > > > > > > > > width: auto; height: auto; > > > > > > > > background-repeat: repeat; > > > > > > > > background-position: 0% 0%; > > > > > > > > } > > > > > > > > > in Resources.java: > > > > > > > > > public interface Resources extends ClientBundle { > > > > > > > > > ... > > > > > > > > > public interface WhateverCss extends CssResource { > > > > > > > > String myClass(); > > > > > > > > } > > > > > > > > > �...@source("com/whoever/client/resources/whatever.css") > > > > > > > > public WhateverCss whateverCss(); > > > > > > > > > } > > > > > > > > > in WhateverClass.ui.xml: > > > > > > > > > <ui:with field="res" > > > > > > > > type="com.whoever.client.resources.Resources" > > > > / > > > > > > > > > <div class="{res.whateverCss.myClass}"> > > > > > > > > > HTH, > > > > > > > > /dave > > > > > > > > > On Mar 10, 8:52 am, Michael <michael.guy...@gmail.com> wrote: > > > > > > > > > Hi there, > > > > > > > > > > I'm having a go at using the declarative layout and was > > > > > > > > > wondering > > > > if > > > > > > > > > there's a way of using an image declared in a ClientBundle as > > > > > > > > > a > > > > > > > > > background-image in the ui:style section, thus: > > > > > > > > > > <ui:UiBinder > > > > > > > > > xmlns:ui="urn:ui:com.google.gwt.uibinder" > > > > > > > > > xmlns:g="urn:import:com.google.gwt.user.client.ui"> > > > > > > > > > <ui:with field="res" > > > > type="com.mycompany.MyClientBundle"/> > > > > > > > > > > <ui:style> > > > > > > > > > .banner { > > > > > background-image:url('res.menuBackground'); > > > > > > > > > } > > > > > > > > > </ui:style> > > > > > > > > > </ui:UiBinder> > > > > > > > > > > If not, how are you supposed to do that? > > > > > > > > > > Cheers > > > > > > > > > > Mike > > > > > > > > > -- > > > > > > > > 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-web-tool...@googlegroups.com. > > > > > > > > To unsubscribe from this group, send email to > > > > > > > > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs > > > > > > > > cr...@googlegroups.com> > > > > <google-web-toolkit%2bunsubscr...@googlegroups.com<google-web-toolkit%252Bu > > > > nsubscr...@googlegroups.com> > > > > ><google-web-toolkit%2Bunsubs > > > > > > cr...@googlegroups.com> > > > > > > > > . > > > > > > > > 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 > > > > google-web-tool...@googlegroups.com. > > > > > > To unsubscribe from this group, send email to > > > > > > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs > > > > > > cr...@googlegroups.com> > > > > <google-web-toolkit%2bunsubscr...@googlegroups.com<google-web-toolkit%252Bu > > > > nsubscr...@googlegroups.com> > > > > > > > . > > > > > > 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 > > > > google-web-tool...@googlegroups.com. > > > > To unsubscribe from this group, send email to > > > > google-web-toolkit+unsubscr...@googlegroups.com<google-web-toolkit%2Bunsubs > > > > cr...@googlegroups.com> > > > > . > > > > 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 google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.