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      componentFamily = "org.apache.myfaces.tobago.Style",
43      rendererType = RendererTypes.STYLE,
44      allowedChildComponenents = "NONE")
45  public interface StyleTagDeclaration extends HasIdBindingAndRendered {
46  
47    /**
48     * Name of the stylesheet file to add to page. The name must be full qualified, or relative.
49     * If using a complete path from root, you'll need to add the contextPath from the web application.
50     * This can be done with the EL #{request.contextPath}.
51     */
52    @TagAttribute()
53    @UIComponentTagAttribute()
54    void setFile(String file);
55  
56    /**
57     * @param customClass A custom CSS class for the parent component.
58     *                    Note: The rendered attribute has no effect to the use of this customClass.
59     *                    To switch the customClass, you may use an EL expression
60     *                    like e.g. customClass="#{isError ? 'red' : null}".
61     * @since 3.0.0
62     */
63    @TagAttribute()
64    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.renderkit.css.CustomClass")
65    void setCustomClass(String customClass);
66  
67    /**
68     * @param selector A selector to define the element for this style rules. Defaults to the ID of the parent component.
69     * @since 4.0.0
70     */
71    @TagAttribute()
72    @UIComponentTagAttribute()
73    void setSelector(String selector);
74  
75    /**
76     * @param width The width for the parent component.
77     * @since 3.0.0
78     */
79    @TagAttribute()
80    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
81    void setWidth(String width);
82  
83    /**
84     * @param height The height for the parent component.
85     * @since 3.0.0
86     */
87    @TagAttribute()
88    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
89    void setHeight(String height);
90  
91    /**
92     * @param minWidth The minimum width for the parent component.
93     * @since 3.0.0
94     */
95    @TagAttribute()
96    @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
97    void setMinWidth(String minWidth);
98  
99    /**
100    * @param minHeight The minimum height for the parent component.
101    * @since 3.0.0
102    */
103   @TagAttribute()
104   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
105   void setMinHeight(String minHeight);
106 
107   /**
108    * @param maxWidth The maximum width for the parent component.
109    * @since 3.0.0
110    */
111   @TagAttribute()
112   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
113   void setMaxWidth(String maxWidth);
114 
115   /**
116    * @param maxHeight The maximum height for the parent component.
117    * @since 3.0.0
118    */
119   @TagAttribute()
120   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
121   void setMaxHeight(String maxHeight);
122 
123   /**
124    * @param left The left position value for the parent component.
125    * @since 3.0.0
126    */
127   @TagAttribute()
128   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
129   void setLeft(String left);
130 
131   /**
132    * @param right The left position value for the parent component.
133    * @since 3.0.0
134    */
135   @TagAttribute()
136   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
137   void setRight(String right);
138 
139   /**
140    * @param top The top position value for the parent component.
141    * @since 3.0.0
142    */
143   @TagAttribute()
144   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
145   void setTop(String top);
146 
147   /**
148    * @param bottom The top position value for the parent component.
149    * @since 3.0.0
150    */
151   @TagAttribute()
152   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
153   void setBottom(String bottom);
154 
155   /**
156    * @param paddingLeft The left padding.
157    * @since 3.0.0
158    */
159   @TagAttribute()
160   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
161   void setPaddingLeft(String paddingLeft);
162 
163   /**
164    * @param paddingRight The right padding.
165    * @since 3.0.0
166    */
167   @TagAttribute()
168   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
169   void setPaddingRight(String paddingRight);
170 
171   /**
172    * @param paddingTop The top padding.
173    * @since 3.0.0
174    */
175   @TagAttribute()
176   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
177   void setPaddingTop(String paddingTop);
178 
179   /**
180    * @param paddingBottom The bottom padding.
181    * @since 3.0.0
182    */
183   @TagAttribute()
184   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
185   void setPaddingBottom(String paddingBottom);
186 
187   /**
188    * @param marginLeft The margin at the left of the parent component.
189    * @since 3.0.0
190    */
191   @TagAttribute()
192   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
193   void setMarginLeft(String marginLeft);
194 
195   /**
196    * @param marginRight The margin at the right of the parent component.
197    * @since 3.0.0
198    */
199   @TagAttribute()
200   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
201   void setMarginRight(String marginRight);
202 
203   /**
204    * @param marginTop The margin at the top of the parent component.
205    * @since 3.0.0
206    */
207   @TagAttribute()
208   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
209   void setMarginTop(String marginTop);
210 
211   /**
212    * @param marginBottom The margin at the bottom of the parent component.
213    * @since 3.0.0
214    */
215   @TagAttribute()
216   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
217   void setMarginBottom(String marginBottom);
218 
219   /**
220    * @param overflowX Does the component need a horizontal scrollbar.
221    * @since 3.0.0
222    */
223   @TagAttribute()
224   @UIComponentTagAttribute(
225       type = "org.apache.myfaces.tobago.layout.Overflow",
226       allowedValues = {Overflow.AUTO, Overflow.SCROLL, Overflow.HIDDEN})
227   void setOverflowX(String overflowX);
228 
229   /**
230    * @param overflowY Does the component need a vertical scrollbar.
231    * @since 3.0.0
232    */
233   @TagAttribute()
234   @UIComponentTagAttribute(
235       type = "org.apache.myfaces.tobago.layout.Overflow",
236       allowedValues = {Overflow.AUTO, Overflow.SCROLL, Overflow.HIDDEN})
237   void setOverflowY(String overflowY);
238 
239   /**
240    * @param display Indicates the renderer to render the element as
241    *                {@link Display#block}, {@link Display#inline} or {@link Display#none}.
242    * @since 3.0.0
243    */
244   @TagAttribute()
245   @UIComponentTagAttribute(
246       type = "org.apache.myfaces.tobago.layout.Display",
247       allowedValues = {Display.BLOCK, Display.INLINE, Display.GRID, Display.NONE})
248   void setDisplay(String display);
249 
250   /**
251    * @param position Values for the position used with CSS.
252    * @since 3.0.0
253    */
254   @TagAttribute()
255   @UIComponentTagAttribute(
256       type = "org.apache.myfaces.tobago.layout.Position",
257       allowedValues = {Position.ABSOLUTE, Position.RELATIVE, Position.FIXED})
258   void setPosition(String position);
259 
260   /**
261    * The alignment of the elements inside of the container, possible values are:
262    * {@link TextAlign#left},
263    * {@link TextAlign#right},
264    * {@link TextAlign#center} and
265    * {@link TextAlign#justify}.
266    *
267    * @since 3.0.0
268    */
269   @TagAttribute
270   @UIComponentTagAttribute(
271       type = {"org.apache.myfaces.tobago.layout.TextAlign"},
272       allowedValues = {
273           TextAlign.LEFT, TextAlign.RIGHT, TextAlign.CENTER, TextAlign.JUSTIFY
274       })
275   void setTextAlign(String textAlign);
276 
277   /**
278    * The background image of the element.
279    *
280    * @since 4.0.0
281    */
282   @TagAttribute
283   @UIComponentTagAttribute
284   void setBackgroundImage(String backgroundImage);
285 
286   /**
287    * Flex grow value of the element.
288    *
289    * @since 4.0.0
290    */
291   @TagAttribute
292   @UIComponentTagAttribute(type = "java.lang.Number")
293   void setFlexGrow(String flexGrow);
294 
295   /**
296    * Flex shrink value of the element.
297    *
298    * @since 4.0.0
299    */
300   @TagAttribute
301   @UIComponentTagAttribute(type = "java.lang.Number")
302   void setFlexShrink(String flexShrink);
303 
304   /**
305    * Flex basis value of the element.
306    *
307    * @since 4.0.0
308    */
309   @TagAttribute
310   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.Measure")
311   void setFlexBasis(String flexBasis);
312 
313   /**
314    * Grid template columns value of the element.
315    *
316    * @since 4.0.0
317    */
318   @TagAttribute
319   @UIComponentTagAttribute//(type = "org.apache.myfaces.tobago.layout.TBD")
320   void setGridTemplateColumns(String gridTemplateColumns);
321 
322   /**
323    * Grid template rows value of the element.
324    *
325    * @since 4.0.0
326    */
327   @TagAttribute
328   @UIComponentTagAttribute//(type = "org.apache.myfaces.tobago.layout.TBD")
329   void setGridTemplateRows(String gridTemplateRows);
330 
331   /**
332    * Grid column value of the element.
333    *
334    * @since 4.0.0
335    */
336   @TagAttribute
337   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.GridSpan")
338   void setGridColumn(String gridColumn);
339 
340   /**
341    * Grid row value of the element.
342    *
343    * @since 4.0.0
344    */
345   @TagAttribute
346   @UIComponentTagAttribute(type = "org.apache.myfaces.tobago.layout.GridSpan")
347   void setGridRow(String gridRow);
348 
349   /**
350    * Note: The rendered attribute has no effect to the use of the customClass attribute.
351    */
352   @Override
353   void setRendered(String rendered);
354 }