KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > internal > databinding > internal > BindingMessages


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jface.internal.databinding.internal;
12
13 import java.util.MissingResourceException JavaDoc;
14 import java.util.ResourceBundle JavaDoc;
15
16 /**
17  * @since 1.0
18  *
19  */

20 public class BindingMessages {
21
22     /**
23      * The Binding resource bundle; eagerly initialized.
24      */

25     private static final ResourceBundle JavaDoc bundle = ResourceBundle
26             .getBundle("org.eclipse.jface.internal.databinding.internal.messages"); //$NON-NLS-1$
27

28     /**
29      * Returns the resource object with the given key in the resource bundle for
30      * JFace Data Binding. If there isn't any value under the given key, the key
31      * is returned.
32      *
33      * @param key
34      * the resource name
35      * @return the string
36      */

37     public static String JavaDoc getString(String JavaDoc key) {
38         try {
39             return bundle.getString(key);
40         } catch (MissingResourceException JavaDoc e) {
41             return key;
42         }
43     }
44 }
45
Popular Tags