Example usage for com.liferay.portal.kernel.util ResourceBundleUtil EMPTY_RESOURCE_BUNDLE

List of usage examples for com.liferay.portal.kernel.util ResourceBundleUtil EMPTY_RESOURCE_BUNDLE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util ResourceBundleUtil EMPTY_RESOURCE_BUNDLE.

Prototype

ResourceBundle EMPTY_RESOURCE_BUNDLE

To view the source code for com.liferay.portal.kernel.util ResourceBundleUtil EMPTY_RESOURCE_BUNDLE.

Click Source Link

Usage

From source file:com.liferay.dynamic.data.lists.form.web.internal.display.context.DDLFormAdminDisplayContextTest.java

License:Open Source License

protected void setUpResourceBundleLoaderUtil() {
    ResourceBundleLoader resourceBundleLoader = mock(ResourceBundleLoader.class);

    ResourceBundleLoaderUtil.setPortalResourceBundleLoader(resourceBundleLoader);

    when(resourceBundleLoader.loadResourceBundle(Matchers.anyString()))
            .thenReturn(ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE);
}

From source file:com.liferay.dynamic.data.lists.form.web.internal.display.context.DDLFormAdminDisplayContextTest.java

License:Open Source License

protected void setUpResourceBundleUtil() {
    mockStatic(ResourceBundleUtil.class);

    when(ResourceBundleUtil.getBundle(Matchers.anyString(), Matchers.any(Locale.class),
            Matchers.any(ClassLoader.class))).thenReturn(ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE);
}

From source file:com.liferay.dynamic.data.mapping.data.provider.internal.DDMRESTDataProviderSettingsTest.java

License:Open Source License

protected void setUpResourceBundleUtil() {
    PowerMockito.mockStatic(ResourceBundleUtil.class);

    PowerMockito.when(ResourceBundleUtil.getBundle(Matchers.anyString(), Matchers.any(Locale.class),
            Matchers.any(ClassLoader.class))).thenReturn(ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE);
}

From source file:com.liferay.dynamic.data.mapping.form.web.internal.display.context.DDMFormAdminDisplayContextTest.java

License:Open Source License

protected void setUpResourceBundleLoaderUtil() {
    ResourceBundleLoader resourceBundleLoader = mock(ResourceBundleLoader.class);

    ResourceBundleLoaderUtil.setPortalResourceBundleLoader(resourceBundleLoader);

    when(resourceBundleLoader.loadResourceBundle(Matchers.any(Locale.class)))
            .thenReturn(ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE);
}

From source file:com.liferay.dynamic.data.mapping.util.DDMFormFactoryTest.java

License:Open Source License

protected void setUpResourceBundleUtil() {
    PowerMockito.mockStatic(ResourceBundleUtil.class);

    Mockito.when(ResourceBundleUtil.getBundle(Matchers.anyString(), Matchers.any(Locale.class),
            Matchers.any(ClassLoader.class))).thenReturn(ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE);
}

From source file:com.liferay.frontend.editor.alloyeditor.web.editor.configuration.AlloyEditorConfigContributor.java

License:Open Source License

protected JSONArray getStyleFormatsJSONArray(Locale locale) {
    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

    ResourceBundle resourceBundle = null;

    try {/*w w w .  j a va 2s. c om*/
        resourceBundle = _resourceBundleLoader.loadResourceBundle(LocaleUtil.toLanguageId(locale));
    } catch (MissingResourceException mre) {
        resourceBundle = ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE;
    }

    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "normal"), "p", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "1"), "h1", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "2"), "h2", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "3"), "h3", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "4"), "h4", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "preformatted-text"), "pre", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "cited-work"), "cite", null,
            _CKEDITOR_STYLE_INLINE));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "computer-code"), "code", null,
            _CKEDITOR_STYLE_INLINE));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "info-message"), "div",
            "portlet-msg-info", _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "alert-message"), "div",
            "portlet-msg-alert", _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "error-message"), "div",
            "portlet-msg-error", _CKEDITOR_STYLE_BLOCK));

    return jsonArray;
}

