1 package net.sourceforge.phpdt.externaltools.internal.model;
3 /**********************************************************************
4 Copyright (c) 2002 IBM Corp. and others. All rights reserved.
5 This file is made available under the terms of the Common Public License v1.0
6 which accompanies this distribution, and is available at
7 http://www.eclipse.org/legal/cpl-v10.html
10 **********************************************************************/
12 import java.text.MessageFormat;
13 import java.util.MissingResourceException;
14 import java.util.ResourceBundle;
17 * Utility class which helps managing messages
19 public final class ExternalToolsModelMessages {
20 private static final String RESOURCE_BUNDLE= "net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages"; //$NON-NLS-1$
21 private static ResourceBundle bundle = ResourceBundle.getBundle(RESOURCE_BUNDLE);
23 private ExternalToolsModelMessages(){
24 // prevent instantiation of class
28 * Returns the formatted message for the given key in
29 * the resource bundle.
31 * @param key the message name
32 * @param args the message arguments
33 * @return the formatted message
35 public static String format(String key, Object[] args) {
36 return MessageFormat.format(getString(key), args);
40 * Returns the message with the given key in
41 * the resource bundle. If there isn't any value under
42 * the given key, the key is returned.
44 * @param key the message name
47 public static String getString(String key) {
49 return bundle.getString(key);
50 } catch (MissingResourceException e) {
56 * Returns the resource bundle for the plug-in
58 public static ResourceBundle getResourceBundle() {