OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 153 Rev 181
Line 87... Line 87...
87
            e.importFromXML(row.get("XML"));
87
            e.importFromXML(row.get("XML"));
88
            this.extensions.add(e);
88
            this.extensions.add(e);
89
        }
89
        }
90
        Log.get().info("setupMenu");
90
        Log.get().info("setupMenu");
91
        // Start previously started extensions
91
        // Start previously started extensions
92
        for (Extension extension : extensions) {
92
        for (Extension extension : this.extensions) {
93
            if (extension.isAutoStart()) {
93
            if (extension.isAutoStart()) {
94
                try {
94
                try {
95
                    extension.setupMenu(ctxt);
95
                    extension.setupMenu(ctxt);
96
                } catch (Throwable e) {
96
                } catch (Throwable e) {
97
                    JOptionPane.showMessageDialog(new JFrame(), "Impossible de démarrer l'extension " + extension.getName() + "\n" + e.getMessage());
97
                    JOptionPane.showMessageDialog(new JFrame(), "Impossible de démarrer l'extension " + extension.getName() + "\n" + e.getMessage());
Line 106... Line 106...
106
    protected void start() {
106
    protected void start() {
107
        Log.get().info("Starting Extension Builder");
107
        Log.get().info("Starting Extension Builder");
108
        final DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
108
        final DBRoot root = ComptaPropsConfiguration.getInstanceCompta().getRootSociete();
109
 
109
 
110
        // Start previously started extensions
110
        // Start previously started extensions
111
        for (Extension extension : extensions) {
111
        for (Extension extension : this.extensions) {
112
            if (extension.isAutoStart()) {
112
            if (extension.isAutoStart()) {
113
                try {
113
                try {
114
                    extension.start(root, true);
114
                    extension.start(root, true);
115
                } catch (Throwable e) {
115
                } catch (Throwable e) {
116
                    JOptionPane.showMessageDialog(new JFrame(), "Impossible de démarrer l'extension " + extension.getName() + "\n" + e.getMessage());
116
                    JOptionPane.showMessageDialog(new JFrame(), "Impossible de démarrer l'extension " + extension.getName() + "\n" + e.getMessage());
Line 122... Line 122...
122
        System.err.println("Starting Extension Builder done, action for test1:" + MenuManager.getInstance().getActionForId("test1") + " " + MenuManager.getInstance());
122
        System.err.println("Starting Extension Builder done, action for test1:" + MenuManager.getInstance().getActionForId("test1") + " " + MenuManager.getInstance());
123
    }
123
    }
124
 
124
 
125
    @Override
125
    @Override
126
    protected void stop() {
126
    protected void stop() {
127
        for (Extension extension : extensions) {
127
        for (Extension extension : this.extensions) {
128
            extension.stop();
128
            extension.stop();
129
        }
129
        }
130
        this.extensions.clear();
130
        this.extensions.clear();
131
    }
131
    }
132
 
132