How to rewrite ClientBundle images to static uibinder images?

30 views
Skip to first unread message

membersound

unread,
Dec 27, 2012, 8:52:46 AM12/27/12
to google-we...@googlegroups.com
I know how to use images in general with uibinder, like:

.ui.xml:
<g:Image resource='{res.image}' />


.java:
public interface Resources extends ClientBundle {
    @Source("image.png")
    @ImageOptions(repeatStyle = RepeatStyle.None)
    ImageResource image();
}

But in case of static images, how can I use the same image in the same way, but without having to write any java code? Just using uibinder?

Thomas Broyer

unread,
Dec 28, 2012, 2:12:20 PM12/28/12
to google-we...@googlegroups.com
Each UiBinder template defines an implicit ClientBundle. You can declare a CssResource using <ui:style>, a DataResource with <ui:data> and an ImageResource with <ui:image>:

<ui:image field="image" src="image.png" repeatStyle="None"/> (there's also a flipRtl="true" attribute; and just like the @Source is optional, src="" is optional too)
 
Reply all
Reply to author
Forward
0 new messages