CalendarView calendarView = ...
calendarView.addEventFilter(LoadEvent.LOAD, evt -> {
for (CalendarSource source : evt.getCalendarSources()) {
if (source instanceof GoogleAccount) {
GoogleAccount account = (GoogleAccount) source;
Thread loadThread = new Thread() {
public void run() {
for (Calendar calendar : account.getCalendars()) {
GoogleCalendar googleCalendar = (GoogleCalendar) calendar;
googleCalendar.load(evt.getStartDate(), evt.getEndDate(), evt.getZoneId());
}
}
};
loadThread.setDaemon(true);
loadThread.start();
break;
}
}
});
| Modifier and Type | Field and Description |
|---|---|
| private final List | |
| private final LocalDate | |
| public static final EventType | LOAD
Gets fired frequently by the framework to indicate that data for the given date range is required to be present in the calendars. |
| private static final long | |
| private final String | |
| private final LocalDate | |
| private final ZoneId |
| Access | Constructor and Description |
|---|---|
| public | LoadEvent(EventType<LoadEvent>
the type of the load event eventType, String the name of the source where the event originated, e.g.
"DayView" sourceName, List<CalendarSource> the affected calendar sources calendarSources, LocalDate the start date of the time interval startDate, LocalDate the end date of the time interval endDate, ZoneId the time zone zoneId)Constructs a new load event. |
| Modifier and Type | Method and Description |
|---|---|
| public List | Returns: the calendar sourcesThe calendar sources that are affected by the load event. |
| public LocalDate | |
| public ZonedDateTime | Returns: the start time defined by this eventConvenience method to return a zoned date time based on the given end date and time zone. |
| public String | Returns: the name of the control requesting the dataA human readable name of the control that triggered the load event, e.g. "Day View" or "Month View". |
| public LocalDate | |
| public ZonedDateTime | Returns: the start time defined by this eventConvenience method to return a zoned date time based on the given start date and time zone. |
| public ZoneId | |
| public String | toString()
Overrides java. Returns a String representation of this EventObject. |
| calendarSources | back to summary |
|---|---|
| private final List<CalendarSource> calendarSources | |
| endDate | back to summary |
|---|---|
| private final LocalDate endDate | |
| LOAD | back to summary |
|---|---|
| public static final EventType<LoadEvent> LOAD Gets fired frequently by the framework to indicate that data for the given date range is required to be present in the calendars. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sourceName | back to summary |
|---|---|
| private final String sourceName | |
| startDate | back to summary |
|---|---|
| private final LocalDate startDate | |
| zoneId | back to summary |
|---|---|
| private final ZoneId zoneId | |
| LoadEvent | back to summary |
|---|---|
| public LoadEvent(EventType<LoadEvent> eventType, String sourceName, List<CalendarSource> calendarSources, LocalDate startDate, LocalDate endDate, ZoneId zoneId) Constructs a new load event.
| |
| getCalendarSources | back to summary |
|---|---|
| public List The calendar sources that are affected by the load event.
| |
| getEndDate | back to summary |
|---|---|
| public LocalDate getEndDate() The end of the loaded time interval.
| |
| getEndTime | back to summary |
|---|---|
| public ZonedDateTime getEndTime() Convenience method to return a zoned date time based on the given end
date and time zone. Uses
| |
| getSourceName | back to summary |
|---|---|
| public String getSourceName() A human readable name of the control that triggered the load event, e.g. "Day View" or "Month View". Mainly used for debugging purposes.
| |
| getStartDate | back to summary |
|---|---|
| public LocalDate getStartDate() The start of the loaded time interval.
| |
| getStartTime | back to summary |
|---|---|
| public ZonedDateTime getStartTime() Convenience method to return a zoned date time based on the given start
date and time zone. Uses
| |
| getZoneId | back to summary |
|---|---|
| public ZoneId getZoneId() The time zone used for the load.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a String representation of this EventObject. | |