OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 156 Rev 177
Line 17... Line 17...
17
import org.openconcerto.erp.config.MainFrame;
17
import org.openconcerto.erp.config.MainFrame;
18
import org.openconcerto.sql.Configuration;
18
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.model.DBRoot;
19
import org.openconcerto.sql.model.DBRoot;
20
import org.openconcerto.utils.i18n.TranslationManager;
20
import org.openconcerto.utils.i18n.TranslationManager;
21
 
21
 
22
import java.util.Locale;
-
 
23
 
-
 
24
public class HeadlessGestion {
22
public class HeadlessGestion {
25
    private final ComptaPropsConfiguration comptaPropsConfiguration;
23
    private final ComptaPropsConfiguration comptaPropsConfiguration;
26
 
24
 
27
    public HeadlessGestion() {
25
    public HeadlessGestion() {
28
        this.comptaPropsConfiguration = ComptaPropsConfiguration.create();
26
        this.comptaPropsConfiguration = ComptaPropsConfiguration.create();
Line 49... Line 47...
49
        return this;
47
        return this;
50
    }
48
    }
51
 
49
 
52
    public HeadlessGestion setGlobalState() {
50
    public HeadlessGestion setGlobalState() {
53
        System.setProperty("java.awt.headless", "true");
51
        System.setProperty("java.awt.headless", "true");
54
        TranslationManager.getInstance().addTranslationStreamFromClass(MainFrame.class);
52
        TranslationManager.addTranslationStreamFromClass(MainFrame.class);
55
        TranslationManager.getInstance().setLocale(Locale.getDefault());
53
        TranslationManager.createDefaultInstance();
56
        // TODO remove
54
        // TODO remove
57
        Configuration.setInstance(this.comptaPropsConfiguration);
55
        Configuration.setInstance(this.comptaPropsConfiguration);
58
        return this;
56
        return this;
59
    }
57
    }
60
 
58