Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » AbstractCalendarField(Example how to use AbstractCalendarField)
AbstractCalendarField [message #763787] Sat, 10 December 2011 15:16 Go to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Is there some example, or can someone explain, how to use the AbstractCalendarField.

Regards Bertin
Re: AbstractCalendarField [message #765159 is a reply to message #763787] Tue, 13 December 2011 14:32 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Found out that in Scout Version: Indigo Service Release 1 (I am using that version for production) there is a bug with the Calendar item in the Scout SDK

If you are on the Calendar->Calendar Item Producers node and in the pop-up menu there is one menu "New Item Provider". If I click on this, a dialog "New Calendar Item Provider" will become visible. If I fill it out and click OK, nothing happens.

On the nightly build version it actually creates an CalendarItemProvider. So then it becomes obvious how to add items to the calendar.

As a work around in SR1, just add the code manually then it also works.

Re: AbstractCalendarField [message #766673 is a reply to message #763787] Fri, 16 December 2011 08:42 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 78
Registered: September 2011
Member
Hi Bertin,

Yes, you are right: There is a bug in the "New Calendar Item Provider" wizard in Indigo SR1 (see Bug 366919). As you can see this bug will be fixed for SR2.

Please find a small example on how to use the AbstractCalendarField below.

Regards,
Matthias

@Order(10.0f)
public class CalendarField extends AbstractCalendarField<CalendarField.Calendar> {

  @Override
  protected boolean getConfiguredLabelVisible() {
    return false;
  }

  public class Calendar extends AbstractCalendar {

    @Order(10.0f)
    public class ItemProducer extends AbstractCalendarItemProvider {

      @Override
      protected long getConfiguredRefreshIntervallMillis() {
        return 1000000L;
      }

      @Override
      protected void execLoadItemsInBackground(IClientSession session, Date minDate, Date maxDate, Holder<ICalendarItem[]> resultHolder) throws ProcessingException {
      	//TODO e.g.: resultHolder.setValue(SERVICES.getService(ICalendarItemProcessService.class).loadCalendarItems(minDate, maxDate));
      }

      @Order(10.0f)
      public class NewMenu extends AbstractMenu {

        @Override
        protected boolean getConfiguredSingleSelectionAction() {
          return false;
        }

        @Override
        protected String getConfiguredText() {
          return Texts.get("NewCalendarItem");
        }

        @Override
        protected void execAction() throws ProcessingException {
          //TODO
        }
      }
    }
  }
}

[Updated on: Fri, 16 December 2011 08:48]

Report message to a moderator

Re: AbstractCalendarField [message #766674 is a reply to message #763787] Fri, 16 December 2011 08:42 Go to previous messageGo to next message
Matthias Villiger is currently offline Matthias Villiger
Messages: 78
Registered: September 2011
Member
One more input to mention: You can add as many AbstractCalendarItemProviders to a calendar as you like. This way you can implement different behaviors (e.g. the automatic refresh intervals) based on the e.g. type of calendar item.

[Updated on: Fri, 16 December 2011 08:47]

Report message to a moderator

Re: AbstractCalendarField [message #767685 is a reply to message #766674] Sun, 18 December 2011 17:25 Go to previous messageGo to next message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Adding providers and items to a calendar work fine.

When I use the calendar I noticed that some days and hours have a darker background. For example 01, 02, 03, 04 december, 1 jan and every day between 12.00 and 13.00 have a darker backgroud.

Why is it that these days and hours are painted with a darker background and can I change this.

Re: AbstractCalendarField [message #768818 is a reply to message #767685] Tue, 20 December 2011 21:38 Go to previous message
Bertin Kiekebosch is currently offline Bertin Kiekebosch
Messages: 303
Registered: August 2011
Senior Member
Found out that it is hardcoded. A day that is not in the current month is painted light-gray and every day 1200-1300 is painted light-gray.
Previous Topic:RemoteFileService
Next Topic:Scout vs Riena platform
Goto Forum:
  


Current Time: Sat Sep 20 02:08:47 GMT 2014

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

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