org.apache.myfaces.custom.schedule.renderer
Class AbstractScheduleRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.myfaces.custom.schedule.renderer.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

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.lang.String getDateString(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, 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(javax.faces.component.UIComponent component)
          The user of the Schedule component can customize the look and feel by specifying a custom implementation of the ScheduleEntryRenderer.
protected  java.lang.String getHeaderDateFormat(javax.faces.component.UIComponent component)
           The date format that is used in the schedule header
protected  int getRowHeight(java.util.Map attributes)
           
protected abstract  java.lang.String getRowHeightProperty()
           
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.
protected  java.lang.String getTheme(javax.faces.component.UIComponent component)
           The theme used when rendering the schedule
protected  boolean showTooltip(javax.faces.component.UIComponent component)
           Should the tooltip be made visible?
 
Methods inherited from class javax.faces.render.Renderer
convertClientId, encodeChildren, encodeEnd, getConvertedValue, getRendersChildren
 
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,
                                         javax.faces.component.UIComponent component,
                                         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
component - the component
date - the date
Returns:
the date string

getTheme

protected java.lang.String getTheme(javax.faces.component.UIComponent component)

The theme used when rendering the schedule

Parameters:
component - the component
Returns:
the theme

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

getHeaderDateFormat

protected java.lang.String getHeaderDateFormat(javax.faces.component.UIComponent component)

The date format that is used in the schedule header

Parameters:
component - the component
Returns:
Returns the headerDateFormat.

showTooltip

protected boolean showTooltip(javax.faces.component.UIComponent component)

Should the tooltip be made visible?

Parameters:
component - the component
Returns:
whether or not tooltips should be rendered

getEntryRenderer

protected ScheduleEntryRenderer getEntryRenderer(javax.faces.component.UIComponent component)
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

getRowHeightProperty

protected abstract java.lang.String getRowHeightProperty()
Returns:
The name of the property that determines the row height

getRowHeight

protected int getRowHeight(java.util.Map attributes)
Parameters:
attributes - The attributes
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


Copyright © 2009. All Rights Reserved.