- Code: Select all
public class BaseWidget extends Composite
{
public static i18nConstants ouri18nConstants = null;
public BaseWidget()
{
if (ouri18nConstants == null)
{
if (!isDesignTime())
{
ouri18nConstants = (i18nConstants) GWT.create(i18nConstants.class);
}
}
}
}
This is all fine and good, except that when you go to use the Design View of Designer, ouri18nConstants is null, so the page doesn't render and the log shows NullPointerException for each call to a method in the i18nConstants class.
If we don't use the isDesignTime method, the pages won't render either b/c Designer can't instantiate the i18nConstants class in Design View.
Example: In a derived class:
- Code: Select all
Label panelHeaderLabel = new Label(ouri18nConstants.header());
Is there a way around this problem?
Thanks!