public void render(IMarkupWriter writer, IRequestCycle cycle) { if (_length == 0) return; // At one time, we would check to see if the cycle was rewinding and // only invoke printRaw() if it was. However, that slows down // normal rendering (microscopically) and, with the new // NullResponseWriter class, the "cost" of invoking cycle.isRewinding() // is approximately the same as the "cost" of invoking writer.printRaw(). writer.printRaw(_templateData, _offset, _length); }
/** * {@inheritDoc} */ public void writeBodyScript(IMarkupWriter normalWriter, String script, IRequestCycle cycle) { _writer.printRaw(script); }
/** * {@inheritDoc} */ public void writeImageInitializations(IMarkupWriter normalWriter, String script, String preloadName, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.printRaw(NEWLINE + preloadName + " = [];" + NEWLINE); writer.printRaw("if (document.images) {" + NEWLINE); writer.printRaw(script); writer.printRaw("}" + NEWLINE); }
/** * {@inheritDoc} */ public void writeInitializationScript(IMarkupWriter normalWriter, String script) { _writer.begin("script"); // return is in XML so must escape any potentially non-xml compliant content _writer.printRaw("\n//<![CDATA[\n"); _writer.printRaw(script); _writer.printRaw("\n//]]>\n"); _writer.end(); }
/** * {@inheritDoc} */ public void writeInitializationScript(IMarkupWriter normalWriter, String script) { _writer.begin("script"); // return is in XML so must escape any potentially non-xml compliant content _writer.printRaw("\n//<![CDATA[\n"); _writer.printRaw(script); _writer.printRaw("\n//]]>\n"); _writer.end(); }
/** * {@inheritDoc} */ public void writeBodyScript(IMarkupWriter normalWriter, String script, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.printRaw(script); }
/** * {@inheritDoc} */ public void endBodyScript(IMarkupWriter normalWriter, IRequestCycle cycle) { _writer.printRaw("\n//]]>\n"); _writer.end(); }
/** * {@inheritDoc} */ public void writeBodyScript(IMarkupWriter normalWriter, String script, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.printRaw(script); }
/** * Closes the internal {@link CharArrayWriter}, then captures its content and invokes * {@link org.apache.tapestry.IMarkupWriter#printRaw(String)} on the parent markup writer * (the writer that created this writer). */ public void close() { String content = getBuffer(); _parent.printRaw(content); } }
void writeStatusMessages() { for (int i=0; i < _statusMessages.size(); i+=2) { IMarkupWriter writer = getWriter((String) _statusMessages.get(i), "status"); writer.printRaw((String) _statusMessages.get(i+1)); } _statusMessages = null; }
void writeStatusMessages() { for (int i=0; i < _statusMessages.size(); i+=2) { IMarkupWriter writer = getWriter((String) _statusMessages.get(i), "status"); writer.printRaw((String) _statusMessages.get(i+1)); } _statusMessages = null; }
/** * {@inheritDoc} */ public void beginBodyScript(IMarkupWriter normalWriter, IRequestCycle cycle) { _writer.begin("script"); _writer.printRaw("\n//<![CDATA[\n"); }
public boolean wasPrerendered(IMarkupWriter writer, IComponent field) { String key = field.getExtendedId(); // During a rewind, if the form is pre-rendered, the buffer will be null, // so do the check based on the key, not a non-null value. if (!_prerenderMap.containsKey(key)) return false; String buffer = (String) _prerenderMap.get(key); writer.printRaw(buffer); _prerenderMap.remove(key); return true; }
public boolean wasPrerendered(IMarkupWriter writer, IComponent field) { String key = field.getExtendedId(); // During a rewind, if the form is pre-rendered, the buffer will be null, // so do the check based on the key, not a non-null value. if (!_prerenderMap.containsKey(key)) return false; String buffer = (String) _prerenderMap.get(key); writer.printRaw(buffer); _prerenderMap.remove(key); return true; }
/** * {@inheritDoc} */ public void beginBodyScript(IMarkupWriter normalWriter, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.begin("script"); writer.printRaw(NEWLINE + "//<![CDATA[" + NEWLINE); }
/** * {@inheritDoc} */ public void beginBodyScript(IMarkupWriter normalWriter, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.begin("script"); writer.printRaw(NEWLINE + "//<![CDATA[" + NEWLINE); }
/** * {@inheritDoc} */ public void endBodyScript(IMarkupWriter normalWriter, IRequestCycle cycle) { IMarkupWriter writer = getWriter(ResponseBuilder.BODY_SCRIPT, ResponseBuilder.SCRIPT_TYPE); writer.printRaw(NEWLINE + "//]]>" + NEWLINE); writer.end(); }
/** * {@inheritDoc} */ public void endBodyScript(IMarkupWriter writer, IRequestCycle cycle) { writer.println(); writer.printRaw("// -->"); writer.end(); }
/** * {@inheritDoc} */ public void endBodyScript(IMarkupWriter writer, IRequestCycle cycle) { writer.println(); writer.printRaw("// -->"); writer.end(); }
/** * {@inheritDoc} */ public void beginBodyScript(IMarkupWriter writer, IRequestCycle cycle) { writer.begin("script"); writer.attribute("type", "text/javascript"); writer.printRaw("<!--"); writer.println(); }