OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 142 | Rev 156 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 142 Rev 149
Line 11... Line 11...
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
 package org.openconcerto.erp.core.edm;
14
 package org.openconcerto.erp.core.edm;
15
 
15
 
-
 
16
import java.util.ArrayList;
-
 
17
import java.util.List;
-
 
18
 
16
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
19
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
17
import org.openconcerto.sql.element.BaseSQLComponent;
20
import org.openconcerto.sql.element.BaseSQLComponent;
18
import org.openconcerto.sql.element.SQLComponent;
21
import org.openconcerto.sql.element.SQLComponent;
19
import org.openconcerto.ui.DefaultGridBagConstraints;
-
 
20
 
-
 
21
import java.awt.GridBagConstraints;
-
 
22
import java.awt.GridBagLayout;
-
 
23
import java.util.ArrayList;
-
 
24
import java.util.List;
-
 
25
 
22
 
26
public class AttachmentSQLElement extends ComptaSQLConfElement {
23
public class AttachmentSQLElement extends ComptaSQLConfElement {
27
 
24
 
28
    public final static String DIRECTORY_PREFS = "EDMdirectory";
25
    public static final String DIRECTORY_PREFS = "EDMdirectory";
29
 
26
 
30
    public AttachmentSQLElement() {
27
    public AttachmentSQLElement() {
31
        super("ATTACHMENT", "un attachement", "attachements");
28
        super("ATTACHMENT", "un attachement", "attachements");
32
 
-
 
33
    }
29
    }
34
 
30
 
35
    protected List<String> getListFields() {
31
    protected List<String> getListFields() {
36
        final List<String> l = new ArrayList<String>();
32
        final List<String> l = new ArrayList<>(10);
37
        l.add("SOURCE_TABLE");
33
        l.add("SOURCE_TABLE");
38
        l.add("SOURCE_ID");
34
        l.add("SOURCE_ID");
39
        l.add("NAME");
35
        l.add("NAME");
40
        l.add("MIMETYPE");
36
        l.add("MIMETYPE");
41
        l.add("FILENAME");
37
        l.add("FILENAME");
Line 45... Line 41...
45
        l.add("THUMBNAIL_HEIGHT");
41
        l.add("THUMBNAIL_HEIGHT");
46
        l.add("TAG");
42
        l.add("TAG");
47
        return l;
43
        return l;
48
    }
44
    }
49
 
45
 
-
 
46
    @Override
50
    protected List<String> getComboFields() {
47
    protected List<String> getComboFields() {
51
        final List<String> l = new ArrayList<String>();
48
        final List<String> l = new ArrayList<>(1);
52
        l.add("NAME");
49
        l.add("NAME");
53
        return l;
50
        return l;
54
    }
51
    }
55
 
52
 
-
 
53
    @Override
-
 
54
    protected String getParentFFName() {
-
 
55
        return "ID_PARENT";
-
 
56
    }
-
 
57
 
56
    public SQLComponent createComponent() {
58
    public SQLComponent createComponent() {
57
        return new BaseSQLComponent(this) {
59
        return new BaseSQLComponent(this) {
58
            public void addViews() {
60
            public void addViews() {
59
                this.setLayout(new GridBagLayout());
-
 
60
 
-
 
61
                final GridBagConstraints c = new DefaultGridBagConstraints();
-
 
62
                c.anchor = GridBagConstraints.NORTHEAST;
-
 
63
                c.gridwidth = 1;
-
 
64
 
-
 
65
                // // Numero
-
 
66
                // JLabel labelNumero = new JLabel("Numéro ");
-
 
67
                // this.add(labelNumero, c);
-
 
68
                //
-
 
69
                // JTextField textNumero = new JTextField();
-
 
70
                // c.gridx++;
-
 
71
                // c.weightx = 1;
-
 
72
                // this.add(textNumero, c);
-
 
73
 
-
 
74
                // this.addRequiredSQLObject(textNumero, "NUMERO");
-
 
75
            }
61
            }
76
        };
62
        };
77
    }
63
    }
78
 
64
 
79
    @Override
65
    @Override