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.BodyContent;
23  import org.apache.myfaces.tobago.apt.annotation.Tag;
24  import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
25  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
26  import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
27  import org.apache.myfaces.tobago.component.RendererTypes;
28  import org.apache.myfaces.tobago.internal.component.AbstractUIMessages;
29  import org.apache.myfaces.tobago.internal.taglib.declaration.HasCurrentMarkup;
30  import org.apache.myfaces.tobago.internal.taglib.declaration.HasFor;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasMarkup;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.IsGridLayoutComponent;
34  
35  import javax.faces.component.UIMessages;
36  
37  /**
38   * Renders error/validation messages.
39   */
40  @Tag(name = "messages", bodyContent = BodyContent.EMPTY)
41  @UIComponentTag(
42      uiComponent = "org.apache.myfaces.tobago.component.UIMessages",
43      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIMessages",
44      uiComponentFacesClass = "javax.faces.component.UIMessages",
45      componentFamily = UIMessages.COMPONENT_FAMILY,
46      rendererType = RendererTypes.MESSAGES,
47      allowedChildComponenents = "NONE")
48  
49  public interface MessagesTagDeclaration
50      extends HasIdBindingAndRendered, HasFor, IsGridLayoutComponent, HasMarkup, HasCurrentMarkup {
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(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.component.UIMessages$OrderBy",
104       allowedValues = {AbstractUIMessages.OrderBy.OCCURRENCE_STRING, AbstractUIMessages.OrderBy.SEVERITY_STRING},
105       defaultValue = AbstractUIMessages.OrderBy.OCCURRENCE_STRING, 
106       defaultCode = "org.apache.myfaces.tobago.internal.component.AbstractUIMessages.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 }