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  package org.apache.myfaces.trinidad.render;
20  
21  import java.util.Arrays;
22  import java.util.List;
23  
24  /**
25   * This class contains some useful constants for (X)HTML rendering.
26   */
27  public final class XhtmlConstants
28  {
29    private XhtmlConstants(){}
30  
31    /**
32     * A portlet facet;  when supported, this facet should
33     * result in a version of page content optimized for use in portlets.
34     */
35    public static final String FACET_PORTLET = "portlet";
36    
37    public static final String SCRIPT_NAME = "script";
38  
39    // Horizontal alignment
40    /**
41     * Horizontal alignment constant for end alignment;  right
42     * alignment will be used in left-to-right languages, left
43     * alignment in right-to-left languages.
44     */
45    public static final String H_ALIGN_END = "end";
46  
47    // Vertical alignment
48    /**
49     * Vertical alignment constant for centering.
50     */
51    public static final String V_ALIGN_MIDDLE = "middle";
52  
53    /**
54     * Vertical alignment constant for top alignment.
55     */
56    public static final String V_ALIGN_TOP = "top";
57  
58    // ============= Html elements ================
59    public static final String DIV_ELEMENT          = "div";
60    public static final List<String> HEADER_ELEMENTS =
61      Arrays.asList(new String[]{"h1", "h2", "h3",
62                                 "h4", "h5", "h6"});
63    public static final String LINK_ELEMENT         = "a";
64    public static final String PARAGRAPH_ELEMENT = "p";
65    public static final String SCRIPT_ELEMENT       = "script";
66    public static final String SPAN_ELEMENT         = "span";
67    public static final String TABLE_DATA_ELEMENT   = "td";
68    public static final String TABLE_BODY_ELEMENT   = "tbody";
69    public static final String TABLE_ELEMENT        = "table";
70    public static final String TABLE_HEADER_ELEMENT = "th";
71    public static final String TABLE_ROW_ELEMENT    = "tr";
72    public static final String FIELDSET_ELEMENT     = "fieldset";
73    public static final String LEGEND_ELEMENT       = "legend";
74    
75    /** Unicode character for non-breaking space */
76    public static final char NBSP_CHAR = 0xA0;
77  
78    /** String containing Unicode character for non-breaking space */
79    public static final String NBSP_STRING = String.valueOf(NBSP_CHAR);
80    
81    public static final String ALIGN_ATTRIBUTE      = "align";
82    public static final String COLS_ATTRIBUTE       = "cols";
83    public static final String COLSPAN_ATTRIBUTE    = "colspan";
84    public static final String HEIGHT_ATTRIBUTE     = "height";
85    public static final String HREF_ATTRIBUTE       = "href";
86    public static final String ID_ATTRIBUTE         = "id";
87    public static final String NOWRAP_ATTRIBUTE     = "nowrap";
88    public static final String ONCLICK_ATTRIBUTE    = "onclick";
89    public static final String ROWS_ATTRIBUTE      = "rows";
90    public static final String ROWSPAN_ATTRIBUTE    = "rowspan";
91    public static final String SIZE_ATTRIBUTE       = "size";
92    public static final String STYLE_ATTRIBUTE      = "style";
93    public static final String VALIGN_ATTRIBUTE     = "valign";
94    public static final String WIDTH_ATTRIBUTE      = "width";
95    
96    public static final String DIR_ATTRIBUTE_VALUE                 = "dir";
97    public static final String EMPTY_STRING_ATTRIBUTE_VALUE        = "";
98    public static final String LEFT_ATTRIBUTE_VALUE                = "left";
99    public static final String MIDDLE_ATTRIBUTE_VALUE              = "middle";
100   public static final String ONE_HUNDRED_PERCENT_ATTRIBUTE_VALUE = "100%";
101   public static final String RIGHT_ATTRIBUTE_VALUE               = "right";
102 
103 }