Example usage for com.liferay.portal.kernel.theme ThemeDisplay isStateMaximized

List of usage examples for com.liferay.portal.kernel.theme ThemeDisplay isStateMaximized

Introduction

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

Prototype

public boolean isStateMaximized() 

Source Link

Usage

From source file:com.liferay.product.navigation.control.menu.web.internal.AddContentProductNavigationControlMenuEntry.java

License:Open Source License

@Override
public boolean isShow(HttpServletRequest request) throws PortalException {
    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    if (themeDisplay.isStateMaximized()) {
        return false;
    }/*from w w w  . ja v a 2s .c  om*/

    Layout layout = themeDisplay.getLayout();

    if (!layout.isTypePortlet()) {
        return false;
    }

    if (_staging.isIncomplete(layout)) {
        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    LayoutTypeController layoutTypeController = layoutTypePortlet.getLayoutTypeController();

    if (layoutTypeController.isFullPageDisplayable()) {
        return false;
    }

    if (!hasAddContentOrApplicationPermission(themeDisplay)) {
        return false;
    }

    if (!(hasUpdateLayoutPermission(themeDisplay) || hasCustomizePermission(themeDisplay))) {

        return false;
    }

    return super.isShow(request);
}