?? eclipsemecorestrings.java
字號:
/*
********************************************************************
*
* File : EclipseMECoreStrings
* 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.core/src/eclipseme/core/EclipseMECoreStrings.java,v $$
* $$Author: kdhunter $$
* $$Date: 2004/12/08 00:34:15 $$
* $$Revision: 1.3 $$
*
********************************************************************
*/
package eclipseme.core;
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.core package. It sets up a ResourceBundle based on the
* file <code>EclipseMECoreStrings.properties</code> in the eclipseme.core
* package, and allows retrieval of keyed strings from that bundle.
*
* @author khunter
*
*/
public class EclipseMECoreStrings
{
private static final String BUNDLE_NAME = "eclipseme.core.EclipseMEPluginResources";
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: EclipseMECoreStrings.java,v $
* $Revision 1.3 2004/12/08 00:34:15 kdhunter
* $Modified other classes in core to use new
* $resource strings class.
* $
* $Revision 1.2 2004/12/07 03:24:14 kdhunter
* $Tied into existing property bundle
* $
* $Revision 1.1 2004/12/07 02:43:24 kdhunter
* $Switched from custom exception classes to CoreException
* $in signing routines.
* $Set up basic error code and error message handling, including
* $prep for internationalization
* $$
*
********************************************************************
*/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -