aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2014-01-10 08:07:41 (EST)
committerDirk Fauth2014-01-10 09:22:06 (EST)
commit023fec35c544e5cab5aed48fdbd6281baf4c20da (patch)
tree10777cd63a947f48aa95a04ef8ad4409c2f78c8d
parent6b32c0283fc9dbfa097ce594c91de6a6c0da30b4 (diff)
downloadeclipse.platform.runtime-023fec35c544e5cab5aed48fdbd6281baf4c20da.zip
eclipse.platform.runtime-023fec35c544e5cab5aed48fdbd6281baf4c20da.tar.gz
eclipse.platform.runtime-023fec35c544e5cab5aed48fdbd6281baf4c20da.tar.bz2
Bug 423991 - Add ILocaleChangeService to add support for dynamic Localerefs/changes/43/19743/3
changes at runtime. Removed changeContextLocale() to only support changing the application locale for now. Change-Id: Ib82c07165882d6cd1532e664ce60fe89cffc11c1 Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
-rw-r--r--bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/services/nls/ILocaleChangeService.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/services/nls/ILocaleChangeService.java b/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/services/nls/ILocaleChangeService.java
new file mode 100644
index 0000000..1542610
--- /dev/null
+++ b/bundles/org.eclipse.e4.core.services/src/org/eclipse/e4/core/services/nls/ILocaleChangeService.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Dirk Fauth and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Dirk Fauth <dirk.fauth@googlemail.com> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.e4.core.services.nls;
+
+import java.util.Locale;
+import org.eclipse.e4.core.contexts.ContextFunction;
+
+/**
+ * Service that is used to change the {@link Locale} at runtime.
+ * <p>
+ * <b>Note:</b> This is not an OSGi service! It is created by a {@link ContextFunction}.
+ * </p>
+ *
+ * @noimplement This interface is not intended to be implemented by clients.
+ * @noextend This interface is not intended to be extended by clients.
+ */
+public interface ILocaleChangeService {
+
+ /**
+ * Base name for all locale change events.
+ */
+ String TOPIC = "org/eclipse/e4/core/NLS"; //$NON-NLS-1$
+ /**
+ * Locale change event: event that gets fired on Locale changes.
+ */
+ String LOCALE_CHANGE = TOPIC + "/" + "LOCALE_CHANGE"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ /**
+ * Change the {@link Locale} in the application context.
+ *
+ * @param locale
+ * The {@link Locale} to set to the application context.
+ */
+ void changeApplicationLocale(Locale locale);
+
+ /**
+ * Change the {@link Locale} in the application context.
+ * <p>
+ * If the given String is not a valid {@link Locale} String representation, there will be no
+ * locale change performed.
+ *
+ * @param localeString
+ * The String representation of the {@link Locale} to set to the application context.
+ */
+ void changeApplicationLocale(String localeString);
+}