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.behavior.ClientBehaviorHolder;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUIObject;
26  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
27  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
28  import org.apache.myfaces.tobago.internal.util.StringUtils;
29  import org.apache.myfaces.tobago.internal.util.Deprecation;
30  import org.apache.myfaces.tobago.component.Tags;
31  import javax.annotation.Generated;
32  import javax.el.ELException;
33  import javax.faces.FacesException;
34  import java.util.Arrays;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /**
42   Show external content inside of an application.
43    This will typically renders an iframe tag.
44    * UIComponent class, generated from template {@code component.stg} with class
45    * {@link org.apache.myfaces.tobago.internal.taglib.component.ObjectTagDeclaration}.
46   */
47  @Generated("component.stg")
48  public class UIObject
49      extends AbstractUIObject implements ClientBehaviorHolder {
50  
51    public static final String COMPONENT_TYPE = Tags.object.componentType();
52  
53    public static final String COMPONENT_FAMILY = "javax.faces.Output";
54  
55  
56    enum PropertyKeys {
57      markup,
58      src,
59      name,
60      sandbox,
61      customClass,
62    }
63  
64    public String getFamily() {
65      return COMPONENT_FAMILY;
66    }
67  
68  
69    public org.apache.myfaces.tobago.context.Markup getMarkup() {
70      Object object = getStateHelper().eval(PropertyKeys.markup);
71      if (object != null) {
72        return Markup.valueOf(object);
73      }
74      return null;
75    }
76  
77    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
78      getStateHelper().put(PropertyKeys.markup, markup);
79    }
80  
81    /**
82    URI to object source
83  
84    */
85    public java.lang.String getSrc() {
86      return (java.lang.String) getStateHelper().eval(PropertyKeys.src);
87    }
88  
89    public void setSrc(java.lang.String src) {
90      getStateHelper().put(PropertyKeys.src, src);
91    }
92  
93    /**
94    Name of the element.
95     If not set the id will be used as name. The id in JSF normally contains colons.
96     This doesn't work in Internet Explorer 9 and lower when using window.open(src, target).
97  
98    */
99    public java.lang.String getName() {
100     return (java.lang.String) getStateHelper().eval(PropertyKeys.name);
101   }
102 
103   public void setName(java.lang.String name) {
104     getStateHelper().put(PropertyKeys.name, name);
105   }
106 
107   /**
108   Value of the iframe sandbox attribute.
109 
110   */
111   public java.lang.String getSandbox() {
112     return (java.lang.String) getStateHelper().eval(PropertyKeys.sandbox);
113   }
114 
115   public void setSandbox(java.lang.String sandbox) {
116     getStateHelper().put(PropertyKeys.sandbox, sandbox);
117   }
118 
119   /**
120   Sets a CSS class in its parent, if the parent supports it.
121 
122    Which this feature it is possible to put a CSS class name into a component with the <tc:style> tag. Example:
123 
124    <pre>
125    &lt;tc:in&gt;
126      &lt;tc:style customClass="my-emphasized"/&gt;
127    &lt;/tc:in&gt;
128    </pre>
129 
130    One capability is, to used external CSS libs.
131    <br>
132    This feature should not be used imprudent.
133    Because it might be unstable against changes in the renderered HTML code.
134 
135   */
136   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
137     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
138   }
139 
140   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
141     getStateHelper().put(PropertyKeys.customClass, customClass);
142   }
143 
144 
145   @Override
146   public void restoreState(FacesContext context, Object state) {
147     // FIXME HACK for mojarra SystemEventListener state restoring bug
148     pushComponentToEL(context, this);
149     super.restoreState(context, state);
150     popComponentFromEL(context);
151   }
152 
153 }