1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.ui.workbench;
\r
14 import java.text.MessageFormat;
\r
15 import java.util.MissingResourceException;
\r
16 import java.util.ResourceBundle;
\r
18 public final class WorkbenchResources {
\r
20 private static final ResourceBundle bundle = ResourceBundle.getBundle("org.simantics.ui.workbench.messages"); //$NON-NLS-1$
\r
23 * Returns the resource object with the given key in the Workbench resource
\r
24 * bundle. If there isn't any value under the given key, the key is
\r
27 * @param key the resource name
\r
28 * @return the string
\r
30 public static final String getString(String key) {
\r
32 return bundle.getString(key);
\r
33 } catch (MissingResourceException e) {
\r
39 * Returns the formatted message for the given key in the Workbench resource
\r
42 * @param key the resource name
\r
43 * @param args the message arguments
\r
44 * @return the string
\r
46 public static String format(String key, Object[] args) {
\r
47 return MessageFormat.format(getString(key), args);
\r