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   This tag adds script files to include into the rendered page.
39    <p/>
40    Deprecated (because of CSP): This tag adds client side script to the rendered page.
41    * UIComponent class, generated from template {@code component2.0.stg} with class
42    * {@link org.apache.myfaces.tobago.internal.taglib.component.ScriptTagDeclaration}.
43   */
44  public class UIScript
45      extends UIComponentBase  {
46  
47    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.Script";
48  
49    public static final String COMPONENT_FAMILY = "org.apache.myfaces.tobago.Script";
50  
51  
52    enum PropertyKeys {
53      onload,
54      file,
55      onunload,
56      script,
57      onexit,
58      onsubmit,
59    }
60  
61    public String getFamily() {
62      return COMPONENT_FAMILY;
63    }
64  
65  
66    @Deprecated
67    public java.lang.String getOnload() {
68      return (java.lang.String) getStateHelper().eval(PropertyKeys.onload);
69    }
70  
71    @Deprecated
72    public void setOnload(java.lang.String onload) {
73        Deprecation.LOG.error("The attribute 'onload' of 'UIScript' is deprecated. "
74            + "Please refer the documentation for further information.");
75      getStateHelper().put(PropertyKeys.onload, onload);
76    }
77  
78    /**
79    File name to include into the rendered 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    @Deprecated
91    public java.lang.String getOnunload() {
92      return (java.lang.String) getStateHelper().eval(PropertyKeys.onunload);
93    }
94  
95    @Deprecated
96    public void setOnunload(java.lang.String onunload) {
97        Deprecation.LOG.error("The attribute 'onunload' of 'UIScript' is deprecated. "
98            + "Please refer the documentation for further information.");
99      getStateHelper().put(PropertyKeys.onunload, onunload);
100   }
101 
102   @Deprecated
103   public java.lang.String getScript() {
104     return (java.lang.String) getStateHelper().eval(PropertyKeys.script);
105   }
106 
107   @Deprecated
108   public void setScript(java.lang.String script) {
109       Deprecation.LOG.error("The attribute 'script' of 'UIScript' is deprecated. "
110           + "Please refer the documentation for further information.");
111     getStateHelper().put(PropertyKeys.script, script);
112   }
113 
114   @Deprecated
115   public java.lang.String getOnexit() {
116     return (java.lang.String) getStateHelper().eval(PropertyKeys.onexit);
117   }
118 
119   @Deprecated
120   public void setOnexit(java.lang.String onexit) {
121       Deprecation.LOG.error("The attribute 'onexit' of 'UIScript' is deprecated. "
122           + "Please refer the documentation for further information.");
123     getStateHelper().put(PropertyKeys.onexit, onexit);
124   }
125 
126   @Deprecated
127   public java.lang.String getOnsubmit() {
128     return (java.lang.String) getStateHelper().eval(PropertyKeys.onsubmit);
129   }
130 
131   @Deprecated
132   public void setOnsubmit(java.lang.String onsubmit) {
133       Deprecation.LOG.error("The attribute 'onsubmit' of 'UIScript' is deprecated. "
134           + "Please refer the documentation for further information.");
135     getStateHelper().put(PropertyKeys.onsubmit, onsubmit);
136   }
137 
138 
139 }