1402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll/******************************************************************************* 2402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Copyright (c) 2000, 2007 IBM Corporation and others. 3402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * All rights reserved. This program and the accompanying materials 4402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * are made available under the terms of the Eclipse Public License v1.0 5402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * which accompanies this distribution, and is available at 6402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * http://www.eclipse.org/legal/epl-v10.html 7402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * 8402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Contributors: 9402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * IBM Corporation - initial API and implementation 10402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll *******************************************************************************/ 11402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpackage org.eclipse.test.performance.ui; 12402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 13402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollimport java.text.MessageFormat; 14402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 15402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollimport org.eclipse.osgi.util.NLS; 16402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 17402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Mollpublic class Messages extends NLS { 18402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 19402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll private static final String BUNDLE_NAME = "org.eclipse.test.performance.ui.messages";//$NON-NLS-1$ 20402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 21402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll private Messages() { 22402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll // Do not instantiate 23402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 24402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 25402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll public static String standardError; 26402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 27402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll static { 28402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll NLS.initializeMessages(BUNDLE_NAME, Messages.class); 29402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 30402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 31402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll /** 32402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Bind the given message's substitution locations with the given string values. 33402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * 34402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param message the message to be manipulated 35402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @return the manipulated String 36402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */ 37402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll public static String bind(String message) { 38402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll return bind(message, null); 39402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 40402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 41402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll /** 42402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Bind the given message's substitution locations with the given string values. 43402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * 44402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param message the message to be manipulated 45402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param binding the object to be inserted into the message 46402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @return the manipulated String 47402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */ 48402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll public static String bind(String message, Object binding) { 49402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll return bind(message, new Object[] {binding}); 50402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 51402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 52402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll /** 53402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Bind the given message's substitution locations with the given string values. 54402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * 55402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param message the message to be manipulated 56402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param binding1 An object to be inserted into the message 57402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param binding2 A second object to be inserted into the message 58402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @return the manipulated String 59402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */ 60402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll public static String bind(String message, Object binding1, Object binding2) { 61402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll return bind(message, new Object[] {binding1, binding2}); 62402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 63402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 64402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll /** 65402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * Bind the given message's substitution locations with the given string values. 66402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * 67402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param message the message to be manipulated 68402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @param bindings An array of objects to be inserted into the message 69402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll * @return the manipulated String 70402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll */ 71402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll public static String bind(String message, Object[] bindings) { 72402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll return MessageFormat.format(message, bindings); 73402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll } 74402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll 75402794e73aed8611d62eb4b01cd155e2d76fcb87Raphael Moll} 76