Skip to main content



      Home
Home » Eclipse Projects » Eclipse Scout » AbstractCalendarField(Example how to use AbstractCalendarField)
AbstractCalendarField [message #763787] Sat, 10 December 2011 10:16 Go to next message
Eclipse UserFriend
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 09:32 Go to previous messageGo to next message
Eclipse UserFriend
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 03:42 Go to previous messageGo to next message
Eclipse UserFriend
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 03:48] by Moderator

Re: AbstractCalendarField [message #766674 is a reply to message #763787] Fri, 16 December 2011 03:42 Go to previous messageGo to next message
Eclipse UserFriend
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 03:47] by Moderator

Re: AbstractCalendarField [message #767685 is a reply to message #766674] Sun, 18 December 2011 12:25 Go to previous messageGo to next message
Eclipse UserFriend
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 16:38 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 11:53:31 EDT 2025

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

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

Back to the top