sokobanmessages.java

来自「mywork是rcp开发的很好的例子」· Java 代码 · 共 62 行

JAVA
62
字号
/*
 * Created on Dec 30, 2003
 *
 * To change the template for this generated file go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
package es.org.chemi.games.sokoban;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

/**
 * @author Chemi
 *
 * To change the template for this generated type comment go to
 * Window>Preferences>Java>Code Generation>Code and Comments
 */
public class SokobanMessages
{
	//资料翻译统一在plugin中
	private static final String BUNDLE_NAME = "plugin";

	private static final ResourceBundle RESOURCE_BUNDLE =
		ResourceBundle.getBundle(BUNDLE_NAME);

	/**
	 * 
	 */
	private SokobanMessages()
	{


	}
	/**
	 * @param key
	 * @return
	 */
	public static String getString(String key)
	{
		try
		{
			return RESOURCE_BUNDLE.getString(key);
		}
		catch (MissingResourceException e)
		{
			return '!' + key + '!';
		}
	}
	
	public static int getInt(String key){
		try
		{
			return Integer.parseInt(RESOURCE_BUNDLE.getString(key));
		}
		catch (Exception e)
		{
			return 0;
		}
		
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?