Skip to content

Package: DefaultLocaleProvider

DefaultLocaleProvider

nameinstructionbranchcomplexitylinemethod
DefaultLocaleProvider()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getLocale()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
setLocale(Locale)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Eugen Neufeld - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.internal.core.services.locale.defaultlocale;
15:
16: import java.util.Locale;
17:
18: import org.eclipse.emfforms.spi.common.locale.AbstractEMFFormsLocaleProvider;
19:
20: /**
21: * EMFFormsLocaleProvider that works on the default {@link Locale}.
22: *
23: * @author Eugen Neufeld
24: *
25: */
26: public class DefaultLocaleProvider extends AbstractEMFFormsLocaleProvider {
27:
28:         /**
29:          * {@inheritDoc}
30:          *
31:          * @see org.eclipse.emfforms.spi.common.locale.EMFFormsLocaleProvider#getLocale()
32:          */
33:         @Override
34:         public Locale getLocale() {
35:                 return Locale.getDefault();
36:         }
37:
38:         /**
39:          * Method to update the locale.
40:          *
41:          * @param newLocale The new Locale
42:          */
43:         public void setLocale(Locale newLocale) {
44:                 Locale.setDefault(newLocale);
45:                 notifyListeners();
46:         }
47: }