Example usage for com.liferay.portal.kernel.theme PortletDisplay isShowConfigurationIcon

List of usage examples for com.liferay.portal.kernel.theme PortletDisplay isShowConfigurationIcon

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.theme PortletDisplay isShowConfigurationIcon.

Prototype

public boolean isShowConfigurationIcon() 

Source Link

Usage

From source file:com.liferay.portlet.configuration.web.internal.portlet.configuration.icon.ConfigurationPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.isShowConfigurationIcon();
}

From source file:com.liferay.portlet.configuration.web.internal.portlet.configuration.icon.ConfigurationTemplatesPortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PermissionChecker permissionChecker = themeDisplay.getPermissionChecker();

    try {/*from  www  .  jav  a  2  s .  co m*/
        if (!GroupPermissionUtil.contains(permissionChecker, themeDisplay.getScopeGroupId(),
                ActionKeys.MANAGE_ARCHIVED_SETUPS)) {

            return false;
        }
    } catch (PortalException pe) {

        // LPS-52675

        if (_log.isDebugEnabled()) {
            _log.debug(pe, pe);
        }

        return false;
    }

    WindowState windowState = portletRequest.getWindowState();

    if (windowState.equals(LiferayWindowState.EXCLUSIVE)) {
        return false;
    }

    Layout layout = themeDisplay.getLayout();

    if (layout.isTypeControlPanel()) {
        return false;
    }

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.isShowConfigurationIcon();
}