summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/UI.java
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 /server/src/com/vaadin/ui/UI.java
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 'server/src/com/vaadin/ui/UI.java')
-rw-r--r--server/src/com/vaadin/ui/UI.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 545c2c7365..706f7c436b 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -30,6 +30,7 @@ import com.vaadin.event.ActionManager;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
import com.vaadin.navigator.Navigator;
+import com.vaadin.server.LocaleService;
import com.vaadin.server.Page;
import com.vaadin.server.PaintException;
import com.vaadin.server.PaintTarget;
@@ -494,6 +495,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements
private boolean hasPendingPush = false;
+ private LocaleService localeService = new LocaleService(this,
+ getState(false).localeServiceState);
+
/**
* This method is used by Component.Focusable objects to request focus to
* themselves. Focus renders must be handled at window level (instead of
@@ -1052,6 +1056,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements
@Override
public void attach() {
super.attach();
+ getLocaleService().addLocale(getLocale());
}
/**
@@ -1428,4 +1433,16 @@ public abstract class UI extends AbstractSingleComponentContainer implements
public void setOverlayContainerLabel(String overlayContainerLabel) {
getState().overlayContainerLabel = overlayContainerLabel;
}
+
+ /**
+ * Returns the locale service which handles transmission of Locale data to
+ * the client.
+ *
+ * @since 7.1
+ * @return The LocaleService for this UI
+ */
+ public LocaleService getLocaleService() {
+ return localeService;
+ }
+
}