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 167
Line 25... Line 25...
25
import javax.swing.JFrame;
25
import javax.swing.JFrame;
26
import javax.swing.JTable;
26
import javax.swing.JTable;
27
import javax.swing.table.DefaultTableCellRenderer;
27
import javax.swing.table.DefaultTableCellRenderer;
28
 
28
 
29
import org.openconcerto.erp.action.CreateFrameAbstractAction;
29
import org.openconcerto.erp.action.CreateFrameAbstractAction;
30
import org.openconcerto.erp.action.PreferencesAction;
-
 
31
import org.openconcerto.erp.config.Gestion;
-
 
32
import org.openconcerto.erp.config.MainFrame;
30
import org.openconcerto.erp.config.MainFrame;
33
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
31
import org.openconcerto.erp.core.common.element.AdresseSQLElement;
34
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
32
import org.openconcerto.erp.core.common.element.ComptaSQLConfElement;
35
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
33
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
36
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement;
34
import org.openconcerto.erp.core.customerrelationship.customer.element.ContactSQLElement;
Line 38... Line 36...
38
import org.openconcerto.erp.modules.AbstractModule;
36
import org.openconcerto.erp.modules.AbstractModule;
39
import org.openconcerto.erp.modules.ComponentsContext;
37
import org.openconcerto.erp.modules.ComponentsContext;
40
import org.openconcerto.erp.modules.DBContext;
38
import org.openconcerto.erp.modules.DBContext;
41
import org.openconcerto.erp.modules.MenuContext;
39
import org.openconcerto.erp.modules.MenuContext;
42
import org.openconcerto.erp.modules.ModuleFactory;
40
import org.openconcerto.erp.modules.ModuleFactory;
43
import org.openconcerto.erp.modules.ModuleManager;
-
 
44
import org.openconcerto.erp.modules.ModulePackager;
-
 
45
import org.openconcerto.erp.modules.ModulePreferencePanel;
41
import org.openconcerto.erp.modules.ModulePreferencePanel;
46
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
42
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
47
import org.openconcerto.erp.modules.ModuleVersion;
43
import org.openconcerto.erp.modules.ModuleVersion;
48
import org.openconcerto.erp.modules.RuntimeModuleFactory;
-
 
49
import org.openconcerto.sql.Configuration;
44
import org.openconcerto.sql.Configuration;
50
import org.openconcerto.sql.element.SQLComponent;
45
import org.openconcerto.sql.element.SQLComponent;
51
import org.openconcerto.sql.element.SQLElement;
46
import org.openconcerto.sql.element.SQLElement;
52
import org.openconcerto.sql.element.SQLElementDirectory;
47
import org.openconcerto.sql.element.SQLElementDirectory;
53
import org.openconcerto.sql.element.UISQLComponent;
48
import org.openconcerto.sql.element.UISQLComponent;
-
 
49
import org.openconcerto.sql.model.DBRoot;
54
import org.openconcerto.sql.model.SQLName;
50
import org.openconcerto.sql.model.SQLName;
55
import org.openconcerto.sql.model.SQLRow;
51
import org.openconcerto.sql.model.SQLRow;
56
import org.openconcerto.sql.model.SQLRowAccessor;
52
import org.openconcerto.sql.model.SQLRowAccessor;
57
import org.openconcerto.sql.model.SQLRowValues;
53
import org.openconcerto.sql.model.SQLRowValues;
58
import org.openconcerto.sql.model.SQLRowValuesListFetcher;
54
import org.openconcerto.sql.model.SQLRowValuesListFetcher;
Line 67... Line 63...
67
import org.openconcerto.sql.view.list.RowAction;
63
import org.openconcerto.sql.view.list.RowAction;
68
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
64
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
69
import org.openconcerto.ui.PanelFrame;
65
import org.openconcerto.ui.PanelFrame;
70
import org.openconcerto.ui.group.Group;
66
import org.openconcerto.ui.group.Group;
71
import org.openconcerto.ui.group.LayoutHints;
67
import org.openconcerto.ui.group.LayoutHints;
72
import org.openconcerto.utils.FileUtils;
-
 
