Package org.primefaces.model

Examples of org.primefaces.model.ScheduleEvent


        writer.write("{");
        writer.write("\"events\" : [");
   
        if(model != null) {
            for(Iterator<ScheduleEvent> iterator = model.getEvents().iterator(); iterator.hasNext();) {
                ScheduleEvent event = iterator.next();
                String className = event.getStyleClass();
                String description = event.getDescription();
              
                writer.write("{");
                writer.write("\"id\": \"" + event.getId() + "\"")
                writer.write(",\"title\": \"" + escapeText(event.getTitle()) + "\"");
                writer.write(",\"start\": \"" + iso.format(event.getStartDate()) + "\"")
                writer.write(",\"end\": \"" + iso.format(event.getEndDate()) + "\"");
                writer.write(",\"allDay\":" + event.isAllDay());
                writer.write(",\"editable\":" + event.isEditable());
                if(className != null) {
                    writer.write(",\"className\":\"" + className + "\"");
                }
                if(description != null) {
                    writer.write(",\"description\":\"" + escapeText(description) + "\"");
View Full Code Here


      String changedEventParam = clientId + "_changedEventId";
     
      //Event select
      if(params.containsKey(selectedEventParam)) {
        String eventId = params.get(selectedEventParam);
        ScheduleEvent selectedEvent = model.getEvent(eventId);
        schedule.queueEvent(new ScheduleEntrySelectEvent(schedule, selectedEvent));
      }
      //Date Select
      else if(params.containsKey(selectedDateParam)) {
        String dateAsString = params.get(selectedDateParam);
        schedule.queueEvent(new DateSelectEvent(component, new Date(Long.valueOf(dateAsString))));
      }
      //Event dragdrop or resize
      else if(params.containsKey(changedEventParam)) {
        String eventId = params.get(changedEventParam);
        ScheduleEvent changedEvent = model.getEvent(eventId);
        int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));
        Calendar calendar = Calendar.getInstance();
        boolean isResize = params.containsKey(clientId + "_resized");
       
        if(!isResize) {
          calendar.setTime(changedEvent.getStartDate());
          calendar.roll(Calendar.DATE, dayDelta);
          changedEvent.getStartDate().setTime(calendar.getTimeInMillis());
        }
       
        calendar = Calendar.getInstance();
        calendar.setTime(changedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        changedEvent.getEndDate().setTime(calendar.getTimeInMillis());
       
        if(isResize)
          schedule.queueEvent(new ScheduleEntryResizeEvent(schedule, changedEvent, dayDelta, minuteDelta));
        else
          schedule.queueEvent(new ScheduleEntryMoveEvent(schedule, changedEvent, dayDelta, minuteDelta));
View Full Code Here

   
    writer.write("{");
    writer.write("\"events\" : [");
   
    for(Iterator<ScheduleEvent> iterator = model.getEvents().iterator(); iterator.hasNext();) {
      ScheduleEvent event = iterator.next();
     
      writer.write("{");
      writer.write("\"id\": \"" + event.getId() + "\"")
      writer.write(",\"title\": \"" + event.getTitle() + "\"");
      writer.write(",\"start\": " + event.getStartDate().getTime())
      writer.write(",\"end\": " + event.getEndDate().getTime())
      writer.write(",\"allDay\":" + event.isAllDay());
      if(event.getStyleClass() != null)
        writer.write(",\"className\":\"" + event.getStyleClass() + "\"");
     
      writer.write("}");

      if(iterator.hasNext())
        writer.write(",");
View Full Code Here

                wrapperEvent = dateSelectEvent;
            }
            else if(eventName.equals("eventSelect")) {
                String selectedEventId = params.get(clientId + "_selectedEventId");
        ScheduleEvent selectedEvent = this.getValue().getEvent(selectedEventId);

                wrapperEvent = new ScheduleEntrySelectEvent(this, behaviorEvent.getBehavior(), selectedEvent);
            }
            else if(eventName.equals("eventMove")) {
                String movedEventId = params.get(clientId + "_movedEventId");
        ScheduleEvent movedEvent = this.getValue().getEvent(movedEventId);
                int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));

                Calendar calendar = Calendar.getInstance();
                calendar.setTime(movedEvent.getStartDate());
                calendar.roll(Calendar.DATE, dayDelta);
                movedEvent.getStartDate().setTime(calendar.getTimeInMillis());

                calendar = Calendar.getInstance();
                calendar.setTime(movedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        movedEvent.getEndDate().setTime(calendar.getTimeInMillis());

                wrapperEvent = new ScheduleEntryMoveEvent(this, behaviorEvent.getBehavior(), movedEvent, dayDelta, minuteDelta);
            }
            else if(eventName.equals("eventResize")) {
                String resizedEventId = params.get(clientId + "_resizedEventId");
        ScheduleEvent resizedEvent = this.getValue().getEvent(resizedEventId);
                int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));

                Calendar calendar = Calendar.getInstance();
                calendar.setTime(resizedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        resizedEvent.getEndDate().setTime(calendar.getTimeInMillis());

                wrapperEvent = new ScheduleEntryResizeEvent(this, behaviorEvent.getBehavior(), resizedEvent, dayDelta, minuteDelta);
            }

            wrapperEvent.setPhaseId(behaviorEvent.getPhaseId());
View Full Code Here

    writer.write("{");
    writer.write("\"events\" : [");
   
    for(Iterator<ScheduleEvent> iterator = model.getEvents().iterator(); iterator.hasNext();) {
      ScheduleEvent event = iterator.next();
     
      writer.write("{");
      writer.write("\"id\": \"" + event.getId() + "\"")
      writer.write(",\"title\": \"" + event.getTitle() + "\"");
      writer.write(",\"start\": " + event.getStartDate().getTime())
      writer.write(",\"end\": " + event.getEndDate().getTime())
      writer.write(",\"allDay\":" + event.isAllDay());
      if(event.getStyleClass() != null)
        writer.write(",\"className\":\"" + event.getStyleClass() + "\"");
     
      writer.write("}");

      if(iterator.hasNext())
        writer.write(",");
View Full Code Here

      String changedEventParam = clientId + "_changedEventId";
     
      //Event select
      if(params.containsKey(selectedEventParam)) {
        String eventId = params.get(selectedEventParam);
        ScheduleEvent selectedEvent = model.getEvent(eventId);
        schedule.queueEvent(new ScheduleEntrySelectEvent(schedule, selectedEvent));
      }
      //Date Select
      else if(params.containsKey(selectedDateParam)) {
        String dateAsString = params.get(selectedDateParam);
        schedule.queueEvent(new DateSelectEvent(component, new Date(Long.valueOf(dateAsString))));
      }
      //Event dragdrop or resize
      else if(params.containsKey(changedEventParam)) {
        String eventId = params.get(changedEventParam);
        ScheduleEvent changedEvent = model.getEvent(eventId);
        int dayDelta = Integer.valueOf(params.get(clientId + "_dayDelta"));
        int minuteDelta = Integer.valueOf(params.get(clientId + "_minuteDelta"));
        Calendar calendar = Calendar.getInstance();
        boolean isResize = params.containsKey(clientId + "_resized");
       
        if(!isResize) {
          calendar.setTime(changedEvent.getStartDate());
          calendar.roll(Calendar.DATE, dayDelta);
          changedEvent.getStartDate().setTime(calendar.getTimeInMillis());
        }
       
        calendar = Calendar.getInstance();
        calendar.setTime(changedEvent.getEndDate());
        calendar.roll(Calendar.DATE, dayDelta);
        changedEvent.getEndDate().setTime(calendar.getTimeInMillis());
       
        if(isResize)
          schedule.queueEvent(new ScheduleEntryResizeEvent(schedule, changedEvent, dayDelta, minuteDelta));
        else
          schedule.queueEvent(new ScheduleEntryMoveEvent(schedule, changedEvent, dayDelta, minuteDelta));
View Full Code Here

   
    writer.write("{");
    writer.write("\"events\" : [");
   
    for(Iterator<ScheduleEvent> iterator = model.getEvents().iterator(); iterator.hasNext();) {
      ScheduleEvent event = iterator.next();
     
      writer.write("{");
      writer.write("\"id\": \"" + event.getId() + "\"")
      writer.write(",\"title\": \"" + event.getTitle() + "\"");
      writer.write(",\"start\": " + event.getStartDate().getTime())
      writer.write(",\"end\": " + event.getEndDate().getTime())
      writer.write(",\"allDay\":" + event.isAllDay());
      if(event.getStyleClass() != null)
        writer.write(",\"className\":\"" + event.getStyleClass() + "\"");
     
      writer.write("}");

      if(iterator.hasNext())
        writer.write(",");
View Full Code Here

TOP

Related Classes of org.primefaces.model.ScheduleEvent

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.