protected boolean isTableLayout(HtmlMessages htmlMessages) { return JsfConstants.TABLE_VALUE.equals(htmlMessages.getLayout()); }
public HtmlMessages() { super(); setRendererType("javax.faces.Messages"); }
/** * <p>Set the value of the <code>dir</code> property.</p> * @param dir the new property value */ public void setDir(java.lang.String dir) { getStateHelper().put(PropertyKeys.dir, dir); handleAttribute("dir", dir); }
style = ((HtmlMessages)messages).getInfoStyle(); styleClass = ((HtmlMessages)messages).getInfoClass(); style = ((HtmlMessages)messages).getWarnStyle(); styleClass = ((HtmlMessages)messages).getWarnClass(); style = ((HtmlMessages)messages).getErrorStyle(); styleClass = ((HtmlMessages)messages).getErrorClass(); style = ((HtmlMessages)messages).getFatalStyle(); styleClass = ((HtmlMessages)messages).getFatalClass(); style = ((HtmlMessages)messages).getStyle(); styleClass = ((HtmlMessages)messages).getStyleClass();
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
} else if (uiComponent instanceof HtmlMessages) { severityStyleClass = ((HtmlMessages) uiComponent).getInfoClass(); baseStyle = "iceMsgs"; } else if (uiComponent instanceof HtmlMessages) { severityStyleClass = ((HtmlMessages) uiComponent).getWarnClass(); baseStyle = "iceMsgs"; } else if (uiComponent instanceof HtmlMessages) { severityStyleClass = ((HtmlMessages) uiComponent).getErrorClass(); baseStyle = "iceMsgs"; } else if (uiComponent instanceof HtmlMessages) { severityStyleClass = ((HtmlMessages) uiComponent).getFatalClass(); styleClass = ((HtmlMessage) uiComponent).getStyleClass(); } else if (uiComponent instanceof HtmlMessages) { styleClass = ((HtmlMessages) uiComponent).getStyleClass();
/** * <p>Return the value of the <code>errorStyle</code> property.</p> * @return the property value * <p>Contents: CSS style(s) to apply to any message * with a severity class of "ERROR". */ public java.lang.String getErrorStyle() { return (java.lang.String) getStateHelper().eval(PropertyKeys.errorStyle); }
/** * Gets The CSS class for this element. Corresponds to the HTML 'class' attribute. * * @return the new styleClass value */ public String getStyleClass() { if (_styleClass != null) { return _styleClass; } ValueExpression expression = getValueExpression("styleClass"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
public static void encodeRenderResponseFunction(FacesContext facesContext) throws IOException { ResponseWriter writer = facesContext.getResponseWriter(); writer.write("\t tomahawk.renderResponse = function(facesContext) {\n"); HtmlMessages htmlMessages = (HtmlMessages) ComponentUtils.findFirstMessagesComponent( facesContext, facesContext.getViewRoot() ); if(htmlMessages != null) { writer.write("\t\t var uimessages = new tomahawk.UIMessages('" + htmlMessages.getClientId(facesContext) + "','" + htmlMessages.getLayout() + "'," + htmlMessages.isShowSummary() + "," + htmlMessages.isShowDetail() + ");\n"); writer.write("\t\t tomahawk.RendererUtils.renderMessages(facesContext,uimessages); \n"); } writer.write("\t\t viewRoot = facesContext.viewRoot;\n"); writer.write("\t\t for(var i = 0; i < viewRoot.children.length ; i ++) { \n"); writer.write("\t\t\t\t var uiinput = viewRoot.children[i]; \n"); writer.write("\t\t\t\t tomahawk.RendererUtils.renderMessage(facesContext,uiinput.clientId); \n"); writer.write("\t\t\t }\n"); writer.write("\t\t }\n"); }
protected String getComponentStyleClass(UIComponent messages) { String styleClass = null; if (messages instanceof HtmlMessages) { styleClass = ((HtmlMessages)messages).getStyleClass(); } else { Map attr = messages.getAttributes(); styleClass = (String)attr.get(org.apache.myfaces.shared.renderkit.JSFAttr.STYLE_CLASS_ATTR); } return styleClass; }
ResponseWriter writer = context.getResponseWriter(); Iterator it; if (htmlMessages.isGlobalOnly()) { it = context.getMessages(null); } else { htmlMessages.getAttributes()); if (tableLayout) { writer.endElement(JsfConstants.TD_ELEM);
comp.setValueBinding("layout", vb); comp.getAttributes().put("layout", _layout); comp.setValueBinding("style", vb); comp.getAttributes().put("style", _style); comp.setValueBinding("styleClass", vb); comp.getAttributes().put("styleClass", _styleClass); comp.setValueBinding("errorClass", vb); comp.getAttributes().put("errorClass", _errorClass); comp.setValueBinding("errorStyle", vb); comp.getAttributes().put("errorStyle", _errorStyle); comp.setValueBinding("fatalClass", vb); comp.getAttributes().put("fatalClass", _fatalClass); comp.setValueBinding("fatalStyle", vb); comp.getAttributes().put("fatalStyle", _fatalStyle); comp.setValueBinding("infoClass", vb);
@Override public Map<String, Object> getAttributes() { if (attributes == null) { attributes = new MessageAttributes(super.getAttributes()); } return attributes; } }
style = ((HtmlMessages)messages).getInfoStyle(); styleClass = ((HtmlMessages)messages).getInfoClass(); style = ((HtmlMessages)messages).getWarnStyle(); styleClass = ((HtmlMessages)messages).getWarnClass(); style = ((HtmlMessages)messages).getErrorStyle(); styleClass = ((HtmlMessages)messages).getErrorClass(); style = ((HtmlMessages)messages).getFatalStyle(); styleClass = ((HtmlMessages)messages).getFatalClass();
private void handleAttribute(String name, Object value) { List<String> setAttributes = (List<String>) this.getAttributes().get("javax.faces.component.UIComponentBase.attributesThatAreSet"); if (setAttributes == null) { String cname = this.getClass().getName(); if (cname != null && cname.startsWith(OPTIMIZED_PACKAGE)) { setAttributes = new ArrayList<String>(6); this.getAttributes().put("javax.faces.component.UIComponentBase.attributesThatAreSet", setAttributes); } } if (setAttributes != null) { if (value == null) { ValueExpression ve = getValueExpression(name); if (ve == null) { setAttributes.remove(name); } } else if (!setAttributes.contains(name)) { setAttributes.add(name); } } }
/** * <p>Set the value of the <code>errorStyle</code> property.</p> * @param errorStyle the new property value */ public void setErrorStyle(java.lang.String errorStyle) { getStateHelper().put(PropertyKeys.errorStyle, errorStyle); }
/** * Gets CSS class to be used for messages with severity "WARN". * * @return the new warnClass value */ public String getWarnClass() { if (_warnClass != null) { return _warnClass; } ValueExpression expression = getValueExpression("warnClass"); if (expression != null) { return (String)expression.getValue(getFacesContext().getELContext()); } return null; }
protected String getComponentStyleClass(UIComponent messages) { String styleClass = null; if (messages instanceof HtmlMessages) { styleClass = ((HtmlMessages)messages).getStyleClass(); } else { Map attr = messages.getAttributes(); styleClass = (String)attr.get(org.apache.myfaces.shared_impl.renderkit.JSFAttr.STYLE_CLASS_ATTR); } return styleClass; }
ResponseWriter writer = context.getResponseWriter(); Iterator it; if (htmlMessages.isGlobalOnly()) { it = context.getMessages(null); } else { htmlMessages.getAttributes()); if (tableLayout) { writer.endElement(JsfConstants.TD_ELEM);
@Override public Map<String, Object> getAttributes() { if (attributes == null) { attributes = new MessageAttributes(super.getAttributes()); } return attributes; } }