OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 30 | Rev 140 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
30 ilm 1
package org.openconcerto.modules.customerrelationship.lead;
2
 
3
import java.util.HashSet;
4
import java.util.Set;
5
 
6
import javax.swing.JComponent;
7
import javax.swing.JLabel;
8
import javax.swing.JScrollPane;
9
import javax.swing.JTextArea;
10
 
11
import org.openconcerto.sql.element.GroupSQLComponent;
12
import org.openconcerto.sql.element.SQLElement;
13
import org.openconcerto.sql.sqlobject.SQLSearchableTextCombo;
14
import org.openconcerto.ui.JDate;
15
import org.openconcerto.ui.component.ComboLockedMode;
16
import org.openconcerto.ui.group.Group;
17
 
18
public class LeadSQLComponent extends GroupSQLComponent {
19
    public LeadSQLComponent(SQLElement element, Group group) {
20
        super(element, group);
21
    }
22
 
23
    @Override
24
    protected Set<String> createRequiredNames() {
25
        final Set<String> s = new HashSet<String>(1);
26
        s.add("ID_ADRESSE");
27
        return s;
28
    }
29
 
30
    @Override
87 ilm 31
    public JComponent createEditor(String id) {
30 ilm 32
        if (id.equals("INFORMATION")) {
33
            final JTextArea jTextArea = new JTextArea();
34
            jTextArea.setFont(new JLabel().getFont());
35
            return new JScrollPane(jTextArea);
36
        } else if (id.equals("INDUSTRY") || id.equals("STATUS") || id.equals("RATING") || id.equals("SOURCE")) {
37
            return new SQLSearchableTextCombo(ComboLockedMode.UNLOCKED, 1, 20, false);
38
        } else if (id.equals("DATE")) {
39
            return new JDate(true);
40
        }
87 ilm 41
        return super.createEditor(id);
30 ilm 42
    }
43
}