Package org.olat.commons.calendar.ui.events

Examples of org.olat.commons.calendar.ui.events.KalendarGUIEditEvent


        vcMain.contextPut("isSubscribed", new Boolean(calendarSubscription.isSubscribed()));
        CoordinatorManager.getCoordinator().getEventBus().fireEventToListenersOf(new KalendarModifiedEvent(), OresHelper.lookupType(CalendarManager.class));
      }
    } else if (source == weeklyCalendar) {
      if (event instanceof KalendarGUIEditEvent) {
        KalendarGUIEditEvent guiEvent = (KalendarGUIEditEvent) event;
        KalendarEvent kalendarEvent = guiEvent.getKalendarEvent();
        if (kalendarEvent == null) {
          // event already deleted
          getWindowControl().setError(translator.translate("cal.error.eventDeleted"));
          return;
        }
        String recurrence = kalendarEvent.getRecurrenceRule();
        boolean isImported = false;
        KalendarRenderWrapper kalendarRenderWrapper = guiEvent.getKalendarRenderWrapper();
        if (kalendarRenderWrapper!=null) {
          isImported = kalendarRenderWrapper.isImported();
        }
        if( !isImported && recurrence != null && !recurrence.equals("") ) {
          List<String> btnLabels = new ArrayList<String>();
          btnLabels.add(translator.translate("cal.edit.dialog.sequence"));
          btnLabels.add(translator.translate("cal.edit.dialog.delete.single"));
          btnLabels.add(translator.translate("cal.edit.dialog.delete.sequence"));
          if (dbcSequence != null) dbcSequence.dispose();
          dbcSequence = DialogBoxUIFactory.createGenericDialog(ureq, getWindowControl(), translator.translate("cal.edit.dialog.title"), translator.translate("cal.edit.dialog.text"), btnLabels);
          dbcSequence.addControllerListener(this);
          dbcSequence.setUserObject(guiEvent);
          dbcSequence.activate();
          return;
        }
        KalendarRenderWrapper kalendarWrapper = guiEvent.getKalendarRenderWrapper();
        pushEditEventController(ureq, kalendarEvent, kalendarWrapper);
      } else if (event instanceof KalendarGUIAddEvent) {
        pushAddEventController((KalendarGUIAddEvent)event, ureq);
      }
    }
View Full Code Here


    } else if (source == gotoDateForm) {
      weeklyCalendar.setDate(gotoDateForm.getGotoDate());
    } else if (source == dbcSequence) {
      if(event != Event.CANCELLED_EVENT) {
        int pos = DialogBoxUIFactory.getButtonPos(event);
        KalendarGUIEditEvent guiEvent = (KalendarGUIEditEvent)dbcSequence.getUserObject();
        KalendarRenderWrapper kalendarWrapper = guiEvent.getKalendarRenderWrapper();
        KalendarEvent kalendarEvent = guiEvent.getKalendarEvent();
        if(pos == 0) { // edit the sequence
          // load the parent event of this sequence
          KalendarEvent parentEvent = kalendarWrapper.getKalendar().getEvent(kalendarEvent.getID());
          pushEditEventController(ureq, parentEvent, kalendarWrapper);
        } else if(pos == 1) { // delete a single event of the sequence
View Full Code Here

      cal.setTime(dateStart);
      cal.add(Calendar.DAY_OF_YEAR, 1);
      Date dateEnd = cal.getTime();
      recurEvent = cm.getRecurringInPeriod(dateStart, dateEnd, event);
      setDirty(true);
      fireEvent(ureq, new KalendarGUIEditEvent(recurEvent != null ? recurEvent : event, kalendarWrapper));
    } else if (command.equals(CMD_ADD)) {
      // this will get us the day of the year
      String sDate = ureq.getParameter(ID_PARAM);
      Date timeDate = new Date();
      try {
View Full Code Here

TOP

Related Classes of org.olat.commons.calendar.ui.events.KalendarGUIEditEvent

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.