I’ve defined a ClientBundle, a Style interface and hooked it up with my css file via the @source annotation.
I have two questions:
-
when I use
<ui:with>in my uibinder file I get the following exception:Deferred binding result type MyStyle should not be abstract.Can someone explain what’s going on? And how I can include the style correctly in my uibinder file? -
I’d like to share the resource across many uibinder without paying the penalty of initializing the style every time. Gwt’s anemic dev guide, suggests using the
UiField(provided=true)or using a@uiFactory. Although I’ve successfully used @uiFactory in order to use my own custom widgets. I have no idea how to use a @uiFactory to inject a style into the uiBinder.
For example:
//in pojo
@UiFactory
public MyStyle getMyStyle() {
return myStyle;
}
//in uibinder
<g:Label addStyleNames="{myStyle.defaultLable}"/>
how can i get this work?
Thanks in advance.
I use the following construction in the uibinder file:
Where
MyResourceis an interface containing the css resource:and
MyCssResourceis:In uibinder file this is used as follows: