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

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

Introduction

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

Prototype

public boolean isStatePopUp() 

Source Link

Usage

From source file:com.liferay.application.list.taglib.display.context.logic.PanelAppContentHelper.java

License:Open Source License

public void writeContent(Writer writer) throws Exception {
    ThemeDisplay themeDisplay = _getThemeDisplay();

    String layoutTemplateId = "max";

    if (themeDisplay.isStatePopUp()) {
        layoutTemplateId = "pop_up";
    }//w ww . jav a 2s  .  c  o  m

    Theme theme = themeDisplay.getTheme();

    String velocityTemplateId = theme.getThemeId() + LayoutTemplateConstants.STANDARD_SEPARATOR
            + layoutTemplateId;

    String content = LayoutTemplateLocalServiceUtil.getContent(layoutTemplateId, true, theme.getThemeId());

    if (Validator.isNotNull(velocityTemplateId) && Validator.isNotNull(content)) {

        HttpServletRequest request = getOriginalHttpServletRequest(_request);

        StringBundler sb = RuntimePageUtil.getProcessedTemplate(request, _response, getPortletId(),
                new StringTemplateResource(velocityTemplateId, content));

        if (sb != null) {
            sb.writeTo(writer);
        }
    }
}