com.vaadin.ui.components.calendar.
Class ContainerEventProvider
- java.lang.Object
-
- com.vaadin.ui.components.calendar.ContainerEventProvider
-
All Implemented Interfaces:
Container.ItemSetChangeListener
,Property.ValueChangeListener
,CalendarComponentEvents.EventMoveHandler
,CalendarComponentEvents.EventResizeHandler
,CalendarEditableEventProvider
,CalendarEvent.EventChangeNotifier
,CalendarEventProvider
,CalendarEventProvider.EventSetChangeNotifier
,Serializable
,EventListener
public class ContainerEventProvider extends Object implements CalendarEditableEventProvider, CalendarEventProvider.EventSetChangeNotifier, CalendarEvent.EventChangeNotifier, CalendarComponentEvents.EventMoveHandler, CalendarComponentEvents.EventResizeHandler, Container.ItemSetChangeListener, Property.ValueChangeListener
A event provider which uses a
Container
as a datasource. Container used as data source. NOTE: The data source must be sorted by date!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 Description static String
ALL_DAY_PROPERTY
static String
CAPTION_PROPERTY
static String
DESCRIPTION_PROPERTY
static String
ENDDATE_PROPERTY
static String
STARTDATE_PROPERTY
static String
STYLENAME_PROPERTY
-
Fields inherited from interface com.vaadin.ui.components.calendar.CalendarComponentEvents.EventMoveHandler
eventMoveMethod
-
Fields inherited from interface com.vaadin.ui.components.calendar.CalendarComponentEvents.EventResizeHandler
eventResizeMethod
-
-
Constructor Summary
Constructors Constructor Description ContainerEventProvider(Container.Indexed container)
Constructor
-
Method Summary
All Methods Modifier and Type Method Description void
addEvent(CalendarEvent event)
Adds an event to the event provider
void
addEventChangeListener(CalendarEvent.EventChangeListener listener)
Add a listener to listen for EventChangeEvents.
void
addEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Add a listener for listening to when new events are adding or removed from the event provider.
void
containerItemSetChange(Container.ItemSetChangeEvent event)
Lets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.
void
detachContainerDataSource()
If you are reusing the container which previously have been attached to this ContainerEventProvider call this method to remove this event providers container listeners before attaching it to an other ContainerEventProvider
void
eventMove(CalendarComponentEvents.MoveEvent event)
This method will be called when event has been moved to a new position.
void
eventResize(CalendarComponentEvents.EventResize event)
Object
getAllDayProperty()
Get the all day property for the event
Object
getCaptionProperty()
Get the property which provides the caption of the event
Container.Indexed
getContainerDataSource()
Returns the container used as data source
Object
getDescriptionProperty()
Get the property which provides the description of the event
Object
getEndDateProperty()
Get the property which provides the ending date and time of the event
List<CalendarEvent>
getEvents(Date startDate, Date endDate)
Gets all available events in the target date range between startDate and endDate.
Object
getStartDateProperty()
Get the property which provides the starting date and time of the event
Object
getStyleNameProperty()
Get the property which provides the style name for the event
void
removeEvent(CalendarEvent event)
Removes an event from the event provider
void
removeEventChangeListener(CalendarEvent.EventChangeListener listener)
Remove a listener from the event provider.
void
removeEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Remove a listener which listens to
CalendarEventProvider.EventSetChangeEvent
-eventsvoid
setAllDayProperty(Object allDayProperty)
Set the all day property for the event
void
setCaptionProperty(Object captionProperty)
Set the property which provides the caption of the event
void
setContainerDataSource(Container.Indexed container)
Set the container data source
void
setDescriptionProperty(Object descriptionProperty)
Set the property which provides the description of the event
void
setEndDateProperty(Object endDateProperty)
Set the property which provides the ending date and time of the event
void
setStartDateProperty(Object startDateProperty)
Set the property which provides the starting date and time of the event
void
setStyleNameProperty(Object styleNameProperty)
Set the property which provides the style name for the event
void
valueChange(Property.ValueChangeEvent event)
Notifies this listener that the Property's value has changed.
-
-
-
Field Detail
-
CAPTION_PROPERTY
public static final String CAPTION_PROPERTY
See Also:
-
DESCRIPTION_PROPERTY
public static final String DESCRIPTION_PROPERTY
See Also:
-
STARTDATE_PROPERTY
public static final String STARTDATE_PROPERTY
See Also:
-
ENDDATE_PROPERTY
public static final String ENDDATE_PROPERTY
See Also:
-
STYLENAME_PROPERTY
public static final String STYLENAME_PROPERTY
See Also:
-
ALL_DAY_PROPERTY
public static final String ALL_DAY_PROPERTY
See Also:
-
-
Constructor Detail
-
ContainerEventProvider
public ContainerEventProvider(Container.Indexed container)
Constructor
Parameters:
container
- Container to use as a data source.
-
-
Method Detail
-
setContainerDataSource
public void setContainerDataSource(Container.Indexed container)
Set the container data source
Parameters:
container
- The container to use as datasource
-
getContainerDataSource
public Container.Indexed getContainerDataSource()
Returns the container used as data source
-
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
-
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
-
addEventChangeListener
public void addEventChangeListener(CalendarEvent.EventChangeListener listener)
Description copied from interface:
CalendarEvent.EventChangeNotifier
Add a listener to listen for EventChangeEvents. These events are fired when a events properties are changed.
Specified by:
addEventChangeListener
in interfaceCalendarEvent.EventChangeNotifier
Parameters:
listener
- The listener to add
-
removeEventChangeListener
public void removeEventChangeListener(CalendarEvent.EventChangeListener listener)
Description copied from interface:
CalendarEvent.EventChangeNotifier
Remove a listener from the event provider.
Specified by:
removeEventChangeListener
in interfaceCalendarEvent.EventChangeNotifier
Parameters:
listener
- The listener to remove
-
getCaptionProperty
public Object getCaptionProperty()
Get the property which provides the caption of the event
-
setCaptionProperty
public void setCaptionProperty(Object captionProperty)
Set the property which provides the caption of the event
-
getDescriptionProperty
public Object getDescriptionProperty()
Get the property which provides the description of the event
-
setDescriptionProperty
public void setDescriptionProperty(Object descriptionProperty)
Set the property which provides the description of the event
-
getStartDateProperty
public Object getStartDateProperty()
Get the property which provides the starting date and time of the event
-
setStartDateProperty
public void setStartDateProperty(Object startDateProperty)
Set the property which provides the starting date and time of the event
-
getEndDateProperty
public Object getEndDateProperty()
Get the property which provides the ending date and time of the event
-
setEndDateProperty
public void setEndDateProperty(Object endDateProperty)
Set the property which provides the ending date and time of the event
-
getStyleNameProperty
public Object getStyleNameProperty()
Get the property which provides the style name for the event
-
setStyleNameProperty
public void setStyleNameProperty(Object styleNameProperty)
Set the property which provides the style name for the event
-
setAllDayProperty
public void setAllDayProperty(Object allDayProperty)
Set the all day property for the event
Since:
7.3.4
-
getAllDayProperty
public Object getAllDayProperty()
Get the all day property for the event
Since:
7.3.4
-
containerItemSetChange
public void containerItemSetChange(Container.ItemSetChangeEvent event)
Description copied from interface:
Container.ItemSetChangeListener
Lets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.
Specified by:
containerItemSetChange
in interfaceContainer.ItemSetChangeListener
Parameters:
event
- change event text
-
valueChange
public void valueChange(Property.ValueChangeEvent event)
Description copied from interface:
Property.ValueChangeListener
Notifies this listener that the Property's value has changed.
Specified by:
valueChange
in interfaceProperty.ValueChangeListener
Parameters:
event
- value change event object
-
eventMove
public void eventMove(CalendarComponentEvents.MoveEvent event)
Description copied from interface:
CalendarComponentEvents.EventMoveHandler
This method will be called when event has been moved to a new position.
Specified by:
eventMove
in interfaceCalendarComponentEvents.EventMoveHandler
Parameters:
event
- MoveEvent containing specific information of the new position and target event.
-
eventResize
public void eventResize(CalendarComponentEvents.EventResize event)
Specified by:
eventResize
in interfaceCalendarComponentEvents.EventResizeHandler
-
detachContainerDataSource
public void detachContainerDataSource()
If you are reusing the container which previously have been attached to this ContainerEventProvider call this method to remove this event providers container listeners before attaching it to an other ContainerEventProvider
-
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
-
-