OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 102 Rev 181
Line 20... Line 20...
20
 
20
 
21
    BatchDetailPanel() {
21
    BatchDetailPanel() {
22
        this.setLayout(new VFlowLayout());
22
        this.setLayout(new VFlowLayout());
23
    }
23
    }
24
 
24
 
25
    public void setField(SQLField field) {
25
    public void setField(BatchField batchField) {
26
        this.removeAll();
26
        this.removeAll();
27
 
27
 
-
 
28
        SQLField field = batchField.getField();
28
        final SQLType type = field.getType();
29
        final SQLType type = field.getType();
29
        final Class<?> javaType = type.getJavaType();
30
        final Class<?> javaType = type.getJavaType();
30
        final String fName = field.getName();
31
        final String fName = field.getName();
31
        if (fName.equals("PV_TTC")) {
32
        if (fName.equals("PV_TTC")) {
32
            final NumberProcessor p = new TTCProcessor(field);
33
            final NumberProcessor p = new TTCProcessor(batchField);
33
            this.add(p);
34
            this.add(p);
34
            this.processor = p;
35
            this.processor = p;
35
        } else if (fName.equals("PV_HT")) {
36
        } else if (fName.equals("PV_HT")) {
36
            final NumberProcessor p = new HTProcessor(field);
37
            final NumberProcessor p = new HTProcessor(batchField);
37
            this.add(p);
38
            this.add(p);
38
            this.processor = p;
39
            this.processor = p;
39
        } else if (fName.equals("ID_TAXE")) {
40
        } else if (fName.equals("ID_TAXE")) {
40
            final ReferenceProcessor p = new TVAProcessor(field);
41
            final ReferenceProcessor p = new TVAProcessor(batchField);
41
            this.add(p);
42
            this.add(p);
42
            this.processor = p;
43
            this.processor = p;
43
        } else if (fName.equals("PA_HT")) {
44
        } else if (fName.equals("PA_HT")) {
44
            final NumberProcessor p = new PurchaseProcessor(field);
45
            final NumberProcessor p = new PurchaseProcessor(batchField);
45
            this.add(p);
46
            this.add(p);
46
            this.processor = p;
47
            this.processor = p;
47
        } else if (javaType.equals(Boolean.class)) {
48
        } else if (javaType.equals(Boolean.class)) {
48
            final BooleanProcessor p = new BooleanProcessor(field);
49
            final BooleanProcessor p = new BooleanProcessor(batchField);
49
            this.add(p);
50
            this.add(p);
50
            this.processor = p;
51
            this.processor = p;
51
        } else if (field.isKey()) {
52
        } else if (field.isKey()) {
52
            final ReferenceProcessor p = new ReferenceProcessor(field);
53
            final ReferenceProcessor p = new ReferenceProcessor(batchField);
53
            this.add(p);
54
            this.add(p);
54
            this.processor = p;
55
            this.processor = p;
55
        } else if (javaType.equals(String.class)) {
56
        } else if (javaType.equals(String.class)) {
56
            final StringProcessor p = new StringProcessor(field);
57
            final StringProcessor p = new StringProcessor(batchField);
57
            this.add(p);
58
            this.add(p);
58
            this.processor = p;
59
            this.processor = p;
59
        } else if (javaType.equals(Date.class)) {
60
        } else if (javaType.equals(Date.class)) {
60
            final DateProcessor p = new DateProcessor(field);
61
            final DateProcessor p = new DateProcessor(batchField);
61
            this.add(p);
62
            this.add(p);
62
            this.processor = p;
63
            this.processor = p;
63
        } else if (javaType.equals(BigDecimal.class) || javaType.equals(Float.class) || javaType.equals(Double.class) || javaType.equals(Integer.class) || javaType.equals(Long.class)) {
64
        } else if (javaType.equals(BigDecimal.class) || javaType.equals(Float.class) || javaType.equals(Double.class) || javaType.equals(Integer.class) || javaType.equals(Long.class)) {
64
            final NumberProcessor p = new NumberProcessor(field);
65
            final NumberProcessor p = new NumberProcessor(batchField);
65
            this.add(p);
66
            this.add(p);
66
            this.processor = p;
67
            this.processor = p;
67
        }
68
        }
68
 
69
 
69
        revalidate();
70
        revalidate();