Example usage for com.liferay.portal.kernel.model LayoutConstants TYPE_PANEL

List of usage examples for com.liferay.portal.kernel.model LayoutConstants TYPE_PANEL

Introduction

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

Prototype

String TYPE_PANEL

To view the source code for com.liferay.portal.kernel.model LayoutConstants TYPE_PANEL.

Click Source Link

Usage

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsSupportsEmbeddedPortletsWithTypePanel() {
    _layout.setType(LayoutConstants.TYPE_PANEL);

    Assert.assertTrue(_layout.isSupportsEmbeddedPortlets());
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePanelReturnsFalse() {
    for (String type : _TYPES) {
        if (type.equals(LayoutConstants.TYPE_PANEL)) {
            continue;
        }//w ww.  j  a v  a 2s  . com

        _layout.setType(type);

        Assert.assertFalse(_layout.isTypePanel());
    }
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePanelReturnsTrue() {
    _layout.setType(LayoutConstants.TYPE_PANEL);

    Assert.assertTrue(_layout.isTypePanel());
}

From source file:com.liferay.layout.service.test.LayoutImplTest.java

License:Open Source License

@Test
public void testIsTypePanelWithLayoutTypeController() throws Exception {
    Registry registry = RegistryUtil.getRegistry();

    LayoutTypeController layoutTypeController = new LayoutTypeControllerImpl(LayoutConstants.TYPE_PANEL);

    for (String layoutTypeValue : _TYPES) {
        if (layoutTypeValue.equals(LayoutConstants.TYPE_PANEL)) {
            continue;
        }/*  w w w  .j  a v  a2  s  . com*/

        _layout.setType(layoutTypeValue);

        Map<String, Object> properties = new HashMap<>();

        properties.put("layout.type", layoutTypeValue);

        ServiceRegistration<LayoutTypeController> serviceRegistration = registry
                .registerService(LayoutTypeController.class, layoutTypeController, properties);

        try {
            Assert.assertTrue(_layout.isTypePanel());
        } finally {
            serviceRegistration.unregister();
        }
    }
}

From source file:com.liferay.tool.datamanipulator.handler.content.LayoutHandler.java

License:Open Source License

private List<KeyValuePair> _getLayoutTypes() {
    List<KeyValuePair> layoutTypes = new ArrayList<KeyValuePair>();

    layoutTypes.add(new KeyValuePair("", ""));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_ARTICLE, LayoutConstants.TYPE_ARTICLE));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_EMBEDDED, LayoutConstants.TYPE_EMBEDDED));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_PANEL, LayoutConstants.TYPE_PANEL));

    layoutTypes.add(new KeyValuePair(LayoutConstants.TYPE_PORTLET, LayoutConstants.TYPE_PORTLET));

    return layoutTypes;
}