Code example for ResourceBundle

Methods: containsKey, getString

0
	 
	/* 
	 * Returns value of the message 
	 */  
	public String value() {
		if (MainPreferencePageMessages.resourceBundle == null || !MainPreferencePageMessages.resourceBundle.containsKey(this.name()))
			return "!!"+this.name()+"!!";
		 
		return MainPreferencePageMessages.resourceBundle.getString(this.name());
	} 
	 
	/* 
	 * Returns value of the formatted message 
	 */  
	public String value(Object... args) {
		if (MainPreferencePageMessages.resourceBundle == null || !MainPreferencePageMessages.resourceBundle.containsKey(this.name()))
			return "!!"+this.name()+"!!";
		 
		return MessageFormat.format(MainPreferencePageMessages.resourceBundle.getString(this.name()), args);
	}