Package javax.faces.application.FacesMessage

Examples of javax.faces.application.FacesMessage.Severity


         final String viewId = render.attributeValue("view-id");
         Element messageElement = render.element("message");
         String message = messageElement==null ? null : messageElement.getTextTrim();
         String control = messageElement==null ? null : messageElement.attributeValue("for");
         String severityName = messageElement==null ? null : messageElement.attributeValue("severity");
         Severity severity = severityName==null ?
                  FacesMessage.SEVERITY_INFO :
                  getFacesMessageValuesMap().get( severityName.toUpperCase() );
         rule.addNavigationHandler( new RenderNavigationHandler(stringValueExpressionFor(viewId), message, severity, control) );
      }
     
      Element redirect = element.element("redirect");
      if (redirect!=null)
      {
         List<Element> children = redirect.elements("param");
         final List<Param> params = new ArrayList<Param>();
         for (Element child: children)
         {
            params.add( parseParam(child) );
         }
         final String viewId = redirect.attributeValue("view-id");
         final String url    = redirect.attributeValue("url");
         final String includePageParamsAttr = redirect.attributeValue("include-page-params");
         final boolean includePageParams = includePageParamsAttr == null ? true : Boolean.getBoolean(includePageParamsAttr);

         Element messageElement = redirect.element("message");
         String control = messageElement==null ? null : messageElement.attributeValue("for");
         String message = messageElement==null ? null : messageElement.getTextTrim();
         String severityName = messageElement==null ? null : messageElement.attributeValue("severity");
         Severity severity = severityName==null ?
                  FacesMessage.SEVERITY_INFO :
                  getFacesMessageValuesMap().get( severityName.toUpperCase() );
         rule.addNavigationHandler(new RedirectNavigationHandler(stringValueExpressionFor(viewId),
               stringValueExpressionFor(url), params, message, severity, control, includePageParams) );
      }
View Full Code Here


      {
         String viewId = redirect.attributeValue("view-id");
         Element messageElement = redirect.element("message");
         final String message = messageElement==null ? null : messageElement.getTextTrim();
         String severityName = messageElement==null ? null : messageElement.attributeValue("severity");
         Severity severity = severityName==null ?
                  FacesMessage.SEVERITY_INFO :
                  Pages.getFacesMessageValuesMap().get( severityName.toUpperCase() );
         return new ConfigRedirectHandler(viewId == null ? null : Expressions.instance().createValueExpression(
               viewId, String.class), clazz, endConversation, message, severity);
      }
View Full Code Here

      if(msg.isRendered() && !uiMessage.isRedisplay()) {
        writer.endElement("span");
        return;
       
      } else {
        Severity severity = msg.getSeverity();
        String severityKey = null;
       
        if(severity.equals(FacesMessage.SEVERITY_ERROR)) severityKey = "error";
        else if(severity.equals(FacesMessage.SEVERITY_INFO)) severityKey = "info";
        else if(severity.equals(FacesMessage.SEVERITY_WARN)) severityKey = "warn";
        else if(severity.equals(FacesMessage.SEVERITY_FATAL))  severityKey = "fatal";
         
        writer.writeAttribute("class", "ui-message-" + severityKey + " ui-widget ui-corner-all", null);
       
        if(uiMessage.isShowSummary())
          encodeMessageText(writer, msg.getSummary(), severityKey + "-summary");
View Full Code Here

        Iterator<FacesMessage> msgIterator = fc.getMessages();
        if (msgIterator != null)
        { // Check Messages
            while (msgIterator.hasNext())
            { // Check Severity
                Severity fms = msgIterator.next().getSeverity();
                if (fms == FacesMessage.SEVERITY_ERROR || fms == FacesMessage.SEVERITY_FATAL)
                    return true;
            }
        }
        return false;
View Full Code Here

  protected boolean isApplicableMessage(List<String> severenities,
      FacesMessage message) {
    if (severenities.size() == 0 || severenities.contains("ALL")) {
      return true;
    }
    Severity severity = message.getSeverity();
    for (Object key : FacesMessage.VALUES_MAP.keySet()) {
      Severity sev = (Severity) FacesMessage.VALUES_MAP.get(key);
      if (0 == sev.compareTo(severity)) {
        return severenities.contains(key);
      }
    }
    return false;
  }
View Full Code Here

     
      if (in.readBoolean()) {
        clientId = in.readUTF();
      }

      Severity severity = FacesMessage.SEVERITY_INFO;
      int ordinal = in.readInt();
      if (ordinal >= 0 && ordinal < FacesMessage.VALUES.size()) {
        severity = (Severity) FacesMessage.VALUES.get(ordinal);
      }
     
View Full Code Here

   
    String markerClass = null;
   
    String markerStyle = null;
   
    Severity severity = null;
   
   
    if(facesMsg != null){
     
      severity = facesMsg.getSeverity();
View Full Code Here

      
    String labelStyle = null;
      
    String passLabel = null;
      
    Severity severity = null;
      
          
    if(facesMsg != null){
      
      severity = facesMsg.getSeverity();
View Full Code Here

   
    String outerClass = null;
      
    String outerStyle = null;
      
    Severity severity = null;
      
      
    if(facesMsg != null){
        
      severity = facesMsg.getSeverity();
View Full Code Here

   
    if(acceptLevels.contains(ALL_NAME) || message == null){
      return true;
    }
   
    Severity severity = message.getSeverity();
   
    if(severity == FacesMessage.SEVERITY_ERROR
        && acceptLevels.contains(ERROR_NAME)){
      accept = true;
     
View Full Code Here

TOP

Related Classes of javax.faces.application.FacesMessage.Severity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.