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