I found something that works, even though I think that should be possible 
with less glue code...

interface TextsBundle extends ClientBundle { @Source("text.txt") 
TextResource myText(); }

class SafeHtmlTexts { 
  @Inject TextBundle texts;
  public SafeHtml myText() { return 
SafeHtmlUtils.fromSafeConstant(texts.myText().getText()); }
}

class ViewImpl {
  private final SafeHtmlTexts texts;
  @Inject public ViewImpl(..., SafeHtmlTexts texts) { this.texts = texts; 
... }
  ...
  @UiFactory SafeHtmlTexts create() { return texts; }
}

ViewImpl.ui.xml:
  <ui:with field='texts' type='....SafeHtmlTexts'/>
  ...
  <div><ui:safehtml from="{texts.myText}"/></div>


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to