org.silverpeas.calendar
Class CalendarViewContext

java.lang.Object
  extended by org.silverpeas.calendar.CalendarViewContext

public class CalendarViewContext
extends Object

User: Yohann Chastagnier Date: 17/04/13


Constructor Summary
CalendarViewContext(String componentInstanceId, String locale)
          Default constructor.
 
Method Summary
protected static ResourceLocator getBundle(String language)
          Gets the bundle
 String 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()
           
 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.
 CalendarViewContext resetFilters()
          Reset to null all filters.
 void setReferenceDay(Date date)
           
 void setViewType(CalendarViewType viewType)
           
 void setWithWeekend(boolean withWeekend)
          Set if weekends have to be displayed.
 void today()
          Set the reference date to the date of today.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarViewContext

public CalendarViewContext(String componentInstanceId,
                           String locale)
Default constructor.

Parameters:
componentInstanceId -
locale -
Method Detail

resetFilters

public CalendarViewContext resetFilters()
Reset to null all filters.


getComponentInstanceId

public String getComponentInstanceId()

getViewType

public CalendarViewType getViewType()

setViewType

public void setViewType(CalendarViewType viewType)

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 ResourceLocator getBundle(String language)
Gets the bundle

Returns:

getPeriodLabel

public static String getPeriodLabel(CalendarPeriod period,
                                    String language)
Compute a period label.

Parameters:
period -
language -
Returns:


Copyright © 2016 Silverpeas. All Rights Reserved.