From source file:com.liferay.frontend.editor.alloyeditor.web.internal.editor.configuration.AlloyEditorBBCodeConfigContributor.java

License:Open Source License

protected JSONArray getStyleFormatsJSONArray(Locale locale) {
    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

    ResourceBundle resourceBundle = null;

    try {/*w w w .j a  va  2  s.  c  o  m*/
        resourceBundle = _resourceBundleLoader.loadResourceBundle(locale);
    } catch (MissingResourceException mre) {
        resourceBundle = ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE;
    }

    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "normal"), "p", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "cited-work"), "cite", null,
            _CKEDITOR_STYLE_INLINE));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "computer-code"), "code", null,
            _CKEDITOR_STYLE_INLINE));

    return jsonArray;
}

From source file:com.liferay.frontend.editor.alloyeditor.web.internal.editor.configuration.AlloyEditorConfigContributor.java

License:Open Source License

protected JSONArray getStyleFormatsJSONArray(Locale locale) {
    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

    ResourceBundle resourceBundle = null;

    try {//from  w w w.jav  a2 s  .com
        resourceBundle = _resourceBundleLoader.loadResourceBundle(locale);
    } catch (MissingResourceException mre) {
        resourceBundle = ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE;
    }

    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "normal"), "p", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "1"), "h1", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "2"), "h2", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "3"), "h3", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "4"), "h4", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "preformatted-text"), "pre", null,
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "cited-work"), "cite", null,
            _CKEDITOR_STYLE_INLINE));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "computer-code"), "code", null,
            _CKEDITOR_STYLE_INLINE));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "info-message"), "div",
            "portlet-msg-info", _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "alert-message"), "div",
            "portlet-msg-alert", _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "error-message"), "div",
            "portlet-msg-error", _CKEDITOR_STYLE_BLOCK));

    return jsonArray;
}

From source file:com.liferay.frontend.editor.alloyeditor.web.internal.editor.configuration.AlloyEditorCreoleConfigContributor.java

License:Open Source License

protected JSONArray getStyleFormatsJSONArray(Locale locale) {
    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

    ResourceBundle resourceBundle = null;

    try {/*w  ww .  j a v a 2  s . c  o  m*/
        resourceBundle = _resourceBundleLoader.loadResourceBundle(locale);
    } catch (MissingResourceException mre) {
        resourceBundle = ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE;
    }

    jsonArray.put(
            getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "normal"), "p", _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "1"), "h1",
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "2"), "h2",
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "3"), "h3",
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "4"), "h4",
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "5"), "h5",
            _CKEDITOR_STYLE_BLOCK));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "6"), "h6",
            _CKEDITOR_STYLE_BLOCK));

    return jsonArray;
}

From source file:com.liferay.frontend.editor.ckeditor.web.editor.configuration.CKEditorConfigContributor.java

License:Open Source License

protected JSONArray getStyleFormatsJSONArray(Locale locale) {
    JSONArray jsonArray = JSONFactoryUtil.createJSONArray();

    ResourceBundle resourceBundle = null;

    try {/*from www .java  2 s .  com*/
        resourceBundle = _resourceBundleLoader.loadResourceBundle(LocaleUtil.toLanguageId(locale));
    } catch (MissingResourceException mre) {
        resourceBundle = ResourceBundleUtil.EMPTY_RESOURCE_BUNDLE;
    }

    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "normal"), "p", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "1"), "h1", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "2"), "h2", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "3"), "h3", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.format(resourceBundle, "heading-x", "4"), "h4", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "preformatted-text"), "pre", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "cited-work"), "cite", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "computer-code"), "code", null));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "info-message"), "div",
            "portlet-msg-info"));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "alert-message"), "div",
            "portlet-msg-alert"));
    jsonArray.put(getStyleFormatJSONObject(LanguageUtil.get(resourceBundle, "error-message"), "div",
            "portlet-msg-error"));

    return jsonArray;
}