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      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIMessages",
41      uiComponentFacesClass = "javax.faces.component.UIMessages",
42      componentFamily = UIMessages.COMPONENT_FAMILY,
43      rendererType = RendererTypes.MESSAGES,
44      allowedChildComponenents = "NONE")
45  
46  public interface MessagesTagDeclaration
47      extends HasIdBindingAndRendered, HasFor, IsVisual {
48  
49    /**
50     * Flag indicating that only messages that are not associated to any
51     * particular UIComponent should be displayed. That are messages without clientId.
52     */
53    @TagAttribute
54    @UIComponentTagAttribute(defaultValue = "false")
55    void setGlobalOnly(String globalOnly);
56  
57    /**
58     * Flag indicating whether the detail should be included
59     */
60    @TagAttribute
61    @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
62    void setShowDetail(String showDetail);
63  
64    /**
65     * Flag indicating whether the summary should be included
66     */
67    @TagAttribute
68    @UIComponentTagAttribute(type = "boolean", defaultValue = "true")
69    void setShowSummary(String showSummary);
70  
71     /**
72     * Sets the mininum severity to be shown. E. g. "warn" shows only "warn", "error" and "fatal".
73     */
74    @TagAttribute
75    @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage$Severity", defaultValue = "info",
76        defaultCode = "javax.faces.application.FacesMessage.SEVERITY_INFO")
77    void setMinSeverity(String minSeverity);
78  
79     /**
80     * Sets the maximum severity to be shown. E. g. "warn" shows only "warn" and "info".
81      * When setting this attribute you usually shoud take care, that you have a second message tag to show the
82      * higher severity levels.
83     */
84    @TagAttribute
85    @UIComponentTagAttribute(type = "javax.faces.application.FacesMessage$Severity", defaultValue = "fatal",
86        defaultCode = "javax.faces.application.FacesMessage.SEVERITY_FATAL")
87    void setMaxSeverity(String maxSeverity);
88  
89     /**
90     * Sets the maximum number of messages to show.
91     */
92    @TagAttribute
93    @UIComponentTagAttribute(type = "java.lang.Integer", defaultValue = "2147483647")
94    void setMaxNumber(String maxNumber);
95  
96     /**
97     * Sets the order of the messages.
98     */
99    @TagAttribute
100   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.OrderBy",
101       allowedValues = {OrderBy.OCCURRENCE, OrderBy.SEVERITY},
102       defaultValue = OrderBy.OCCURRENCE,
103       defaultCode = "org.apache.myfaces.tobago.layout.OrderBy.occurrence")
104   void setOrderBy(String orderBy);
105 
106   /**
107    * Has the user to confirm this message?
108    * This attributes handles the case, if the application wants to warn the user about a problem,
109    * and the user has to confirm the message before he/she can continue.
110    */
111   @TagAttribute
112   @UIComponentTagAttribute(type = "boolean", defaultValue = "false")
113   void setConfirmation(String confirmation);
114 
115 }