public WidgetBuilder append(char chr) throws IOException { context.getResponseWriter().write(chr); return this; }
protected void encodeDropTarget(FacesContext context, Tree tree) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("li", null); writer.writeAttribute("class", "ui-tree-droppoint", null); writer.endElement("li"); }
public void finish() throws IOException { ResponseWriter rw = context.getResponseWriter(); rw.write("});"); if (endFunction) { rw.write("});"); } rw.endElement("script"); } }
protected void renderContent(FacesContext context, Link link) throws IOException { ResponseWriter writer = context.getResponseWriter(); Object value = link.getValue(); if (value != null) { if (link.isEscape()) { writer.writeText(value, "value"); } else { writer.write(value.toString()); } } else { renderChildren(context, link); } }
protected void encodeExplicitFocus(FacesContext context, Focus focus) throws IOException { ResponseWriter writer = context.getResponseWriter(); UIComponent forComponent = SearchExpressionFacade.resolveComponent( context, focus, focus.getFor()); String clientId = forComponent.getClientId(context); writer.write("$(function(){"); writer.write("PrimeFaces.focus('" + clientId + "');"); writer.write("});"); }
protected void handleCommand(FacesContext context, Terminal terminal) throws IOException { String[] tokens = getValueTokens(context, terminal); String command = tokens[0]; String[] args = Arrays.copyOfRange(tokens, 1, tokens.length); MethodExpression commandHandler = terminal.getCommandHandler(); String result = (String) commandHandler.invoke(context.getELContext(), new Object[]{command, args}); ResponseWriter writer = context.getResponseWriter(); writer.writeText(result, null); }
protected void encodeInline(FacesContext context, ColorPicker colorPicker, String clientId) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("div", null); writer.writeAttribute("id", clientId + "_inline", "id"); writer.endElement("div"); }
public WidgetBuilder nativeAttr(String name, String value) throws IOException { if (value != null) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(value); } return this; }
protected void renderContent(FacesContext context, LinkButton linkButton) throws IOException { ResponseWriter writer = context.getResponseWriter(); Object value = linkButton.getValue(); if (value != null) { if (linkButton.isEscape()) { writer.writeText(value, "value"); } else { writer.write(value.toString()); } } else { renderChildren(context, linkButton); } }
protected void encodeSubmenuIcon(FacesContext context, Submenu submenu) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("span", null); writer.writeAttribute("class", Menu.SUBMENU_RIGHT_ICON_CLASS, null); writer.endElement("span"); } }
public WidgetBuilder callback(String name, String callback) throws IOException { if (callback != null) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(callback); } return this; }
protected void autoCompleteCommand(FacesContext context, Terminal terminal) throws IOException { String[] tokens = getValueTokens(context, terminal); String command = tokens[0]; String[] args = Arrays.copyOfRange(tokens, 1, tokens.length); TerminalAutoCompleteModel autoCompleteModel = terminal.getAutoCompleteModel(); ResponseWriter writer = context.getResponseWriter(); if (autoCompleteModel == null) { writer.write("null"); } else { TerminalAutoCompleteMatches matches = terminal.traverseAutoCompleteModel(autoCompleteModel, command, args); writer.writeText(matches.toString(), null); } }
protected void encodeIcon(FacesContext context, String label, String styleClass) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("span", null); writer.writeAttribute("class", styleClass, null); writer.endElement("span"); } }
public WidgetBuilder attr(String name, Boolean value) throws IOException { if (value != null) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(Boolean.toString(value)); } return this; }
protected void renderLoading(FacesContext context, OutputPanel panel) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("div", null); writer.writeAttribute("class", OutputPanel.LOADING_CLASS, null); writer.endElement("div"); }
public WidgetBuilder attr(String name, int value, int defaultValue) throws IOException { if (value != defaultValue) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(Integer.toString(value)); } return this; }
protected void encodeHandle(FacesContext context) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("div", null); writer.writeAttribute("class", InputSwitch.HANDLE_CLASS, null); writer.endElement("div"); }
public WidgetBuilder nativeAttr(String name, String value, String defaultValue) throws IOException { if (value != null && !value.equals(defaultValue)) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(value); } return this; }
protected void encodeIcon(FacesContext context, String styleClass) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("div", null); writer.writeAttribute("class", styleClass, null); writer.startElement("a", null); writer.endElement("a"); writer.endElement("div"); }
public WidgetBuilder attr(String name, boolean value, boolean defaultValue) throws IOException { if (value != defaultValue) { ResponseWriter rw = context.getResponseWriter(); rw.write(","); rw.write(name); rw.write(":"); rw.write(Boolean.toString(value)); } return this; }