Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.0.0-RC1
-
None
-
None
Description
to reproduce in the starter app,
make SimpleObject implement Calenderable (rather than CalendarEventable):
@Override public Set<String> getCalendarNames() { return _Sets.of("Check-in", "Check-out"); } @Override public Map<String, CalendarEventable> getCalendarEvents() { return _Maps.unmodifiable( "Check-in", new MyCalendarEventable("Check-in", () -> getLastCheckedIn()), "Check-out", new MyCalendarEventable("Check-out", () -> getLastCheckedIn().plusDays(5)) ); } @SuppressWarnings("CdiManagedBeanInconsistencyInspection") @RequiredArgsConstructor class MyCalendarEventable implements CalendarEventable { private final String calendarName; private final Supplier<LocalDate> localDateSupplier; @Override public String getCalendarName() { return calendarName; } @Override public CalendarEvent toCalendarEvent() { LocalDate localDate = localDateSupplier.get(); return localDate != null ? toCalendarEvent(localDate) : null; } private CalendarEvent toCalendarEvent(LocalDate localDate) { ZoneRules zoneRules = clockService.getClock().nowAsOffsetDateTime().toZonedDateTime().getZone().getRules(); long epochMillis = localDate.toEpochSecond(LocalTime.MIDNIGHT, zoneRules.getOffset(localDate.atStartOfDay())) * 1000L; return new CalendarEvent(epochMillis, calendarName, titleService.titleOf(SimpleObject.this), getNotes()); } }
is then rendered as:
We do see that both the events for each domain object are shown, and in different colours, .... but I recall that there used to be a legend to say what the colours meant, and a checkbox to show or hide each such "calendar".
IN ADDITION:
- the "notes" property of the `CalendarEvent` I think is meant to be for a tooltip, but isn't shown
- the mouse cursor changes to an 'edit bar' when hovering over, but should be a hand cursor (to indicate that the end-user can click on the object).