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.icon.edit.internal.EditPortletConfigurationIcon.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.getURLEdit();
}

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

From source file:com.liferay.portlet.configuration.icon.help.internal.HelpPortletConfigurationIcon.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.getURLHelp();
}

From source file:com.liferay.portlet.configuration.icon.help.internal.HelpPortletConfigurationIcon.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.isShowHelpIcon();
}

From source file:com.liferay.portlet.configuration.icon.locator.internal.LegacyConfigurationIconLocator.java

License:Open Source License

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    String portletId = portletDisplay.getRootPortletId();

    Portlet portlet = _portletLocalService.getPortletById(portletId);

    if (portlet == null) {
        return StringPool.BLANK;
    }//from   w  w  w  . ja  v  a2 s. co m

    Map<String, String> initParams = portlet.getInitParams();

    boolean alwaysDisplayDefaultConfigurationIcons = GetterUtil
            .getBoolean(initParams.get("always-display-default-configuration-icons"));

    if (alwaysDisplayDefaultConfigurationIcons) {
        return StringPool.DASH;
    }

    return StringPool.BLANK;
}

From source file:com.liferay.portlet.configuration.icon.maximize.internal.MaximizePortletConfigurationIcon.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 "submitForm(document.hrefFm, '".concat(HtmlUtil.escapeJS(portletDisplay.getURLMax()))
            .concat("'); return false;");
}

From source file:com.liferay.portlet.configuration.icon.maximize.internal.MaximizePortletConfigurationIcon.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.getURLMax();
}

From source file:com.liferay.portlet.configuration.icon.minimize.internal.MinimizePortletConfigurationIcon.java

License:Open Source License

@Override
public String getMessage(PortletRequest portletRequest) {
    String key = "minimize";

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

    PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

    if (portletDisplay.isStateMin()) {
        key = "restore";
    }/*from w  ww .j  av  a2 s. co  m*/

    return LanguageUtil.get(getResourceBundle(getLocale(portletRequest)), key);
}

From source file:com.liferay.portlet.configuration.icon.minimize.internal.MinimizePortletConfigurationIcon.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.minimize('#p_p_id_".concat(portletDisplay.getId())
            .concat("_', this); return false;");
}

From source file:com.liferay.portlet.configuration.icon.minimize.internal.MinimizePortletConfigurationIcon.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.getURLMin();
}