GWT access style defined inside .ui.xml within corresponding .java file
Some times you may want to access styles defined inside your Sample.ui.xml file which you want to access/use from within Sample.java widget class. You can do that by defining an interface which extends from com.google.gwt.resources.client.CssResource and declaring method with name matching exactly that of required style class name that you have declared inside ui.xml. Refer below code.
Sample.ui.xml contents
<src path>/com/pandurang/client/ui/Sample.ui.xml <ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' xmlns:g='urn:import:com.google.gwt.user.client.ui'> . . . <ui:style type="com.pandurang.client.ui.Sample.MyStyle"> .domain { margin: 0 auto; width: 730px; } .
[Read More]