public class ContainerEventProvider extends Object implements CalendarEditableEventProvider, CalendarEventProvider.EventSetChangeNotifier, CalendarEvent.EventChangeNotifier, CalendarComponentEvents.EventMoveHandler, CalendarComponentEvents.EventResizeHandler, Container.ItemSetChangeListener, Property.ValueChangeListener
Container
as a datasource. Container
used as data source.
NOTE: The data source must be sorted by date!CalendarEventProvider.EventSetChangeEvent, CalendarEventProvider.EventSetChangeListener, CalendarEventProvider.EventSetChangeNotifier
Modifier and Type | Field and 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 |
eventMoveMethod
eventResizeMethod
Constructor and Description |
---|
ContainerEventProvider(Container.Indexed container)
Constructor
|
Modifier and Type | Method and 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 -events |
void |
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.
|
public static final String CAPTION_PROPERTY
public static final String DESCRIPTION_PROPERTY
public static final String STARTDATE_PROPERTY
public static final String ENDDATE_PROPERTY
public static final String STYLENAME_PROPERTY
public static final String ALL_DAY_PROPERTY
public ContainerEventProvider(Container.Indexed container)
container
- Container to use as a data source.public void setContainerDataSource(Container.Indexed container)
container
- The container to use as datasourcepublic Container.Indexed getContainerDataSource()
public List<CalendarEvent> getEvents(Date startDate, Date endDate)
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.
getEvents
in interface CalendarEventProvider
startDate
- Start dateendDate
- End datepublic void addEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
CalendarEventProvider.EventSetChangeNotifier
addEventSetChangeListener
in interface CalendarEventProvider.EventSetChangeNotifier
listener
- The listener to addpublic void removeEventSetChangeListener(CalendarEventProvider.EventSetChangeListener listener)
CalendarEventProvider.EventSetChangeNotifier
CalendarEventProvider.EventSetChangeEvent
-eventsremoveEventSetChangeListener
in interface CalendarEventProvider.EventSetChangeNotifier
listener
- The listener to removepublic void addEventChangeListener(CalendarEvent.EventChangeListener listener)
CalendarEvent.EventChangeNotifier
addEventChangeListener
in interface CalendarEvent.EventChangeNotifier
listener
- The listener to addpublic void removeEventChangeListener(CalendarEvent.EventChangeListener listener)
CalendarEvent.EventChangeNotifier
removeEventChangeListener
in interface CalendarEvent.EventChangeNotifier
listener
- The listener to removepublic Object getCaptionProperty()
public void setCaptionProperty(Object captionProperty)
public Object getDescriptionProperty()
public void setDescriptionProperty(Object descriptionProperty)
public Object getStartDateProperty()
public void setStartDateProperty(Object startDateProperty)
public Object getEndDateProperty()
public void setEndDateProperty(Object endDateProperty)
public Object getStyleNameProperty()
public void setStyleNameProperty(Object styleNameProperty)
public void setAllDayProperty(Object allDayProperty)
public Object getAllDayProperty()
public void containerItemSetChange(Container.ItemSetChangeEvent event)
Container.ItemSetChangeListener
containerItemSetChange
in interface Container.ItemSetChangeListener
event
- change event textpublic void valueChange(Property.ValueChangeEvent event)
Property.ValueChangeListener
valueChange
in interface Property.ValueChangeListener
event
- value change event objectpublic void eventMove(CalendarComponentEvents.MoveEvent event)
CalendarComponentEvents.EventMoveHandler
eventMove
in interface CalendarComponentEvents.EventMoveHandler
event
- MoveEvent containing specific information of the new
position and target event.public void eventResize(CalendarComponentEvents.EventResize event)
eventResize
in interface CalendarComponentEvents.EventResizeHandler
public void detachContainerDataSource()
public void addEvent(CalendarEvent event)
CalendarEditableEventProvider
addEvent
in interface CalendarEditableEventProvider
event
- The event to addpublic void removeEvent(CalendarEvent event)
CalendarEditableEventProvider
removeEvent
in interface CalendarEditableEventProvider
event
- The eventCopyright © 2016 Vaadin Ltd. All rights reserved.