Package net.ftlines.wicket.fullcalendar

Examples of net.ftlines.wicket.fullcalendar.Event


      } else {
        if (dataProtection == false && date != null) {
          birthdayAddress.setAge(date.toDate());
        }
      }
      final Event event = new Event().setAllDay(true);
      event.setClassName(EVENT_CLASS_NAME);
      final String id = "" + address.getId();
      event.setId(id);
      event.setStart(date);
      final StringBuffer buf = new StringBuffer();
      if (dataProtection == false) {
        // Birthday is not visible for all users (age == 0).
        buf.append(
            DateTimeFormatter.instance().getFormattedDate(address.getBirthday(), DateFormats.getFormatString(DateFormatType.DATE_SHORT)))
            .append(" ");
      }
      buf.append(address.getFirstName()).append(" ").append(address.getName());
      if (dataProtection == false && birthdayAddress.getAge() > 0) {
        // Birthday is not visible for all users (age == 0).
        buf.append(" (").append(birthdayAddress.getAge()).append(" ").append(PFUserContext.getLocalizedString("address.age.short")).append(")");
      }
      event.setTitle(buf.toString());
      if (birthdayAddress.isFavorite() == true) {
        // Colors of events of birthdays of favorites (for default color see CalendarPanel):
        event.setBackgroundColor("#06790E");
        event.setBorderColor("#06790E");
        event.setTextColor("#FFFFFF");
      }
      events.put(id, event);
    }
  }
View Full Code Here


        if (calFilter.isShowBreaks() == true) {
          if (lastStopTime != null
              && DateHelper.isSameDay(stopTime, lastStopTime) == true
              && startTime.getMillis() - lastStopTime.getMillis() > 60000) {
            // Show breaks between time sheets of one day (> 60s).
            final Event breakEvent = new Event();
            breakEvent.setEditable(false);
            final String breakId = String.valueOf(++breaksCounter);
            breakEvent.setClassName(BREAK_EVENT_CLASS_NAME).setId(breakId).setStart(lastStopTime).setEnd(startTime)
            .setTitle(getString("timesheet.break"));
            breakEvent.setTextColor("#666666").setBackgroundColor("#F9F9F9").setColor("#F9F9F9");
            events.put(breakId, breakEvent);
            final TimesheetDO breakTimesheet = new TimesheetDO().setStartDate(lastStopTime.toDate()).setStopTime(startTime.getMillis());
            breaksMap.put(breakId, breakTimesheet);
          }
          lastStopTime = stopTime;
        }
        final long duration = timesheet.getDuration();
        final MyEvent event = new MyEvent();
        final String id = "" + timesheet.getId();
        event.setClassName(EVENT_CLASS_NAME);
        event.setId(id);
        event.setStart(startTime);
        event.setEnd(stopTime);
        final String title = getTitle(timesheet);
        if (longFormat == true) {
          // Week or day view:
          event.setTitle(title + "\n" + getToolTip(timesheet) + "\n" + formatDuration(duration, false));
        } else {
          // Month view:
          event.setTitle(title);
        }
        if (month != null && startTime.getMonthOfYear() != month && stopTime.getMonthOfYear() != month) {
          // Display time sheets of other month as grey blue:
          event.setTextColor("#222222").setBackgroundColor("#ACD9E8").setColor("#ACD9E8");
        }
        events.put(id, event);
        if (month == null || startTime.getMonthOfYear() == month) {
          totalDuration += duration;
          addDurationOfDay(startTime.getDayOfMonth(), duration);
        }
        final int dayOfYear = startTime.getDayOfYear();
        addDurationOfDayOfYear(dayOfYear, duration);
        event.setTooltip(
            getString("timesheet"),
            new String[][] {
              { title},
              { timesheet.getLocation(), getString("timesheet.location")},
              { KostFormatter.formatLong(timesheet.getKost2()), getString("fibu.kost2")},
              { TaskFormatter.instance().getTaskPath(timesheet.getTaskId(), true, OutputType.PLAIN),
                getString("task")},
                { timesheet.getDescription(), getString("description")}});
      }
    }
    if (calFilter.isShowStatistics() == true) {
      // Show statistics: duration of every day is shown as all day event.
      DateTime day = start;
      final Calendar cal = DateHelper.getCalendar();
      cal.setTime(start.toDate());
      final int numberOfDaysInYear = cal.getActualMaximum(Calendar.DAY_OF_YEAR);
      int paranoiaCounter = 0;
      do {
        if (++paranoiaCounter > 1000) {
          log.error("Paranoia counter exceeded! Dear developer, please have a look at the implementation of buildEvents.");
          break;
        }
        final int dayOfYear = day.getDayOfYear();
        final long duration = durationsPerDayOfYear[dayOfYear];
        final boolean firstDayOfWeek = day.getDayOfWeek() == PFUserContext.getJodaFirstDayOfWeek();
        if (firstDayOfWeek == false && duration == 0) {
          day = day.plusDays(1);
          continue;
        }
        final Event event = new Event().setAllDay(true);
        final String id = "s-" + (dayOfYear);
        event.setId(id);
        event.setStart(day);
        final String durationString = formatDuration(duration, false);
        if (firstDayOfWeek == true) {
          // Show week of year at top of first day of week.
          long weekDuration = 0;
          for (short i = 0; i < 7; i++) {
            int d = dayOfYear + i;
            if (d > numberOfDaysInYear) {
              d -= numberOfDaysInYear;
            }
            weekDuration += durationsPerDayOfYear[d];
          }
          final StringBuffer buf = new StringBuffer();
          buf.append(getString("calendar.weekOfYearShortLabel")).append(DateHelper.getWeekOfYear(day));
          if (days > 1 && weekDuration > 0) {
            // Show total sum of durations over all time sheets of current week (only in week and month view).
            buf.append(": ").append(formatDuration(weekDuration, false));
          }
          if (duration > 0) {
            buf.append(", ").append(durationString);
          }
          event.setTitle(buf.toString());
        } else {
          event.setTitle(durationString);
        }
        event.setTextColor("#666666").setBackgroundColor("#F9F9F9").setColor("#F9F9F9");
        event.setEditable(false);
        events.put(id, event);
        day = day.plusDays(1);
      } while (day.isAfter(end) == false);
    }
  }
