javagwtuibinder

Creating @UiTemplate on a GWT application


I have this class here that I can't find the respective .ui.xml file. After reading some doc's I understood that this .ui.xml file should be in the same package as the respective class, is that correct?

What should be the layout of the .ui.xml file of the following class?

public class ConfigurableWidgetHandheld  {
private static final ConfigurableWidgetHandheld.HandheldUiBinder _uiBinder = (ConfigurableWidgetHandheld.HandheldUiBinder) GWT.create(ConfigurableWidgetHandheld.HandheldUiBinder.class);
@UiField
Label lblTitle;
@UiField
Label lblDescription;
@UiField
FlexPanel formPanel;
@UiField
FlexPanel contextPanel;
@UiField
FlexPanel mainPanel;
@UiField
FlexPanel titlePanel;
@UiField
FlexPanel fullScreenHeaderPanel;

@UiTemplate("ConfigurableWidgetHandheld.ui.xml")
public interface HandheldUiBinder extends UiBinder<Widget, ConfigurableWidgetHandheld> {
}

}


Solution

  • Yes, the file ConfigurableWidgetHandheld.ui.xml should be in the same package.

    Depending on your build system, you could have multiple directories/folders holding files for the same package. For example, if using maven, you might have the following:

    Both these files will go into the same package, my.package