blob: fdd98a90b9b4a4914ce02428ad532952860cc60a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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);
}
}
|