java.lang.Object | |
↳ | com.google.gwt.uibinder.rebind.UiBinderWriter |
Writer for UiBinder generated classes. TODO(rdamazio): Refactor this, extract model classes, improve ordering guarantees, etc. TODO(rjrjr): Line numbers in error messages.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.google.gwt.uibinder.rebind.Statements
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Add a statement to be executed right after the current attached element is
detached.
| |||||||||||
Add a statement to be run after everything has been instantiated, in the
style of
format(String, Object...) . | |||||||||||
Adds a statement to the block run after fields are declared, in the style
of
format(String, Object...) . | |||||||||||
Begin a section where a new attachable element is being parsed--that is,
one that will be constructed as a big innerHTML string, and then briefly
attached to the dom to allow fields accessing its to be filled (at the
moment, HasHTMLParser, HTMLPanelParser, and DomElementParser.).
| |||||||||||
Declare a field that will hold an Element instance.
| |||||||||||
Declare a variable that will be filled at runtime with a unique id, safe
for use as a dom element's id attribute.
| |||||||||||
Declares a field of the given type name, returning the name of the declared
field.
| |||||||||||
If this element has a gwt:field attribute, create a field for it of the
appropriate type, and return the field name.
| |||||||||||
Given a string containing tokens returned by
tokenForExpression(String) or
declareDomField(String) , return a string with those tokens replaced by the
appropriate expressions. | |||||||||||
Post an error message and halt processing.
| |||||||||||
Post an error message about a specific XMLElement and halt processing.
| |||||||||||
Post an error message and halt processing.
| |||||||||||
End the current attachable section.
| |||||||||||
Ensure that the specified element is attached to the DOM.
| |||||||||||
Ensure that the specified field is attached to the DOM.
| |||||||||||
Escape text that will be part of a string literal to be interpreted at
runtime as an HTML attribute value.
| |||||||||||
Escape text that will be part of a string literal to be interpreted at
runtime as HTML, optionally preserving whitespace.
| |||||||||||
Escape characters that would mess up interpretation of this string as a
string literal in generated code (that is, protect \, \n and " ).
| |||||||||||
Finds the JClassType that corresponds to this XMLElement, which must be a
Widget or an Element.
| |||||||||||
Generates the code to set a property value (assumes that 'value' is a valid
Java expression).
| |||||||||||
Generates the code to set a string property.
| |||||||||||
This method is deprecated.
exists only to support
BundleAttributeParser , which
will be leaving us soon.
| |||||||||||
Returns the
DesignTimeUtils , not null . | |||||||||||
Returns the logger, at least until we get get it handed off to parsers via
constructor args.
| |||||||||||
Get the
MessagesWriter for this UI, generating it if necessary. | |||||||||||
Gets the type oracle.
| |||||||||||
Parses the object associated with the specified element, and returns the
name of the field (possibly private) that will hold it.
| |||||||||||
Gives the writer the initializer to use for this field instead of the
default GWT.create call.
| |||||||||||
Instructs the writer to initialize the field with a specific constructor
invocation, instead of the default GWT.create call.
| |||||||||||
Returns a string token that can be used in place the given expression
inside any string literals.
| |||||||||||
Post a warning message.
| |||||||||||
Post a warning message.
| |||||||||||
Post a warning message.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.uibinder.rebind.Statements
|
UnableToCompleteException |
---|
Add a statement to be executed right after the current attached element is detached. This is useful for doing things that might be expensive while the element is attached to the DOM.
Add a statement to be run after everything has been instantiated, in the
style of format(String, Object...)
.
Adds a statement to the block run after fields are declared, in the style
of format(String, Object...)
.
Begin a section where a new attachable element is being parsed--that is, one that will be constructed as a big innerHTML string, and then briefly attached to the dom to allow fields accessing its to be filled (at the moment, HasHTMLParser, HTMLPanelParser, and DomElementParser.).
Succeeding calls made to ensureAttached()
and
#ensureFieldAttached must refer to children of this element, until
endAttachedSection()
is called.
element | Java expression for the generated code that will return the dom element to be attached. |
---|
Declare a field that will hold an Element instance. Returns a token that the caller must set as the id attribute of that element in whatever innerHTML expression will reproduce it at runtime.
In the generated code, this token will be replaced by an expression to generate a unique dom id at runtime. Further code will be generated to be run after widgets are instantiated, to use that dom id in a getElementById call and assign the Element instance to its field.
fieldName | The name of the field being declared |
---|
UnableToCompleteException |
---|
Declare a variable that will be filled at runtime with a unique id, safe for use as a dom element's id attribute.
UnableToCompleteException |
---|
Declares a field of the given type name, returning the name of the declared field. If the element has a field or id attribute, use its value. Otherwise, create and return a new, private field name for it.
UnableToCompleteException |
---|
If this element has a gwt:field attribute, create a field for it of the appropriate type, and return the field name. If no gwt:field attribute is found, do nothing and return null
UnableToCompleteException |
---|
Given a string containing tokens returned by tokenForExpression(String)
or
declareDomField(String)
, return a string with those tokens replaced by the
appropriate expressions. (It is not normally necessary for an
XMLElement.Interpreter
or ElementParser
to make this call,
as the tokens are typically replaced by the TemplateWriter itself.)
Post an error message and halt processing. This method always throws an UnableToCompleteException
UnableToCompleteException |
---|
Post an error message about a specific XMLElement and halt processing. This method always throws an UnableToCompleteException
UnableToCompleteException |
---|
Post an error message and halt processing. This method always throws an UnableToCompleteException
UnableToCompleteException |
---|
End the current attachable section. This will detach the element if it was ever attached and execute any detach statements.
Ensure that the specified element is attached to the DOM.
Ensure that the specified field is attached to the DOM. The field must hold
an object that responds to Element getElement(). Convenience wrapper for
ensureAttached(field + ".getElement()")
.
Escape text that will be part of a string literal to be interpreted at runtime as an HTML attribute value.
Escape text that will be part of a string literal to be interpreted at runtime as HTML, optionally preserving whitespace.
Escape characters that would mess up interpretation of this string as a string literal in generated code (that is, protect \, \n and " ).
Finds the JClassType that corresponds to this XMLElement, which must be a Widget or an Element.
UnableToCompleteException | If no such widget class exists |
---|---|
RuntimeException | if asked to handle a non-widget, non-DOM element |
Generates the code to set a property value (assumes that 'value' is a valid Java expression).
Generates the code to set a string property.
This method is deprecated.
exists only to support BundleAttributeParser
, which
will be leaving us soon.
Finds an attribute BundleAttributeParser
for the given xml
attribute, if any, based on its namespace uri.
UnableToCompleteException |
---|
Returns the logger, at least until we get get it handed off to parsers via constructor args.
Get the MessagesWriter
for this UI, generating it if necessary.
Gets the type oracle.
Parses the object associated with the specified element, and returns the name of the field (possibly private) that will hold it. The element is likely to make recursive calls back to this method to have its children parsed.
elem | the xml element to be parsed |
---|
UnableToCompleteException |
---|
Gives the writer the initializer to use for this field instead of the default GWT.create call.
IllegalStateException | if an initializer has already been set |
---|
Instructs the writer to initialize the field with a specific constructor invocation, instead of the default GWT.create call.
fieldName | the field to initialize |
---|---|
type | the type of the field |
args | arguments to the constructor call |
Returns a string token that can be used in place the given expression inside any string literals. Before the generated code is written, the expression will be stiched back into the generated code in place of the token, surrounded by plus signs. This is useful in strings to be handed to setInnerHTML() and setText() calls, to allow a unique dom id attribute or other runtime expression in the string.