2 * Copyright 2000-2018 Vaadin Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License. You may obtain a copy of
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 * License for the specific language governing permissions and limitations under
16 package com.vaadin.v7.ui.components.calendar.event;
18 import java.io.Serializable;
19 import java.util.Date;
20 import java.util.List;
23 * Interface for querying events. The Vaadin Calendar always has a
24 * CalendarEventProvider set.
30 public interface CalendarEventProvider extends Serializable {
33 * Gets all available events in the target date range between startDate and
34 * endDate. The Vaadin Calendar queries the events from the range that is
35 * shown, which is not guaranteed to be the same as the date range that is
40 * For example, if you set the date range to be monday 22.2.2010 - wednesday
41 * 24.2.2010, the used Event Provider will be queried for events between
42 * monday 22.2.2010 00:00 and sunday 28.2.2010 23:59. Generally you can
43 * expect the date range to be expanded to whole days and whole weeks.
50 * @return List of events
52 public List<CalendarEvent> getEvents(Date startDate, Date endDate);
55 * Event to signal that the set of events has changed and the calendar
56 * should refresh its view from the
57 * {@link com.vaadin.addon.calendar.event.CalendarEventProvider
58 * CalendarEventProvider} .
61 @SuppressWarnings("serial")
63 public class EventSetChangeEvent implements Serializable {
65 private CalendarEventProvider source;
67 public EventSetChangeEvent(CalendarEventProvider source) {
73 * {@link com.vaadin.addon.calendar.event.CalendarEventProvider
74 * CalendarEventProvider} that has changed
76 public CalendarEventProvider getProvider() {
82 * Listener for EventSetChange events.
85 public interface EventSetChangeListener extends Serializable {
88 * Called when the set of Events has changed.
90 public void eventSetChange(EventSetChangeEvent changeEvent);
94 * Notifier interface for EventSetChange events.
97 public interface EventSetChangeNotifier extends Serializable {
100 * Add a listener for listening to when new events are adding or removed
101 * from the event provider.
104 * The listener to add
106 void addEventSetChangeListener(EventSetChangeListener listener);
109 * Remove a listener which listens to
110 * {@link EventSetChangeEvent}-events.
113 * The listener to remove
115 void removeEventSetChangeListener(EventSetChangeListener listener);