public class FieldWriterOfLazyDomElement extends Object
LazyDomElement
.Constructor and Description |
---|
FieldWriterOfLazyDomElement(FieldManager manager,
com.google.gwt.core.ext.typeinfo.JClassType templateFieldType,
OwnerField ownerField,
MortalLogger logger) |
Modifier and Type | Method and Description |
---|---|
void |
addAttachStatement(String format,
Object... args)
Add a statement to be executed right after the current field is attached.
|
void |
addDetachStatement(String format,
Object... args)
Add a statement to be executed right after the current field is detached.
|
void |
addStatement(String format,
Object... args)
Add a statement for the given field, executed right after its creation.
|
com.google.gwt.core.ext.typeinfo.JClassType |
getAssignableType()
Returns the type of this field, or for generated types the type it extends.
|
int |
getBuildPrecedence()
Gets this field builder precedence.
|
FieldWriterType |
getFieldType()
Gets the type of this field.
|
String |
getHtml()
Returns the string html representation of the field.
|
String |
getInitializer()
Returns the custom initializer for this field, or null if it is not set.
|
com.google.gwt.core.ext.typeinfo.JClassType |
getInstantiableType()
Returns the type of this field, or null if this field is of a type that has
not yet been generated.
|
String |
getName()
Get the name of the field.
|
String |
getNextReference()
Returns the expression that to evaluate to get the contents of this field.
|
String |
getQualifiedSourceName()
Returns the qualified source name of this type.
|
com.google.gwt.core.ext.typeinfo.JType |
getReturnType(String[] path,
MonitoredLogger logger)
Returns the return type found at the end of the given method call
path, which must begin with the receiver's name, or null if the
path is invalid.
|
String |
getSafeHtml()
Returns the string SafeHtml representation of the field.
|
void |
needs(FieldWriter f)
Declares that the receiver depends upon the given field.
|
void |
setBuildPrecedence(int precedence)
Sets the precedence of this field builder.
|
void |
setHtml(String html)
Sets the html representation of the field for applicable field types.
|
void |
setInitializer(String initializer)
Used to provide an initializer string to use instead of a
GWT.create(java.lang.Class<?>) call. |
String |
toString() |
void |
write(IndentedWriter w)
Write the field declaration.
|
void |
writeFieldBuilder(IndentedWriter w,
int getterCount,
OwnerField ownerField)
Write this field builder in the Widgets inner class.
|
void |
writeFieldDefinition(IndentedWriter w,
com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle,
OwnerField ownerField,
DesignTimeUtils designTime,
int getterCount,
boolean useLazyWidgetBuilders)
Output the getter and builder definitions for the given field.
|
public FieldWriterOfLazyDomElement(FieldManager manager, com.google.gwt.core.ext.typeinfo.JClassType templateFieldType, OwnerField ownerField, MortalLogger logger) throws com.google.gwt.core.ext.UnableToCompleteException
com.google.gwt.core.ext.UnableToCompleteException
public com.google.gwt.core.ext.typeinfo.JClassType getAssignableType()
FieldWriter
public com.google.gwt.core.ext.typeinfo.JClassType getInstantiableType()
FieldWriter
public String getQualifiedSourceName()
FieldWriter
public void addAttachStatement(String format, Object... args)
FieldWriter
HTMLPanel panel = new HTMLPanel( "..."); // statement section. widgetX.setStyleName("someCss"); widgetX.setVisible(true); // attach section. UiBinderUtil.TempAttachment attachRecord = UiBinderUtil.attachToDom(panel.getElement()); get_domId0Element().get(); get_domId1Element().get(); // detach section. attachRecord.detach(); panel.addAndReplaceElement(get_someWidget(), get_domId0Element().get()); panel.addAndReplaceElement(get_otherWidget(), get_domId1Element().get());
addAttachStatement
in interface FieldWriter
public void addDetachStatement(String format, Object... args)
FieldWriter
FieldWriter.addAttachStatement(java.lang.String, java.lang.Object...)
.addDetachStatement
in interface FieldWriter
public void addStatement(String format, Object... args)
FieldWriter
WidgetX widgetX = GWT.create(WidgetX.class); // statement section. widgetX.setStyleName("someCss"); widgetX.setVisible(true);
addStatement
in interface FieldWriter
public int getBuildPrecedence()
FieldWriter
getBuildPrecedence
in interface FieldWriter
public FieldWriterType getFieldType()
FieldWriter
getFieldType
in interface FieldWriter
public String getHtml()
FieldWriter
getHtml
in interface FieldWriter
public String getInitializer()
FieldWriter
getInitializer
in interface FieldWriter
public String getName()
FieldWriter
getName
in interface FieldWriter
public String getNextReference()
FieldWriter
getNextReference
in interface FieldWriter
public com.google.gwt.core.ext.typeinfo.JType getReturnType(String[] path, MonitoredLogger logger)
FieldWriter
getReturnType
in interface FieldWriter
public String getSafeHtml()
FieldWriter
getSafeHtml
in interface FieldWriter
public void needs(FieldWriter f)
FieldWriter
needs
in interface FieldWriter
public void setBuildPrecedence(int precedence)
FieldWriter
setBuildPrecedence
in interface FieldWriter
public void setHtml(String html)
FieldWriter
setHtml
in interface FieldWriter
public void setInitializer(String initializer)
FieldWriter
GWT.create(java.lang.Class<?>)
call. Note that this is an
RHS expression. Don't include the leading '=', and don't end it with ';'.setInitializer
in interface FieldWriter
public void write(IndentedWriter w) throws com.google.gwt.core.ext.UnableToCompleteException
FieldWriter
write
in interface FieldWriter
com.google.gwt.core.ext.UnableToCompleteException
public void writeFieldBuilder(IndentedWriter w, int getterCount, OwnerField ownerField)
FieldWriter
com.google.gwt.uibinder.rebind.FieldWriter#writeFieldGetter
.writeFieldBuilder
in interface FieldWriter
public void writeFieldDefinition(IndentedWriter w, com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle, OwnerField ownerField, DesignTimeUtils designTime, int getterCount, boolean useLazyWidgetBuilders) throws com.google.gwt.core.ext.UnableToCompleteException
FieldWriter
Example for widgets called only once:
private WidgetX get_widgetX() { return build_widgetX(); } private WidgetX build_widgetX() { widget = GWT.create(WidgetX.class); widget.setStyleName("css"); return widgetX; }Notice that there's no field and the getter just fallback to the builder.
Example for widgets called more than once:
private WidgetX widgetX; private WidgetX get_widgetX() { return widgetX; } private WidgetX build_widgetX() { widget = GWT.create(WidgetX.class); widget.setStyleName("css"); return widgetX; }Notice that the getter just returns the field. The builder is called in the Widgets ctor.
writeFieldDefinition
in interface FieldWriter
com.google.gwt.core.ext.UnableToCompleteException
Copyright © 2016. All rights reserved.