use of org.apache.tapestry5.MarkupWriter in project tapestry-5 by apache.
the class OverrideMixin method afterRender.
void afterRender(MarkupWriter writer) {
final Element element = writer.getDocument().getElementById(clientElement.getClientId());
element.element("span", "id", "overrideMixin").text(" [Override mixin]");
}
use of org.apache.tapestry5.MarkupWriter in project tapestry-5 by apache.
the class ConfigureHTMLElementFilter method renderMarkup.
public void renderMarkup(MarkupWriter writer, MarkupRenderer renderer) {
renderer.renderMarkup(writer);
// After that's done (i.e., pretty much all rendering), touch it up a little.
Element html = writer.getDocument().find("html");
// to describe locale, and if debug is enabled.
if (html != null) {
html.attributes("data-locale", threadLocale.getLocale().toString());
if (debugEnabled) {
html.attributes("data-debug-enabled", "true");
}
}
}
use of org.apache.tapestry5.MarkupWriter in project tapestry-5 by apache.
the class AjaxFormUpdateControllerImpl method setupBeforePartialZoneRender.
public void setupBeforePartialZoneRender(MarkupWriter writer) {
if (formComponentId == null)
return;
hiddenFieldPositioner = new HiddenFieldPositioner(writer, rules);
actionSink = new ComponentActionSink(logger, clientDataEncoder);
formSupport = createInternalFormSupport(formClientId, formComponentId, actionSink);
environment.push(FormSupport.class, formSupport);
environment.push(ValidationTracker.class, new ValidationTrackerImpl());
heartbeat.begin();
}
use of org.apache.tapestry5.MarkupWriter in project tapestry-5 by apache.
the class BlockImplTest method body_pushed_to_queue_backwards.
@Test
public void body_pushed_to_queue_backwards() {
BlockImpl block = new BlockImpl(null, null);
RenderQueue queue = mockRenderQueue();
MarkupWriter writer = mockMarkupWriter();
RenderCommand element1 = mockRenderCommand();
RenderCommand element2 = mockRenderCommand();
getMocksControl().checkOrder(true);
queue.push(element2);
queue.push(element1);
replay();
block.addToBody(element1);
block.addToBody(element2);
block.render(writer, queue);
verify();
}
use of org.apache.tapestry5.MarkupWriter in project tapestry-5 by apache.
the class ExpansionPageElementImplTest method invariant_binding_is_cached.
@Test
public void invariant_binding_is_cached() {
Binding binding = mockBinding();
TypeCoercer coercer = mockTypeCoercer();
MarkupWriter writer = mockMarkupWriter();
RenderQueue queue = mockRenderQueue();
Object value = new Object();
train_isInvariant(binding, true);
replay();
RenderCommand element = new ExpansionPageElement(binding, coercer);
verify();
train_get(binding, value);
train_coerce(coercer, value, String.class, "STRING-VALUE");
writer.write("STRING-VALUE");
replay();
element.render(writer, queue);
verify();
// It is now cached ...
writer.write("STRING-VALUE");
replay();
element.render(writer, queue);
verify();
}
Aggregations