tracefw/tracecompiler/src/com.nokia.tracecompiler/src/com/nokia/tracecompiler/Messages.java
equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 ** Localization for tracecompiler package |
|
17 * |
|
18 */ |
|
19 package com.nokia.tracecompiler; |
|
20 |
|
21 import java.util.MissingResourceException; |
|
22 import java.util.ResourceBundle; |
|
23 |
|
24 @SuppressWarnings("all") |
|
25 public final class Messages { |
|
26 |
|
27 /** |
|
28 * Bundle name |
|
29 */ |
|
30 private static final String BUNDLE_NAME = "com.nokia.tracecompiler.messages"; //$NON-NLS-1$ |
|
31 |
|
32 /** |
|
33 * Bundle |
|
34 */ |
|
35 private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle |
|
36 .getBundle(BUNDLE_NAME); |
|
37 |
|
38 /** |
|
39 * Prevents construction |
|
40 */ |
|
41 private Messages() { |
|
42 } |
|
43 |
|
44 /** |
|
45 * Gets localized string based on key |
|
46 * |
|
47 * @param key |
|
48 * the resource key |
|
49 * @return the localized resource |
|
50 */ |
|
51 public static String getString(String key) { |
|
52 try { |
|
53 return RESOURCE_BUNDLE.getString(key); |
|
54 } catch (MissingResourceException e) { |
|
55 return '!' + key + '!'; |
|
56 } |
|
57 } |
|
58 } |