org.apache.myfaces.custom.schedule
Interface ScheduleEntryRenderer

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultScheduleEntryRenderer

public interface ScheduleEntryRenderer
extends Serializable

The ScheduleEntryRenderer is responsible for rendering the content and the tooltip of a ScheduleEntry.

Note that the box around the entry is rendered by the ScheduleRenderer, because determining the position and size of the box cannot be done independent of the other entries.

The color of the box can be set using the getEntryColor method. This allows a developer to use different colors for the entries of different users for example.

Since:
1.1.7
Version:
$Revision$
Author:
Jurgen Lust (latest modification by $Author$)

Method Summary
 String getColor(javax.faces.context.FacesContext context, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleEntry entry, boolean selected)
          Get the color of an entry.
 String getEntryClass(org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleEntry entry)
          Get the class for the entry container.
 void renderContent(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDay day, ScheduleEntry entry, boolean compact, boolean selected)
          Render the content of an entry.
 void renderToolTip(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleEntry entry, boolean selected)
          Render the tooltip of a ScheduleEntry.
 

Method Detail

renderContent

void renderContent(javax.faces.context.FacesContext context,
                   javax.faces.context.ResponseWriter writer,
                   org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                   ScheduleDay day,
                   ScheduleEntry entry,
                   boolean compact,
                   boolean selected)
                   throws IOException
Render the content of an entry.

Parameters:
context - the FacesContext
writer - the ResponseWriter
schedule - the Schedule component
day - the current day
entry - the entry that should be rendered
compact - is the schedule rendered in a compact mode?
selected - whether or not the entry is currently selected
Throws:
IOException - when the output cannot be written

getColor

String getColor(javax.faces.context.FacesContext context,
                org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                ScheduleEntry entry,
                boolean selected)
Get the color of an entry. The border around the entry will be rendered in this color. The return value of this method should be a CSS2 color specification, such as #000000 or rgb(0,0,0). If the return value is null, then the current theme's default color will be used.

Parameters:
context - the FacesContext
schedule - the Schedule component
entry - the entry
selected - whether or not the entry is currently selected
Returns:
the color

renderToolTip

void renderToolTip(javax.faces.context.FacesContext context,
                   javax.faces.context.ResponseWriter writer,
                   org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                   ScheduleEntry entry,
                   boolean selected)
                   throws IOException
Render the tooltip of a ScheduleEntry. This method will only be called if the schedule's tooltip property is set to 'true'.

Parameters:
context - the FacesContext
writer - the ResponseWriter
schedule - the Schedule component
entry - the entry
selected - whether or not the entry is currently selected
Throws:
IOException - when the output cannot be written

getEntryClass

String getEntryClass(org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                     ScheduleEntry entry)
Get the class for the entry container. Overriding this allows the class to vary based on the entry being displayed.

Parameters:
schedule - the Schedule component
entry - the entry


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