-
Notifications
You must be signed in to change notification settings - Fork 184
Description
When using the MonthView will full day event, fake helper entries are create to occupy space.
These entries will display with a time in the view:
See the 12:00 entries in the above image
These space entries are clickable and if done so, will cause an NPE because they don't belong to a calendar:
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException: Cannot invoke "com.calendarfx.model.Calendar.readOnlyProperty()" because the return value of "com.calendarfx.model.Entry.getCalendar()" is null
at com.calendarfx.view.popover.EntryDetailsView.(EntryDetailsView.java:102)
at com.calendarfx.view.popover.EntryPopOverContentPane.(EntryPopOverContentPane.java:60)
However this issue can easily be resolved by setting them also to fullday:
So add the setFullDay line MonthViewSkin:update
/*
* Do not use factory for this. SPACE is important to guarantee that the blank
* entries have the same height as the regular entries.
*/
MonthEntryView label = new MonthEntryView(new Entry<>(SPACE));
label.setVisible(false);
label.getEntry().setFullDay(true);
label.getProperties().put("control", getSkinnable());
fullDayNodes[i] = label;
Now the space item correctly shows as white space without a time, and is not clickable and does not cause NPEs.
