srcanaapps/depexplorer/com.nokia.s60tools.appdep/src/com/nokia/s60tools/appdep/resources/Messages.java
changeset 0 a02c979e8dfd
equal deleted inserted replaced
-1:000000000000 0:a02c979e8dfd
       
     1 /*
       
     2 * Copyright (c) 2006 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 */
       
    17  
       
    18 package com.nokia.s60tools.appdep.resources;
       
    19 
       
    20 import java.util.MissingResourceException;
       
    21 import java.util.ResourceBundle;
       
    22 
       
    23 /**
       
    24  * Messages class is used to fetch localised strings from properties file.
       
    25  */
       
    26 public class Messages {
       
    27 	private static final String BUNDLE_NAME = "com.nokia.s60tools.appdep.resources.messages"; //$NON-NLS-1$
       
    28 
       
    29 	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
       
    30 			.getBundle(BUNDLE_NAME);
       
    31 
       
    32 	private Messages() {
       
    33 	}
       
    34 
       
    35 	public static String getString(String key) {
       
    36 		try {
       
    37 			return RESOURCE_BUNDLE.getString(key);
       
    38 		} catch (MissingResourceException e) {
       
    39 			return '!' + key + '!';
       
    40 		}
       
    41 	}
       
    42 }