OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 18 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18 Rev 156
Line 16... Line 16...
16
import org.openconcerto.sql.model.SQLRow;
16
import org.openconcerto.sql.model.SQLRow;
17
 
17
 
18
public class VariableRowTreeNode extends FormuleTreeNode {
18
public class VariableRowTreeNode extends FormuleTreeNode {
19
 
19
 
20
    private SQLRow row;
20
    private SQLRow row;
-
 
21
    private String label;
21
 
22
 
22
    public VariableRowTreeNode(SQLRow row) {
23
    public VariableRowTreeNode(SQLRow row) {
23
        this.row = row;
24
        this.row = row;
-
 
25
        setLabelFromRow();
-
 
26
    }
-
 
27
 
-
 
28
    private void setLabelFromRow() {
-
 
29
        this.label = "";
-
 
30
        if (this.row != null) {
-
 
31
            if (this.row.contains("CODE")) {
-
 
32
                this.label = this.row.getString("CODE") + " - " + this.row.getString("NOM");
-
 
33
            } else {
-
 
34
                this.label = this.row.getString("NOM");
-
 
35
            }
-
 
36
        }
-
 
37
 
24
    }
38
    }
25
 
39
 
26
    public String getName() {
40
    public String getName() {
27
        return (this.row == null) ? "" : this.row.getString("NOM");
41
        return this.label;
28
    }
42
    }
29
 
43
 
-
 
44
    @Override
30
    public String toString() {
45
    public String toString() {
31
        return (this.row == null) ? "" : this.row.getString("NOM");
46
        return this.label;
32
    }
47
    }
33
 
48
 
34
    public String getTextValue() {
49
    public String getTextValue() {
35
        return (this.row == null) ? "" : this.row.getString("NOM");
50
        return this.label;
36
    }
51
    }
37
 
52
 
38
    public String getTextInfosValue() {
53
    public String getTextInfosValue() {
39
        return (this.row == null) ? "" : this.row.getString("INFOS");
54
        return (this.row == null) ? "" : this.row.getString("INFOS");
40
    }
55
    }
Line 43... Line 58...
43
        return this.row;
58
        return this.row;
44
    }
59
    }
45
 
60
 
46
    public void setRow(SQLRow row) {
61
    public void setRow(SQLRow row) {
47
        this.row = row;
62
        this.row = row;
-
 
63
        setLabelFromRow();
48
    }
64
    }
49
 
65
 
50
    public int getID() {
66
    public int getID() {
51
 
67
 
52
        return this.row == null ? 1 : row.getID();
68
        return this.row == null ? 1 : row.getID();