⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 propertiesmanager.java

📁 用Swing实现的CHM制作工具
💻 JAVA
字号:
package g2w.app.gchm.util;

import java.io.IOException;

import g2w.app.gchm.lib.GProperties;

/**
 * PropertiesManager, used to load properties files for needs.
 * 
 * @author GreatGhoul
 * @version 002 2009-3-10 23:24:20
 * @since GCHMCreator 1.1
 */
public class PropertiesManager {
	
	/** Configuration properties. */
	private GProperties config = null;
	
	/**
	 * Constructs a properties manager.
	 */
	public PropertiesManager() {
		loadConfigurationProperties();
	}

	/**
	 * Loads configuration properties.
	 */
	private void loadConfigurationProperties() {
		try {
			config = new GProperties("config/config.xml");
		} catch (IOException e) {
			System.err.println("Error load configuration properties.");
			e.printStackTrace();
		}
	}


	/**
	 * Returns the refered properties.
	 *  
	 * @param name The name of the property
	 * @return The refered property, null if not exists.
	 */
	public String getProperty(String name) {
		return config.getProperty(name);
	}

	public void setProperty(String name, String value) {
		config.setProperty(name, value);
		try {
			config.store();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

⌨️ 快捷键说明

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