summaryrefslogtreecommitdiffstats
path: root/shared
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-05-28 12:00:15 +0300
committerVaadin Code Review <review@vaadin.com>2013-05-29 12:33:17 +0000
commita9afca67ba942afa287be3507eb225e0a7b954e6 (patch)
treed2ddd12b3acc2f83c3361c018717bd557454cec6 /shared
parenta3ad62d947c86d3f53f333ca9bc36e4544cd5d46 (diff)
downloadvaadin-framework-a9afca67ba942afa287be3507eb225e0a7b954e6.tar.gz
vaadin-framework-a9afca67ba942afa287be3507eb225e0a7b954e6.zip
Moved Locale data handling to LocaleService (#11378)
The locale data is now tracked per UI instance and no longer sent in every request. Change-Id: I4bebd00327da6f8d812181fd76a85eb6196d0010
Diffstat (limited to 'shared')
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/UIState.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java
index 16c1ed16c7..f01d5d8100 100644
--- a/shared/src/com/vaadin/shared/ui/ui/UIState.java
+++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java
@@ -16,7 +16,11 @@
package com.vaadin.shared.ui.ui;
import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import com.vaadin.server.LocaleService;
+import com.vaadin.server.Page;
import com.vaadin.shared.communication.PushMode;
import com.vaadin.shared.ui.TabIndexState;
@@ -50,10 +54,34 @@ public class UIState extends TabIndexState {
* State related to the {@link Page} class.
*/
public PageState pageState = new PageState();
+ /**
+ * State related to the {@link LocaleService} class.
+ */
+ public LocaleServiceState localeServiceState = new LocaleServiceState();
{
primaryStyleName = "v-ui";
// Default is 1 for legacy reasons
tabIndex = 1;
}
+
+ public static class LocaleServiceState implements Serializable {
+ public List<LocaleData> localeData = new ArrayList<LocaleData>();
+ }
+
+ public static class LocaleData implements Serializable {
+ public String name;
+ public String[] monthNames;
+ public String[] shortMonthNames;
+ public String[] shortDayNames;
+ public String[] dayNames;
+ public int firstDayOfWeek;
+ public String dateFormat;
+ public boolean twelveHourClock;
+ public String hourMinuteDelimiter;
+ public String am;
+ public String pm;
+
+ }
+
}