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:
Serializable, EventListener, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener
Direct Known Subclasses:
AbstractCompactScheduleRenderer

public abstract class AbstractScheduleRenderer
extends javax.faces.render.Renderer
implements Serializable, javax.faces.event.ComponentSystemEventListener

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 org.apache.myfaces.custom.schedule.util.ScheduleEntryComparator comparator
           
static String DEFAULT_THEME
           
static String EVOLUTION_THEME
           
protected static String LAST_CLICKED_DATE
           
protected static String LAST_CLICKED_Y
           
static String OUTLOOK_THEME
           
 
Constructor Summary
AbstractScheduleRenderer()
           
 
Method Summary
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected abstract  Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, String dateId, String yPos)
          Determine the last clicked date
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
           
protected  Calendar getCalendarInstance(org.apache.myfaces.custom.schedule.UIScheduleBase schedule, Date date)
           
protected static DateFormat getDateFormat(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.UIScheduleBase schedule, String pattern)
           
protected static DateFormat getDateFormat(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.UIScheduleBase schedule, String pattern, Date date)
           
protected  String getDateString(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.UIScheduleBase schedule, 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  org.apache.myfaces.custom.schedule.ScheduleEntryRenderer getEntryRenderer(org.apache.myfaces.custom.schedule.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(org.apache.myfaces.custom.schedule.UIScheduleBase schedule)
           
protected  String getStyleClass(javax.faces.component.UIComponent component, String className)
           Allow the developer to specify custom CSS classnames for the schedule component.
 void processEvent(javax.faces.event.ComponentSystemEvent event)
           
 
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 org.apache.myfaces.custom.schedule.util.ScheduleEntryComparator comparator

LAST_CLICKED_DATE

protected static final String LAST_CLICKED_DATE
See Also:
Constant Field Values

LAST_CLICKED_Y

protected static final String LAST_CLICKED_Y
See Also:
Constant Field Values

DEFAULT_THEME

public static final String DEFAULT_THEME
See Also:
Constant Field Values

OUTLOOK_THEME

public static final String OUTLOOK_THEME
See Also:
Constant Field Values

EVOLUTION_THEME

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

AbstractScheduleRenderer

public AbstractScheduleRenderer()
Method Detail

processEvent

public void processEvent(javax.faces.event.ComponentSystemEvent event)
Specified by:
processEvent in interface javax.faces.event.ComponentSystemEventListener

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 IOException
Overrides:
encodeBegin in class javax.faces.render.Renderer
Throws:
IOException
See Also:
Renderer.encodeBegin(javax.faces.context.FacesContext, javax.faces.component.UIComponent)

getDateString

protected String getDateString(javax.faces.context.FacesContext context,
                               org.apache.myfaces.custom.schedule.UIScheduleBase schedule,
                               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 DateFormat getDateFormat(javax.faces.context.FacesContext context,
                                          org.apache.myfaces.custom.schedule.UIScheduleBase schedule,
                                          String pattern)

getDateFormat

protected static DateFormat getDateFormat(javax.faces.context.FacesContext context,
                                          org.apache.myfaces.custom.schedule.UIScheduleBase schedule,
                                          String pattern,
                                          Date date)

getStyleClass

protected String getStyleClass(javax.faces.component.UIComponent component,
                               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 org.apache.myfaces.custom.schedule.ScheduleEntryRenderer getEntryRenderer(org.apache.myfaces.custom.schedule.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(org.apache.myfaces.custom.schedule.UIScheduleBase schedule)
Parameters:
schedule - The schedule
Returns:
The row height, in pixels

determineLastClickedDate

protected abstract Date determineLastClickedDate(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                                 String dateId,
                                                 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 Calendar getCalendarInstance(org.apache.myfaces.custom.schedule.UIScheduleBase schedule,
                                       Date date)


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