sysperfana/memspyext/com.nokia.s60tools.swmtanalyser/src/com/nokia/s60tools/swmtanalyser/resources/Tooltips.java
changeset 7 8e12a575a9b5
equal deleted inserted replaced
6:f65f740e69f9 7:8e12a575a9b5
       
     1 /*
       
     2 * Copyright (c) 2009 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 package com.nokia.s60tools.swmtanalyser.resources;
       
    18 
       
    19 import java.util.MissingResourceException;
       
    20 import java.util.ResourceBundle;
       
    21 
       
    22 /**
       
    23  * Helper class to get the tooltips from the resource file.
       
    24  *
       
    25  */
       
    26 public class Tooltips {
       
    27 	private static final String BUNDLE_NAME = "com.nokia.s60tools.swmtanalyser.resources.tooltip"; //$NON-NLS-1$
       
    28 
       
    29 	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle
       
    30 			.getBundle(BUNDLE_NAME);
       
    31 
       
    32 	private Tooltips() {
       
    33 	}
       
    34 
       
    35 	/**
       
    36 	 * Get a tooltip by key
       
    37 	 * @param key
       
    38 	 * @return tooltip
       
    39 	 */
       
    40 	public static String getTooltip(String key) {
       
    41 		try {
       
    42 			return RESOURCE_BUNDLE.getString(key);
       
    43 		} catch (MissingResourceException e) {
       
    44 			return '!' + key + '!';
       
    45 		}
       
    46 	}
       
    47 }