diff options
author | Dani Megert | 2007-07-15 14:25:29 +0000 |
---|---|---|
committer | Dani Megert | 2007-07-15 14:25:29 +0000 |
commit | bd78df21497a5970e50d627dfb841a8c95973299 (patch) | |
tree | be2a3fe81edba4b3e3169e6bdcafbb522a2a36f8 /org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java | |
parent | 13d5f3e9647a806910b8159dbd44a4c10dbfc7f9 (diff) | |
download | eclipse.platform.text-bd78df21497a5970e50d627dfb841a8c95973299.tar.gz eclipse.platform.text-bd78df21497a5970e50d627dfb841a8c95973299.tar.xz eclipse.platform.text-bd78df21497a5970e50d627dfb841a8c95973299.zip |
Fixed bug 80667: [find/replace] Regex replace patterns should interpret character patterns
Diffstat (limited to 'org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java')
-rw-r--r-- | org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java b/org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java new file mode 100644 index 00000000000..f21cebf60a8 --- /dev/null +++ b/org.eclipse.text/src/org/eclipse/jface/text/TextMessages.java @@ -0,0 +1,48 @@ +/******************************************************************************* + * Copyright (c) 2007 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jface.text; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import com.ibm.icu.text.MessageFormat; + + +/** + * Helper class to get NLSed messages. + * + * @since 3.4 + */ +public class TextMessages { + private static final String BUNDLE_NAME= "org.eclipse.jface.text.TextMessages"; //$NON-NLS-1$ + + private static final ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME); + + private TextMessages() { + } + + public static String getString(String key) { + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } + + public static String getFormattedString(String key, Object arg) { + return getFormattedString(key, new Object[] { arg }); + } + + public static String getFormattedString(String key, Object[] args) { + return MessageFormat.format(getString(key), args); + } + +} |