com.ibm.xsp.util
Class HtmlUtil

java.lang.Object
  extended by com.ibm.xsp.util.HtmlUtil

public class HtmlUtil
extends java.lang.Object

This is helper utility class for HTML and XHTML renderers


Field Summary
static java.lang.String ABSOLUTE
           
static java.lang.String BACKGROUND_COLOR
           
static java.lang.String BOLD
           
static java.lang.String BOTTOM
           
static int checkRoot
           
static java.lang.String CLASS
           
static java.lang.String COLON
           
static java.lang.String COLOR
           
static java.lang.String FIXED
           
static java.lang.String FONT_FAMILY
           
static java.lang.String FONT_SIZE
           
static java.lang.String FONT_STYLE
           
static java.lang.String FONT_WEIGHT
           
static java.lang.String HEIGHT
           
static java.lang.String ID
           
static java.lang.String ITALIC
           
static java.lang.String JAVASCRIPT
           
static java.lang.String JAVASCRIPT_CLIENTSIDE
           
static java.lang.String LEFT
           
static java.lang.String OVERFLOW
           
static java.lang.String PARAGRAPH
           
static java.lang.String POSITION
           
static java.lang.String PT
           
static java.lang.String PX
           
static java.lang.String RELATIVE
           
static java.lang.String RIGHT
           
static java.lang.String SEMI_COLON
           
static java.lang.String SPAN
           
static java.lang.String STATIC
           
static java.lang.String STYLE
           
static java.lang.String STYLECLASS
           
static java.lang.String TimeZoneCookie
           
static java.lang.String TOP
           
static int useHTML
           
static int useXHTML
           
static java.lang.String VERTICAL_ALIGN
           
static java.lang.String WIDTH
           
static java.lang.String Z_INDEX
           
 
Constructor Summary
HtmlUtil()
           
 
Method Summary
static void addCssStyle(java.lang.String cssProperty, java.lang.String cssValue, java.lang.StringBuilder sBuf)
           
static java.util.TimeZone computeClientTimeZone(java.lang.String valueCookie)
           
static java.lang.String extractProperty(java.lang.String style, java.lang.String property)
           
static int extractPropertyInt(java.lang.String style, java.lang.String property)
           
static boolean isUserId(java.lang.String id)
          Return true if this id was user defined
static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c)
          Read the value stored during encodeBegin.
static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, boolean remove)
           
static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, java.lang.String prop)
           
static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, java.lang.String prop, boolean remove)
           
static void removeEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c)
           
static void removeEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, java.lang.String prop)
           
static void storeEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, java.lang.Object value)
          Store a value during the encodeBegin method, and reuse it during encodeEnd.
static void storeEncodeParameter(javax.faces.context.FacesContext context, javax.faces.component.UIComponent c, java.lang.String prop, java.lang.Object value)
           
static java.lang.String toHTMLContentString(java.lang.String s, boolean replaceSpaces)
          Converts a Java string to an HTML one, with internal entities into a Java string.
static java.lang.String toHTMLContentString(java.lang.String s, boolean replaceSpaces, int forceHtml)
           
