Example usage for com.liferay.portal.kernel.model Portlet getAllPortletModes

List of usage examples for com.liferay.portal.kernel.model Portlet getAllPortletModes

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model Portlet getAllPortletModes.

Prototype

public java.util.Set<String> getAllPortletModes();

Source Link

Document

Returns the portlet modes of the portlet.

Usage

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

License:Open Source License

public void editSupportedClients(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    Portlet portlet = ActionUtil.getPortlet(actionRequest);

    PortletPreferences portletPreferences = actionRequest.getPreferences();

    actionRequest = ActionUtil.getWrappedActionRequest(actionRequest, portletPreferences);

    Set<String> allPortletModes = portlet.getAllPortletModes();

    for (String portletMode : allPortletModes) {
        String mobileDevicesParam = "portletSetupSupportedClientsMobileDevices_" + portletMode;

        boolean mobileDevices = ParamUtil.getBoolean(actionRequest, mobileDevicesParam);

        portletPreferences.setValue(mobileDevicesParam, String.valueOf(mobileDevices));
    }/*w  w  w  . j a v  a 2s  . c om*/

    portletPreferences.store();
}