Examples of CalendarService


Examples of com.projity.pm.calendar.CalendarService

    return "Calendar";
  }
  public void redo() throws CannotRedoException {
    super.redo();
    dest.assignFrom(newValue);
      CalendarService service=CalendarService.getInstance();
      service.saveAndUpdate(dest);
  }
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

      service.saveAndUpdate(dest);
  }
  public void undo() throws CannotUndoException {
    super.undo();
    dest.assignFrom(oldValue);
      CalendarService service=CalendarService.getInstance();
      service.saveAndUpdate(dest);
  }
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

    return instance;
  }
  HashMap importedCalendarMap = new HashMap();
  public void addImportedCalendar(WorkingCalendar cal, ProjectCalendar mpxCal) {
    importedCalendarMap.put(mpxCal,cal);
    CalendarService calendarService=CalendarService.getInstance();
    if (cal.isBaseCalendar()) {
      if (calendarService.findBaseCalendar(cal.getName(),true) != null)
        return;
// cal.setName(cal.getName() + PLACE_HOLDER_NAME);
    }
    calendarService.add(cal);
  }
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

    createNewBase.setSelected(true);
    bind(true);
  }
 
  protected boolean bind(boolean get) {
    CalendarService service = CalendarService.getInstance();
    if (get) {
      ComboBoxModel calModel = new DefaultComboBoxModel(service.getBaseCalendars().toArray());
      calendarToCopy.setModel(calModel);
    } else {
      WorkingCalendar toCopy;
      if (makeACopy.isSelected())
        toCopy = (WorkingCalendar) calendarToCopy.getSelectedItem();
      else
        toCopy = CalendarService.getInstance().getDefaultInstance();
      newCalendar = CalendarService.getInstance().makeScratchCopy(toCopy);
       
      newCalendar.setName(name.getText());
      service.add(newCalendar);
    }
    return super.bind(get);
  }
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

      return c;
    }
  }
  private void fillInCalendarNames() {
    ArrayList all = new ArrayList();
    CalendarService service = CalendarService.getInstance();
    all.addAll(service.getBaseCalendars());
    all.addAll(projectCalendars);

    if (documentCalendars != null)
      all.addAll(documentCalendars);
    ComboBoxModel calModel = new DefaultComboBoxModel(all.toArray());
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService


      defaultWorkingTime.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            setWorkingHours(null);
          CalendarService service=CalendarService.getInstance();
          WorkingCalendar wc=form.getCalendar();
          service.makeDefaultDays(wc,sdCalendar.getSelectedFixedIntervals(), sdCalendar.getSelectedWeekDays());
          dirtyWorkingHours = false;
          updateWorkingHours();
          updateView();
          clearLastSelection();

        }});

      nonWorking.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
            setWorkingHours(null);
          CalendarService service=CalendarService.getInstance();
          WorkingCalendar wc=form.getCalendar();
          WorkingCalendar copy = wc.makeScratchCopy();
          try {
            // try on copy first
          service.setDaysNonWorking(copy,sdCalendar.getSelectedFixedIntervals(), sdCalendar.getSelectedWeekDays());
            service.setDaysNonWorking(wc,sdCalendar.getSelectedFixedIntervals(), sdCalendar.getSelectedWeekDays());
        } catch (InvalidCalendarException e1) {
          Alert.error(e1.getMessage(),ChangeWorkingTimeDialogBox.this);
          return;
        }
          dirtyWorkingHours = false;
          updateWorkingHours();
          updateView();
              clearLastSelection();
        }});

      working.addActionListener(new ActionListener(){
        public void actionPerformed(ActionEvent e){
          CalendarService service=CalendarService.getInstance();
          WorkingCalendar wc=form.getCalendar();

            setWorkingHours(defaultWorkingHours);
          WorkingCalendar copy = wc.makeScratchCopy();

          try {
                    service.setDaysWorkingHours(copy,sdCalendar.getSelectedFixedIntervals(), sdCalendar.getSelectedWeekDays(),defaultWorkingHours);
                    service.setDaysWorkingHours(wc,sdCalendar.getSelectedFixedIntervals(), sdCalendar.getSelectedWeekDays(),defaultWorkingHours);
              dirtyWorkingHours = false;
              updateWorkingHours();
                    updateView();
                } catch (WorkRangeException e1) {
                    e1.printStackTrace();
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

                      Alert.warn(Messages.getString("Message.badTimeFormat"),this); //$NON-NLS-1$
                      return;
                  }
              }
          }
        CalendarService service=CalendarService.getInstance();
        WorkingCalendar wc=form.getCalendar();
        WorkingCalendar copy = wc.makeScratchCopy();
        service.setDaysWorkingHours(copy,lastSelection,lastWeekSelection,hours);
        service.setDaysWorkingHours(wc,lastSelection,lastWeekSelection,hours);
        unsaved = false;

        if (saveCalendar) {
          saveCalendar();
        } else {
View Full Code Here

Examples of com.projity.pm.calendar.CalendarService

      updateView();
  }

  private void saveCalendar() {
    unsaved = false;
    CalendarService service=CalendarService.getInstance();
    WorkingCalendar wc=form.getCalendar();
    UndoableEditSupport undoableEditSupport=undoController.getEditSupport();
    if (undoableEditSupport!=null){
      undoableEditSupport.postEdit(new CalendarEdit(editedCalendar,wc));
    }

    service.assignCalendar(editedCalendar,wc);
    service.saveAndUpdate(editedCalendar);

  }
View Full Code Here

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

Examples of com.projity.pm.calendar.CalendarService

  }


  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
Copyright © 2018 www.massapi.com. 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.