Package javax.faces.application.FacesMessage

Examples of javax.faces.application.FacesMessage.Severity


    writer.startElement("span", message);
    writer.writeAttribute("id", message.getClientId(facesContext), null);
   
    if(msg != null) {
      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", "pf-message-" + severityKey, null);
     
      if(message.isShowSummary())
        encodeMessageText(writer, msg.getSummary(), severityKey + "-summary");
View Full Code Here


      {
         final 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, clazz, endConversation, message, severity);
      }
     
View Full Code Here

   }

   @Override
   public Severity getMaximumSeverity()
   {
      Severity max = null;
      for (FacesMessage msg : messages.keySet())
      {
         if (max == null || msg.getSeverity().compareTo(max) > 0)
         {
            max = msg.getSeverity();
View Full Code Here

      {
         final String viewId = render.attributeValue("view-id");
         Element messageElement = render.element("message");
         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 RenderNavigationHandler(viewId, message, severity) );
      }
     
      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");
         Element messageElement = redirect.element("message");
         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(viewId, params, message, severity) );
      }
     
View Full Code Here

         severityOrdinal = fm.getSeverity().getOrdinal();
      }
     
      FacesMessage toFacesMessage()
      {
         Severity severity = null;
         for (Object o : FacesMessage.VALUES) {
            severity = (Severity) o;
            if (severity.getOrdinal() == severityOrdinal) {
               break;
            }
         }
         return new FacesMessage(severity, summary, detail );
      }
View Full Code Here


    /** {@inheritDoc} */
    public Severity getMaximumSeverity() {

        Severity severity = null;
        Iterator messages = getMessages();
        while (messages.hasNext()) {
            FacesMessage message = (FacesMessage) messages.next();
            if (severity == null) {
                severity = message.getSeverity();
            } else if (message.getSeverity().getOrdinal() > severity.getOrdinal()) {
                severity = message.getSeverity();
            }
        }
        return severity;

View Full Code Here

     * @see javax.faces.context.FacesContext#getMaximumSeverity()
     */
    @Override
    public Severity getMaximumSeverity() {
        assertNotReleased();
        Severity result = null;
        if (componentMessageLists != null
            && !(componentMessageLists.isEmpty())) {
            for (Iterator<FacesMessage> i =
                  new ComponentMessagesIterator(componentMessageLists);
                 i.hasNext();) {
                Severity severity = i.next().getSeverity();
                if (result == null || severity.compareTo(result) > 0) {
                    result = severity;
                }
                if (result == FacesMessage.SEVERITY_FATAL) {
                    break;
                }
View Full Code Here

        Util.notNull("message", message);

        if (maxSeverity == null) {
            maxSeverity = message.getSeverity();
        } else {
            Severity sev = message.getSeverity();
            if (sev.getOrdinal() > maxSeverity.getOrdinal()) {
                maxSeverity = sev;
            }
        }

        if (componentMessageLists == null) {
View Full Code Here

    /**
     * @see javax.faces.context.FacesContext#getMaximumSeverity()
     */
    public Severity getMaximumSeverity() {
        assertNotReleased();
        Severity result = null;
        if (componentMessageLists != null
            && !(componentMessageLists.isEmpty())) {
            for (Iterator<FacesMessage> i =
                  new ComponentMessagesIterator(componentMessageLists);
                 i.hasNext();) {
                Severity severity = i.next().getSeverity();
                if (result == null || severity.compareTo(result) > 0) {
                    result = severity;
                }
                if (result == FacesMessage.SEVERITY_FATAL) {
                    break;
                }
View Full Code Here

        Util.notNull("message", message);

        if (maxSeverity == null) {
            maxSeverity = message.getSeverity();
        } else {
            Severity sev = message.getSeverity();
            if (sev.getOrdinal() > maxSeverity.getOrdinal()) {
                maxSeverity = sev;
            }
        }

        if (componentMessageLists == null) {
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.