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 aContaineras 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:
- Serialized Form
-
-
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 StringALL_DAY_PROPERTYstatic StringCAPTION_PROPERTYstatic StringDESCRIPTION_PROPERTYstatic StringENDDATE_PROPERTYstatic StringSTARTDATE_PROPERTYstatic StringSTYLENAME_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 Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvent(CalendarEvent event)Adds an event to the event providervoidaddEventChangeListener(CalendarEvent.EventChangeListener listener)Add a listener to listen for EventChangeEvents.voidaddEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)Add a listener for listening to when new events are adding or removed from the event provider.voidcontainerItemSetChange(Container.ItemSetChangeEvent event)Lets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.voiddetachContainerDataSource()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 ContainerEventProvidervoideventMove(CalendarComponentEvents.MoveEvent event)This method will be called when event has been moved to a new position.voideventResize(CalendarComponentEvents.EventResize event)ObjectgetAllDayProperty()Get the all day property for the eventObjectgetCaptionProperty()Get the property which provides the caption of the eventContainer.IndexedgetContainerDataSource()Returns the container used as data sourceObjectgetDescriptionProperty()Get the property which provides the description of the eventObjectgetEndDateProperty()Get the property which provides the ending date and time of the eventList<CalendarEvent>getEvents(Date startDate, Date endDate)Gets all available events in the target date range between startDate and endDate.ObjectgetStartDateProperty()Get the property which provides the starting date and time of the eventObjectgetStyleNameProperty()Get the property which provides the style name for the eventvoidremoveEvent(CalendarEvent event)Removes an event from the event providervoidremoveEventChangeListener(CalendarEvent.EventChangeListener listener)Remove a listener from the event provider.voidremoveEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)Remove a listener which listens toCalendarEventProvider.EventSetChangeEvent-eventsvoidsetAllDayProperty(Object allDayProperty)Set the all day property for the eventvoidsetCaptionProperty(Object captionProperty)Set the property which provides the caption of the eventvoidsetContainerDataSource(Container.Indexed container)Set the container data sourcevoidsetDescriptionProperty(Object descriptionProperty)Set the property which provides the description of the eventvoidsetEndDateProperty(Object endDateProperty)Set the property which provides the ending date and time of the eventvoidsetStartDateProperty(Object startDateProperty)Set the property which provides the starting date and time of the eventvoidsetStyleNameProperty(Object styleNameProperty)Set the property which provides the style name for the eventvoidvalueChange(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:
- Constant Field Values
-
DESCRIPTION_PROPERTY
public static final String DESCRIPTION_PROPERTY
- See Also:
- Constant Field Values
-
STARTDATE_PROPERTY
public static final String STARTDATE_PROPERTY
- See Also:
- Constant Field Values
-
ENDDATE_PROPERTY
public static final String ENDDATE_PROPERTY
- See Also:
- Constant Field Values
-
STYLENAME_PROPERTY
public static final String STYLENAME_PROPERTY
- See Also:
- Constant Field Values
-
ALL_DAY_PROPERTY
public static final String ALL_DAY_PROPERTY
- See Also:
- Constant Field Values
-
-
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:CalendarEventProviderGets 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:
getEventsin interfaceCalendarEventProvider- Parameters:
startDate- Start dateendDate- End date- Returns:
- List of events
-
addEventSetChangeListener
public void addEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Description copied from interface:CalendarEventProvider.EventSetChangeNotifierAdd a listener for listening to when new events are adding or removed from the event provider.- Specified by:
addEventSetChangeListenerin interfaceCalendarEventProvider.EventSetChangeNotifier- Parameters:
listener- The listener to add
-
removeEventSetChangeListener
public void removeEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
Description copied from interface:CalendarEventProvider.EventSetChangeNotifierRemove a listener which listens toCalendarEventProvider.EventSetChangeEvent-events- Specified by:
removeEventSetChangeListenerin interfaceCalendarEventProvider.EventSetChangeNotifier- Parameters:
listener- The listener to remove
-
addEventChangeListener
public void addEventChangeListener(CalendarEvent.EventChangeListener listener)
Description copied from interface:CalendarEvent.EventChangeNotifierAdd a listener to listen for EventChangeEvents. These events are fired when a events properties are changed.- Specified by:
addEventChangeListenerin interfaceCalendarEvent.EventChangeNotifier- Parameters:
listener- The listener to add
-
removeEventChangeListener
public void removeEventChangeListener(CalendarEvent.EventChangeListener listener)
Description copied from interface:CalendarEvent.EventChangeNotifierRemove a listener from the event provider.- Specified by:
removeEventChangeListenerin 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.ItemSetChangeListenerLets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.- Specified by:
containerItemSetChangein interfaceContainer.ItemSetChangeListener- Parameters:
event- change event text
-
valueChange
public void valueChange(Property.ValueChangeEvent event)
Description copied from interface:Property.ValueChangeListenerNotifies this listener that the Property's value has changed.- Specified by:
valueChangein interfaceProperty.ValueChangeListener- Parameters:
event- value change event object
-
eventMove
public void eventMove(CalendarComponentEvents.MoveEvent event)
Description copied from interface:CalendarComponentEvents.EventMoveHandlerThis method will be called when event has been moved to a new position.- Specified by:
eventMovein interfaceCalendarComponentEvents.EventMoveHandler- Parameters:
event- MoveEvent containing specific information of the new position and target event.
-
eventResize
public void eventResize(CalendarComponentEvents.EventResize event)
- Specified by:
eventResizein 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:CalendarEditableEventProviderAdds an event to the event provider- Specified by:
addEventin interfaceCalendarEditableEventProvider- Parameters:
event- The event to add
-
removeEvent
public void removeEvent(CalendarEvent event)
Description copied from interface:CalendarEditableEventProviderRemoves an event from the event provider- Specified by:
removeEventin interfaceCalendarEditableEventProvider- Parameters:
event- The event
-
-