Example usage for com.liferay.portal.kernel.model Portlet getPortletName

List of usage examples for com.liferay.portal.kernel.model Portlet getPortletName

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model Portlet getPortletName.

Prototype

public String getPortletName();

Source Link

Document

Returns the name of the portlet.

Usage

From source file:com.liferay.application.list.adapter.PortletPanelAppAdapter.java

License:Open Source License

@Override
public String getLabel(Locale locale) {
    PortletConfig portletConfig = PortletConfigFactoryUtil.get(getPortletId());

    ResourceBundle resourceBundle = portletConfig.getResourceBundle(locale);

    Portlet portlet = getPortlet();

    String key = JavaConstants.JAVAX_PORTLET_TITLE + StringPool.PERIOD + portlet.getPortletName();

    String value = LanguageUtil.get(resourceBundle, key);

    if (!key.equals(value)) {
        return value;
    }//w w w . j  a  v  a2s  .  c om

    value = LanguageUtil.get(locale, key);

    if (!key.equals(value)) {
        return value;
    }

    String displayName = portlet.getDisplayName();

    if (!displayName.equals(portlet.getPortletName())) {
        return displayName;
    }

    return key;
}