当前位置: 首页>>代码示例>>Java>>正文


Java ResourceBundleUtil类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.ResourceBundleUtil的典型用法代码示例。如果您正苦于以下问题:Java ResourceBundleUtil类的具体用法?Java ResourceBundleUtil怎么用?Java ResourceBundleUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResourceBundleUtil类属于com.liferay.portal.kernel.util包,在下文中一共展示了ResourceBundleUtil类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLocalization

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
private String getLocalization(String key, Locale locale) {
	if (_resourceBundle == null) {
		_resourceBundle = ResourceBundleUtil.getBundle(
			"content.Language", locale, JSONConfigurationHelperServiceImpl.class);
	}
	try {
		return _resourceBundle.getString(key);
	} catch (Exception e) {
		_log.error(e, e);
	}
	return key;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:13,代码来源:JSONConfigurationHelperServiceImpl.java

示例2: getHelpText

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
/**
 * Get help text. 
 *  
 * @return String help test
 */
protected String getHelpText(ResourceRequest resourceRequest) {

	ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", resourceRequest.getLocale(),
		GSearchPortlet.class);

	return LanguageUtil.get(resourceBundle, "helptext");
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:14,代码来源:GetHelpTextMVCResourceCommand.java

示例3: getLabel

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
/**
 * Returns the Control Menu entry's label stored in the module's resource
 * bundle.
 *
 * @param  locale the label's locale
 * @return the Control Menu entry's label
 */
@Override
public String getLabel(Locale locale) {
	ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", locale, getClass());

	return LanguageUtil.get(
		resourceBundle, "blade-menu-entry-custom-message");
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:16,代码来源:BladeProductNavigationControlMenuEntry.java

示例4: getMessage

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
@Override
public String getMessage(PortletRequest portletRequest) {
	ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", getLocale(portletRequest), getClass());

	return LanguageUtil.get(resourceBundle, "sample-link");
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:8,代码来源:BladePortletConfigurationIcon.java

示例5: getLabel

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
@Override
public String getLabel(Locale locale) {
	ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", locale, getClass());

	return LanguageUtil.get(resourceBundle, "simulation-sample");
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:8,代码来源:BladeSimulationPanelApp.java

示例6: getName

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
@Override
public String getName(Locale locale) {
    ResourceBundle bundle = ResourceBundleUtil.getBundle(RES_BUNDLE, locale, this.getClass());
    return this.language.get(bundle, LANGUAGE_KEY_TEMPLATE);
}
 
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:6,代码来源:DLFileEntryTypeTemplateHandler.java

示例7: getName

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
@Override
public String getName(Locale locale) {
    ResourceBundle bundle = ResourceBundleUtil.getBundle(LANGUAGE_BUNDLE, locale, this.getClass());
    return this.language.get(bundle, LANGUAGE_KEY_TEMPLATE);
}
 
开发者ID:savoirfairelinux,项目名称:flashlight-search,代码行数:6,代码来源:SearchTemplateHandler.java

示例8: buildResults

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public JSONObject buildResults(
	PortletRequest portletRequest, PortletResponse portletResponse,
	QueryParams queryParams, SearchContext searchContext, Hits hits) {

	_hits = hits;
	_portletRequest = portletRequest;
	_portletResponse = portletResponse;
	_queryParams = queryParams;
	
	// See class comments
	
	_resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", _queryParams.getLocale(), ResultsBuilderImpl.class);
	
	JSONObject resultsObject = JSONFactoryUtil.createJSONObject();

	long startTime = System.currentTimeMillis();

	// Create items array
	
	resultsObject.put("items", createItemsArray());

	// Create meta info array

	resultsObject.put("meta", createMetaObject());

	// Paging object
	
	resultsObject.put("paging", createPagingObject());

	// Create facets

	try {
		resultsObject.put("facets", createFacetsArray(searchContext));
	}
	catch (Exception e) {
		_log.error(e, e);
	}

	if (_log.isDebugEnabled()) {
		_log.debug(
			"Results processing took: " +
				(System.currentTimeMillis() - startTime));
	}
	return resultsObject;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:51,代码来源:ResultsBuilderImpl.java

示例9: getPortletTitleMenus

import com.liferay.portal.kernel.util.ResourceBundleUtil; //导入依赖的package包/类
@Override
public List<Menu> getPortletTitleMenus(
	PortletRequest portletRequest, PortletResponse portletResponse) {

	List<MenuItem> menuItems = new ArrayList<>();

	URLMenuItem urlMenuItem = new URLMenuItem();

	urlMenuItem.setLabel("Liferay");
	urlMenuItem.setURL("http://www.liferay.com");

	menuItems.add(urlMenuItem);

	List<Menu> menus = new ArrayList<>();

	Menu menu = new Menu();

	menu.setDirection("right");
	menu.setExtended(false);
	menu.setIcon("sites");
	menu.setMarkupView("lexicon");
	menu.setMenuItems(menuItems);

	ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
		"content.Language", getLocale(portletRequest), getClass());

	String message = LanguageUtil.get(resourceBundle, "list-of-links");

	menu.setMessage(message);

	menu.setScroll(false);
	menu.setShowArrow(false);
	menu.setShowWhenSingleIcon(true);

	menus.add(menu);

	return menus;
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:39,代码来源:BladePortletToolbarContributor.java


注:本文中的com.liferay.portal.kernel.util.ResourceBundleUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。