diff options
author | Denis <denis@vaadin.com> | 2016-12-14 13:50:06 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2016-12-14 13:50:06 +0200 |
commit | fc011f6a8a08064f48fd5f4280f1d4d3647ab7f1 (patch) | |
tree | 3cb8e0f9022aa752b55e9f83f209388e1557b0ba /compatibility-shared/src/main | |
parent | 692bbef040a61388d8ba028a9701a760b64baa43 (diff) | |
download | vaadin-framework-fc011f6a8a08064f48fd5f4280f1d4d3647ab7f1.tar.gz vaadin-framework-fc011f6a8a08064f48fd5f4280f1d4d3647ab7f1.zip |
Provide configuration for events order in month and week views
Diffstat (limited to 'compatibility-shared/src/main')
-rw-r--r-- | compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java index dd15c09b7f..646c7eed44 100644 --- a/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java +++ b/compatibility-shared/src/main/java/com/vaadin/v7/shared/ui/calendar/CalendarState.java @@ -40,6 +40,32 @@ public class CalendarState extends AbstractLegacyComponentState { public List<CalendarState.Action> actions; public boolean eventCaptionAsHtml; + public EventSortOrder eventSortOrder = EventSortOrder.DURATION_DESC; + + /** + * Defines sort strategy for events in calendar month view and week view. In + * month view events will be sorted from top to bottom using the order in + * day cell. In week view events inside same day will be sorted from left to + * right using the order if their intervals are overlapping. + * <p> + * <ul> + * <li>{@code UNSORTED} means no sort. Events will be in the order provided + * by com.vaadin.ui.components.calendar.event.CalendarEventProvider. + * <li>{@code START_DATE_DESC} means descending sort by events start date + * (earlier event are shown first). + * <li>{@code DURATION_DESC} means descending sort by duration (longer event + * are shown first). + * <li>{@code START_DATE_ASC} means ascending sort by events start date + * (later event are shown first). + * <li>{@code DURATION_ASC} means ascending sort by duration (shorter event + * are shown first). + * + * </ul> + */ + public enum EventSortOrder { + UNSORTED, START_DATE_DESC, START_DATE_ASC, DURATION_DESC, DURATION_ASC; + } + public static class Day implements java.io.Serializable { public String date; public String localizedDateFormat; |