Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » CalenderField(How to use the calendar field)
CalenderField [message #780804] Thu, 19 January 2012 12:49 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 306
Registered: August 2011
Senior Member
Hi,

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

Regards bertin
Re: CalenderField [message #781053 is a reply to message #780804] Fri, 20 January 2012 08:55 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 80
Registered: September 2011
Member
Hi Bertin

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.

Hope this helps.

kind regards
Matthias
Re: CalenderField [message #781078 is a reply to message #781053] Fri, 20 January 2012 12:41 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 306
Registered: August 2011
Senior Member
Hi Matthias,

this already helps a lot, thanks.

Some more questions:

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?

Regards Bertin

Re: CalenderField [message #781599 is a reply to message #780804] Sat, 21 January 2012 19:21 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 80
Registered: September 2011
Member
Hi Bertin,

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).

Regards
Matthias
Re: CalenderField [message #781639 is a reply to message #781599] Sat, 21 January 2012 22:13 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 306
Registered: August 2011
Senior Member
Hi Matthias,

Its up and running, thanks a lot for the help.

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?

Regards Bertin

Re: CalenderField [message #783315 is a reply to message #780804] Wed, 25 January 2012 13:41 Go to previous message
Matthias Villiger is currently offline Matthias Villiger
Messages: 80
Registered: September 2011
Member
Hi Bertin,

I am glad that it works now.

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.

Kind regards
Matthias
Previous Topic:Process hangs
Next Topic:Lookupservice
Goto Forum:
  


Current Time: Sat Oct 25 12:05:13 GMT 2014

Powered by FUDForum. Page generated in 0.02547 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software