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.Markup;
23  import org.apache.myfaces.tobago.apt.annotation.Tag;
24  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
25  import org.apache.myfaces.tobago.component.RendererTypes;
26  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
27  import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
28  import org.apache.myfaces.tobago.internal.taglib.declaration.HasValue;
29  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
30  
31  import javax.faces.component.UIOutput;
32  
33  /**
34   * Renders a badge element.
35   */
36  @Tag(name = "badge")
37  @UIComponentTag(
38      uiComponent = "org.apache.myfaces.tobago.component.UIBadge",
39      uiComponentFacesClass = "javax.faces.component.UIOutput",
40      interfaces = {
41          // As long as no behavior event names are defined, ClientBehaviorHolder must be implemented for Mojarra.
42          "javax.faces.component.behavior.ClientBehaviorHolder"
43      },
44      componentFamily = UIOutput.COMPONENT_FAMILY,
45      rendererType = RendererTypes.BADGE,
46      allowedChildComponenents = "NONE",
47      markups = {
48          @Markup(
49              name = org.apache.myfaces.tobago.context.Markup.STRING_PILL,
50              description = "Make badges more rounded."
51          ),
52          @Markup(
53              name = org.apache.myfaces.tobago.context.Markup.STRING_PRIMARY,
54              description = "Set badge color to primary color of the theme."
55          ),
56          @Markup(
57              name = org.apache.myfaces.tobago.context.Markup.STRING_SECONDARY,
58              description = "Set badge color to secondary color of the theme."
59          ),
60          @Markup(
61              name = org.apache.myfaces.tobago.context.Markup.STRING_DANGER,
62              description = "Set badge color to danger color of the theme."
63          ),
64          @Markup(
65              name = org.apache.myfaces.tobago.context.Markup.STRING_WARNING,
66              description = "Set badge color to warning color of the theme."
67          ),
68          @Markup(
69              name = org.apache.myfaces.tobago.context.Markup.STRING_SUCCESS,
70              description = "Set badge color to success color of the theme."
71          ),
72          @Markup(
73              name = org.apache.myfaces.tobago.context.Markup.STRING_INFO,
74              description = "Set badge color to info color of the theme."
75          ),
76          @Markup(
77              name = org.apache.myfaces.tobago.context.Markup.STRING_LIGHT,
78              description = "Set badge color to light color of the theme."
79          ),
80          @Markup(
81              name = org.apache.myfaces.tobago.context.Markup.STRING_DARK,
82              description = "Set badge color to dark color of the theme."
83          ),
84          @Markup(
85              name = org.apache.myfaces.tobago.context.Markup.STRING_NONE,
86              description = "Colorless badge."
87          )
88      })
89  public interface BadgeTagDeclaration extends HasIdBindingAndRendered, HasTip, IsVisual, HasValue {
90  }