Package org.silverpeas.core.web.calendar
Class CalendarTimeWindowViewContext
- java.lang.Object
-
- org.silverpeas.core.web.calendar.CalendarTimeWindowViewContext
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UserCalendarTimeWindowViewContext
public class CalendarTimeWindowViewContext extends Object implements Serializable
Handles a time window context for calendar managements.- Author:
- Yohann Chastagnier
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CalendarTimeWindowViewContext(String componentInstanceId, String locale, ZoneId zoneId)
Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAsJSonString()
List<CalendarViewType>
getAvailableViewTypes()
protected static org.silverpeas.kernel.bundle.LocalizationBundle
getBundle(String language)
Gets the bundleString
getComponentInstanceId()
int
getFirstDayOfWeek()
Gets the first day of weeks of the calendar with 1 meaning for sunday, 2 meaning for monday, and so on.String
getFormattedReferenceDay()
static String
getPeriodLabel(CalendarPeriod period, String language)
Compute a period label.CalendarDay
getReferenceDay()
CalendarPeriod
getReferencePeriod()
String
getReferencePeriodLabel()
CalendarViewType
getViewType()
ZoneId
getZoneId()
Gets the zone identifier of the view.String
getZoneIdAsString()
Gets the zone identifier of the view.boolean
isListViewMode()
boolean
isWithWeekend()
Indicates if weekends have to be displayed.void
next()
Change reference date to the next period according to the current view.void
previous()
Change reference date to the previous period according to the current view.CalendarTimeWindowViewContext
resetFilters()
Reset to null all filters.void
setAvailableViewTypes(List<CalendarViewType> availableViewTypes)
void
setListViewMode(boolean listViewMode)
void
setReferenceDay(Date date)
void
setViewType(CalendarViewType viewType)
void
setWithWeekend(boolean withWeekend)
Set if weekends have to be displayed.void
setZoneId(ZoneId zoneId)
void
today()
Set the reference date to the date of today.String
toJSonScript(String jsVariableName)
-
-
-
Method Detail
-
getAsJSonString
public String getAsJSonString()
-
resetFilters
public CalendarTimeWindowViewContext resetFilters()
Reset to null all filters.
-
getComponentInstanceId
public String getComponentInstanceId()
-
getAvailableViewTypes
public List<CalendarViewType> getAvailableViewTypes()
-
setAvailableViewTypes
public void setAvailableViewTypes(List<CalendarViewType> availableViewTypes)
-
getViewType
public CalendarViewType getViewType()
-
setViewType
public void setViewType(CalendarViewType viewType)
-
isListViewMode
public boolean isListViewMode()
-
setListViewMode
public void setListViewMode(boolean listViewMode)
-
getReferencePeriod
public CalendarPeriod getReferencePeriod()
-
getReferencePeriodLabel
public String getReferencePeriodLabel()
-
getReferenceDay
public CalendarDay getReferenceDay()
-
getFormattedReferenceDay
public String getFormattedReferenceDay()
-
setReferenceDay
public void setReferenceDay(Date date)
-
previous
public void previous()
Change reference date to the previous period according to the current view.
-
next
public void next()
Change reference date to the next period according to the current view.
-
today
public void today()
Set the reference date to the date of today.
-
isWithWeekend
public boolean isWithWeekend()
Indicates if weekends have to be displayed.- Returns:
-
setWithWeekend
public void setWithWeekend(boolean withWeekend)
Set if weekends have to be displayed.- Parameters:
withWeekend
-
-
getFirstDayOfWeek
public int getFirstDayOfWeek()
Gets the first day of weeks of the calendar with 1 meaning for sunday, 2 meaning for monday, and so on. The first day of weeks depends on the locale; the first day of weeks is monday for french whereas it is for sunday for US.- Returns:
- the first day of week.
-
getBundle
protected static org.silverpeas.kernel.bundle.LocalizationBundle getBundle(String language)
Gets the bundle- Returns:
-
getPeriodLabel
public static String getPeriodLabel(CalendarPeriod period, String language)
Compute a period label.- Parameters:
period
-language
-- Returns:
-
getZoneIdAsString
public String getZoneIdAsString()
Gets the zone identifier of the view.- Returns:
- the zone identifier as
ZoneId
instance.
-
getZoneId
public ZoneId getZoneId()
Gets the zone identifier of the view.- Returns:
- the zone identifier as
ZoneId
instance.
-
setZoneId
public void setZoneId(ZoneId zoneId)
-
-