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.HasIdBindingAndRendered;
28  import org.apache.myfaces.tobago.layout.Display;
29  import org.apache.myfaces.tobago.layout.Overflow;
30  import org.apache.myfaces.tobago.layout.Position;
31  import org.apache.myfaces.tobago.layout.TextAlign;
32  
33  /**
34   * <p>
35   * Add a style tag with the given file name to the header (using file attribute) or add
36   * some CSS styles to the parent component.
37   * </p>
38   */
39  @Tag(name = "style")
40  @UIComponentTag(
41      uiComponent = "org.apache.myfaces.tobago.component.UIStyle",
42      uiComponentBaseClass = "org.apache.myfaces.tobago.internal.component.AbstractUIStyle",
43      componentFamily = "org.apache.myfaces.tobago.Style",
44      rendererType = RendererTypes.STYLE,
45      allowedChildComponenents = "NONE")
46  public interface StyleTagDeclaration extends HasIdBindingAndRendered {
47  
48    /**
49     * Name of the stylesheet file to add to page. The name must be full qualified, or relative.
50     * If using a complete path from root, you'll need to add the contextPath from the web application.
51     * This can be done with the EL #{request.contextPath}.
52     */
53    @TagAttribute()
54    @UIComponentTagAttribute()
55    void setFile(String file);
56  
57    /**
58     * @param customClass A custom CSS class for the parent component.
59     *                    Note: The rendered attribute has no effect to the use of this customClass.
60     *                    To switch the customClass, you may use an EL expression
61     *                    like e.g. customClass="#{isError ? 'red' : null}".
62     * @since 3.0.0
63     */
64    @TagAttribute()
65    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.renderkit.css.CustomClass")
66    void setCustomClass(String customClass);
67  
68  
69    /**
70     * @param selector A selector to define the element for this style rules. Defaults to the ID of the parent component.
71     * @since 4.0.0
72     */
73    @TagAttribute()
74    @UIComponentTagAttribute()
75    void setSelector(String selector);
76  
77    /**
78     * @param width The width for the parent component.
79     * @since 3.0.0
80     */
81    @TagAttribute()
82    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
83    void setWidth(String width);
84  
85    /**
86     * @param height The height for the parent component.
87     * @since 3.0.0
88     */
89    @TagAttribute()
90    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
91    void setHeight(String height);
92  
93    /**
94     * @param minWidth The minimum width for the parent component.
95     * @since 3.0.0
96     */
97    @TagAttribute()
98    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
99    void setMinWidth(String minWidth);
100 
101   /**
102    * @param minHeight The minimum height for the parent component.
103    * @since 3.0.0
104    */
105   @TagAttribute()
106   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
107   void setMinHeight(String minHeight);
108 
109   /**
110    * @param maxWidth The maximum width for the parent component.
111    * @since 3.0.0
112    */
113   @TagAttribute()
114   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
115   void setMaxWidth(String maxWidth);
116 
117   /**
118    * @param maxHeight The maximum height for the parent component.
119    * @since 3.0.0
120    */
121   @TagAttribute()
122   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
123   void setMaxHeight(String maxHeight);
124 
125   /**
126    * @param left The left position value for the parent component.
127    * @since 3.0.0
128    */
129   @TagAttribute()
130   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
131   void setLeft(String left);
132 
133   /**
134    * @param right The left position value for the parent component.
135    * @since 3.0.0
136    */
137   @TagAttribute()
138   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
139   void setRight(String right);
140 
141   /**
142    * @param top The top position value for the parent component.
143    * @since 3.0.0
144    */
145   @TagAttribute()
146   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
147   void setTop(String top);
148 
149   /**
150    * @param bottom The top position value for the parent component.
151    * @since 3.0.0
152    */
153   @TagAttribute()
154   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
155   void setBottom(String bottom);
156 
157   /**
158    * @param paddingLeft The left padding.
159    * @since 3.0.0
160    */
161   @TagAttribute()
162   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
163   void setPaddingLeft(String paddingLeft);
164 
165   /**
166    * @param paddingRight The right padding.
167    * @since 3.0.0
168    */
169   @TagAttribute()
170   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
171   void setPaddingRight(String paddingRight);
172 
173   /**
174    * @param paddingTop The top padding.
175    * @since 3.0.0
176    */
177   @TagAttribute()
178   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
179   void setPaddingTop(String paddingTop);
180 
181   /**
182    * @param paddingBottom The bottom padding.
183    * @since 3.0.0
184    */
185   @TagAttribute()
186   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
187   void setPaddingBottom(String paddingBottom);
188 
189   /**
190    * @param marginLeft The margin at the left of the parent component.
191    * @since 3.0.0
192    */
193   @TagAttribute()
194   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
195   void setMarginLeft(String marginLeft);
196 
197   /**
198    * @param marginRight The margin at the right of the parent component.
199    * @since 3.0.0
200    */
201   @TagAttribute()
202   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
203   void setMarginRight(String marginRight);
204 
205   /**
206    * @param marginTop The margin at the top of the parent component.
207    * @since 3.0.0
208    */
209   @TagAttribute()
210   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
211   void setMarginTop(String marginTop);
212 
213   /**
214    * @param marginBottom The margin at the bottom of the parent component.
215    * @since 3.0.0
216    */
217   @TagAttribute()
218   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
219   void setMarginBottom(String marginBottom);
220 
221   /**
222    * @param overflowX Does the component need a horizontal scrollbar.
223    * @since 3.0.0
224    */
225   @TagAttribute()
226   @UIComponentTagAttribute(
227       type = "org.apache.myfaces.tobago.layout.Overflow",
228       allowedValues = {Overflow.AUTO, Overflow.SCROLL, Overflow.HIDDEN})
229   void setOverflowX(String overflowX);
230 
231   /**
232    * @param overflowY Does the component need a vertical scrollbar.
233    * @since 3.0.0
234    */
235   @TagAttribute()
236   @UIComponentTagAttribute(
237       type = "org.apache.myfaces.tobago.layout.Overflow",
238       allowedValues = {Overflow.AUTO, Overflow.SCROLL, Overflow.HIDDEN})
239   void setOverflowY(String overflowY);
240 
241   /**
242    * @param display Indicates the renderer to render the element as
243    *                {@link Display#block}, {@link Display#inline} or {@link Display#none}.
244    * @since 3.0.0
245    */
246   @TagAttribute()
247   @UIComponentTagAttribute(
248       type = "org.apache.myfaces.tobago.layout.Display",
249       allowedValues = {Display.BLOCK, Display.INLINE, Display.NONE})
250   void setDisplay(String display);
251 
252   /**
253    * @param position Values for the position used with CSS.
254    * @since 3.0.0
255    */
256   @TagAttribute()
257   @UIComponentTagAttribute(
258       type = "org.apache.myfaces.tobago.layout.Position",
259       allowedValues = {Position.ABSOLUTE, Position.RELATIVE, Position.FIXED})
260   void setPosition(String position);
261 
262   /**
263    * The alignment of the elements inside of the container, possible values are:
264    * {@link TextAlign#left},
265    * {@link TextAlign#right},
266    * {@link TextAlign#center} and
267    * {@link TextAlign#justify}.
268    *
269    * @since 3.0.0
270    */
271   @TagAttribute
272   @UIComponentTagAttribute(
273       type = {"org.apache.myfaces.tobago.layout.TextAlign"},
274       allowedValues = {
275           TextAlign.LEFT, TextAlign.RIGHT, TextAlign.CENTER, TextAlign.JUSTIFY
276       })
277   void setTextAlign(String textAlign);
278 
279   /**
280    * The background image of the element.
281    *
282    * @since 4.0.0
283    */
284   @TagAttribute
285   @UIComponentTagAttribute
286   void setBackgroundImage(String backgroundImage);
287 
288 }