OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 156 Rev 174
Line 32... Line 32...
32
import java.awt.event.ActionEvent;
32
import java.awt.event.ActionEvent;
33
import java.awt.event.MouseEvent;
33
import java.awt.event.MouseEvent;
34
import java.beans.PropertyChangeEvent;
34
import java.beans.PropertyChangeEvent;
35
import java.beans.PropertyChangeListener;
35
import java.beans.PropertyChangeListener;
36
import java.util.EventObject;
36
import java.util.EventObject;
-
 
37
import java.util.List;
37
 
38
 
38
import javax.swing.AbstractAction;
39
import javax.swing.AbstractAction;
39
import javax.swing.AbstractCellEditor;
40
import javax.swing.AbstractCellEditor;
40
import javax.swing.Action;
41
import javax.swing.Action;
41
import javax.swing.JTable;
42
import javax.swing.JTable;
Line 54... Line 55...
54
    boolean addUndefined;
55
    boolean addUndefined;
55
 
56
 
56
    private IListFrame listFrame = null;
57
    private IListFrame listFrame = null;
57
 
58
 
58
    public SQLTextComboTableCellEditor(final SQLElement elt, final boolean addUndefined) {
59
    public SQLTextComboTableCellEditor(final SQLElement elt, final boolean addUndefined) {
59
        this(elt, addUndefined, false);
60
        this(elt, addUndefined, false,null);
60
    }
61
    }
61
 
62
 
62
    /**
63
    /**
63
     * 
64
     * 
64
     * @param elt Element à afficher dans la combo
65
     * @param elt Element à afficher dans la combo
65
     * @param addUndefined ajout de l'indéfini
66
     * @param addUndefined ajout de l'indéfini
66
     * @param chooseInListe possibilité de choisir via une IListe
67
     * @param chooseInListe possibilité de choisir via une IListe
67
     */
68
     */
68
    public SQLTextComboTableCellEditor(final SQLElement elt, final boolean addUndefined, boolean chooseInListe) {
69
    public SQLTextComboTableCellEditor(final SQLElement elt, final boolean addUndefined, boolean chooseInListe) {
-
 
70
        this(elt, addUndefined, chooseInListe, null);
-
 
71
    }
-
 
72
 
-
 
73
    /**
-
 
74
     * 
-
 
75
     * @param elt Element à afficher dans la combo
-
 
76
     * @param addUndefined ajout de l'indéfini
-
 
77
     * @param chooseInListe possibilité de choisir via une IListe
-
 
78
     */
-
 
79
    public SQLTextComboTableCellEditor(final SQLElement elt, final boolean addUndefined, boolean chooseInListe, List<String> fieldsInCombo) {
69
        super();
80
         super();
70
 
81
 
71
        this.addUndefined = addUndefined;
82
        this.addUndefined = addUndefined;
72
 
83
 
73
        this.comboBox = new SQLRequestComboBox(addUndefined);
84
        this.comboBox = new SQLRequestComboBox(addUndefined);
Line 75... Line 86...
75
        // Mimic JTable.GenericEditor behavior
86
        // Mimic JTable.GenericEditor behavior
76
        this.comboBox.getTextComp().setBorder(new EmptyBorder(0, 0, 0, 18));
87
        this.comboBox.getTextComp().setBorder(new EmptyBorder(0, 0, 0, 18));
77
        this.comboBox.setBorder(new LineBorder(Color.black));
88
        this.comboBox.setBorder(new LineBorder(Color.black));
78
        this.comboBox.getPulseComponents().iterator().next().setBorder(null);
89
        this.comboBox.getPulseComponents().iterator().next().setBorder(null);
79
 
90
 
80
        ComboSQLRequest c = elt.getComboRequest(true);
91
        ComboSQLRequest c = fieldsInCombo == null || fieldsInCombo.isEmpty() ? elt.getComboRequest(true) : elt.createComboRequest(fieldsInCombo, null);        
81
        this.comboBox.uiInit(c);
92
        this.comboBox.uiInit(c);
82
 
93
 
83
        if (chooseInListe) {
94
        if (chooseInListe) {
84
            this.comboBox.getActions().add(0, new AbstractAction("Tout afficher") {
95
            this.comboBox.getActions().add(0, new AbstractAction("Tout afficher") {
85
                @Override
96
                @Override