View Javadoc

1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.component;
21  
22  import javax.faces.component.UIComponentBase;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
25  import org.apache.myfaces.tobago.internal.util.StringUtils;
26  import org.apache.myfaces.tobago.internal.util.Deprecation;
27  import org.apache.myfaces.tobago.renderkit.MarginValues;
28  import org.apache.myfaces.tobago.renderkit.SpacingValues;
29  import org.apache.myfaces.tobago.renderkit.LayoutComponentRenderer;
30  import javax.el.ELException;
31  import javax.faces.FacesException;
32  import java.util.ArrayList;
33  import java.util.List;
34  import javax.el.MethodExpression;
35  import javax.el.ValueExpression;
36  
37  /** 
38   Add a style tag with the given file name.
39    <p/>
40    Remark: Inline styles are deprecated because of CSP.
41    * UIComponent class, generated from template {@code component2.0.stg} with class
42    * {@link org.apache.myfaces.tobago.internal.taglib.component.StyleTagDeclaration}.
43   */
44  public class UIStyle
45      extends UIComponentBase  {
46  
47    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Style";
48  
49    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.Style";
50  
51  
52    enum PropertyKeys {
53      style,
54      file,
55    }
56  
57    public String getFamily() {
58      return COMPONENT_FAMILY;
59    }
60  
61  
62    /**
63    stylesheet to add to page.
64  
65    @deprecated*/
66    @Deprecated
67    public java.lang.String getStyle() {
68      return (java.lang.String) getStateHelper().eval(PropertyKeys.style);
69    }
70  
71    @Deprecated
72    public void setStyle(java.lang.String style) {
73        Deprecation.LOG.error("The attribute 'style' of 'UIStyle' is deprecated. "
74            + "Please refer the documentation for further information.");
75      getStateHelper().put(PropertyKeys.style, style);
76    }
77  
78    /**
79    Name of the stylesheet file to add to page.
80  
81    */
82    public java.lang.String getFile() {
83      return (java.lang.String) getStateHelper().eval(PropertyKeys.file);
84    }
85  
86    public void setFile(java.lang.String file) {
87      getStateHelper().put(PropertyKeys.file, file);
88    }
89  
90  
91  
92  }