Package javax.faces.application.FacesMessage

Examples of javax.faces.application.FacesMessage.Severity


  private static FacesContext getFacesContext() {
    return Beans.getReference(FacesContext.class);
  }

  public static Severity parse(final SeverityType severityType) {
    Severity result = null;

    switch (severityType) {
      case INFO:
        result = SEVERITY_INFO;
        break;
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(Expressions.instance().createValueExpression(viewId, String.class), clazz, endConversation, message, severity);
      }
     
View Full Code Here

         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(viewId == null ? null :
            Expressions.instance().createValueExpression(viewId, String.class), 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");
         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(viewId == null ? null :
            Expressions.instance().createValueExpression(viewId, String.class), params, message, severity, control) );
      }
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

  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

     * </p>
     */
    private void readObject(ObjectInputStream in) throws IOException,
        ClassNotFoundException {
      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);
      }
      String summary = in.readUTF();
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

  private static FacesContext getFacesContext() {
    return Beans.getReference(FacesContext.class);
  }

  public static Severity parse(final SeverityType severityType) {
    Severity result = null;

    switch (severityType) {
      case INFO:
        result = SEVERITY_INFO;
        break;
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.