View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.taglib.component;
21  
22  import org.apache.myfaces.tobago.apt.annotation.Tag;
23  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
24  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
25  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
26  import org.apache.myfaces.tobago.component.RendererTypes;
27  import org.apache.myfaces.tobago.internal.taglib.declaration.HasFor;
28  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
29  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
30  import org.apache.myfaces.tobago.layout.OrderBy;
31  
32  import javax.faces.component.UIMessages;
33  
34  /**
35   * Renders error/validation messages.
36   */
37  @Tag(name = "messages")
38  @UIComponentTag(
39      uiComponent = "org.apache.myfaces.tobago.component.UIMessages",
40      uiComponentFacesClass = "javax.faces.component.UIMessages",
41      componentFamily = UIMessages.COMPONENT_FAMILY,
42      rendererType = RendererTypes.MESSAGES,
43      interfaces = {
44          // As long as no behavior event names are defined, ClientBehaviorHolder must be implemented for Mojarra.
45          "javax.faces.component.behavior.ClientBehaviorHolder"
46      },
47      allowedChildComponenents = "NONE")
48  
49  public interface MessagesTagDeclaration
50      extends HasIdBindingAndRendered, HasFor, IsVisual {
51  
52    /**
53     * Flag indicating that only messages that are not associated to any
54     * particular UIComponent should be displayed. That are messages without clientId.
55     */
56    @TagAttribute
57    @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
58    void setGlobalOnly(String globalOnly);
59  
60    /**
61     * Flag indicating whether the detail should be included
62     */
63    @TagAttribute
64    @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
65    void setShowDetail(String showDetail);
66  
67    /**
68     * Flag indicating whether the summary should be included
69     */
70    @TagAttribute
71    @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
72    void setShowSummary(String showSummary);
73  
74     /**
75     * Sets the mininum severity to be shown. E. g. "warn" shows only "warn", "error" and "fatal".
76     */
77    @TagAttribute
78    @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage$Severity", defaultValue = "info",
79        defaultCode = "javax.faces.application.FacesMessage.SEVERITY_INFO")
80    void setMinSeverity(String minSeverity);
81  
82     /**
83     * Sets the maximum severity to be shown. E. g. "warn" shows only "warn" and "info".
84      * When setting this attribute you usually shoud take care, that you have a second message tag to show the
85      * higher severity levels.
86     */
87    @TagAttribute
88    @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage$Severity", defaultValue = "fatal",
89        defaultCode = "javax.faces.application.FacesMessage.SEVERITY_FATAL")
90    void setMaxSeverity(String maxSeverity);
91  
92     /**
93     * Sets the maximum number of messages to show.
94     */
95    @TagAttribute
96    @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "2147483647")
97    void setMaxNumber(String maxNumber);
98  
99     /**
100    * Sets the order of the messages.
101    */
102   @TagAttribute
103   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.OrderBy",
104       allowedValues = {OrderBy.OCCURRENCE, OrderBy.SEVERITY},
105       defaultValue = OrderBy.OCCURRENCE,
106       defaultCode = "org.apache.myfaces.tobago.layout.OrderBy.occurrence")
107   void setOrderBy(String orderBy);
108 
109   /**
110    * Has the user to confirm this message?
111    * This attributes handles the case, if the application wants to warn the user about a problem,
112    * and the user has to confirm the message before he/she can continue.
113    */
114   @TagAttribute
115   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
116   void setConfirmation(String confirmation);
117 
118 }