KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > editors > text > NLSUtility


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.ui.internal.editors.text;
12
13 import com.ibm.icu.text.MessageFormat;
14
15 /**
16  * A number of routines used for string externalization.
17  *
18  * @since 3.1
19  */

20 public class NLSUtility {
21
22     /**
23      * Formats the given string with the given argument.
24      *
25      * @param message the message to format, must not be <code>null</code>
26      * @param argument the argument used to format the string
27      * @return the formatted string
28      */

29     public static String JavaDoc format(String JavaDoc message, Object JavaDoc argument) {
30         return MessageFormat.format(message, new Object JavaDoc[] { argument });
31     }
32
33     /**
34      * Formats the given string with the given argument.
35      *
36      * @param message the message to format, must not be <code>null</code>
37      * @param arguments the arguments used to format the string
38      * @return the formatted string
39      */

40     public static String JavaDoc format(String JavaDoc message, Object JavaDoc[] arguments) {
41         return MessageFormat.format(message, arguments);
42     }
43
44     private NLSUtility() {
45         // Do not instantiate
46
}
47 }
48
Popular Tags