Package com.projity.pm.calendar

Examples of com.projity.pm.calendar.CalendarService


  }


  protected void updateView(){

      CalendarService service=CalendarService.getInstance();
      WorkingCalendar wc=form.getCalendar();
      if (wc.isBaseCalendar()) {
        basedOnText.setText(" "); // a space.  need a space for vertical spacing //$NON-NLS-1$
      } else {
        basedOnText.setText(Messages.getString("ChangeWorkingTimeDialogBox.BasedOn") + wc.getBaseCalendar().getName()); //$NON-NLS-1$
      }

      long first=sdCalendar.getFirstDisplayedDate();
      long last=sdCalendar.getLastDisplayedDate();
      Calendar calendar=DateTime.calendarInstance();
      calendar.setTimeInMillis(first);

      sdCalendar.setFlaggedDates(null);
        sdCalendar.setColorDates(null);

      DayDescriptor day;
      ArrayList flaggedDates=new ArrayList();
      ArrayList colorDates=new ArrayList();
      while(calendar.getTimeInMillis()<=last){
          day=service.getDay(wc,calendar.getTimeInMillis());
          if (day.isModified())
              flaggedDates.add(new Long(calendar.getTimeInMillis()));
          if (!day.isWorking())
              colorDates.add(new Long(calendar.getTimeInMillis()));
          calendar.add(Calendar.DATE,1);
      }


      if (flaggedDates.size()>0)
        sdCalendar.setFlaggedDates(toLongArray(flaggedDates));
      if (colorDates.size()>0)
        sdCalendar.setColorDates(toLongArray(colorDates));

      boolean colorWeekDates[] = new boolean[7];
      boolean flaggedWeekDates[] = new boolean[7];
      for (int i =0; i < 7; i++) {
        day = service.getWeekDay(wc,i+1);
        if (day.isModified())
          flaggedWeekDates[i] = true;
        if (!day.isWorking())
          colorWeekDates[i] = true;
      }
View Full Code Here


  }


  private void updateWorkingHours() {
//    System.out.println("updating working hours");
        final CalendarService service=CalendarService.getInstance();

     if (dirtyWorkingHours){
          saveWorkingHoursChanges(false);
      }

        DayDescriptor day=service.getDay(form.getCalendar(),sdCalendar.getSelectedFixedIntervals(),sdCalendar.getSelectedWeekDays());
        if (day==null){
//            System.out.println("none");
            ChangeWorkingTimeDialogBox.this.datesSetting.setSelected(ChangeWorkingTimeDialogBox.this.unknownWorkingTime.getModel(),true);
            setWorkingHours(null);
        }else if (!day.isModified()){
View Full Code Here

TOP

Related Classes of com.projity.pm.calendar.CalendarService

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.