org.apache.myfaces.custom.schedule
Class AbstractScheduleRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.custom.schedule.AbstractScheduleRenderer
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractCompactScheduleRenderer, ScheduleDetailedDayRenderer

public abstract class AbstractScheduleRenderer
extends javax.faces.render.Renderer
implements java.io.Serializable

Abstract superclass for all renderer of the UISchedule component

Since:
1.1.7
Version:
$Revision: 389938 $
Author:
Jurgen Lust (latest modification by $Author: mkienenb $), Bruno Aranda (adaptation of Jurgen's code to myfaces)
See Also:
Serialized Form

Field Summary
protected static ScheduleEntryComparator comparator
           
static java.lang.String DEFAULT_THEME
           
static java.lang.String EVOLUTION_THEME
           
protected static java.lang.String LAST_CLICKED_DATE
           
protected static java.lang.String LAST_CLICKED_Y
           
static java.lang.String OUTLOOK_THEME
           
 
Constructor Summary
AbstractScheduleRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected abstract  java.util.Date determineLastClickedDate(HtmlSchedule schedule, java.lang.String dateId, java.lang.String yPos)
          Determine the last clicked date
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  java.util.Calendar getCalendarInstance(UIScheduleBase schedule, java.util.Date date)
           
protected static java.text.DateFormat getDateFormat(javax.faces.context.FacesContext context, UIScheduleBase schedule, java.lang.String pattern)
           
protected static java.text.DateFormat getDateFormat(javax.faces.context.FacesContext context, UIScheduleBase schedule, java.lang.String pattern, java.util.Date date)
           
protected  java.lang.String getDateString(javax.faces.context.FacesContext context, UIScheduleBase schedule, java.util.Date date)
           Get the String representation of a date, taking into account the specified date format or the current Locale.
protected abstract  int getDefaultRowHeight()
           
protected  ScheduleEntryRenderer getEntryRenderer(HtmlSchedule schedule)
          The user of the Schedule component can customize the look and feel by specifying a custom implementation of the ScheduleEntryRenderer.
 boolean getRendersChildren()
           
protected abstract  int getRowHeight(UIScheduleBase schedule)
           
protected  java.lang.String getStyleClass(javax.faces.component.UIComponent component, java.lang.String className)
           Allow the developer to specify custom CSS classnames for the schedule component.
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeChildren, encodeEnd, getConvertedValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comparator

protected static final ScheduleEntryComparator comparator

LAST_CLICKED_DATE

protected static final java.lang.String LAST_CLICKED_DATE
See Also:
Constant Field Values

LAST_CLICKED_Y

protected static final java.lang.String LAST_CLICKED_Y
See Also:
Constant Field Values

DEFAULT_THEME

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

OUTLOOK_THEME

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

EVOLUTION_THEME

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

AbstractScheduleRenderer

public AbstractScheduleRenderer()
Method Detail

decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)
Overrides:
decode in class javax.faces.render.Renderer
See Also:
Renderer.decode(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws java.io.IOException
Overrides:
encodeBegin in class javax.faces.render.Renderer
Throws:
java.io.IOException
See Also:
Renderer.encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

getDateString

protected java.lang.String getDateString(javax.faces.context.FacesContext context,
                                         UIScheduleBase schedule,
                                         java.util.Date date)

Get the String representation of a date, taking into account the specified date format or the current Locale.

Parameters:
context - the FacesContext
schedule - the component
date - the date
Returns:
the date string

getDateFormat

protected static java.text.DateFormat getDateFormat(javax.faces.context.FacesContext context,
                                                    UIScheduleBase schedule,
                                                    java.lang.String pattern)

getDateFormat

protected static java.text.DateFormat getDateFormat(javax.faces.context.FacesContext context,
                                                    UIScheduleBase schedule,
                                                    java.lang.String pattern,
                                                    java.util.Date date)

getStyleClass

protected java.lang.String getStyleClass(javax.faces.component.UIComponent component,
                                         java.lang.String className)

Allow the developer to specify custom CSS classnames for the schedule component.

Parameters:
component - the component
className - the default CSS classname
Returns:
the custom classname

getEntryRenderer

protected ScheduleEntryRenderer getEntryRenderer(HtmlSchedule schedule)
The user of the Schedule component can customize the look and feel by specifying a custom implementation of the ScheduleEntryRenderer. This method gets an instance of the specified class, or if none was specified, takes the default.

Parameters:
component - the Schedule component
Returns:
a ScheduleEntryRenderer instance

getDefaultRowHeight

protected abstract int getDefaultRowHeight()
Returns:
The default height, in pixels, of one row in the schedule grid

getRowHeight

protected abstract int getRowHeight(UIScheduleBase schedule)
Parameters:
schedule - The schedule
Returns:
The row height, in pixels

determineLastClickedDate

protected abstract java.util.Date determineLastClickedDate(HtmlSchedule schedule,
                                                           java.lang.String dateId,
                                                           java.lang.String yPos)
Determine the last clicked date

Parameters:
schedule - the schedule component
dateId - the string identifying the date
yPos - the y coordinate of the mouse
Returns:
the clicked date

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.render.Renderer
See Also:
Renderer.getRendersChildren()

getCalendarInstance

protected java.util.Calendar getCalendarInstance(UIScheduleBase schedule,
                                                 java.util.Date date)


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.