Package org.jbpm.formapi.shared.api.items

Examples of org.jbpm.formapi.shared.api.items.MIGPanelRepresentation


        populate(this.table);
    }

    @Override
    public FormItemRepresentation getRepresentation() {
        MIGPanelRepresentation rep = super.getRepresentation(new MIGPanelRepresentation());
        rep.setRows(this.rows);
        rep.setBorderWidth(this.borderWidth);
        rep.setCellPadding(this.cellpadding);
        rep.setCellSpacing(this.cellspacing);
        rep.setTitle(this.title);
        for (int r = 0; r < table.getRowCount(); r++) {
            for (int c = 0; c < table.getCellCount(r); c++) {
                Widget widget = table.getWidget(r, c);
                int colspan = table.getFlexCellFormatter().getColSpan(r, c);
                int rowspan = table.getFlexCellFormatter().getRowSpan(r, c);
                if (widget != null && widget instanceof FBFormItem) {
                    FBFormItem item = (FBFormItem) widget;
                    FormItemRepresentation subRep = item.getRepresentation();
                    rep.setElement(r, c, subRep, colspan, rowspan);
                }
            }
        }
        return rep;
    }
View Full Code Here


    public void populate(FormItemRepresentation rep) throws FormBuilderException {
        if (!(rep instanceof MIGPanelRepresentation)) {
            throw new FormBuilderException(i18n.RepNotOfType(rep.getClass().getName(), "MIGPanelRepresentation"));
        }
        super.populate(rep);
        MIGPanelRepresentation mprep = (MIGPanelRepresentation) rep;
        this.rows = mprep.getRows();
        this.borderWidth = mprep.getBorderWidth();
        this.cellpadding = mprep.getCellPadding();
        this.cellspacing = mprep.getCellSpacing();
        populate(this.table);
        this.table.clear();
        super.getItems().clear();
        if (mprep.getWidth() != null) {
            setWidth(mprep.getWidth());
        }
        if (mprep.getHeight() != null) {
            setHeight(mprep.getHeight());
        }
        if (mprep.getElements() != null) {
            for (int rowindex = 0; rowindex < mprep.getElements().size(); rowindex++) {
                List<FormItemRepresentation> row = mprep.getElements().get(rowindex);
                if(row != null) {
                    for (int cellindex = 0; cellindex < row.size(); cellindex++) {
                        FormItemRepresentation cell = row.get(cellindex);
                        FBFormItem subItem = super.createItem(cell);
                        this.table.setWidget(rowindex, cellindex, subItem);
                        int colspan = mprep.getColspan(rowindex, cellindex);
                        int rowspan = mprep.getRowspan(rowindex, cellindex);
                        if (colspan > 1) {
                            this.table.getFlexCellFormatter().setColSpan(rowindex, cellindex, colspan);
                        }
                        if (rowspan > 1) {
                            this.table.getFlexCellFormatter().setRowSpan(rowindex, cellindex, rowspan);
View Full Code Here

TOP

Related Classes of org.jbpm.formapi.shared.api.items.MIGPanelRepresentation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.