static void writeIdAttribute(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          Write user defined id attribute for the specified component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final java.lang.String ID
See Also:
Constant Field Values

COLON

public static final java.lang.String COLON
See Also:
Constant Field Values

SEMI_COLON

public static final java.lang.String SEMI_COLON
See Also:
Constant Field Values

STYLE

public static final java.lang.String STYLE
See Also:
Constant Field Values

STYLECLASS

public static final java.lang.String STYLECLASS
See Also:
Constant Field Values

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values

SPAN

public static final java.lang.String SPAN
See Also:
Constant Field Values

PARAGRAPH

public static final java.lang.String PARAGRAPH
See Also:
Constant Field Values

FONT_FAMILY

public static final java.lang.String FONT_FAMILY
See Also:
Constant Field Values

FONT_SIZE

public static final java.lang.String FONT_SIZE
See Also:
Constant Field Values

FONT_STYLE

public static final java.lang.String FONT_STYLE
See Also:
Constant Field Values

FONT_WEIGHT

public static final java.lang.String FONT_WEIGHT
See Also:
Constant Field Values

BOLD

public static final java.lang.String BOLD
See Also:
Constant Field Values

ITALIC

public static final java.lang.String ITALIC
See Also:
Constant Field Values

COLOR

public static final java.lang.String COLOR
See Also:
Constant Field Values

BACKGROUND_COLOR

public static final java.lang.String BACKGROUND_COLOR
See Also:
Constant Field Values

JAVASCRIPT

public static final java.lang.String JAVASCRIPT
See Also:
Constant Field Values

JAVASCRIPT_CLIENTSIDE

public static final java.lang.String JAVASCRIPT_CLIENTSIDE
See Also:
Constant Field Values

TOP

public static final java.lang.String TOP
See Also:
Constant Field Values

LEFT

public static final java.lang.String LEFT
See Also:
Constant Field Values

BOTTOM

public static final java.lang.String BOTTOM
See Also:
Constant Field Values

RIGHT

public static final java.lang.String RIGHT
See Also:
Constant Field Values

OVERFLOW

public static final java.lang.String OVERFLOW
See Also:
Constant Field Values

POSITION

public static final java.lang.String POSITION
See Also:
Constant Field Values

VERTICAL_ALIGN

public static final java.lang.String VERTICAL_ALIGN
See Also:
Constant Field Values

Z_INDEX

public static final java.lang.String Z_INDEX
See Also:
Constant Field Values

WIDTH

public static final java.lang.String WIDTH
See Also:
Constant Field Values

HEIGHT

public static final java.lang.String HEIGHT
See Also:
Constant Field Values

STATIC

public static final java.lang.String STATIC
See Also:
Constant Field Values

ABSOLUTE

public static final java.lang.String ABSOLUTE
See Also:
Constant Field Values

RELATIVE

public static final java.lang.String RELATIVE
See Also:
Constant Field Values

FIXED

public static final java.lang.String FIXED
See Also:
Constant Field Values

PX

public static final java.lang.String PX
See Also:
Constant Field Values

PT

public static final java.lang.String PT
See Also:
Constant Field Values

checkRoot

public static int checkRoot

useHTML

public static int useHTML

useXHTML

public static int useXHTML

TimeZoneCookie

public static final java.lang.String TimeZoneCookie
See Also:
Constant Field Values
Constructor Detail

HtmlUtil

public HtmlUtil()
Method Detail

storeEncodeParameter

public static void storeEncodeParameter(javax.faces.context.FacesContext context,
                                        javax.faces.component.UIComponent c,
                                        java.lang.Object value)
Store a value during the encodeBegin method, and reuse it during encodeEnd.


storeEncodeParameter

public static void storeEncodeParameter(javax.faces.context.FacesContext context,
                                        javax.faces.component.UIComponent c,
                                        java.lang.String prop,
                                        java.lang.Object value)

removeEncodeParameter

public static void removeEncodeParameter(javax.faces.context.FacesContext context,
                                         javax.faces.component.UIComponent c)

removeEncodeParameter

public static void removeEncodeParameter(javax.faces.context.FacesContext context,
                                         javax.faces.component.UIComponent c,
                                         java.lang.String prop)

readEncodeParameter

public static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context,
                                                   javax.faces.component.UIComponent c)
Read the value stored during encodeBegin. A call to this method removes access to the value.


readEncodeParameter

public static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context,
                                                   javax.faces.component.UIComponent c,
                                                   boolean remove)

readEncodeParameter

public static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context,
                                                   javax.faces.component.UIComponent c,
                                                   java.lang.String prop)

readEncodeParameter

public static java.lang.Object readEncodeParameter(javax.faces.context.FacesContext context,
                                                   javax.faces.component.UIComponent c,
                                                   java.lang.String prop,
                                                   boolean remove)

isUserId

public static boolean isUserId(java.lang.String id)
Return true if this id was user defined


writeIdAttribute

public static void writeIdAttribute(javax.faces.context.FacesContext context,
                                    javax.faces.component.UIComponent component)
                             throws java.io.IOException
Write user defined id attribute for the specified component

Throws:
java.io.IOException

addCssStyle

public static void addCssStyle(java.lang.String cssProperty,
                               java.lang.String cssValue,
                               java.lang.StringBuilder sBuf)

extractProperty

public static java.lang.String extractProperty(java.lang.String style,
                                               java.lang.String property)

extractPropertyInt

public static int extractPropertyInt(java.lang.String style,
                                     java.lang.String property)

toHTMLContentString

public static java.lang.String toHTMLContentString(java.lang.String s,
                                                   boolean replaceSpaces)
Converts a Java string to an HTML one, with internal entities into a Java string. Space character is replaced by  

Parameters:
s - the Java string
Returns:
the converted string

toHTMLContentString

public static java.lang.String toHTMLContentString(java.lang.String s,
                                                   boolean replaceSpaces,
                                                   int forceHtml)
Parameters:
forceHtml - 0 indicates to check the viewRoot, 1 indicates to use HTML, 2 indicates to use XHTML.

computeClientTimeZone

public static java.util.TimeZone computeClientTimeZone(java.lang.String valueCookie)