org.calendartag.decorator
Interface CalendarDecorator

All Known Implementing Classes:
DefaultCalendarDecorator

public interface CalendarDecorator

The Calendar Decorator defines the interface for decoraing a rendered calendar. Provide the fully qualifed classpath of an implementation as the decorator attribute.

Since:
Aug 28, 2004
Author:
James Smith
See Also:
org.calendartag.decorators.DefaultCalendarDecorator

Method Summary
 java.lang.String getCalendarTitle()
          Gets the calendar's title.
 java.lang.String getDay(java.lang.String url)
          Gets the contents of an unempty day.
 java.lang.String getDayStyleClass(boolean isOddMonth, boolean isSelectedDay)
          Called when a day cell is being rendered.
 java.lang.String getEmptyDay()
          Gets the contents of an empty day.
 java.lang.String getNextLink(java.lang.String url)
          Gets the next link as HTML
 java.lang.String getPreviousLink(java.lang.String url)
          Gets the previous link as HTML
 java.lang.String getWeekdayTitle(int day)
          Gets the day of the week's abreviation for each column.
 void initializeCalendar()
          Called before any of the calendar is displayed.
 void setCalendar(java.util.Calendar calendar)
          Defines a Calendar object that will always reflect the current day being rendered.
 void setEnd(java.util.Calendar end)
          Sets the end date of the calendar's range
 void setPageContext(javax.servlet.jsp.PageContext pageContext)
          Defines the pageContext which should bea useful elsewhere.
 void setStart(java.util.Calendar start)
          Sets the start date of the calendar's range
 

Method Detail

getDayStyleClass

public java.lang.String getDayStyleClass(boolean isOddMonth,
                                         boolean isSelectedDay)
Called when a day cell is being rendered.

Parameters:
isOddMonth - true if the month is odd
isSelectedDay - true if the day is selected
Returns:
the string representing the css class to display.

initializeCalendar

public void initializeCalendar()
Called before any of the calendar is displayed. This is an appropriate place to determine which information is required from the database. It has access to startCalendar and endCalendar since both setEnd and setStart have already been called.


getCalendarTitle

public java.lang.String getCalendarTitle()
Gets the calendar's title.

Returns:
the calendar's title as HTML

getWeekdayTitle

public java.lang.String getWeekdayTitle(int day)
Gets the day of the week's abreviation for each column.

Parameters:
day - the day as an integer, 1-7 monday-friday
Returns:
the day of the week's abreviation as HTML

getEmptyDay

public java.lang.String getEmptyDay()
Gets the contents of an empty day.

Returns:
the contents of an empty day as HTML

getDay

public java.lang.String getDay(java.lang.String url)
Gets the contents of an unempty day. setCalendar will have previously been called, this object will contain the information required to know which day it is.

Parameters:
url - the url that can be used to set the current day to focus
Returns:
the contents of an unempty day as HTML

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContext)
Defines the pageContext which should bea useful elsewhere.

Parameters:
pageContext - the pageContext of the HttpServletRequest

setCalendar

public void setCalendar(java.util.Calendar calendar)
Defines a Calendar object that will always reflect the current day being rendered.

Parameters:
calendar - a Calendar object

getPreviousLink

public java.lang.String getPreviousLink(java.lang.String url)
Gets the previous link as HTML

Parameters:
url - the url that the previous link should point to
Returns:
the previous link

getNextLink

public java.lang.String getNextLink(java.lang.String url)
Gets the next link as HTML

Parameters:
url - the url that the next link should point to
Returns:
the next link

setStart

public void setStart(java.util.Calendar start)
Sets the start date of the calendar's range

Parameters:
start - the start date

setEnd

public void setEnd(java.util.Calendar end)
Sets the end date of the calendar's range

Parameters:
end - the end date


Copyright © 2004-2005 Sourceforge. All Rights Reserved.