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