Created
May 9, 2013 16:57
-
-
Save niloc132/5548820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Sample implements IsWidget { | |
private final Binder binder = GWT.create(Binder.class); | |
private Widget root; | |
@UiField(provided=true) MyBundle bundle = GWT.create(MyBundle.class); | |
public Sample() { | |
//first, provided items | |
bundle.myCss().ensureInjected(); | |
//then, run the uibinder | |
root = binder.createAndBind(this); | |
} | |
public Widget asWidget() { | |
return root; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' ...> | |
<!-- because we call it bundle here... --> | |
<ui:with type="package.to.my.client.MyBundle" field="bundle" /> | |
<!-- ... we can reference it here --> | |
<g:Widget addStyleName="{bundle.myCss.style}"... /> | |
</ui:UiBinder> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment