Hello,
I have a common module, module1.gwt.xml . It is not an entry point class. It is just inherited from main module.
In common module, i have a widget and its respective ui.xml file which i want to reuse in other module.
package - common.client.view.
MyWidget.ui.xml:
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
xmlns:g="urn:import:com.google.gwt.user.client.ui">
<ui:style field='myStyle' src="Common.css"/>
<g:HTMLPanel>
<div class="{myStyle.sectionContent}">
<g:VerticalPanel styleName="{myStyle.sectionContent}" ui:field="panel"/>
</div>
</g:HTMLPanel>
MyWidget:
public class MyWidget extends Composite implements LeafValueEditor<List<String>>
{
private static MyWidgetUiBinder uiBinder = GWT.create(MyWidgetUiBinder .class);
@UiTemplate("MyWidget.ui.xml")
interface MyWidgetUiBinder extends UiBinder<Widget, MyWidgetUiBinder >
{
}
.....
}
</ui:UiBinder>
Now i have another module, which is the application module and is an EntryPoint class.
I want to reuse the common ui.xml file in the application module.
I reused it in the following way with the fully qualified name for the uitemplate annotation as below:
package: application.client.view
public class MyApplicationWidget extends Composite implements LeafValueEditor<List<String>>
{
private static MyApplicationWidgetUiBinder uiBinder = GWT.create(MyApplicationWidget .class);
@UiTemplate("common.client.view.MyWidget.ui.xml")
interface MyApplicationWidgetUiBinder extends UiBinder<Widget, MyApplicationWidget >
{
}
...
}
But, when i compile this code using GWT compiler, it gives the compilation error saying it cannot find Common.css:
Below is the snippet:
Invoking generator com.google.gwt.uibinder.rebind.UiBinderGenerator
ERROR] Unable to find resource: application/client/view/FACommon.css
validating {myStyle.sectionContent}
[ERROR] Can't interpret CSS
[ERROR] Could not find no-arg method named sectionContent in type com.google.gwt.resources.client.CssResource.
It is trying to find the CSS file in the same path where the view(widget) is.
Could anybody help if there is anyway where in we can override this behaviour of GWT and keep the CSS file from wherever we want.
Any help is appreciated.