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