📄 eclipsemeuistrings.java
字号:
/*
********************************************************************
*
* File : EclipseMEUIStrings
* Package : eclipseme.core
* System : eclipseme.core
* Author : Kevin Hunter
* Description : This class provides internationalization of strings
* in the EclipseME eclipseme.core package.
*
* Copyright (c) 2004 Kevin Hunter
* All Rights Reserved.
* Licensed under the Eclipse Public License - v 1.0
* For more information see http://www.eclipse.org/legal/epl-v10.html
*
* CVS
* $$Source: /cvsroot/eclipseme/eclipseme.ui/src/eclipseme/ui/EclipseMEUIStrings.java,v $$
* $$Author: kdhunter $$
* $$Date: 2004/12/09 01:47:21 $$
* $$Revision: 1.2 $$
*
********************************************************************
*/
package eclipseme.ui;
import java.text.MessageFormat;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/**
* This class provides the means to internationalize strings that are located
* in the eclipseme.ui package. It sets up a ResourceBundle based on the
* file <code>EclipseMEUIStrings.properties</code> in the eclipseme.core
* package, and allows retrieval of keyed strings from that bundle.
*
* @author khunter
*
*/
public class EclipseMEUIStrings
{
private static final String BUNDLE_NAME = "eclipseme.ui.EclipseMEUIPluginResources";
private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME);
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found.
*/
public static String getString(String key)
{
String result = key;
try
{
result = RESOURCE_BUNDLE.getString(key).trim();
}
catch(MissingResourceException e)
{
}
return(result);
}
/**
* Returns the string from the plugin's resource bundle,
* or 'key' if not found. Substitutions will be made if
* supplied.
*
* @param key
* @param substitutions
* @return String
*/
public static String getString(String key, Object[] substitutions)
{
String result = '!' + key + '!';
try
{
result = RESOURCE_BUNDLE.getString(key).trim();
}
catch(MissingResourceException e)
{
}
return MessageFormat.format(result, substitutions);
}
/**
* Returns the string from the plugin's resource bundle,
* or <code>null</code> if not found.
*/
public static String getBundleString(String key)
{
String result = null;
try
{
result = RESOURCE_BUNDLE.getString(key).trim();
}
catch(MissingResourceException e)
{
}
return(result);
}
}
/*
********************************************************************
* CVS History
* $$Log: EclipseMEUIStrings.java,v $
* $Revision 1.2 2004/12/09 01:47:21 kdhunter
* $Refactored old string support over to new string access class
* $
* $Revision 1.1 2004/12/07 03:09:25 kdhunter
* $Internationalized J2MEProjectPropertiesPage
* $$
*
********************************************************************
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -