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

java.lang.Object
  extended bycom.cc.framework.ui.painter.ControlPainter
      extended bycom.cc.framework.ui.painter.html.HtmlPainterBase
          extended bycom.cc.framework.ui.painter.html.HtmlTextPainter
              extended bycom.cc.framework.ui.painter.html.HtmlCalendarPainter

public class HtmlCalendarPainter
extends HtmlTextPainter

Painter for the calendar control. This painter generates the HTML whch is necessary for the calendar control. The control consist of a HTML input element followed by an img element, which is embedded into an anchor. If the user clicks on the image an new browser window opens which includes the calendar.

Since:
1.0
Version:
$Revision: 1.41 $
Author:
Gernot Schulz

Field Summary
 
Fields inherited from class com.cc.framework.ui.painter.html.HtmlTextPainter
 
Fields inherited from class com.cc.framework.ui.painter.ControlPainter
log
 
Constructor Summary
HtmlCalendarPainter(PainterContext painterContext, CalendarControl ctrl)
          Constructor for HtmlCalendarPainter
 
Method Summary
protected  org.apache.ecs.ConcreteElement doCreateElement()
          Creates the HTML-Element.
protected  org.apache.ecs.html.A doCreateImageLink()
          Creates the calendar icon which is used to open the popup calendar.
protected  java.lang.String doCreateLinkInlineWindow(java.lang.String localeStr, java.lang.String format, java.lang.String width, java.lang.String height, java.lang.String layout)
          Creates the javascript needed to open the inline calendar.
protected  java.lang.String doCreateLinkPopUpWindow(java.lang.String localeStr, java.lang.String format, java.lang.String width, java.lang.String height, java.lang.String layout)
          Creates the javascript needed to open the popup calendar, which opens in a seperat new window.
 java.lang.String getAsString(Converter converter, java.lang.Object value)
          Uses a Bean Converter to convert the given object to a String representation.
protected  java.lang.String getFormat()
          Returns the DateTime pattern /format
 
Methods inherited from class com.cc.framework.ui.painter.html.HtmlTextPainter
doCreateDisplayElement, doCreateEditElement, getCtrl, getValue
 
Methods inherited from class com.cc.framework.ui.painter.ControlPainter
ajaxPaint, attr, attr, attr, beginPaint, createActionPainter, createActionPainter, createElement, createImage, createImage, createImage, createInput, createInput, createSpacer, createSpacer, createSpacer, decorateURL, doAddDecorationsToRow, doAddDecorationsToRow, doAfterCreate, doAttachDecorations, doBeforeCreate, encodeURL, endPaint, forceControlName, getAwtColor, getColor, getContextPath, getControlName, getDecorationsOnce, getElementClass, getElementName, getFramePainter, getFrameworkString, getFrameworkString, getImage, getImage, getImage, getImageSrc, getImageSrc, getImageSrc, getLocale, getPageContext, getPainterContext, getPrincipal, getRequest, getResponse, getSession, getSmartCaption, getSmartDetail, getSource, getSource, getStringResource, getStyleId, html, html, html, init, isRunAtClient, localize, localize, localize, paint, removeHtml, removeHtml, request, response, session, showComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlCalendarPainter

public HtmlCalendarPainter(PainterContext painterContext,
                           CalendarControl ctrl)
Constructor for HtmlCalendarPainter

Parameters:
painterContext - The PainterContext
ctrl - The Control to render
Method Detail

doCreateElement

protected org.apache.ecs.ConcreteElement doCreateElement()
Description copied from class: ControlPainter
Creates the HTML-Element. This Method must be implemented by the concrete Sub-Class

Overrides:
doCreateElement in class HtmlTextPainter
See Also:
ControlPainter.doCreateElement()

doCreateImageLink

protected org.apache.ecs.html.A doCreateImageLink()
Creates the calendar icon which is used to open the popup calendar. Therefore an anchor ans some javascript is needed.

Returns:
Anchor Element which contains an image and the javascript to open the calendar

doCreateLinkPopUpWindow

protected java.lang.String doCreateLinkPopUpWindow(java.lang.String localeStr,
                                                   java.lang.String format,
                                                   java.lang.String width,
                                                   java.lang.String height,
                                                   java.lang.String layout)
Creates the javascript needed to open the popup calendar, which opens in a seperat new window.

Parameters:
localeStr - The Locale
format - The format mask
width - The window width
height - The window height
layout - The layout template to use
Returns:
HTML String

doCreateLinkInlineWindow

protected java.lang.String doCreateLinkInlineWindow(java.lang.String localeStr,
                                                    java.lang.String format,
                                                    java.lang.String width,
                                                    java.lang.String height,
                                                    java.lang.String layout)
Creates the javascript needed to open the inline calendar.

Parameters:
localeStr - The Locale
format - The format mask
width - The window width
height - The window height
layout - The layout template to use
Returns:
HTML String

getFormat

protected java.lang.String getFormat()
Returns the DateTime pattern /format

Returns:
The DateTime pattern /format

getAsString

public java.lang.String getAsString(Converter converter,
                                    java.lang.Object value)
                             throws ConverterException
Uses a Bean Converter to convert the given object to a String representation.

Overrides:
getAsString in class ControlPainter
Parameters:
converter - The converter to use or null to use a default Converter
value - The Bean to convert
Returns:
String or null
Throws:
ConverterException - Is thrown when a conversion exception occurs


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