Search in sources :

Example 6 with PortletColumnElement

use of com.liferay.ide.layouttpl.core.model.PortletColumnElement in project liferay-ide by liferay.

the class LayoutTemplatesFactory method add_Layout_1_2_1.

public static void add_Layout_1_2_1(LayoutTplElement layoutTpl) {
    PortletLayoutElement row1 = layoutTpl.getPortletLayouts().insert();
    PortletColumnElement column11 = row1.getPortletColumns().insert();
    int fullWeight = column11.getFullWeight().content();
    column11.setWeight(fullWeight);
    PortletLayoutElement row2 = layoutTpl.getPortletLayouts().insert();
    PortletColumnElement column21 = row2.getPortletColumns().insert();
    column21.setWeight(fullWeight / 2);
    PortletColumnElement column22 = row2.getPortletColumns().insert();
    column22.setWeight(fullWeight / 2);
    PortletLayoutElement row3 = layoutTpl.getPortletLayouts().insert();
    PortletColumnElement column31 = row3.getPortletColumns().insert();
    column31.setWeight(fullWeight);
}
Also used : PortletLayoutElement(com.liferay.ide.layouttpl.core.model.PortletLayoutElement) PortletColumnElement(com.liferay.ide.layouttpl.core.model.PortletColumnElement)

Example 7 with PortletColumnElement

use of com.liferay.ide.layouttpl.core.model.PortletColumnElement in project liferay-ide by liferay.

the class LayoutTemplatesFactory method add_Row_1.

public static void add_Row_1(CanAddPortletLayouts element) {
    PortletLayoutElement row = element.getPortletLayouts().insert();
    PortletColumnElement column = row.getPortletColumns().insert();
    column.setWeight(column.getFullWeight().content());
}
Also used : PortletLayoutElement(com.liferay.ide.layouttpl.core.model.PortletLayoutElement) PortletColumnElement(com.liferay.ide.layouttpl.core.model.PortletColumnElement)

Example 8 with PortletColumnElement

use of com.liferay.ide.layouttpl.core.model.PortletColumnElement in project liferay-ide by liferay.

the class LayoutTemplatesFactory method add_Layout_1_2_II.

public static void add_Layout_1_2_II(LayoutTplElement layoutTpl) {
    PortletLayoutElement row1 = layoutTpl.getPortletLayouts().insert();
    PortletColumnElement column11 = row1.getPortletColumns().insert();
    column11.setWeight(column11.getFullWeight().content());
    PortletLayoutElement row2 = layoutTpl.getPortletLayouts().insert();
    PortletColumnElement column21 = row2.getPortletColumns().insert();
    PortletColumnElement column22 = row2.getPortletColumns().insert();
    if (_isBootstrapStyle(layoutTpl)) {
        column21.setWeight(8);
        column22.setWeight(4);
    } else {
        column21.setWeight(70);
        column22.setWeight(30);
    }
}
Also used : PortletLayoutElement(com.liferay.ide.layouttpl.core.model.PortletLayoutElement) PortletColumnElement(com.liferay.ide.layouttpl.core.model.PortletColumnElement)

Example 9 with PortletColumnElement

use of com.liferay.ide.layouttpl.core.model.PortletColumnElement in project liferay-ide by liferay.

the class LayoutTemplatesFactory method add_Row_3.

public static void add_Row_3(CanAddPortletLayouts element) {
    PortletLayoutElement row = element.getPortletLayouts().insert();
    PortletColumnElement column1 = row.getPortletColumns().insert();
    PortletColumnElement column2 = row.getPortletColumns().insert();
    PortletColumnElement column3 = row.getPortletColumns().insert();
    int fullWeight = column1.getFullWeight().content();
    column1.setWeight(fullWeight / 3);
    column2.setWeight(fullWeight / 3);
    column3.setWeight(fullWeight / 3);
}
Also used : PortletLayoutElement(com.liferay.ide.layouttpl.core.model.PortletLayoutElement) PortletColumnElement(com.liferay.ide.layouttpl.core.model.PortletColumnElement)

Example 10 with PortletColumnElement

use of com.liferay.ide.layouttpl.core.model.PortletColumnElement in project liferay-ide by liferay.

the class LayoutTemplatesFactory method add_Row_2_II.

public static void add_Row_2_II(CanAddPortletLayouts element) {
    PortletLayoutElement row = element.getPortletLayouts().insert();
    PortletColumnElement column1 = row.getPortletColumns().insert();
    PortletColumnElement column2 = row.getPortletColumns().insert();
    if (_isBootstrapStyle(element)) {
        column1.setWeight(4);
        column2.setWeight(8);
    } else {
        column1.setWeight(30);
        column2.setWeight(70);
    }
}
Also used : PortletLayoutElement(com.liferay.ide.layouttpl.core.model.PortletLayoutElement) PortletColumnElement(com.liferay.ide.layouttpl.core.model.PortletColumnElement)

Aggregations

PortletColumnElement (com.liferay.ide.layouttpl.core.model.PortletColumnElement)23 PortletLayoutElement (com.liferay.ide.layouttpl.core.model.PortletLayoutElement)18 LayoutTplElement (com.liferay.ide.layouttpl.core.model.LayoutTplElement)9 Test (org.junit.Test)5 Dimension (org.eclipse.draw2d.geometry.Dimension)2 Status (org.eclipse.sapphire.modeling.Status)2 ValidationService (org.eclipse.sapphire.services.ValidationService)2 ColumnFigure (com.liferay.ide.layouttpl.ui.draw2d.ColumnFigure)1 PortletLayoutPanel (com.liferay.ide.layouttpl.ui.draw2d.PortletLayoutPanel)1 List (java.util.List)1 IFile (org.eclipse.core.resources.IFile)1 GridData (org.eclipse.draw2d.GridData)1 GridLayout (org.eclipse.draw2d.GridLayout)1 IFigure (org.eclipse.draw2d.IFigure)1 RoundedRectangle (org.eclipse.draw2d.RoundedRectangle)1 GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)1 Element (org.eclipse.sapphire.Element)1 ElementList (org.eclipse.sapphire.ElementList)1 Value (org.eclipse.sapphire.Value)1