Skip to content

Package: Messages

Messages

nameinstructionbranchcomplexitylinemethod
getString(String)
M: 16 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
static {...}
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2014 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 - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.diffmerge.internal.renderer.swt;
15:
16: import java.util.MissingResourceException;
17: import java.util.ResourceBundle;
18:
19: /**
20: * Messages.
21: *
22: * @author Eugen
23: *
24: */
25: public final class Messages {
26:         private static final String BUNDLE_NAME = "org.eclipse.emf.ecp.diffmerge.internal.renderer.swt.messages"; //$NON-NLS-1$
27:
28:         private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
29:
30:         private Messages() {
31:         }
32:
33:         /**
34:          * retrieve a translated string for a given key.
35:          *
36:          * @param key the key
37:          * @return the translated String
38:          */
39:         public static String getString(String key) {
40:                 try {
41:                         return RESOURCE_BUNDLE.getString(key);
42:                 } catch (final MissingResourceException e) {
43:                         return '!' + key + '!';
44:                 }
45:         }
46: }