org.apache.myfaces.custom.schedule
Class DefaultScheduleEntryRenderer

java.lang.Object
  extended by org.apache.myfaces.custom.schedule.DefaultScheduleEntryRenderer
All Implemented Interfaces:
Serializable, ScheduleEntryRenderer

public class DefaultScheduleEntryRenderer
extends Object
implements ScheduleEntryRenderer, Serializable

The default implementation of the ScheduleEntryRenderer

Since:
1.1.7
Version:
$Revision$
Author:
Jurgen Lust (latest modification by $Author$)
See Also:
Serialized Form

Constructor Summary
DefaultScheduleEntryRenderer()
           
 
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.
protected  String getStyleClass(javax.faces.component.UIComponent component, String className)
           Allow the developer to specify custom CSS classnames for the schedule component.
protected  void renderCompactContent(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDay day, ScheduleEntry entry, boolean selected)
           
 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.
protected  void renderDetailedContentText(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter writer, org.apache.myfaces.custom.schedule.HtmlSchedule schedule, ScheduleDay day, ScheduleEntry entry, boolean selected)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultScheduleEntryRenderer

public DefaultScheduleEntryRenderer()
Method Detail

renderContent

public 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
Description copied from interface: ScheduleEntryRenderer
Render the content of an entry.

Specified by:
renderContent in interface ScheduleEntryRenderer
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
See Also:
ScheduleEntryRenderer.renderContent(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleDay, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean, boolean)

renderCompactContent

protected void renderCompactContent(javax.faces.context.FacesContext context,
                                    javax.faces.context.ResponseWriter writer,
                                    org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                    ScheduleDay day,
                                    ScheduleEntry entry,
                                    boolean selected)
                             throws IOException
Throws:
IOException

renderDetailedContentText

protected void renderDetailedContentText(javax.faces.context.FacesContext context,
                                         javax.faces.context.ResponseWriter writer,
                                         org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                                         ScheduleDay day,
                                         ScheduleEntry entry,
                                         boolean selected)
                                  throws IOException
Throws:
IOException

getColor

public String getColor(javax.faces.context.FacesContext context,
                       org.apache.myfaces.custom.schedule.HtmlSchedule schedule,
                       ScheduleEntry entry,
                       boolean selected)
Description copied from interface: ScheduleEntryRenderer
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.

Specified by:
getColor in interface ScheduleEntryRenderer
Parameters:
context - the FacesContext
schedule - the Schedule component
entry - the entry
selected - whether or not the entry is currently selected
Returns:
the color
See Also:
ScheduleEntryRenderer.getColor(javax.faces.context.FacesContext, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)

renderToolTip

public 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
Description copied from interface: ScheduleEntryRenderer
Render the tooltip of a ScheduleEntry. This method will only be called if the schedule's tooltip property is set to 'true'.

Specified by:
renderToolTip in interface ScheduleEntryRenderer
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
See Also:
ScheduleEntryRenderer.renderToolTip(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry, boolean)

getEntryClass

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

Specified by:
getEntryClass in interface ScheduleEntryRenderer
Parameters:
schedule - the Schedule component
entry - the entry
See Also:
ScheduleEntryRenderer.getEntryClass(org.apache.myfaces.custom.schedule.HtmlSchedule, org.apache.myfaces.custom.schedule.model.ScheduleEntry)

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


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