Class WidgetPlaceholderInterpreter
java.lang.Object
com.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter
com.google.gwt.uibinder.elementparsers.HtmlPlaceholderInterpreter
com.google.gwt.uibinder.elementparsers.WidgetPlaceholderInterpreter
- All Implemented Interfaces:
com.google.gwt.uibinder.rebind.XMLElement.Interpreter<String>
,com.google.gwt.uibinder.rebind.XMLElement.PostProcessingInterpreter<String>
Used by
HTMLPanelParser
. Refines HtmlPlaceholderInterpreter
to allow widgets to appear inside msg elements in an HTMLPanel.
HasText and HasHTML get special treatment, where their innerText or innerHTML become part of the @Default value of the message being generated. E.g., this markup in an HTMLPanel:
invalid input: '<'m:msg>Hello <gwt:HyperLink>click here</gwt:HyperLink> thank you.invalid input: '<'/m:msg>becomes a message like this:
@Default("Hello {0}click here{1} thank you.") String getMessage1( @Example("<span>") String widget1Begin, @Example("</span>") String widget1End );
The contents of other widget types are opaque to the message, and are covered by a single placeholder. One implication of this is that the content of an HTMLPanel inside a msg in another HTMLPanel must always be in a separate message.
-
Field Summary
Fields inherited from class com.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter
message, tokenator, uiWriter
-
Constructor Summary
ConstructorDescriptionWidgetPlaceholderInterpreter
(String fieldName, com.google.gwt.uibinder.rebind.UiBinderWriter writer, com.google.gwt.uibinder.rebind.messages.MessageWriter message, String ancestorExpression) -
Method Summary
Modifier and TypeMethodDescriptioninterpretElement
(com.google.gwt.uibinder.rebind.XMLElement elem) Given an XMLElement, return its filtered value.postProcess
(String consumed) Called byXMLElement.consumeInnerHtml(com.google.gwt.uibinder.rebind.XMLElement.Interpreter<java.lang.String>)
after all elements have been handed tointerpretElement(com.google.gwt.uibinder.rebind.XMLElement)
.Methods inherited from class com.google.gwt.uibinder.elementparsers.HtmlPlaceholderInterpreter
consumePlaceholderInnards, nextClosePlaceholder, nextOpenPlaceholder
Methods inherited from class com.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter
nextPlaceholder, stripTokens
-
Constructor Details
-
WidgetPlaceholderInterpreter
-
-
Method Details
-
interpretElement
public String interpretElement(com.google.gwt.uibinder.rebind.XMLElement elem) throws UnableToCompleteException Description copied from interface:com.google.gwt.uibinder.rebind.XMLElement.Interpreter
Given an XMLElement, return its filtered value.- Specified by:
interpretElement
in interfacecom.google.gwt.uibinder.rebind.XMLElement.Interpreter<String>
- Overrides:
interpretElement
in classHtmlPlaceholderInterpreter
- Throws:
UnableToCompleteException
- on error
-
postProcess
Called byXMLElement.consumeInnerHtml(com.google.gwt.uibinder.rebind.XMLElement.Interpreter<java.lang.String>)
after all elements have been handed tointerpretElement(com.google.gwt.uibinder.rebind.XMLElement)
.- Specified by:
postProcess
in interfacecom.google.gwt.uibinder.rebind.XMLElement.PostProcessingInterpreter<String>
- Overrides:
postProcess
in classcom.google.gwt.uibinder.rebind.messages.PlaceholderInterpreter
- Throws:
UnableToCompleteException
-