com.cc.framework.ui.painter.html
Class HtmlPainterHelp

java.lang.Object
  extended bycom.cc.framework.ui.painter.html.HtmlPainterHelp

public abstract class HtmlPainterHelp
extends java.lang.Object

Utility Class to add the JavaScript object "DTPRes" to a HTML page and initialize the JavaScript object with the localized weekday names, month names, button labels and the window title. The calendar.js file need this information to retrieve and display the localized message strings. Predefined keys can be used to specified the message resources within the resource bundle for the application.

Since:
1.4
Version:
$Revision: 1.17 $
Author:
Gernot Schulz

Constructor Summary
protected HtmlPainterHelp()
          Constructor
 
Method Summary
static void createBase(javax.servlet.jsp.PageContext pageContext)
          Writes the HTML base tag to the output
static void createButton(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.String textResourceKey, java.lang.String tooltipResourceKey, java.lang.String styleId, java.lang.String onClick)
          Writes a Button to the Page
static void createCalendarScript(javax.servlet.jsp.PageContext pageContext)
          Generate the JavaScript and initialize the DTPRes JavaScript object.
static void createCalendarScript(javax.servlet.jsp.PageContext pageContext, java.lang.String localeName)
          Generate the JavaScript and initialize the DTPRes JavaScript object.
static void createFameworkIncludes(javax.servlet.jsp.PageContext pageContext)
          Writes the Framework includes into the current page
static java.lang.String getLiteral(javax.servlet.jsp.PageContext pageContext, java.lang.String key)
          Retrieves a calendar resource
static java.lang.String getStringLiteral(javax.servlet.jsp.PageContext pageContext, java.lang.String key)
          Retrieves a calendar resource as a JavaScript String literal ( 'xxxx' )
protected static java.lang.String html(java.lang.String raw)
          Method encodeHtml
protected static java.lang.String[] removeEmptyElements(java.lang.String[] arr)
          Removes the null elements from the array
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlPainterHelp

protected HtmlPainterHelp()
Constructor

Method Detail

html

protected static java.lang.String html(java.lang.String raw)
Method encodeHtml

Parameters:
raw - Raw String
Returns:
HTML encoded String or null

createCalendarScript

public static void createCalendarScript(javax.servlet.jsp.PageContext pageContext)
Generate the JavaScript and initialize the DTPRes JavaScript object.

Parameters:
pageContext - The JSP Page Context

createCalendarScript

public static void createCalendarScript(javax.servlet.jsp.PageContext pageContext,
                                        java.lang.String localeName)
Generate the JavaScript and initialize the DTPRes JavaScript object.

Parameters:
pageContext - The JSP Page Context
localeName - The name of the locale to use

createFameworkIncludes

public static void createFameworkIncludes(javax.servlet.jsp.PageContext pageContext)
Writes the Framework includes into the current page

Parameters:
pageContext - PageContext

createBase

public static void createBase(javax.servlet.jsp.PageContext pageContext)
Writes the HTML base tag to the output

Parameters:
pageContext - PageContext

createButton

public static void createButton(javax.servlet.jsp.PageContext pageContext,
                                java.lang.String name,
                                java.lang.String textResourceKey,
                                java.lang.String tooltipResourceKey,
                                java.lang.String styleId,
                                java.lang.String onClick)
Writes a Button to the Page

Parameters:
pageContext - PageContext
name - The buttons name
textResourceKey - The buttons label text (resource key)
tooltipResourceKey - The buttons tooltip (resource key)
styleId - The buttons Style Id
onClick - OnClick Handler

getLiteral

public static java.lang.String getLiteral(javax.servlet.jsp.PageContext pageContext,
                                          java.lang.String key)
Retrieves a calendar resource

Parameters:
pageContext - PageContext
key - The framework resource key
Returns:
Resource value

getStringLiteral

public static java.lang.String getStringLiteral(javax.servlet.jsp.PageContext pageContext,
                                                java.lang.String key)
Retrieves a calendar resource as a JavaScript String literal ( 'xxxx' )

Parameters:
pageContext - PageContext
key - The framework resource key
Returns:
Resource value in quotes

removeEmptyElements

protected static java.lang.String[] removeEmptyElements(java.lang.String[] arr)
Removes the null elements from the array

Parameters:
arr - Array to check
Returns:
New Array without null elements


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.