本文整理汇总了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;
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}