OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 74 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.openconcerto.modules.extensionbuilder.list;

import java.util.ArrayList;
import java.util.List;

import org.openconcerto.utils.StringUtils;

public class ColumnDescriptor {
    private List<String> fieldPaths = new ArrayList<String>();
    private String id;
    private String style = "concat";

    public ColumnDescriptor(String id) {
        this.id = id;
    }

    public String getId() {
        return this.id;
    }

    public String getFieldsPaths() {
        String r = "";
        final int size = this.fieldPaths.size();
        for (int i = 0; i < size; i++) {
            String fieldPath = this.fieldPaths.get(i);
            if (i != 0) {
                r += ",";
            }
            r += fieldPath;
        }
        return r;
    }

    public void setFieldsPaths(String paths) {
        final List<String> l = StringUtils.fastSplit(paths, ',');
        this.fieldPaths.clear();
        for (String string : l) {
            this.fieldPaths.add(string.trim());
        }
    }

    public String getStyle() {
        return this.style;
    }

    public void setStyle(String style) {
        this.style = style;
    }

}