Java 类com.liferay.portal.kernel.util.ResourceBundleUtil 实例源码

项目:liferay-gsearch    文件:JSONConfigurationHelperServiceImpl.java   
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;
}
项目:liferay-gsearch    文件:GetHelpTextMVCResourceCommand.java   
/**
 * 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");
}
项目:liferay-blade-samples    文件:BladeProductNavigationControlMenuEntry.java   
/**
 * 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");
}
项目:liferay-blade-samples    文件:BladePortletConfigurationIcon.java   
@Override
public String getMessage(PortletRequest portletRequest) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", getLocale(portletRequest), getClass());

    return LanguageUtil.get(resourceBundle, "sample-link");
}
项目:liferay-blade-samples    文件:BladeSimulationPanelApp.java   
@Override
public String getLabel(Locale locale) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", locale, getClass());

    return LanguageUtil.get(resourceBundle, "simulation-sample");
}
项目:liferay-blade-samples    文件:BladeProductNavigationControlMenuEntry.java   
/**
 * 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");
}
项目:liferay-blade-samples    文件:BladePortletConfigurationIcon.java   
@Override
public String getMessage(PortletRequest portletRequest) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", getLocale(portletRequest), getClass());

    return LanguageUtil.get(resourceBundle, "sample-link");
}
项目:liferay-blade-samples    文件:BladeSimulationPanelApp.java   
@Override
public String getLabel(Locale locale) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", locale, getClass());

    return LanguageUtil.get(resourceBundle, "simulation-sample");
}
项目:liferay-blade-samples    文件:BladeProductNavigationControlMenuEntry.java   
/**
 * 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");
}
项目:liferay-blade-samples    文件:BladePortletConfigurationIcon.java   
@Override
public String getMessage(PortletRequest portletRequest) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", getLocale(portletRequest), getClass());

    return LanguageUtil.get(resourceBundle, "sample-link");
}
项目:liferay-blade-samples    文件:BladeSimulationPanelApp.java   
@Override
public String getLabel(Locale locale) {
    ResourceBundle resourceBundle = ResourceBundleUtil.getBundle(
        "content.Language", locale, getClass());

    return LanguageUtil.get(resourceBundle, "simulation-sample");
}
项目:flashlight-search    文件:DLFileEntryTypeTemplateHandler.java   
@Override
public String getName(Locale locale) {
    ResourceBundle bundle = ResourceBundleUtil.getBundle(RES_BUNDLE, locale, this.getClass());
    return this.language.get(bundle, LANGUAGE_KEY_TEMPLATE);
}
项目:flashlight-search    文件:SearchTemplateHandler.java   
@Override
public String getName(Locale locale) {
    ResourceBundle bundle = ResourceBundleUtil.getBundle(LANGUAGE_BUNDLE, locale, this.getClass());
    return this.language.get(bundle, LANGUAGE_KEY_TEMPLATE);
}
项目:flashlight-search    文件:JournalArticleViewTemplateHandler.java   
@Override
public String getName(Locale locale) {
    ResourceBundle bundle = ResourceBundleUtil.getBundle(LANGUAGE_BUNDLE, locale, this.getClass());
    return this.language.get(bundle, LANGUAGE_KEY_TEMPLATE);
}
项目:liferay-gsearch    文件:ResultsBuilderImpl.java   
/**
 * {@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;
}
项目:liferay-blade-samples    文件:BladePortletToolbarContributor.java   
@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;
}
项目:liferay-blade-samples    文件:BladePortletToolbarContributor.java   
@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;
}
项目:liferay-blade-samples    文件:BladePortletToolbarContributor.java   
@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;
}