OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 144 Rev 156
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.customerrelationship.customer.element;
14
 package org.openconcerto.erp.core.customerrelationship.customer.element;
15
 
15
 
16
import org.openconcerto.erp.core.edm.AttachmentAction;
16
import org.openconcerto.erp.core.edm.AttachmentAction;
-
 
17
import org.openconcerto.erp.core.reports.history.ui.HistoriqueClientFrame;
17
import org.openconcerto.sql.element.GlobalMapper;
18
import org.openconcerto.sql.element.GlobalMapper;
18
import org.openconcerto.sql.element.GroupSQLComponent;
19
import org.openconcerto.sql.element.GroupSQLComponent;
19
import org.openconcerto.sql.element.SQLComponent;
20
import org.openconcerto.sql.element.SQLComponent;
20
import org.openconcerto.sql.model.SQLRowAccessor;
21
import org.openconcerto.sql.model.SQLRowAccessor;
21
import org.openconcerto.sql.request.SQLFieldTranslator;
22
import org.openconcerto.sql.request.SQLFieldTranslator;
-
 
23
import org.openconcerto.sql.view.list.IListe;
22
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
24
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
23
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
25
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
24
import org.openconcerto.ui.light.LightUIElement;
26
import org.openconcerto.ui.light.LightUIElement;
25
import org.openconcerto.ui.light.LightUILine;
27
import org.openconcerto.ui.light.LightUILine;
26
import org.openconcerto.ui.light.LightUIPanel;
28
import org.openconcerto.ui.light.LightUIPanel;
27
import org.openconcerto.ui.light.SimpleTextLine;
29
import org.openconcerto.ui.light.SimpleTextLine;
28
 
30
 
-
 
31
import java.awt.event.ActionEvent;
29
import java.util.List;
32
import java.util.List;
30
 
33
 
-
 
34
import javax.swing.AbstractAction;
-
 
35
 
31
public class CustomerSQLElement extends ClientNormalSQLElement {
36
public class CustomerSQLElement extends ClientNormalSQLElement {
32
 
37
 
33
    public CustomerSQLElement() {
38
    public CustomerSQLElement() {
34
        super();
39
        super();
35
        final CustomerGroup group = new CustomerGroup();
40
        final CustomerGroup group = new CustomerGroup();
Line 38... Line 43...
38
 
43
 
39
        PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
44
        PredicateRowAction actionAttachment = new PredicateRowAction(new AttachmentAction().getAction(), true);
40
        actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
45
        actionAttachment.setPredicate(IListeEvent.getSingleSelectionPredicate());
41
        getRowActions().add(actionAttachment);
46
        getRowActions().add(actionAttachment);
42
 
47
 
-
 
48
        PredicateRowAction actionHistory = new PredicateRowAction(new AbstractAction("Historique client") {
-
 
49
 
-
 
50
            @Override
-
 
51
            public void actionPerformed(ActionEvent e) {
-
 
52
                HistoriqueClientFrame histoFrame = new HistoriqueClientFrame();
-
 
53
                int idClient = IListe.get(e).getSelectedId();
-
 
54
                histoFrame.selectId(idClient);
-
 
55
                histoFrame.setVisible(true);
-
 
56
            }
-
 
57
        }, true);
-
 
58
        actionHistory.setPredicate(IListeEvent.getSingleSelectionPredicate());
-
 
59
        getRowActions().add(actionHistory);
-
 
60
 
43
    }
61
    }
44
 
62
 
45
    @Override
63
    @Override
46
    public SQLComponent createComponent() {
64
    public SQLComponent createComponent() {
47
        final GroupSQLComponent c = new CustomerSQLComponent(this);
65
        final GroupSQLComponent c = new CustomerSQLComponent(this);