当前位置: 首页>>代码示例>>Java>>正文


Java LayoutColumn类代码示例

本文整理汇总了Java中org.uberfire.ext.layout.editor.api.editor.LayoutColumn的典型用法代码示例。如果您正苦于以下问题:Java LayoutColumn类的具体用法?Java LayoutColumn怎么用?Java LayoutColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LayoutColumn类属于org.uberfire.ext.layout.editor.api.editor包,在下文中一共展示了LayoutColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private void generateComponents(LayoutTemplate layoutTemplate,
                                final LayoutInstance layoutInstance,
                                final LayoutColumn layoutColumn,
                                final HTMLElement column) {
    for (final LayoutComponent layoutComponent : layoutColumn.getLayoutComponents()) {
        final LayoutDragComponent dragComponent = lookupLayoutDragComponent(layoutComponent);
        if (dragComponent != null) {
            Widget columnWidget = ElementWrapperWidget.getWidget(column);
            RenderingContext componentContext = new RenderingContext(layoutComponent, columnWidget);
            IsWidget componentWidget = dragComponent.getShowWidget(componentContext);

            if (layoutTemplate.isPageStyle() && layoutColumn.getHeight().isEmpty()) {
                componentWidget.asWidget().getElement().addClassName("uf-perspective-col");
            }
            else if (!layoutColumn.getHeight().isEmpty()) {
                column.getClassList().add("uf-perspective-row-" + layoutColumn.getHeight());
            }
            if (componentWidget != null) {
                DOMUtil.appendWidgetToElement(column, componentWidget);
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:AbstractLayoutGenerator.java

示例2: extractColumnWithComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private void extractColumnWithComponents(LayoutColumn layoutColumn) {
    for (LayoutRow row : layoutColumn.getRows()) {
        Integer columnWidth = new Integer(layoutColumn.getSpan());
        final ColumnWithComponents columnWithComponents = createColumnWithComponentsInstance();

        columnWithComponents
                .init(id,
                      columnWidth,
                      pageStyle,
                      dropCommand(),
                      removeComponentCommand,
                      removeColumnCommand(),
                      currentLayoutTemplateSupplier,
                      getHeight(layoutColumn.getHeight()));

        for (LayoutColumn column : row.getLayoutColumns()) {
            ComponentColumn newComponentColumn = getComponentColumn(column);
            newComponentColumn.setColumnHeight(getHeight(column.getHeight()));
            columnWithComponents.withComponents(newComponentColumn);
        }

        this.columns.add(columnWithComponents);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:Row.java

示例3: hasNavigationComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
public boolean hasNavigationComponents(LayoutRow row) {
    for (LayoutColumn column : row.getLayoutColumns()) {

        for (LayoutComponent component : column.getLayoutComponents()) {
            NavDragComponentType dragType = NavDragComponentType.getByClassName(component.getDragTypeName());
            if (dragType != null && ALL_NAV_GROUP_COMPONENTS.contains(dragType)) {
                return true;
            }
        }

        for (LayoutRow childRow : column.getRows()) {
            boolean hasNavComps = hasNavigationComponents(childRow);
            if (hasNavComps) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:LayoutTemplateAnalyzer.java

示例4: addFieldsToTemplate

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
protected void addFieldsToTemplate(LayoutTemplate template,
                                   List<FieldDefinition> fields,
                                   String formId) {
    fields.forEach(field -> {
        LayoutComponent layoutComponent = new LayoutComponent(getDraggableType());
        layoutComponent.addProperty(FormLayoutComponent.FORM_ID,
                                    formId);
        layoutComponent.addProperty(FormLayoutComponent.FIELD_ID,
                                    field.getId());

        LayoutColumn column = new LayoutColumn("12");
        column.add(layoutComponent);

        LayoutRow row = new LayoutRow();
        row.add(column);

        template.addRow(row);
    });
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:20,代码来源:AbstractFormLayoutTemplateGenerator.java

示例5: generateRows

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private void generateRows(LayoutTemplate layoutTemplate,
                          LayoutInstance layoutInstance,
                          List<LayoutRow> rows,
                          HTMLElement parentWidget) {
    for (LayoutRow layoutRow : rows) {
        HTMLElement row = createRow(layoutRow);

        if (layoutTemplate.isPageStyle()) {
            row.getClassList().add(RowSizeBuilder.buildRowSize(layoutRow.getHeight()));
            row.getClassList().add("uf-le-overflow");
        }
        for (LayoutColumn layoutColumn : layoutRow.getLayoutColumns()) {
            HTMLElement column = createColumn(layoutColumn);

            if (layoutTemplate.isPageStyle() && layoutColumn.getHeight().isEmpty()) {
                column.getClassList().add("uf-perspective-col");
            }
            if (columnHasNestedRows(layoutColumn)) {
                if (layoutTemplate.isPageStyle() && layoutColumn.getHeight().isEmpty()) {
                    column.getClassList().add("uf-perspective-col");
                } else if (!layoutColumn.getHeight().isEmpty()) {
                    column.getClassList().add("uf-perspective-row-" + layoutColumn.getHeight());
                }
                generateRows(layoutTemplate,
                             layoutInstance,
                             layoutColumn.getRows(),
                             column);
            } else {
                generateComponents(layoutTemplate,
                                   layoutInstance,
                                   layoutColumn,
                                   column);
            }
            column.getClassList().add("uf-perspective-rendered-col");
            row.appendChild(column);
        }
        row.getClassList().add("uf-perspective-rendered-row");
        parentWidget.appendChild(row);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:41,代码来源:AbstractLayoutGenerator.java

示例6: createColumn

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
@Override
protected HTMLElement createColumn(LayoutColumn layoutColumn) {
    Div div = (Div) Window.getDocument().createElement("div");
    String colSize = ColumnSizeBuilder.buildColumnSize(new Integer(layoutColumn.getSpan()));
    div.setClassName(colSize);
    return div;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:BootstrapLayoutGenerator.java

示例7: extractColumns

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private static void extractColumns(List<Column> columns,
                                   LayoutRow layoutRow) {
    for (Column col : columns) {
        LayoutColumn layoutColumn = new LayoutColumn(col.getColumnWidth().toString(),
                                                     col.getColumnHeight().toString());
        if (col.hasInnerRows()) {
            extractColumnWithComponents(col,
                                        layoutColumn);
        } else {
            extractComponents(col,
                              layoutColumn);
        }
        layoutRow.add(layoutColumn);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:16,代码来源:LayoutTemplateAdapter.java

示例8: extractColumnWithComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private static void extractColumnWithComponents(Column col,
                                                LayoutColumn layoutColumn) {
    if (col instanceof ColumnWithComponents) {
        ColumnWithComponents columnWithComponents = (ColumnWithComponents) col;
        LayoutRow layoutRow = new LayoutRow(Row.ROW_DEFAULT_HEIGHT.toString());
        extractColumns(columnWithComponents.getRow().getColumns(),
                       layoutRow);
        layoutColumn.addRow(layoutRow);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:11,代码来源:LayoutTemplateAdapter.java

示例9: extractColumns

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private void extractColumns(LayoutRow layoutRow) {
    for (LayoutColumn layoutColumn : layoutRow.getLayoutColumns()) {
        if (isColumnWithComponents(layoutColumn)) {
            extractColumnWithComponents(layoutColumn);
        } else {
            extractComponentColumn(layoutColumn);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:10,代码来源:Row.java

示例10: getComponentColumn

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private ComponentColumn getComponentColumn(LayoutColumn column) {
    LayoutComponent layoutComponent = column.getLayoutComponents().get(0);
    return createNewComponentColumn(layoutComponent,
                                    new Integer(
                                            column.getSpan()),
                                    false);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:8,代码来源:Row.java

示例11: searchForComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private static void searchForComponents(List<LayoutRow> rows,
                                        List<String> ids) {
    for (LayoutRow layoutRow : rows) {
        for (LayoutColumn layoutColumn : layoutRow.getLayoutColumns()) {
            if (columnHasNestedRows(layoutColumn)) {
                searchForComponents(layoutColumn.getRows(),
                                    ids);
            } else {
                extractTargetDiv(layoutColumn.getLayoutComponents(),
                                 ids);
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:15,代码来源:TargetDivList.java

示例12: build

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
public LayoutTemplate build() {
    LayoutTemplate template = new LayoutTemplate();

    rows.stream()
            .filter(row -> !row.cells.isEmpty())
            .forEach(row -> {
                LayoutRow layoutRow = new LayoutRow();

                template.addRow(layoutRow);

                row.cells.forEach(cell -> {
                    LayoutColumn layoutColumn = new LayoutColumn(String.valueOf(cell.horizontalSpan));
                    layoutRow.add(layoutColumn);

                    if (cell.getComponentsCount() == 0) {
                        return;
                    } else if (cell.getComponentsCount() == 1) {
                        layoutColumn.add(cell.components.get(0));
                    } else {
                        cell.components.forEach(component -> {
                            LayoutRow nestedRow = new LayoutRow();
                            layoutColumn.addRow(nestedRow);
                            LayoutColumn nestedColumn = new LayoutColumn(String.valueOf(MAX_SPAN));
                            nestedRow.add(nestedColumn);
                            nestedColumn.add(component);
                        });
                    }
                });
            });

    return template;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:33,代码来源:LayoutGenerator.java

示例13: testGeneratedLayout

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
protected void testGeneratedLayout() {
    LayoutTemplate layout = form.getLayoutTemplate();

    assertNotNull(layout);

    assertNotNull(layout.getRows());

    assertEquals(form.getFields().size(),
                 layout.getRows().size());

    for (LayoutRow row : layout.getRows()) {
        assertEquals(1,
                     row.getLayoutColumns().size());

        for (LayoutColumn col : row.getLayoutColumns()) {
            assertEquals("12",
                         col.getSpan());

            assertEquals(0,
                         col.getRows().size());

            assertEquals(1,
                         col.getLayoutComponents().size());

            for (LayoutComponent component : col.getLayoutComponents()) {
                assertEquals(templateGenerator.getDraggableType(),
                             component.getDragTypeName());

                assertEquals(form.getId(),
                             component.getProperties().get(FormLayoutComponent.FORM_ID));

                String fieldId = component.getProperties().get(FormLayoutComponent.FIELD_ID);

                assertNotNull(fieldId);

                assertNotNull(form.getFieldById(fieldId));
            }
        }
    }
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:41,代码来源:FormLayoutTemplateGeneratorTest.java

示例14: columnHasNestedRows

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private boolean columnHasNestedRows(LayoutColumn layoutColumn) {
    return layoutColumn.getRows() != null && !layoutColumn.getRows().isEmpty();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:4,代码来源:AbstractLayoutGenerator.java

示例15: extractComponents

import org.uberfire.ext.layout.editor.api.editor.LayoutColumn; //导入依赖的package包/类
private static void extractComponents(Column col,
                                      LayoutColumn layoutColumn) {
    extractLayoutEditorComponent(col,
                                 layoutColumn);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:6,代码来源:LayoutTemplateAdapter.java


注:本文中的org.uberfire.ext.layout.editor.api.editor.LayoutColumn类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。