KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > dolphin > rcp > Messages


1 /*
2 * Copyright (C) 2005 Bourgeon Jérôme, Macherel Bruno
3 *
4 * This file is part of Dolphin
5 *
6 * Dolphin : An open source J2EE Deployment Tool JSR-88 compliant
7 * Contact: ishmael-dev@objectweb.org
8 *
9 * Dolphin is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or any later version.
13 *
14 * Dolphin is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with Dolphin; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
22 * USA
23 */

24 package org.objectweb.dolphin.rcp;
25
26 import java.util.MissingResourceException JavaDoc;
27 import java.util.ResourceBundle JavaDoc;
28
29 /**
30  * @author Bourgeon Jérôme, Macherel Bruno
31  *
32  */

33 public class Messages {
34
35     private static final String JavaDoc BUNDLE_NAME = "org.objectweb.dolphin.rcp.Dolphin"; //$NON-NLS-1$
36

37     private static final ResourceBundle JavaDoc RESOURCE_BUNDLE = ResourceBundle
38             .getBundle(BUNDLE_NAME);
39
40     /**
41      * Return the string place in the bundle org.objectweb.dolphin.rcp.Dolphin
42      * matching with the key
43      * @param key
44      * @return key value
45      */

46     public static String JavaDoc getString(String JavaDoc key) {
47         try {
48             return RESOURCE_BUNDLE.getString(key);
49         } catch (MissingResourceException JavaDoc e) {
50             return '!' + key + '!';
51         }
52     }
53 }
54
Popular Tags