Package com.projity.pm.calendar

Examples of com.projity.pm.calendar.CalendarService


            .getResourcePool().extractCalendars();
      }
    }
    if (wc == null)
      wc = (WorkingCalendar) getProject().getWorkCalendar();
    CalendarService service = CalendarService.getInstance();


    ChangeWorkingTimeDialogBox dlg = ChangeWorkingTimeDialogBox
        .getInstance(getGraphicManager().getFrame(), project,wc, documentCalendars,restrict,this.getUndoController());
    dlg.doModal();
View Full Code Here


//        if (calendar!=null){
//            ProjectCalendar calendarData=projectData.addDefaultBaseCalendar();
//            calendarData.setName(calendar.getName());
//        }
        projectFile.setAutoCalendarUniqueID(true);
    CalendarService service = CalendarService.getInstance();
    Object[] calendars=CalendarService.allBaseCalendars();
    if (calendars!=null)
    for (int i=0;i<calendars.length;i++){
      WorkingCalendar workCalendar=(WorkingCalendar)calendars[i];
      ProjectCalendar cal = projectFile.addBaseCalendar();
View Full Code Here

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

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

    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

    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

      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


      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

                      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

      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

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.