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.Behavior;
23  import org.apache.myfaces.tobago.apt.annotation.BodyContentDescription;
24  import org.apache.myfaces.tobago.apt.annotation.Facet;
25  import org.apache.myfaces.tobago.apt.annotation.Markup;
26  import org.apache.myfaces.tobago.apt.annotation.Tag;
27  import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
28  import org.apache.myfaces.tobago.component.ClientBehaviors;
29  import org.apache.myfaces.tobago.component.Facets;
30  import org.apache.myfaces.tobago.component.RendererTypes;
31  import org.apache.myfaces.tobago.internal.taglib.declaration.HasAccessKey;
32  import org.apache.myfaces.tobago.internal.taglib.declaration.HasAction;
33  import org.apache.myfaces.tobago.internal.taglib.declaration.HasActionListener;
34  import org.apache.myfaces.tobago.internal.taglib.declaration.HasConfirmation;
35  import org.apache.myfaces.tobago.internal.taglib.declaration.HasFragment;
36  import org.apache.myfaces.tobago.internal.taglib.declaration.HasIdBindingAndRendered;
37  import org.apache.myfaces.tobago.internal.taglib.declaration.HasImage;
38  import org.apache.myfaces.tobago.internal.taglib.declaration.HasLabel;
39  import org.apache.myfaces.tobago.internal.taglib.declaration.HasLink;
40  import org.apache.myfaces.tobago.internal.taglib.declaration.HasOutcome;
41  import org.apache.myfaces.tobago.internal.taglib.declaration.HasTabIndex;
42  import org.apache.myfaces.tobago.internal.taglib.declaration.HasTarget;
43  import org.apache.myfaces.tobago.internal.taglib.declaration.HasTip;
44  import org.apache.myfaces.tobago.internal.taglib.declaration.IsDefaultCommand;
45  import org.apache.myfaces.tobago.internal.taglib.declaration.IsDisabledBySecurity;
46  import org.apache.myfaces.tobago.internal.taglib.declaration.IsImmediateCommand;
47  import org.apache.myfaces.tobago.internal.taglib.declaration.IsOmit;
48  import org.apache.myfaces.tobago.internal.taglib.declaration.IsTransition;
49  import org.apache.myfaces.tobago.internal.taglib.declaration.IsVisual;
50  
51  import javax.faces.component.UICommand;
52  
53  /**
54   * Renders a button element.
55   */
56  @Tag(name = "button")
57  @BodyContentDescription(anyTagOf = "facestag")
58  @UIComponentTag(
59      uiComponent = "org.apache.myfaces.tobago.component.UIButton",
60      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIButton",
61      uiComponentFacesClass = "javax.faces.component.UICommand",
62      interfaces = {
63          "org.apache.myfaces.tobago.component.SupportsAccessKey"
64      },
65      componentFamily = UICommand.COMPONENT_FAMILY,
66      rendererType = {RendererTypes.BUTTON, RendererTypes.BUTTON_INSIDE_BUTTONS, RendererTypes.BUTTON_INSIDE_IN,
67          RendererTypes.BUTTON_INSIDE_IN_AFTER},
68      allowedChildComponenents = "NONE",
69      facets = {
70          @Facet(
71              name = Facets.CONFIRMATION,
72              description = "Contains a UIOutput instance with the confirmation message.",
73              allowedChildComponenents = "org.apache.myfaces.tobago.Out")
74      },
75      behaviors = {
76          @Behavior(
77              name = ClientBehaviors.CLICK,
78              description = "Behavior of a click event.",
79              isDefault = true),
80          @Behavior(
81              name = ClientBehaviors.DBLCLICK),
82          @Behavior(
83              name = ClientBehaviors.FOCUS),
84          @Behavior(
85              name = ClientBehaviors.BLUR)
86      },
87      markups = {
88          @Markup(
89              name = org.apache.myfaces.tobago.context.Markup.STRING_PRIMARY,
90              description = "Set button color to primary color of the theme."
91          ),
92          @Markup(
93              name = org.apache.myfaces.tobago.context.Markup.STRING_SECONDARY,
94              description = "Set button color to secondary color of the theme."
95          ),
96          @Markup(
97              name = org.apache.myfaces.tobago.context.Markup.STRING_SUCCESS,
98              description = "Set button color to success color of the theme."
99          ),
100         @Markup(
101             name = org.apache.myfaces.tobago.context.Markup.STRING_DANGER,
102             description = "Set button color to danger color of the theme."
103         ),
104         @Markup(
105             name = org.apache.myfaces.tobago.context.Markup.STRING_WARNING,
106             description = "Set button color to warning color of the theme."
107         ),
108         @Markup(
109             name = org.apache.myfaces.tobago.context.Markup.STRING_INFO,
110             description = "Set button color to info color of the theme."
111         ),
112         @Markup(
113             name = org.apache.myfaces.tobago.context.Markup.STRING_LIGHT,
114             description = "Set button color to light color of the theme."
115         ),
116         @Markup(
117             name = org.apache.myfaces.tobago.context.Markup.STRING_DARK,
118             description = "Set button color to dark color of the theme."
119         ),
120         @Markup(
121             name = org.apache.myfaces.tobago.context.Markup.STRING_NONE,
122             description = "Colorless button."
123         ),
124         @Markup(
125             name = org.apache.myfaces.tobago.context.Markup.STRING_BADGE,
126             description = "Display the button as a badge."
127         ),
128         @Markup(
129             name = org.apache.myfaces.tobago.context.Markup.STRING_PILL,
130             description = "Make badges more rounded if button is displayed as a badge."
131         )
132     })
133 public interface ButtonTagDeclaration
134     extends HasIdBindingAndRendered, HasAction, HasActionListener, IsImmediateCommand, HasConfirmation,
135     HasLink, HasOutcome, HasFragment, IsTransition, HasTarget, IsDisabledBySecurity,
136     IsOmit, IsVisual, HasLabel, HasAccessKey, HasTip, HasImage,
137     IsDefaultCommand, HasTabIndex {
138 }