View Full Code Here

      }

      @Override
      protected void onEventClicked(final ClickedEvent clickedEvent, final CalendarResponse response)
      {
        final Event event = clickedEvent.getEvent();
        final String eventId = event != null ? event.getId() : null;
        final String eventClassName = event != null ? event.getClassName() : null;
        if (log.isDebugEnabled() == true) {
          log.debug("Event clicked. eventId: "
              + eventId
              + " eventClass"
              + event.getClassName()
              + ", sourceId: "
              + clickedEvent.getSource().getUuid());
        }
        if (eventId != null && eventClassName != null) {
          if (TimesheetEventsProvider.EVENT_CLASS_NAME.startsWith(eventClassName) == true) {
View Full Code Here

  }

  @Override
  public Event getEventForId(final String id) throws EventNotFoundException
  {
    final Event event = events.get(id);
    if (event != null) {
      return event;
    }
    throw new EventNotFoundException("Event with id: " + id + " not found");
  }
View Full Code Here

      } else {
        day = day.plusDays(1);
        continue;
      }

      final Event event = new Event().setAllDay(true);
      final String id = "h-" + (++idCounter);
      event.setId(id);
      event.setStart(day.toDateTime());
      String title;
      final String holidayInfo = dh.getHolidayInfo();
      if (holidayInfo != null && holidayInfo.startsWith("calendar.holiday.") == true) {
        title = PFUserContext.getLocalizedString(holidayInfo);
      } else {
        title = holidayInfo;
      }
      event.setTitle(title);
      event.setBackgroundColor(backgroundColor);
      event.setColor(color);
      event.setTextColor(textColor);
      events.put(id, event);
      day = day.plusDays(1);
    } while (day.isAfter(end) == false);
  }
View Full Code Here

                final CalendarEvent calendarEvent = calendarEventFor(domainObject, calendarName);
                if(calendarEvent == null) {
                    return null;
                }

                final Event event = new Event();
               
                final DateTime start = calendarEvent.getDateTime();
                final DateTime end = start;
                event.setStart(start);
                event.setEnd(end);
                event.setAllDay(true);

                final String oidStr = input.getOid().enString(IsisContext.getOidMarshaller());
                event.setId(oidStr + "-" + calendarName);

                event.setClassName("fullCalendar2-event-" + calendarName);
                event.setEditable(false);
                event.setPayload(oidStr);
                event.setTitle(calendarEvent.getTitle());

                //event.setBackgroundColor(backgroundColor)
                //event.setBorderColor(borderColor)
                //event.setColor(color)
                //event.setTextColor(textColor)
View Full Code Here

                final CalendarEvent calendarEvent = calendarEventFor(domainObject, calendarName);
                if(calendarEvent == null) {
                    return null;
                }

                final Event event = new Event();
               
                final DateTime start = calendarEvent.getDateTime();
                final DateTime end = start;
                event.setStart(start);
                event.setEnd(end);
                event.setAllDay(true);

                final String oidStr = input.getOid().enString(IsisContext.getOidMarshaller());
                event.setId(oidStr + "-" + calendarName);

                event.setClassName("fullCalendar2-event-" + calendarName);
                event.setEditable(false);
                event.setPayload(oidStr);
                event.setTitle(calendarEvent.getTitle());

                //event.setBackgroundColor(backgroundColor)
                //event.setBorderColor(borderColor)
                //event.setColor(color)
                //event.setTextColor(textColor)
View Full Code Here

TOP

Related Classes of net.ftlines.wicket.fullcalendar.Event

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.