View Javadoc

1   // WARNING: This file was automatically generated. Do not edit it directly,
2   //          or you will lose your changes.
3   
4   /*
5    * Licensed to the Apache Software Foundation (ASF) under one
6    * or more contributor license agreements.  See the NOTICE file
7    * distributed with this work for additional information
8    * regarding copyright ownership.  The ASF licenses this file
9    * to you under the Apache License, Version 2.0 (the
10   * "License"); you may not use this file except in compliance
11   * with the License.  You may obtain a copy of the License at
12   *
13   *   http://www.apache.org/licenses/LICENSE-2.0
14   *
15   * Unless required by applicable law or agreed to in writing,
16   * software distributed under the License is distributed on an
17   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18   * KIND, either express or implied.  See the License for the
19   * specific language governing permissions and limitations
20   * under the License.
21  */
22  package org.apache.myfaces.trinidad.component.html;
23  
24  import org.apache.myfaces.trinidad.bean.FacesBean;
25  import org.apache.myfaces.trinidad.bean.PropertyKey;
26  import org.apache.myfaces.trinidad.component.UIXComponentBase;
27  import org.apache.myfaces.trinidad.util.ComponentUtils;
28  
29  /**
30   *
31   * <html:p>
32   *             The meta component supports generating an html meta tag for things like reloading the page or configuring viewport characteristics like these:
33   *             <html:ul>
34   *               <html:li><html:pre>&lt;meta name="viewport" content="width=device-width, user-scalable=no"&gt;</html:pre></html:li>
35   *               <html:li><html:pre>&lt;meta name="apple-mobile-web-app-capable" content="yes"&gt;</html:pre></html:li>
36   *               <html:li><html:pre>&lt;meta http-equiv="refresh" content="2;url=./test/index.jspx"&gt;</html:pre></html:li>
37   *             </html:ul>
38   *             It is also important to note that a meta HTML tag cannot have an ID so the component ID will not be seen in the browser source.
39   * 	  </html:p>
40   *
41   * <h4>Events:</h4>
42   * <table border="1" width="100%" cellpadding="3" summary="">
43   * <tr bgcolor="#CCCCFF" class="TableHeadingColor">
44   * <th align="left">Type</th>
45   * <th align="left">Phases</th>
46   * <th align="left">Description</th>
47   * </tr>
48   * <tr class="TableRowColor">
49   * <td valign="top"><code>org.apache.myfaces.trinidad.event.AttributeChangeEvent</code></td>
50   * <td valign="top" nowrap>Invoke<br>Application<br>Apply<br>Request<br>Values</td>
51   * <td valign="top">Event delivered to describe an attribute change.  Attribute change events are not delivered for any programmatic change to a property.  They are only delivered when a renderer changes a property without the application's specific request.  An example of an attribute change event might include the width of a column that supported client-side resizing.</td>
52   * </tr>
53   * </table>
54   */
55  public class HtmlMeta extends UIXComponentBase
56  {
57    static public final String TYPE_NAME = "name";
58    static public final String TYPE_HTTP_EQUIV = "httpEquiv";
59    static public final FacesBean.Type TYPE = new FacesBean.Type(
60      UIXComponentBase.TYPE);
61    static public final PropertyKey NAME_KEY =
62      TYPE.registerKey("name", String.class);
63    static public final PropertyKey TYPE_KEY =
64      TYPE.registerKey("type", String.class, "name");
65    static public final PropertyKey CONTENT_KEY =
66      TYPE.registerKey("content", String.class);
67  
68    static public final String COMPONENT_FAMILY =
69      "org.apache.myfaces.trinidad.Meta";
70    static public final String COMPONENT_TYPE =
71      "org.apache.myfaces.trinidad.HtmlMeta";
72  
73    /**
74     * Construct an instance of the HtmlMeta.
75     */
76    public HtmlMeta()
77    {
78      super("org.apache.myfaces.trinidad.Meta");
79    }
80  
81    /**
82     * Gets the	name or the http-equiv attribute for the meta tag (see the type attribute for further configuration)
83     *
84     * @return  the new name value
85     */
86    final public String getName()
87    {
88      return ComponentUtils.resolveString(getProperty(NAME_KEY));
89    }
90  
91    /**
92     * Sets the	name or the http-equiv attribute for the meta tag (see the type attribute for further configuration)
93     * 
94     * @param name  the new name value
95     */
96    final public void setName(String name)
97    {
98      setProperty(NAME_KEY, (name));
99    }
100 
101   /**
102    * Gets <html>how the name attribute is used.  Options are:
103    *               <ul><li>name - for "name" which is the most common use for meta tags
104    *                 </li><li>httpEquiv - for "http-equiv" which is the used in some legacy meta tags
105    *                 </li></ul>
106    *               </html>
107    *
108    * @return  the new type value
109    */
110   final public String getType()
111   {
112     return ComponentUtils.resolveString(getProperty(TYPE_KEY), "name");
113   }
114 
115   /**
116    * Sets <html>how the name attribute is used.  Options are:
117    *               <ul><li>name - for "name" which is the most common use for meta tags
118    *                 </li><li>httpEquiv - for "http-equiv" which is the used in some legacy meta tags
119    *                 </li></ul>
120    *               </html>
121    * 
122    * @param type  the new type value
123    */
124   final public void setType(String type)
125   {
126     setProperty(TYPE_KEY, (type));
127   }
128 
129   /**
130    * Gets the	content for the meta tag
131    *
132    * @return  the new content value
133    */
134   final public String getContent()
135   {
136     return ComponentUtils.resolveString(getProperty(CONTENT_KEY));
137   }
138 
139   /**
140    * Sets the	content for the meta tag
141    * 
142    * @param content  the new content value
143    */
144   final public void setContent(String content)
145   {
146     setProperty(CONTENT_KEY, (content));
147   }
148 
149   @Override
150   public String getFamily()
151   {
152     return COMPONENT_FAMILY;
153   }
154 
155   @Override
156   protected FacesBean.Type getBeanType()
157   {
158     return TYPE;
159   }
160 
161   /**
162    * Construct an instance of the HtmlMeta.
163    */
164   protected HtmlMeta(
165     String rendererType
166     )
167   {
168     super(rendererType);
169   }
170 
171   static
172   {
173     TYPE.lockAndRegister("org.apache.myfaces.trinidad.Meta","org.apache.myfaces.trinidad.Meta");
174   }
175 }