|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.legacy.client.core.Template
public class Template
Represents an HTML fragment template. Templates can be precompiled for greater performance.
| Constructor Summary | |
|---|---|
Template(String html)
Creates a new template with the given html. |
|
| Method Summary | |
|---|---|
Element |
append(Element el,
LegacyParams values)
Applies the supplied values to the template and appends the new node(s) to el. |
Element |
append(Element el,
Object... values)
Applies the supplied values to the template and appends the new node(s) to el. |
String |
applyTemplate(JavaScriptObject values)
Returns an HTML fragment of this template with the specified values applied. |
String |
applyTemplate(LegacyParams values)
Returns an HTML fragment of this template with the specified values applied. |
void |
compile()
Compiles the template into an internal function, eliminating the regex overhead. |
Element |
create(LegacyParams values)
Creates a new element. |
Element |
create(Object... values)
Creates a new element. |
String |
getHtml()
|
ModelStringProvider<ModelData> |
getStringProvider()
Returns the template's string provider. |
Element |
insert(Element el,
int index,
LegacyParams values)
Applies the supplied values to the template and inserts the new node(s) at the given index. |
Element |
insertAfter(Element el,
LegacyParams params)
Applies the supplied values to the template and inserts the new node(s) after el. |
Element |
insertBefore(Element el,
LegacyParams values)
Applies the supplied values to the template and inserts the new node(s) before el. |
Element |
insertFirst(Element el,
LegacyParams values)
Applies the supplied values to the template and inserts the new node(s) as the first child of el. |
Element |
overwrite(Element el,
JavaScriptObject values)
Applies the supplied values to the template and overwrites the content of el with the new node(s). |
Element |
overwrite(Element el,
LegacyParams values)
Applies the supplied values to the template and overwrites the content of el with the new node(s). |
void |
set(String html,
boolean compile)
Sets the HTML used as the template and optionally compiles it. |
void |
setStringProvider(ModelStringProvider<ModelData> stringProvider)
Sets the string provider for the template. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Template(String html)
html - the HTML fragment or an array| Method Detail |
|---|
public Element append(Element el,
Object... values)
el - the context elementvalues - the positional template values
public Element append(Element el,
LegacyParams values)
el - the context elementvalues - the template values
public String applyTemplate(JavaScriptObject values)
values - the substitution values
public String applyTemplate(LegacyParams values)
values - the values
public void compile()
public Element create(Object... values)
values - the substitution values
public Element create(LegacyParams values)
values - the substitution values
public String getHtml()
public ModelStringProvider<ModelData> getStringProvider()
public Element insert(Element el,
int index,
LegacyParams values)
el - the context elementindex - the insert indexvalues - the values
public Element insertAfter(Element el,
LegacyParams params)
el - the context elementparams - the values
public Element insertBefore(Element el,
LegacyParams values)
el - the context elementvalues - the values
public Element insertFirst(Element el,
LegacyParams values)
el - the context elementvalues - the values
public Element overwrite(Element el,
LegacyParams values)
el - the context elementvalues - the values
public Element overwrite(Element el,
JavaScriptObject values)
el - the context elementvalues - the values
public void set(String html,
boolean compile)
html - the html fragmentcompile - true to compilepublic void setStringProvider(ModelStringProvider<ModelData> stringProvider)
stringProvider - the string provider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||