I did some little tests with the CalendarField (SWT version). So I can show the calendarfield on a form, add a provider, override AbstractCalendarItemProvider.execLoadItems to add some items to it.
I have some more questions about it:
When I start the calendar I like to show the current week of one employee with items in it. I can do this with a provider as explainde above. But when the user skips to the next week or month, how can I load the additional items in it?
Can I manipulate the "background"? For example some employees work part-time. It would be nice to reflect this in the "background" of the calender. I mean the same effect as the noon hour (12:00 to 13:00). This is always with a darker colour.
How to move items? @Override getConfiguredMoveItemEnabled() does not do anything
When the user skips to another week, the execLoadItems() method is called again with the newly displayed period as parameters (minDate, maxDate). This allows you to put all calendar items into the holder that are within the shown period.
Unfortunately, the calendar background cannot be modified at the moment.
Moving items is currently only supported in swing UI. The SWT version is not capable to drag-and-drop calendar items.
Calendar has a method execFilterCalendarItems. What is the meaning of this method, what is it used for?
What is the best practice for execLoadItems() with its minDate and maxDate. If all the activities are in the database and the user skips forward and backwards through the calendar. Do you then cache items in the client and have some smart algorithm so you know that items are already loaded, or just load every period directly from the database so only the activities of the current period are in memory?
execFilterCalendarItems can be used to restrict the items that should be displayed and is called after the providers have contributed their items. This allows you to influence the items displayed at a single point.
In the parameter list you get the class of each provider that contributed items together with the items contributed by it. you can then go through the map and modify the map. In the end only the items present in the map will be shown.
This is useful if you have e.g. filtering capabilities in the UI where the user can choose to only see items of a specific type or items containing a specific text etc.
Usually it is the best way to always load the items directly from the database (considering the minDate and maxDate). This has the advantage that you only keep items in the memory that can actually be displayed because they are within the shown timeframe and you always see the newest data from the database (don't have to care about refreshing any cached data).
For some activities an employee has only 10 minutes. On the calendar 10 minutes is such a small line that the text does not fit. On the other hand, an activity never starts before 08.00 and never ends after 18:00, so there is a lot of empty space on the screen. Will there be an option to configure the start and end time of a day in the future?
Currently there is no plan to make the start and end time configurable. If you need this feature, please feel free to create a enhancement bug in bugzilla. Then it can maybe be part of a future release.