Interface HolidayPolicy
-
- All Superinterfaces:
Policy
public interface HolidayPolicy extends Policy
This interface is used byCalendarPane
andDatePicker
to provide means to define hollidays and optionally provide descriptions to them.- Author:
- Michael Baranov
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getHollidayName(java.lang.Object source, java.util.Calendar date)
This method is used to query a description for a holliday date.boolean
isHolliday(java.lang.Object source, java.util.Calendar date)
This method is used to check if a date is a holliday.boolean
isWeekend(java.lang.Object source, java.util.Calendar date)
This method is used to check if a date is a weekend date.-
Methods inherited from interface com.michaelbaranov.microba.common.Policy
addVetoPolicyListener, removeVetoPolicyListener
-
-
-
-
Method Detail
-
isHolliday
boolean isHolliday(java.lang.Object source, java.util.Calendar date)
This method is used to check if a date is a holliday. Holliday dates are displayed by contols in a special way.- Parameters:
source
- a control calling this methoddate
- a date to check- Returns:
true
if givendate
is a hollidayfalse
otherwise
-
isWeekend
boolean isWeekend(java.lang.Object source, java.util.Calendar date)
This method is used to check if a date is a weekend date. Implementation should only check day of week component of the date.- Parameters:
source
- a control calling this methoddate
- a date to check- Returns:
true
if givendate
is weekend datefalse
otherwise
-
getHollidayName
java.lang.String getHollidayName(java.lang.Object source, java.util.Calendar date)
This method is used to query a description for a holliday date. Note, that implementation may return localized results based on the locale passed with the date.- Parameters:
source
- a control calling this methoddate
- a holliday date to get the description for- Returns:
- a localized name (a description) for a holliday
-
-