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 180
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.sales.invoice.action;
14
 package org.openconcerto.erp.core.sales.invoice.action;
15
 
15
 
-
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.core.sales.invoice.report.ReportingStockXmlSheet;
17
import org.openconcerto.erp.core.sales.invoice.ui.RapportEtatDeStockDepotSelectionPanel;
-
 
18
import org.openconcerto.sql.Configuration;
-
 
19
import org.openconcerto.ui.FrameUtil;
-
 
20
import org.openconcerto.ui.state.WindowStateManager;
17
import org.openconcerto.utils.ExceptionHandler;
21
import org.openconcerto.utils.FileUtils;
-
 
22
 
-
 
23
import java.awt.Dimension;
-
 
24
import java.io.File;
18
 
25
 
19
import javax.swing.AbstractAction;
26
import javax.swing.AbstractAction;
20
import javax.swing.Action;
27
import javax.swing.Action;
-
 
28
import javax.swing.JFrame;
21
 
29
 
22
public class GenEtatStockAction extends AbstractAction {
30
public class GenEtatStockAction extends AbstractAction {
23
    public GenEtatStockAction() {
31
    public GenEtatStockAction() {
24
        this.putValue(Action.NAME, "Etat du stock");
32
        this.putValue(Action.NAME, "Etat du stock");
25
    }
33
    }
26
 
34
 
27
    public void actionPerformed(java.awt.event.ActionEvent e) {
35
    public void actionPerformed(java.awt.event.ActionEvent e) {
28
        final Thread thread = new Thread(new Runnable() {
36
        final Thread thread = new Thread(new Runnable() {
29
            public void run() {
37
            public void run() {
30
                try {
-
 
31
 
38
 
-
 
39
                // Création de la fenêtre de popup de séléction du dépot.
-
 
40
                JFrame frame = new JFrame();
-
 
41
                frame.setTitle("Sélection des dépôts.");
-
 
42
                frame.setPreferredSize(new Dimension(500, 130));
-
 
43
                frame.setLocationRelativeTo(null); // la fenêtre est centrée à l'écran
-
 
44
 
-
 
45
                WindowStateManager stateManager;
32
                    ReportingStockXmlSheet sheet = new ReportingStockXmlSheet(false);
46
                stateManager = new WindowStateManager(frame,
-
 
47
                        new File(Configuration.getInstance().getConfDir(), "Configuration" + File.separator + "Frame" + File.separator + FileUtils.sanitize("RapportEtatDeStockPanel") + ".xml"));
33
 
48
 
34
                    sheet.createDocumentAsynchronous().get();
49
                frame.getContentPane().add(new RapportEtatDeStockDepotSelectionPanel((ComptaPropsConfiguration) Configuration.getInstance()));
35
                    sheet.openDocument(false);
-
 
36
 
50
 
37
                } catch (Exception e) {
51
                FrameUtil.showPacked(frame);
38
                    ExceptionHandler.handle("Erreur de traitement", e);
52
                stateManager.loadState();
39
                }
-
 
40
            }
53
            }
-
 
54
 
41
        });
55
        });
42
        thread.start();
56
        thread.start();
43
    };
57
    };
44
 
58
 
45
}
59
}