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

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

Introduction

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

Prototype

@JSON(include = false)
    public PortletDisplay getPortletDisplay() 

Source Link

Usage

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

License:Open Source License

@Override
public String getOnClick(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletURL baseActionURL = PortletURLFactoryUtil.create(portletRequest,
            PortletConfigurationCSSPortletKeys.PORTLET_CONFIGURATION_CSS, PortletRequest.ACTION_PHASE);

    PortletURL baseRenderURL = PortletURLFactoryUtil.create(portletRequest,
            PortletConfigurationCSSPortletKeys.PORTLET_CONFIGURATION_CSS, PortletRequest.RENDER_PHASE);

    PortletURL baseResourceURL = PortletURLFactoryUtil.create(portletRequest,
            PortletConfigurationCSSPortletKeys.PORTLET_CONFIGURATION_CSS, PortletRequest.RESOURCE_PHASE);

    StringBundler sb = new StringBundler(9);

    sb.append("Liferay.Portlet.loadCSSEditor('");

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    sb.append(portletDisplay.getId());//w w  w.j a v  a 2s  .  c om

    sb.append("', '");
    sb.append(baseActionURL);
    sb.append("', '");
    sb.append(baseRenderURL);
    sb.append("', '");
    sb.append(baseResourceURL);
    sb.append("'); return false;");

    return sb.toString();
}

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

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getURLPortletCss();
}

From source file:com.liferay.portlet.configuration.css.web.internal.portlet.configuration.icon.PortletConfigurationCSSPortletConfigurationIcon.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.isShowPortletCssIcon();
}

From source file:com.liferay.portlet.configuration.icon.close.internal.ClosePortletConfigurationIcon.java

License:Open Source License

@Override
public String getOnClick(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return "Liferay.Portlet.close('#p_p_id_".concat(portletDisplay.getId()).concat("_'); return false;");
}

From source file:com.liferay.portlet.configuration.icon.close.internal.ClosePortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getURLClose();
}

From source file:com.liferay.portlet.configuration.icon.close.internal.ClosePortletConfigurationIcon.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.isShowCloseIcon();
}

From source file:com.liferay.portlet.configuration.icon.edit.defaults.internal.EditDefaultsPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getURLEditDefaults();
}

From source file:com.liferay.portlet.configuration.icon.edit.defaults.internal.EditDefaultsPortletConfigurationIcon.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.isShowEditDefaultsIcon();
}

From source file:com.liferay.portlet.configuration.icon.edit.guest.internal.EditGuestPortletConfigurationIcon.java

License:Open Source License

@Override
public String getURL(PortletRequest portletRequest, PortletResponse portletResponse) {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    return portletDisplay.getURLEditGuest();
}

From source file:com.liferay.portlet.configuration.icon.edit.guest.internal.EditGuestPortletConfigurationIcon.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.isShowEditGuestIcon();
}