OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev Author Line No. Line
74 ilm 1
package org.openconcerto.modules.extensionbuilder.list;
2
 
3
import java.util.ArrayList;
4
import java.util.List;
5
 
6
import org.openconcerto.utils.StringUtils;
7
 
8
public class ColumnDescriptor {
9
    private List<String> fieldPaths = new ArrayList<String>();
10
    private String id;
11
    private String style = "concat";
12
 
13
    public ColumnDescriptor(String id) {
14
        this.id = id;
15
    }
16
 
17
    public String getId() {
181 ilm 18
        return this.id;
74 ilm 19
    }
20
 
21
    public String getFieldsPaths() {
22
        String r = "";
181 ilm 23
        final int size = this.fieldPaths.size();
74 ilm 24
        for (int i = 0; i < size; i++) {
181 ilm 25
            String fieldPath = this.fieldPaths.get(i);
74 ilm 26
            if (i != 0) {
27
                r += ",";
28
            }
29
            r += fieldPath;
30
        }
31
        return r;
32
    }
33
 
34
    public void setFieldsPaths(String paths) {
35
        final List<String> l = StringUtils.fastSplit(paths, ',');
181 ilm 36
        this.fieldPaths.clear();
74 ilm 37
        for (String string : l) {
181 ilm 38
            this.fieldPaths.add(string.trim());
74 ilm 39
        }
40
    }
41
 
42
    public String getStyle() {
181 ilm 43
        return this.style;
74 ilm 44
    }
45
 
46
    public void setStyle(String style) {
47
        this.style = style;
48
    }
49
 
50
}