73
import org.openconcerto.utils.ListMap;
68
import org.openconcerto.utils.ListMap;
74
import org.openconcerto.utils.PrefType;
69
import org.openconcerto.utils.PrefType;
75
import org.openconcerto.utils.StringUtils;
70
import org.openconcerto.utils.StringUtils;
76
import org.openconcerto.utils.cc.IClosure;
71
import org.openconcerto.utils.cc.IClosure;
77
 
72
 
Line 425... Line 420...
425
            public JFrame createFrame() {
420
            public JFrame createFrame() {
426
 
421
 
427
                return new IListFrame(getPanelEntree(false));
422
                return new IListFrame(getPanelEntree(false));
428
            }
423
            }
429
        }, MainFrame.LIST_MENU);
424
        }, MainFrame.LIST_MENU);
430
        ctxt.addMenuItem(new PreferencesAction(), MainFrame.FILE_MENU);
425
        ctxt.addMenuItem(ctxt.getMenuAndActions().getAction("preferences"), MainFrame.FILE_MENU);
431
    }
426
    }
432
 
427
 
433
    @Override
428
    @Override
434
    protected void start() {
429
    protected void start() {
435
        MainFrame.getInstance().getTabbedPane().addTab("Liste des entrées", getPanelEntree(true));
430
        MainFrame.getInstance().getTabbedPane().addTab("Liste des entrées", getPanelEntree(true));
Line 437... Line 432...
437
 
432
 
438
    @Override
433
    @Override
439
    protected void stop() {
434
    protected void stop() {
440
    }
435
    }
441
 
436
 
442
    public static void main(String[] args) throws IOException {
-
 
443
        final File propsFile = new File("module.properties");
-
 
444
 
-
 
445
        final ModuleFactory factory = new RuntimeModuleFactory(propsFile);
-
 
446
 
-
 
447
        final File distDir = new File("dist");
-
 
448
        FileUtils.mkdir_p(distDir);
-
 
449
        new ModulePackager(propsFile, new File("bin/")).writeToDir(distDir);
-
 
450
        new ModulePackager(propsFile, new File("bin/")).writeToDir(new File("../OpenConcerto/Modules"));
-
 
451
 
-
 
452
        ModuleManager.getInstance().addFactoryAndStart(factory, false);
-
 
453
 
-
 
454
        Gestion.main(args);
-
 
455
 
-
 
456
    }
-
 
457
 
-
 
458
    public final static String ENTREE_PREF = "entreeAdmin";
437
    public final static String ENTREE_PREF = "entreeAdmin";
459
 
438
 
460
    @Override
439
    @Override
461
    public List<ModulePreferencePanelDesc> getPrefDescriptors() {
440
    public List<ModulePreferencePanelDesc> getPrefDescriptors(final DBRoot root) {
462
        return Arrays.<ModulePreferencePanelDesc> asList(new ModulePreferencePanelDesc("Gestion des entrées") {
441
        return Arrays.<ModulePreferencePanelDesc> asList(new ModulePreferencePanelDesc("Gestion des entrées") {
463
            @Override
442
            @Override
464
            protected ModulePreferencePanel createPanel() {
443
            protected ModulePreferencePanel createPanel() {
465
                return new ModulePreferencePanel("Gestion des entrées") {
444
                return new ModulePreferencePanel(root, "Gestion des entrées") {
466
                    @Override
445
                    @Override
467
                    protected void addViews() {
446
                    protected void addViews() {
468
 
-
 
469
                        this.addView(new SQLPrefView<Boolean>(PrefType.BOOLEAN_TYPE, "N'autoriser que les administrateurs à entrer ", ENTREE_PREF));
447
                        this.addView(new SQLPrefView<Boolean>(PrefType.BOOLEAN_TYPE, "N'autoriser que les administrateurs à entrer ", ENTREE_PREF));
470
                    }
448
                    }
471
                };
449
                };
472
            }
450
            }
473
        }.setLocal(false).setKeywords("entrée"));
451
        }.setLocal(false).setKeywords("entrée"));