diff options
Diffstat (limited to 'uitest/src/main/java/com/vaadin/tests/smoke/CalendarSmoke.java')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/smoke/CalendarSmoke.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/smoke/CalendarSmoke.java b/uitest/src/main/java/com/vaadin/tests/smoke/CalendarSmoke.java new file mode 100644 index 0000000000..fdd98a90b9 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/smoke/CalendarSmoke.java @@ -0,0 +1,55 @@ +package com.vaadin.tests.smoke; + +import java.text.ParseException; +import java.text.SimpleDateFormat; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.v7.ui.Calendar; +import com.vaadin.v7.ui.components.calendar.CalendarComponentEvents; +import com.vaadin.v7.ui.components.calendar.event.BasicEvent; + +public class CalendarSmoke extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Calendar calendar = new Calendar(); + + if (request.getParameter("readonly") != null) { + calendar.setReadOnly(true); + } + + calendar.setFirstVisibleHourOfDay(8); + calendar.setLastVisibleHourOfDay(16); + + calendar.setTimeFormat(Calendar.TimeFormat.Format24H); + calendar.setHandler((CalendarComponentEvents.EventResizeHandler) null); + + calendar.setSizeFull(); + + try { + calendar.setStartDate( + new SimpleDateFormat("yyyy-MM-dd").parse("2013-09-01")); + calendar.setEndDate( + new SimpleDateFormat("yyyy-MM-dd").parse("2013-09-30")); + + 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-05 22:20")); + event.setStyleName("color1"); + + calendar.addEvent(event); + calendar.addEvent(event); + calendar.addEvent(event); + calendar.addEvent(event); + + } catch (ParseException e) { + + } + + addComponent(calendar); + } + +} |