Examples of BasicEvent


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

        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

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

                    .getTargetDetails();

            TableTransferable transferable = (TableTransferable) event
                    .getTransferable();

            calendar.addEvent(new BasicEvent(transferable.getItemId()
                    .toString(), "This event was dragged here", details
                    .getDropTime()));

            table.removeItem(transferable.getItemId());
        }
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", "TOOLTIP",
                            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
                }
                events.add(event);

                try {
                    event = new BasicEvent("NAME 2", "TOOLTIP2",
                            new SimpleDateFormat("yyyy-MM-dd hh:mm")
                                    .parse("2013-01-03 07:00"),
                            new SimpleDateFormat("yyyy-MM-dd hh:mm")
                                    .parse("2013-01-04 11:00"));
                } catch (ParseException e) {
View Full Code Here

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

        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

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

        } 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.setStyleName(String.valueOf(item.getItemProperty(
                        styleNameProperty).getValue()));
            }
            if (allDayProperty != null
                    && item.getItemPropertyIds().contains(allDayProperty)) {
                basicEvent.setAllDay((Boolean) item.getItemProperty(
                        allDayProperty).getValue());
            }
            event = basicEvent;
        }
        return event;
View Full Code Here

Examples of com.vaadin.ui.components.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
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.