com.vaadin.ui.components.calendar.event.
Class BasicEventProvider
- java.lang.Object
-
- com.vaadin.ui.components.calendar.event.BasicEventProvider
-
All Implemented Interfaces:
CalendarEditableEventProvider, CalendarEvent.EventChangeListener, CalendarEventProvider, CalendarEventProvider.EventSetChangeNotifier, Serializable
public class BasicEventProvider extends Object implements CalendarEditableEventProvider, CalendarEventProvider.EventSetChangeNotifier, CalendarEvent.EventChangeListener
Simple implementation of
CalendarEventProvider
. UseaddEvent(CalendarEvent)
andremoveEvent(CalendarEvent)
to add / remove events.EventSetChangeNotifier
andEventChangeListener
are also implemented, so the Calendar is notified when an event is added, changed or removed.Since:
7.1.0
Author:
Vaadin Ltd.
See Also:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.ui.components.calendar.event.CalendarEventProvider
CalendarEventProvider.EventSetChangeEvent, CalendarEventProvider.EventSetChangeListener, CalendarEventProvider.EventSetChangeNotifier
-
-
Field Summary
Fields Modifier and Type Field and Description protected List<CalendarEvent>
eventList
-
Constructor Summary
Constructors Constructor and Description BasicEventProvider()
-
Method Summary
All Methods Modifier and Type Method and Description void
addEvent(CalendarEvent event)
Adds an event to the event provider
void
addEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Add a listener for listening to when new events are adding or removed from the event provider.
boolean
containsEvent(BasicEvent event)
Does this event provider container this event
void
eventChange(CalendarEvent.EventChangeEvent changeEvent)
Called when an Event has changed.
protected void
fireEventSetChange()
Fires a eventsetchange event.
List<CalendarEvent>
getEvents(Date startDate, Date endDate)
Gets all available events in the target date range between startDate and endDate.
void
removeEvent(CalendarEvent event)
Removes an event from the event provider
void
removeEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Remove a listener which listens to
CalendarEventProvider.EventSetChangeEvent
-events
-
-
-
Field Detail
-
eventList
protected List<CalendarEvent> eventList
-
-
Method Detail
-
getEvents
public List<CalendarEvent> getEvents(Date startDate, Date endDate)
Description copied from interface:
CalendarEventProvider
Gets all available events in the target date range between startDate and endDate. The Vaadin Calendar queries the events from the range that is shown, which is not guaranteed to be the same as the date range that is set.
For example, if you set the date range to be monday 22.2.2010 - wednesday 24.2.2010, the used Event Provider will be queried for events between monday 22.2.2010 00:00 and sunday 28.2.2010 23:59. Generally you can expect the date range to be expanded to whole days and whole weeks.
Specified by:
getEvents
in interfaceCalendarEventProvider
Parameters:
startDate
- Start dateendDate
- End dateReturns:
List of events
-
containsEvent
public boolean containsEvent(BasicEvent event)
Does this event provider container this event
Parameters:
event
- The event to check forReturns:
If this provider has the event then true is returned, else false
-
addEventSetChangeListener
public void addEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Description copied from interface:
CalendarEventProvider.EventSetChangeNotifier
Add a listener for listening to when new events are adding or removed from the event provider.
Specified by:
addEventSetChangeListener
in interfaceCalendarEventProvider.EventSetChangeNotifier
Parameters:
listener
- The listener to add
-
removeEventSetChangeListener
public void removeEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Description copied from interface:
CalendarEventProvider.EventSetChangeNotifier
Remove a listener which listens to
CalendarEventProvider.EventSetChangeEvent
-eventsSpecified by:
removeEventSetChangeListener
in interfaceCalendarEventProvider.EventSetChangeNotifier
Parameters:
listener
- The listener to remove
-
fireEventSetChange
protected void fireEventSetChange()
Fires a eventsetchange event. The event is fired when either an event is added or removed to the event provider
-
eventChange
public void eventChange(CalendarEvent.EventChangeEvent changeEvent)
Description copied from interface:
CalendarEvent.EventChangeListener
Called when an Event has changed.
Specified by:
eventChange
in interfaceCalendarEvent.EventChangeListener
-
addEvent
public void addEvent(CalendarEvent event)
Description copied from interface:
CalendarEditableEventProvider
Adds an event to the event provider
Specified by:
addEvent
in interfaceCalendarEditableEventProvider
Parameters:
event
- The event to add
-
removeEvent
public void removeEvent(CalendarEvent event)
Description copied from interface:
CalendarEditableEventProvider
Removes an event from the event provider
Specified by:
removeEvent
in interfaceCalendarEditableEventProvider
Parameters:
event
- The event
-
-