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