OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 19 Rev 25
Line 19... Line 19...
19
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
19
import org.openconcerto.erp.model.MouseSheetXmlListeListener;
20
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.Configuration;
21
import org.openconcerto.sql.model.SQLRow;
21
import org.openconcerto.sql.model.SQLRow;
22
import org.openconcerto.sql.view.IListFrame;
22
import org.openconcerto.sql.view.IListFrame;
23
import org.openconcerto.sql.view.ListeAddPanel;
23
import org.openconcerto.sql.view.ListeAddPanel;
-
 
24
import org.openconcerto.sql.view.list.IListe;
-
 
25
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
-
 
26
import org.openconcerto.sql.view.list.RowAction;
-
 
27
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
24
 
28
 
25
import java.awt.event.ActionEvent;
29
import java.awt.event.ActionEvent;
26
import java.util.ArrayList;
30
import java.util.ArrayList;
27
import java.util.List;
31
import java.util.List;
28
 
32
 
Line 37... Line 41...
37
    }
41
    }
38
 
42
 
39
    public JFrame createFrame() {
43
    public JFrame createFrame() {
40
        final IListFrame frame = new IListFrame(new ListeAddPanel(Configuration.getInstance().getDirectory().getElement("COMMANDE")));
44
        final IListFrame frame = new IListFrame(new ListeAddPanel(Configuration.getInstance().getDirectory().getElement("COMMANDE")));
41
 
45
 
42
        frame.getPanel().getListe().getJTable().addMouseListener(new MouseSheetXmlListeListener(frame.getPanel().getListe(), CommandeXmlSheet.class) {
46
        frame.getPanel().getListe().addIListeActions(new MouseSheetXmlListeListener(CommandeXmlSheet.class) {
43
            @Override
47
            @Override
44
            public List<AbstractAction> addToMenu() {
48
            public List<RowAction> addToMenu() {
45
                // Transfert vers BR
49
                // Transfert vers BR
46
                AbstractAction bonAction = (new AbstractAction("Transfert vers BR") {
50
                PredicateRowAction bonAction = new PredicateRowAction(new AbstractAction("Transfert vers BR") {
47
                    public void actionPerformed(ActionEvent e) {
51
                    public void actionPerformed(ActionEvent e) {
48
                        transfertBonReceptionClient(frame.getPanel().getListe().getSelectedRow());
52
                        transfertBonReceptionClient(IListe.get(e).getSelectedRow());
49
                    }
53
                    }
50
                });
54
                }, false);
-
 
55
 
-
 
56
                bonAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
51
 
57
 
52
                // Transfert vers facture
58
                // Transfert vers facture
53
                AbstractAction factureAction = (new AbstractAction("Transfert vers facture") {
59
                PredicateRowAction factureAction = new PredicateRowAction(new AbstractAction("Transfert vers facture") {
54
                    public void actionPerformed(ActionEvent e) {
60
                    public void actionPerformed(ActionEvent e) {
55
                        transfertFactureFournisseur(frame.getPanel().getListe().getSelectedRow());
61
                        transfertFactureFournisseur(IListe.get(e).getSelectedRow());
56
                    }
62
                    }
57
                });
63
                }, false);
-
 
64
 
-
 
65
                factureAction.setPredicate(IListeEvent.getSingleSelectionPredicate());
58
 
66
 
59
                List<AbstractAction> l = new ArrayList<AbstractAction>();
67
                List<RowAction> l = new ArrayList<RowAction>();
60
                l.add(bonAction);
68
                l.add(bonAction);
61
                l.add(factureAction);
69
                l.add(factureAction);
62
                return l;
70
                return l;
63
            }
71
            }
64
        });
72
        }.getRowActions());
65
 
73
 
66
        return frame;
74
        return frame;
67
    }
75
    }
68
 
76
 
69
    /**
77
    /**