Class ListCalendarDataProvider
java.lang.Object
io.jmix.fullcalendarflowui.component.data.ListCalendarDataProvider
- All Implemented Interfaces:
CalendarDataProvider
,ItemsCalendarDataProvider
Data provider that fetches events from
List
.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.fullcalendarflowui.component.data.ItemsCalendarDataProvider
ItemsCalendarDataProvider.ItemSetChangeEvent
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addItem
(CalendarEvent item) Adds calendar event.final void
addItems
(CalendarEvent... items) Adds calendar events.void
addItems
(List<CalendarEvent> items) Adds a list of calendar events.com.vaadin.flow.shared.Registration
Adds an item set change listener.protected void
fireItemSetChangeEvent
(DataChangeOperation operation, List<CalendarEvent> items) getId()
getItems()
void
Removes all events from data provider.void
removeItem
(CalendarEvent item) Removes an event.void
updateItem
(CalendarEvent item) Replaces previous event by new one, if exists.
-
Field Details
-
id
-
items
-
eventBus
-
-
Constructor Details
-
ListCalendarDataProvider
public ListCalendarDataProvider() -
ListCalendarDataProvider
-
ListCalendarDataProvider
-
ListCalendarDataProvider
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceCalendarDataProvider
- Returns:
- an ID of data provider
-
getItems
- Specified by:
getItems
in interfaceItemsCalendarDataProvider
- Returns:
- loaded calendar events
-
getItem
- Specified by:
getItem
in interfaceItemsCalendarDataProvider
- Parameters:
itemId
- ID of calendar event- Returns:
- calendar event or
null
if no event with provided ID
-
addItem
Adds calendar event.- Parameters:
item
- item to add
-
addItems
Adds calendar events.- Parameters:
items
- items to add
-
addItems
Adds a list of calendar events.- Parameters:
items
- items to add
-
updateItem
Replaces previous event by new one, if exists.- Parameters:
item
- item to update- Throws:
IllegalArgumentException
- if data provider does not contain provided event
-
removeItem
Removes an event.- Parameters:
item
- item to remove
-
removeAllItems
public void removeAllItems()Removes all events from data provider. -
addItemSetChangeListener
public com.vaadin.flow.shared.Registration addItemSetChangeListener(Consumer<ItemsCalendarDataProvider.ItemSetChangeEvent> listener) Description copied from interface:ItemsCalendarDataProvider
Adds an item set change listener.- Specified by:
addItemSetChangeListener
in interfaceItemsCalendarDataProvider
- Parameters:
listener
- listener to add- Returns:
- a registration object for removing an event listener added to a data provider
-
fireItemSetChangeEvent
-