OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 57 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
18 ilm 1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
10
 *
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
13
 
14
 package org.openconcerto.erp.core.humanresources.payroll.element;
15
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.sql.element.BaseSQLComponent;
18
import org.openconcerto.sql.element.SQLComponent;
19
import org.openconcerto.sql.sqlobject.ElementComboBox;
20
import org.openconcerto.ui.DefaultGridBagConstraints;
21
 
22
import java.awt.GridBagConstraints;
23
import java.awt.GridBagLayout;
24
import java.util.ArrayList;
25
import java.util.List;
26
 
27
import javax.swing.JLabel;
28
 
29
public class RegimeBaseSQLElement extends ComptaSQLConfElement {
30
 
31
    public RegimeBaseSQLElement() {
32
        super("REGIME_BASE", "un régime de base", "régimes de base");
33
    }
34
 
35
    protected List<String> getListFields() {
36
        final List<String> l = new ArrayList<String>();
37
        l.add("ID_CODE_REGIME_BASE");
38
        l.add("ID_CODE_REGIME_MALADIE");
39
        l.add("ID_CODE_REGIME_AT");
40
        l.add("ID_CODE_REGIME_VIEL_P");
41
        l.add("ID_CODE_REGIME_VIEL_S");
42
        return l;
43
    }
44
 
45
    protected List<String> getComboFields() {
46
        final List<String> l = new ArrayList<String>();
47
        l.add("ID_CODE_REGIME_BASE");
48
        l.add("ID_CODE_REGIME_MALADIE");
49
        l.add("ID_CODE_REGIME_AT");
50
        l.add("ID_CODE_REGIME_VIEL_P");
51
        l.add("ID_CODE_REGIME_VIEL_S");
52
        return l;
53
    }
54
 
55
    /*
56
     * (non-Javadoc)
57
     *
58
     * @see org.openconcerto.devis.SQLElement#getComponent()
59
     */
60
    public SQLComponent createComponent() {
61
        return new BaseSQLComponent(this) {
62
 
63
            public void addViews() {
64
 
65
                this.setLayout(new GridBagLayout());
66
                final GridBagConstraints c = new DefaultGridBagConstraints();
67
 
68
                // Code regime base
69
                JLabel labelBase = new JLabel(getLabelFor("ID_CODE_REGIME_BASE"));
70
                ElementComboBox comboSelBase = new ElementComboBox();
71
 
72
                this.add(labelBase, c);
73
                c.gridx++;
74
                this.add(comboSelBase, c);
75
 
76
                // Code regime maladie
77
                JLabel labelMaladie = new JLabel(getLabelFor("ID_CODE_REGIME_MALADIE"));
78
                ElementComboBox comboSelMaladie = new ElementComboBox();
79
 
80
                c.gridy++;
81
                c.gridx = 0;
82
                this.add(labelMaladie, c);
83
                c.gridx++;
84
                this.add(comboSelMaladie, c);
85
 
86
                // Code regime AT
87
                JLabel labelAT = new JLabel(getLabelFor("ID_CODE_REGIME_AT"));
88
                ElementComboBox comboSelAT = new ElementComboBox();
89
 
90
                c.gridy++;
91
                c.gridx = 0;
92
                this.add(labelAT, c);
93
                c.gridx++;
94
                this.add(comboSelAT, c);
95
 
96
                // Code regime Viellesse pat
97
                JLabel labelVielP = new JLabel(getLabelFor("ID_CODE_REGIME_VIEL_P"));
98
                ElementComboBox comboSelVielP = new ElementComboBox();
99
 
100
                c.gridy++;
101
                c.gridx = 0;
102
                this.add(labelVielP, c);
103
                c.gridx++;
104
                this.add(comboSelVielP, c);
105
 
106
                // Code regime Viellesse pat
107
                JLabel labelVielS = new JLabel(getLabelFor("ID_CODE_REGIME_VIEL_S"));
108
                ElementComboBox comboSelVielS = new ElementComboBox();
109
 
110
                c.gridy++;
111
                c.gridx = 0;
112
                this.add(labelVielS, c);
113
                c.gridx++;
114
                this.add(comboSelVielS, c);
115
 
116
                this.addRequiredSQLObject(comboSelVielS, "ID_CODE_REGIME_VIEL_S");
117
                this.addRequiredSQLObject(comboSelVielP, "ID_CODE_REGIME_VIEL_P");
118
                this.addRequiredSQLObject(comboSelAT, "ID_CODE_REGIME_AT");
119
                this.addRequiredSQLObject(comboSelMaladie, "ID_CODE_REGIME_MALADIE");
120
                this.addRequiredSQLObject(comboSelBase, "ID_CODE_REGIME_BASE");
121
            }
122
        };
123
    }
124
}