01: /*******************************************************************************
02: * Copyright (c) 2000, 2004 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Common Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/cpl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.drools.eclipse.editors.scanners;
11:
12: import java.util.MissingResourceException;
13: import java.util.ResourceBundle;
14:
15: public class RuleEditorMessages {
16:
17: private static final String RESOURCE_BUNDLE = getLocation();
18:
19: private static ResourceBundle fgResourceBundle = ResourceBundle
20: .getBundle(RESOURCE_BUNDLE);
21:
22: private RuleEditorMessages() {
23: }
24:
25: public static String getString(String key) {
26:
27: try {
28: return fgResourceBundle.getString(key);
29: } catch (MissingResourceException e) {
30: return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
31: }
32: }
33:
34: public static ResourceBundle getResourceBundle() {
35: return fgResourceBundle;
36: }
37:
38: private static String getLocation() {
39: return RuleEditorMessages.class.getPackage().getName()
40: + ".RuleEditorMessages";
41: }
42:
43: }
|