Package com.vaadin.ui.components.calendar.event

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());
View Full Code Here


    private static Indexed createTestBeanItemContainer() {
        BeanItemContainer<CalendarEvent> eventContainer = new BeanItemContainer<CalendarEvent>(
                CalendarEvent.class);
        java.util.Calendar cal = java.util.Calendar.getInstance();
        for (int i = 1; i <= 10; i++) {
            eventContainer.addBean(new BasicEvent("Test " + i, "Description "
                    + i, cal.getTime()));
            cal.add(java.util.Calendar.DAY_OF_MONTH, 2);
        }
        return eventContainer;
    }
View Full Code Here

            private final Action REMOVE = new Action("Remove event");

            @Override
            public void handleAction(Action action, Object sender, Object target) {
                if (action == ADD) {
                    BasicEvent event = new BasicEvent();
                    event.setStart(new Date(100, 1, 1));
                    event.setEnd(new Date(100, 1, 1));
                    editEvent(event);
                } else if (action == EDIT) {
                    editEvent((BasicEvent) target);
                } else if (action == REMOVE) {
                    events.removeItem(target);
View Full Code Here

                    /*
                     * BeanItemContainer does not notify container listeners
                     * when the bean changes so we need to trigger a
                     * ItemSetChange event
                     */
                    BasicEvent dummy = new BasicEvent();
                    events.addBean(dummy);
                    events.removeItem(dummy);

                } else {
                    events.addBean(event);
View Full Code Here

        Date from = cal.getTime();

        cal.add(java.util.Calendar.HOUR, 1);
        Date to = cal.getTime();

        final BasicEvent basicEvent = new BasicEvent("event", "description",
                from, to);

        HorizontalLayout info = new HorizontalLayout();
        info.setSpacing(true);
        info.setMargin(true);
View Full Code Here

        }
    }

    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

        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);
        }
        removeWindow(scheduleEventPopup);
    }
View Full Code Here

    }

    /* 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

             */
            @Override
            public void handleAction(Action action, Object sender, Object target) {
                Date date = (Date) target;
                if (action == NEW_EVENT) {
                    BasicEvent event = new BasicEvent("New event",
                            "Hello world", date, date);
                    calendar.addEvent(event);
                }
            }

View Full Code Here

        private int index;
        private List<CalendarEvent> events = new ArrayList<CalendarEvent>();

        public void addEvent(Date date) {
            BasicEvent e = new BasicEvent();
            e.setAllDay(true);
            e.setStart(date);
            e.setEnd(date);
            e.setCaption("Some event " + ++index);
            events.add(e);
        }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.components.calendar.event.BasicEvent

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.