OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 144 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 144 Rev 156
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
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
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
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.
9
 * language governing permissions and limitations under the License.
10
 * 
10
 * 
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 /*
14
 /*
15
 * Créé le 26 sept. 2012
15
 * Créé le 26 sept. 2012
16
 */
16
 */
17
package org.openconcerto.erp.core.supplychain.order.element;
17
package org.openconcerto.erp.core.supplychain.order.element;
18
 
18
 
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
20
import org.openconcerto.sql.element.SQLComponent;
20
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.UISQLComponent;
21
import org.openconcerto.sql.element.UISQLComponent;
22
import org.openconcerto.utils.ListMap;
22
import org.openconcerto.utils.ListMap;
23
 
23
 
24
import java.util.ArrayList;
24
import java.util.ArrayList;
25
import java.util.List;
25
import java.util.List;
26
 
26
 
27
import javax.swing.JTextField;
27
import javax.swing.JTextField;
28
 
28
 
29
public class FabricantSQLElement extends ComptaSQLConfElement {
29
public class FabricantSQLElement extends ComptaSQLConfElement {
30
 
30
 
31
    public FabricantSQLElement() {
31
    public FabricantSQLElement() {
32
        super("FABRICANT", "un fabricant", "fabricants");
32
        super("FABRICANT", "un fabricant", "fabricants");
33
    }
33
    }
34
 
34
 
35
    protected List<String> getListFields() {
35
    protected List<String> getListFields() {
36
        final List<String> l = new ArrayList<String>();
36
        final List<String> l = new ArrayList<String>();
37
        l.add("NOM");
37
        l.add("NOM");
38
        return l;
38
        return l;
39
    }
39
    }
40
 
40
 
41
    protected List<String> getComboFields() {
41
    protected List<String> getComboFields() {
42
        final List<String> l = new ArrayList<String>();
42
        final List<String> l = new ArrayList<String>();
43
        l.add("NOM");
43
        l.add("NOM");
44
        return l;
44
        return l;
45
    }
45
    }
46
 
46
 
47
    @Override
47
    @Override
48
    public ListMap<String, String> getShowAs() {
48
    public ListMap<String, String> getShowAs() {
49
        final ListMap<String, String> res = new ListMap<String, String>();
49
        final ListMap<String, String> res = new ListMap<String, String>();
50
        res.add(null, "NOM");
50
        res.add(null, "NOM");
51
        return res;
51
        return res;
52
    }
52
    }
53
 
53
 
54
    /*
54
    /*
55
     * (non-Javadoc)
55
     * (non-Javadoc)
56
     * 
56
     * 
57
     * @see org.openconcerto.devis.SQLElement#getComponent()
57
     * @see org.openconcerto.devis.SQLElement#getComponent()
58
     */
58
     */
59
    public SQLComponent createComponent() {
59
    public SQLComponent createComponent() {
60
        return new UISQLComponent(this) {
60
        return new UISQLComponent(this) {
61
            public void addViews() {
61
            public void addViews() {
62
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
62
                this.addRequiredSQLObject(new JTextField(), "NOM", "left");
63
            }
63
            }
64
        };
64
        };
65
    }
65
    }
66
 
66
 
67
    @Override
67
    @Override
68
    protected String createCode() {
68
    protected String createCode() {
69
        return createCodeFromPackage() + ".manufacturor";
69
        return createCodeOfPackage() + ".manufacturor";
70
    }
70
    }
71
 
71
 
72
}
72
}