summaryrefslogtreecommitdiffstats
path: root/shared/src
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-03-27 16:33:28 +0200
committerVaadin Code Review <review@vaadin.com>2013-04-03 08:03:37 +0000
commit217ba18e53a8607a9e2480574ec1c3da11f4037f (patch)
tree2c38b306985b77144e0797e8bc83d386c8575aa3 /shared/src
parent1d25d6d6427f94e93e3bf7417aa968aaa9673dab (diff)
downloadvaadin-framework-217ba18e53a8607a9e2480574ec1c3da11f4037f.tar.gz
vaadin-framework-217ba18e53a8607a9e2480574ec1c3da11f4037f.zip
Integrate Calendar into core #11079
Everything else integrated, except TB3 tests (ticket #11090, old TB2 tests used instead) Change-Id: If1700d7680a6c0a45f84d6e3c7b80e6536da78c8
Diffstat (limited to 'shared/src')
-rw-r--r--shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java28
-rw-r--r--shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java36
-rw-r--r--shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java49
-rw-r--r--shared/src/com/vaadin/shared/ui/calendar/CalendarState.java69
-rw-r--r--shared/src/com/vaadin/shared/ui/calendar/DateConstants.java33
5 files changed, 215 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java
new file mode 100644
index 0000000000..c1ff8bdda5
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.calendar;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+/**
+ *
+ * @since 7.1
+ * @author Vaadin Ltd.
+ *
+ */
+public interface CalendarClientRpc extends ClientRpc {
+ void scroll(int scrollPosition);
+}
diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java
new file mode 100644
index 0000000000..6f52aabf43
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.calendar;
+
+/**
+ * CalendarEventId contains static String identifiers for all Calendar events.
+ * These are used both in the client and server side code.
+ *
+ * @since 7.1
+ * @author Vaadin Ltd.
+ */
+public class CalendarEventId {
+
+ public static final String EVENTMOVE = "eventMove";
+ public static final String RANGESELECT = "rangeSelect";
+ public static final String FORWARD = "forward";
+ public static final String BACKWARD = "backward";
+ public static final String DATECLICK = "dateClick";
+ public static final String WEEKCLICK = "weekClick";
+ public static final String EVENTCLICK = "eventClick";
+ public static final String EVENTRESIZE = "eventResize";
+ public static final String ACTION = "action";
+}
diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java
new file mode 100644
index 0000000000..5257310cbf
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.calendar;
+
+import com.vaadin.shared.annotations.Delayed;
+import com.vaadin.shared.communication.ServerRpc;
+
+/**
+ * @since 7.1
+ * @author Vaadin Ltd.
+ */
+public interface CalendarServerRpc extends ServerRpc {
+ void eventMove(int eventIndex, String newDate);
+
+ void rangeSelect(String range);
+
+ void forward();
+
+ void backward();
+
+ void dateClick(String date);
+
+ void weekClick(String event);
+
+ void eventClick(int eventIndex);
+
+ void eventResize(int eventIndex, String newStartDate, String newEndDate);
+
+ void actionOnEmptyCell(String actionKey, String startDate, String endDate);
+
+ void actionOnEvent(String actionKey, String startDate, String endDate,
+ int eventIndex);
+
+ @Delayed(lastOnly = true)
+ void scroll(int scrollPosition);
+}
diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java
new file mode 100644
index 0000000000..fab5fd828e
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.calendar;
+
+import java.util.List;
+
+import com.vaadin.shared.AbstractComponentState;
+
+/**
+ * @since 7.1.0
+ * @author Vaadin Ltd.
+ */
+public class CalendarState extends AbstractComponentState {
+
+ public boolean format24H;
+ public String[] dayNames;
+ public String[] monthNames;
+ public int firstVisibleDayOfWeek = 1;
+ public int lastVisibleDayOfWeek = 7;
+ public int firstHourOfDay = 0;
+ public int lastHourOfDay = 23;
+ public int firstDayOfWeek;
+ public int scroll;
+ public String now;
+ public List<CalendarState.Day> days;
+ public List<CalendarState.Event> events;
+ public List<CalendarState.Action> actions;
+
+ public static class Day implements java.io.Serializable {
+ public String date;
+ public String localizedDateFormat;
+ public int dayOfWeek;
+ public int week;
+ }
+
+ public static class Action implements java.io.Serializable {
+
+ public String caption;
+ public String iconKey;
+ public String actionKey;
+ public String startDate;
+ public String endDate;
+ }
+
+ public static class Event implements java.io.Serializable {
+ public int index;
+ public String caption;
+ public String dateFrom;
+ public String dateTo;
+ public String timeFrom;
+ public String timeTo;
+ public String styleName;
+ public String description;
+ public boolean allDay;
+ }
+}
diff --git a/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java b/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java
new file mode 100644
index 0000000000..8a840274c2
--- /dev/null
+++ b/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2000-2013 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.shared.ui.calendar;
+
+/**
+ *
+ * @since 7.1
+ *
+ */
+public class DateConstants {
+
+ public static final String ACTION_DATE_FORMAT_PATTERN = "yyyy-MM-dd HH:mm:ss";
+ public static final String CLIENT_DATE_FORMAT = "yyyy-MM-dd";
+ public static final String CLIENT_TIME_FORMAT = "HH-mm";
+ public static final long MINUTEINMILLIS = 60 * 1000;
+ public static final long HOURINMILLIS = 60 * MINUTEINMILLIS;
+ public static final long DAYINMILLIS = 24 * HOURINMILLIS;
+ public static final long WEEKINMILLIS = 7 * DAYINMILLIS;
+
+}