Examples of BasicEvent


Examples of com.vaadin.addon.calendar.event.BasicEvent

        } else {
            /*
             * Else we use the properties to create the event
             */
            BasicEvent basicEvent = new ContainerCalendarEvent(index);

            // Set values from property values
            if (captionProperty != null
                    && item.getItemPropertyIds().contains(captionProperty)) {
                basicEvent.setCaption(String.valueOf(item.getItemProperty(
                        captionProperty).getValue()));
            }
            if (descriptionProperty != null
                    && item.getItemPropertyIds().contains(
                            descriptionProperty)) {
                basicEvent.setDescription(String.valueOf(item
                        .getItemProperty(descriptionProperty).getValue()));
            }
            if (startDateProperty != null
                    && item.getItemPropertyIds()
                    .contains(startDateProperty)) {
                basicEvent.setStart((Date) item.getItemProperty(
                        startDateProperty).getValue());
            }
            if (endDateProperty != null
                    && item.getItemPropertyIds().contains(endDateProperty)) {
                basicEvent.setEnd((Date) item.getItemProperty(
                        endDateProperty).getValue());
            }
            if (styleNameProperty != null
                    && item.getItemPropertyIds()
                    .contains(styleNameProperty)) {
                basicEvent.setDescription(String.valueOf(item
                        .getItemProperty(descriptionProperty).getValue()));
            }
            event = basicEvent;
        }
        return event;
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

            endDateField.setResolution(resolution);
        }
    }

    private CalendarEvent createNewEvent(Date startDate, Date endDate) {
        BasicEvent event = new BasicEvent();
        event.setCaption("");
        event.setStart(startDate);
        event.setEnd(endDate);
        event.setStyleName("color1");
        return event;
    }
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

        return event;
    }

    /* Removes the event from the data source and fires change event. */
    private void deleteCalendarEvent() {
        BasicEvent event = getFormCalendarEvent();
        if (dataSource.containsEvent(event)) {
            dataSource.removeEvent(event);
        }
        getUI().removeWindow(scheduleEventPopup);
    }
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

    }

    /* Adds/updates the event in the data source and fires change event. */
    private void commitCalendarEvent() throws CommitException {
        scheduleEventFieldGroup.commit();
        BasicEvent event = getFormCalendarEvent();
        if (event.getEnd() == null) {
            event.setEnd(event.getStart());
        }
        if (!dataSource.containsEvent(event)) {
            dataSource.addEvent(event);
        }

View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

    protected void setup(VaadinRequest request) {
        calendar = new Calendar();

        try {

            BasicEvent event = new BasicEvent("EVENT NAME 1",
                    "EVENT TOOLTIP 1",
                    new SimpleDateFormat("yyyy-MM-dd HH:mm")
                            .parse("2013-09-05 15:30"), new SimpleDateFormat(
                            "yyyy-MM-dd HH:mm").parse("2013-09-07 22:20"));
            event.setStyleName("color1");
            calendar.addEvent(event);

            event = new BasicEvent("EVENT NAME 2", "EVENT TOOLTIP 2",
                    new SimpleDateFormat("yyyy-MM-dd HH:mm")
                            .parse("2013-09-05 12:10"), new SimpleDateFormat(
                            "yyyy-MM-dd HH:mm").parse("2013-09-05 13:20"));
            event.setStyleName("color2");
            calendar.addEvent(event);

            event = new BasicEvent("EVENT NAME 3", "EVENT TOOLTIP 3",
                    new SimpleDateFormat("yyyy-MM-dd HH:mm")
                            .parse("2013-09-01 11:30"), new SimpleDateFormat(
                            "yyyy-MM-dd HH:mm").parse("2013-09-29 15:20"));
            event.setStyleName("color3");
            calendar.addEvent(event);

            event = new BasicEvent("EVENT NAME 4", "EVENT TOOLTIP 4",
                    new SimpleDateFormat("yyyy-MM-dd HH:mm")
                            .parse("2013-09-01 11:30"), new SimpleDateFormat(
                            "yyyy-MM-dd HH:mm").parse("2013-09-01 15:20"));
            event.setStyleName("color4");
            event.setAllDay(true);
            calendar.addEvent(event);
        } catch (ParseException e1) { // Nothing to do
            e1.printStackTrace();
        }
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

    @Override
    protected void setup(VaadinRequest request) {
        calendar = new Calendar();

        try {
            BasicEvent event = new BasicEvent("EVENT NAME 1",
                    "EVENT TOOLTIP 1",
                    new SimpleDateFormat("yyyy-MM-dd HH:mm")
                            .parse("2013-09-05 09:30"), new SimpleDateFormat(
                            "yyyy-MM-dd HH:mm").parse("2013-09-05 14:00"));
            event.setStyleName("color1");
            calendar.addEvent(event);
        } catch (ParseException e1) { // Nothing to do
            e1.printStackTrace();
        }
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

                    Date date3 = format.parse(todayString + " 12:00:00");
                    Date date4 = format.parse(todayString + " 14:00:00");
                    Date date5 = format.parse(todayString + " 15:00:00");
                    Date date6 = format.parse(todayString + " 17:00:00");

                    CalendarEvent event1 = new BasicEvent("First", "", date1,
                            date2);
                    CalendarEvent event2 = new BasicEvent("Second", "", date3,
                            date4);
                    CalendarEvent event3 = new BasicEvent("Third", "", date5,
                            date6);

                    events.add(event1);
                    events.add(event2);
                    events.add(event3);
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

                List<CalendarEvent> events = new ArrayList<CalendarEvent>();

                CalendarEvent event = null;
                try {
                    event = new BasicEvent("NAME", null, new SimpleDateFormat(
                            "yyyy-MM-dd hh:mm").parse("2013-01-01 07:00"),
                            new SimpleDateFormat("yyyy-MM-dd hh:mm")
                                    .parse("2013-01-01 11:00"));
                } catch (ParseException e) {
                    // Nothing to do
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

        // Ensure no events
        assertEquals(0, calendar.getEvents(start, end).size());

        // Add an event
        BasicEvent event = new BasicEvent("Test", "Test", start);
        calendar.addEvent(event);

        // Ensure event exists
        List<CalendarEvent> events = calendar.getEvents(start, end);
        assertEquals(1, events.size());
        assertEquals(events.get(0).getCaption(), event.getCaption());
        assertEquals(events.get(0).getDescription(), event.getDescription());
        assertEquals(events.get(0).getStart(), event.getStart());
    }
View Full Code Here

Examples of com.vaadin.ui.components.calendar.event.BasicEvent

        // Ensure no events
        assertEquals(0, calendar.getEvents(start, end).size());

        // Add an event
        CalendarEvent event = new BasicEvent("Test", "Test", start);
        calendar.addEvent(event);

        // Ensure event exists
        assertEquals(1, calendar.getEvents(start, end).size());
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.