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

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


    @SuppressWarnings("unchecked")
    private BasicEvent getFormCalendarEvent() {
        BeanItem<CalendarEvent> item = (BeanItem<CalendarEvent>) scheduleEventFieldGroup
                .getItemDataSource();
        CalendarEvent event = item.getBean();
        return (BasicEvent) event;
    }
View Full Code Here


                    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

            public List<com.vaadin.ui.components.calendar.event.CalendarEvent> getEvents(
                    Date startDate, Date endDate) {

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

        List<CalendarEvent> events = calendar.getEventProvider().getEvents(
                start, end);
        assertEquals(container.size(), events.size());

        // Check that event values are present
        CalendarEvent e = events.get(0);
        assertEquals("Test 1", e.getCaption());
        assertEquals("Description 1", e.getDescription());
        assertTrue(e.getStart().compareTo(start) == 0);

        // Test that a certain range is returned
        cal.setTime((Date) container.getItem(container.getIdByIndex(6))
                .getItemProperty("testStartDate").getValue());
        end = cal.getTime();
View Full Code Here

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

            @Override
            public void eventSetChange(EventSetChangeEvent event) {
                List<CalendarEvent> events = event.getProvider().getEvents(
                        new Date(0), new Date(Long.MAX_VALUE));
                CalendarEvent calEvent = events.get(0);
                Date startEvent = calEvent.getStart();
                Date endEvent = calEvent.getEnd();

                startLbl.setValue(String.valueOf(startEvent.getTime()));
                endLbl.setValue(String.valueOf(endEvent.getTime()));
            }
        });
View Full Code Here

    @SuppressWarnings("unchecked")
    private BasicEvent getFormCalendarEvent() {
        BeanItem<CalendarEvent> item = (BeanItem<CalendarEvent>) scheduleEventFieldGroup
                .getItemDataSource();
        CalendarEvent event = item.getBean();
        return (BasicEvent) event;
    }
View Full Code Here

            public List<com.vaadin.ui.components.calendar.event.CalendarEvent> getEvents(
                    Date startDate, Date endDate) {

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

                CalendarEvent event = null;
                try {
                    event = new BasicEvent("NAME", "TOOLTIP",
                            new SimpleDateFormat("yyyy-MM-dd hh:mm")
                                    .parse("2013-01-01 07:00"),
                            new SimpleDateFormat("yyyy-MM-dd hh:mm")
View Full Code Here

            }
        }

        final Object id = container.getIdByIndex(index);
        Item item = container.getItem(id);
        CalendarEvent event;
        if (id instanceof CalendarEvent) {
            /*
             * If we are using the BeanItemContainer or another container which
             * stores the objects as ids then just return the instances
             */
 
View Full Code Here

     * #eventMove
     * (com.vaadin.addon.calendar.ui.CalendarComponentEvents.MoveEvent)
     */
    @Override
    public void eventMove(MoveEvent event) {
        CalendarEvent ce = event.getCalendarEvent();
        if (eventCache.contains(ce)) {
            int index;
            if (ce instanceof ContainerCalendarEvent) {
                index = ((ContainerCalendarEvent) ce).getContainerIndex();
            } else {
                index = container.indexOfId(ce);
            }

            long eventLength = ce.getEnd().getTime() - ce.getStart().getTime();
            Date newEnd = new Date(event.getNewStart().getTime() + eventLength);

            ignoreContainerEvents();
            Item item = container.getItem(container.getIdByIndex(index));
            item.getItemProperty(startDateProperty).setValue(
View Full Code Here

TOP

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

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.