OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 180
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
10
 * 
10
 * 
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.finance.accounting.ui;
14
 package org.openconcerto.erp.core.finance.accounting.ui;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.finance.tax.ui.TvaPreferencePanel;
17
import org.openconcerto.erp.core.finance.tax.ui.TvaPreferencePanel;
18
import org.openconcerto.erp.core.humanresources.payroll.ui.ImpressionPayePreferencePanel;
18
import org.openconcerto.erp.core.humanresources.payroll.ui.ImpressionPayePreferencePanel;
19
import org.openconcerto.erp.core.sales.product.ui.GestionArticlePreferencePanel;
19
import org.openconcerto.erp.core.sales.product.ui.GestionArticlePreferencePanel;
20
import org.openconcerto.erp.modules.AbstractModule;
20
import org.openconcerto.erp.modules.AbstractModule;
21
import org.openconcerto.erp.modules.ModuleManager;
21
import org.openconcerto.erp.modules.ModuleManager;
22
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
22
import org.openconcerto.erp.modules.ModulePreferencePanelDesc;
23
import org.openconcerto.erp.preferences.AttachmentPreferencePanel;
23
import org.openconcerto.erp.preferences.AttachmentPreferencePanel;
24
import org.openconcerto.erp.preferences.GenerationDeclarationDocPreferencePanel;
24
import org.openconcerto.erp.preferences.GenerationDeclarationDocPreferencePanel;
25
import org.openconcerto.erp.preferences.GenerationDocGlobalPreferencePanel;
25
import org.openconcerto.erp.preferences.GenerationDocGlobalPreferencePanel;
26
import org.openconcerto.erp.preferences.GenerationDocumentComptaPreferencePanel;
26
import org.openconcerto.erp.preferences.GenerationDocumentComptaPreferencePanel;
27
import org.openconcerto.erp.preferences.GenerationDocumentGestCommPreferencePanel;
27
import org.openconcerto.erp.preferences.GenerationDocumentGestCommPreferencePanel;
28
import org.openconcerto.erp.preferences.GenerationDocumentPayePreferencePanel;
28
import org.openconcerto.erp.preferences.GenerationDocumentPayePreferencePanel;
29
import org.openconcerto.erp.preferences.GestionArticleGlobalPreferencePanel;
29
import org.openconcerto.erp.preferences.GestionArticleGlobalPreferencePanel;
30
import org.openconcerto.erp.preferences.GestionClientPreferencePanel;
30
import org.openconcerto.erp.preferences.GestionClientPreferencePanel;
31
import org.openconcerto.erp.preferences.GestionCommercialeGlobalPreferencePanel;
31
import org.openconcerto.erp.preferences.GestionCommercialeGlobalPreferencePanel;
32
import org.openconcerto.erp.preferences.GestionPieceCommercialePanel;
32
import org.openconcerto.erp.preferences.GestionPieceCommercialePanel;
33
import org.openconcerto.erp.preferences.ImpressionGestCommPreferencePanel;
33
import org.openconcerto.erp.preferences.ImpressionGestCommPreferencePanel;
34
import org.openconcerto.erp.preferences.ModeReglementDefautPrefPanel;
34
import org.openconcerto.erp.preferences.ModeReglementDefautPrefPanel;
35
import org.openconcerto.erp.preferences.NumerotationPreferencePanel;
35
import org.openconcerto.erp.preferences.NumerotationPreferencePanel;
36
import org.openconcerto.erp.preferences.PayPalPreferencePanel;
36
import org.openconcerto.erp.preferences.PayPalPreferencePanel;
37
import org.openconcerto.erp.preferences.PayeGlobalPreferencePanel;
37
import org.openconcerto.erp.preferences.PayeGlobalPreferencePanel;
38
import org.openconcerto.erp.preferences.SauvegardeEnLignePreferencePanel;
38
import org.openconcerto.erp.preferences.SauvegardeEnLignePreferencePanel;
39
import org.openconcerto.erp.preferences.SauvegardeFichierPreferencePanel;
39
import org.openconcerto.erp.preferences.SauvegardeFichierPreferencePanel;
40
import org.openconcerto.erp.preferences.SocietePreferencePanel;
40
import org.openconcerto.erp.preferences.SocietePreferencePanel;
41
import org.openconcerto.erp.preferences.TemplatePreferencePanel;
41
import org.openconcerto.erp.preferences.TemplatePreferencePanel;
42
import org.openconcerto.erp.preferences.UIPreferencePanel;
42
import org.openconcerto.erp.preferences.UIPreferencePanel;
43
import org.openconcerto.sql.Configuration;
43
import org.openconcerto.sql.Configuration;
44
import org.openconcerto.ui.preferences.EmailNode;
44
import org.openconcerto.ui.preferences.EmailNode;
45
import org.openconcerto.ui.preferences.EmptyPreferencePanel;
45
import org.openconcerto.ui.preferences.EmptyPreferencePanel;
46
import org.openconcerto.ui.preferences.PrefTreeNode;
46
import org.openconcerto.ui.preferences.PrefTreeNode;
47
 
47
 
48
import java.util.List;
48
import java.util.List;
49
import java.util.Map.Entry;
49
import java.util.Map.Entry;
50
 
50
 
51
import javax.swing.tree.DefaultMutableTreeNode;
51
import javax.swing.tree.DefaultMutableTreeNode;
52
 
52
 
53
public class ComptaPrefTreeNode extends DefaultMutableTreeNode {
53
public class ComptaPrefTreeNode extends DefaultMutableTreeNode {
54
    public ComptaPrefTreeNode(final ModuleManager moduleManager) {
54
    public ComptaPrefTreeNode(final ModuleManager moduleManager) {
55
        super(" Préférences");
55
        super(" Préférences");
56
 
56
 
57
        // Globale
57
        // Globale
58
        final PrefTreeNode nsGlobale = new PrefTreeNode(EmptyPreferencePanel.class, "Globales", new String[] {}, true);
58
        final PrefTreeNode nsGlobale = new PrefTreeNode(EmptyPreferencePanel.class, "Globales", new String[] {}, true);
59
        // Poste
59
        // Poste
60
        final PrefTreeNode nsPoste = new PrefTreeNode(EmptyPreferencePanel.class, "De l'ordinateur", new String[] {}, true);
60
        final PrefTreeNode nsPoste = new PrefTreeNode(EmptyPreferencePanel.class, "De l'ordinateur", new String[] {}, true);
61
        final PrefTreeNode nUI = new PrefTreeNode(UIPreferencePanel.class, "Interface", new String[] { "couleur", "color", "list" });
61
        final PrefTreeNode nUI = new PrefTreeNode(UIPreferencePanel.class, "Interface", new String[] { "couleur", "color", "list" });
62
        nsPoste.add(nUI);
62
        nsPoste.add(nUI);
63
        // Sauvegarde
63
        // Sauvegarde
64
 
64
 
65
        final PrefTreeNode ns = new PrefTreeNode(EmptyPreferencePanel.class, "Sauvegarde", new String[] { "sauvegarde", "backup" });
65
        final PrefTreeNode ns = new PrefTreeNode(EmptyPreferencePanel.class, "Sauvegarde", new String[] { "sauvegarde", "backup" });
66
        final PrefTreeNode n = new PrefTreeNode(SauvegardeEnLignePreferencePanel.class, "Sauvegarde en ligne", new String[] { "rien", "activer" });
66
        final PrefTreeNode n = new PrefTreeNode(SauvegardeEnLignePreferencePanel.class, "Sauvegarde en ligne", new String[] { "rien", "activer" });
67
        final PrefTreeNode n2 = new PrefTreeNode(SauvegardeFichierPreferencePanel.class, "Sauvegarde fichier", new String[] { "rien", "action" });
67
        final PrefTreeNode n2 = new PrefTreeNode(SauvegardeFichierPreferencePanel.class, "Sauvegarde fichier", new String[] { "rien", "action" });
68
        ns.add(n2);
68
        ns.add(n2);
69
        ns.add(n);
69
        ns.add(n);
70
        // nsGlobale.add(ns);
70
        // nsGlobale.add(ns);
71
 
71
 
72
        // TVA
72
        // TVA
73
        final PrefTreeNode nTVA = new PrefTreeNode(TvaPreferencePanel.class, "TVA", new String[] { "TVA", "Taxe" });
73
        final PrefTreeNode nTVA = new PrefTreeNode(TvaPreferencePanel.class, "TVA", new String[] { "TVA", "Taxe" });
74
 
74
 
75
        nsGlobale.add(nTVA);
75
        nsGlobale.add(nTVA);
76
 
76
 
77
        // Compte pour les saisies guidées
77
        // Compte pour les saisies guidées
78
        final PrefTreeNode nCompte = new PrefTreeNode(EmptyPreferencePanel.class, "Préférences comptes", new String[] { "compte", "paye" });
78
        final PrefTreeNode nCompte = new PrefTreeNode(EmptyPreferencePanel.class, "Préférences comptes", new String[] { "compte", "paye" });
79
        final PrefTreeNode nCompteCloture = new PrefTreeNode(CompteCloturePreferencePanel.class, "Clôture", new String[] { "compte", "cloture" });
79
        final PrefTreeNode nCompteCloture = new PrefTreeNode(CompteCloturePreferencePanel.class, "Clôture", new String[] { "compte", "cloture" });
80
        final PrefTreeNode nCompteGestComm = new PrefTreeNode(CompteGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "compte" });
80
        final PrefTreeNode nCompteGestComm = new PrefTreeNode(CompteGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "compte" });
81
        final PrefTreeNode nComptePaye = new PrefTreeNode(ComptePayePreferencePanel.class, "Paye", new String[] { "compte" });
81
        final PrefTreeNode nComptePaye = new PrefTreeNode(ComptePayePreferencePanel.class, "Paye", new String[] { "compte" });
82
        nCompte.add(nCompteCloture);
82
        nCompte.add(nCompteCloture);
83
        nCompte.add(nCompteGestComm);
83
        nCompte.add(nCompteGestComm);
84
        nCompte.add(nComptePaye);
84
        nCompte.add(nComptePaye);
85
 
85
 
86
        nsGlobale.add(nCompte);
86
        nsGlobale.add(nCompte);
87
 
87
 
88
        // Compte de règlement
88
        // Compte de règlement
89
        final PrefTreeNode nReglement = new PrefTreeNode(EmptyPreferencePanel.class, "Compte de règlement", new String[] { "règlement", "compte" });
89
        final PrefTreeNode nReglement = new PrefTreeNode(EmptyPreferencePanel.class, "Compte de règlement", new String[] { "règlement", "compte" });
90
        final PrefTreeNode nCompteAchatRegl = new PrefTreeNode(ReglementCompteAchatPreferencePanel.class, "Achats", new String[] { "compte", "règlement" });
90
        final PrefTreeNode nCompteAchatRegl = new PrefTreeNode(ReglementCompteAchatPreferencePanel.class, "Achats", new String[] { "compte", "règlement" });
91
        final PrefTreeNode nCompteVenteRegl = new PrefTreeNode(ReglementCompteVentePreferencePanel.class, "Ventes", new String[] { "compte", "règlement" });
91
        final PrefTreeNode nCompteVenteRegl = new PrefTreeNode(ReglementCompteVentePreferencePanel.class, "Ventes", new String[] { "compte", "règlement" });
92
        nReglement.add(nCompteAchatRegl);
92
        nReglement.add(nCompteAchatRegl);
93
        nReglement.add(nCompteVenteRegl);
93
        nReglement.add(nCompteVenteRegl);
94
 
94
 
95
        nsGlobale.add(nReglement);
95
        nsGlobale.add(nReglement);
96
 
96
 
97
        nsGlobale.add(new PrefTreeNode(PayeGlobalPreferencePanel.class, "Paye", new String[] { "paye", "csg" }));
97
        nsGlobale.add(new PrefTreeNode(PayeGlobalPreferencePanel.class, "Paye", new String[] { "paye", "csg" }));
98
 
98
 
-
 
99
        // Comptabilité
-
 
100
        final PrefTreeNode nCompta = new PrefTreeNode(ComptabiliteWorkflowPreferencePanel.class, "Comptabilité", new String[] { "comptabilité", "lettrage" });
-
 
101
        nsGlobale.add(nCompta);
-
 
102
 
99
        // Gestion commerciale
103
        // Gestion commerciale
100
        final PrefTreeNode nGestionArticle = new PrefTreeNode(GestionArticlePreferencePanel.class, "Gestion des articles", new String[] { "articles", "gestion", "longueur", "largeur", "poids" });
104
        final PrefTreeNode nGestionArticle = new PrefTreeNode(GestionArticlePreferencePanel.class, "Gestion des articles", new String[] { "articles", "gestion", "longueur", "largeur", "poids" });
101
        final PrefTreeNode nGestionPiece = new PrefTreeNode(GestionPieceCommercialePanel.class, "Gestion des pièces commerciales", new String[] { "mouvements", "pieces", "facture" });
105
        final PrefTreeNode nGestionPiece = new PrefTreeNode(GestionPieceCommercialePanel.class, "Gestion des pièces commerciales", new String[] { "mouvements", "pieces", "facture" });
102
        nsPoste.add(nGestionArticle);
106
        nsPoste.add(nGestionArticle);
103
        nsPoste.add(nGestionPiece);
107
        nsPoste.add(nGestionPiece);
104
 
108
 
105
        // Mode de règlement par défaut
109
        // Mode de règlement par défaut
106
        final PrefTreeNode nModeRegl = new PrefTreeNode(ModeReglementDefautPrefPanel.class, "Mode de règlement par défaut", new String[] { "mode", "règlement", "défaut" });
110
        final PrefTreeNode nModeRegl = new PrefTreeNode(ModeReglementDefautPrefPanel.class, "Mode de règlement par défaut", new String[] { "mode", "règlement", "défaut" });
107
        nsGlobale.add(nModeRegl);
111
        nsGlobale.add(nModeRegl);
108
 
112
 
109
        // Société
113
        // Société
110
        final PrefTreeNode nSociete = new PrefTreeNode(SocietePreferencePanel.class, "Société", new String[] { "société" });
114
        final PrefTreeNode nSociete = new PrefTreeNode(SocietePreferencePanel.class, "Société", new String[] { "société" });
111
        nsGlobale.add(nSociete);
115
        nsGlobale.add(nSociete);
112
 
116
 
113
        // Numérotation
117
        // Numérotation
114
        final PrefTreeNode nNum = new PrefTreeNode(NumerotationPreferencePanel.class, "Numérotation", new String[] { "numérotation" });
118
        final PrefTreeNode nNum = new PrefTreeNode(NumerotationPreferencePanel.class, "Numérotation", new String[] { "numérotation" });
115
        nsGlobale.add(nNum);
119
        nsGlobale.add(nNum);
116
 
120
 
117
        nsGlobale.add(new PrefTreeNode(GestionArticleGlobalPreferencePanel.class, "Gestion des articles", new String[] { "articles", "stock" }));
121
        nsGlobale.add(new PrefTreeNode(GestionArticleGlobalPreferencePanel.class, "Gestion des articles", new String[] { "articles", "stock" }));
118
        nsGlobale.add(new PrefTreeNode(GenerationDocGlobalPreferencePanel.class, "Génération des Documents", new String[] { "documents" }));
122
        nsGlobale.add(new PrefTreeNode(GenerationDocGlobalPreferencePanel.class, "Génération des Documents", new String[] { "documents" }));
119
        nsGlobale.add(new PrefTreeNode(GestionClientPreferencePanel.class, "Gestion des clients", new String[] { "client", "service" }));
123
        nsGlobale.add(new PrefTreeNode(GestionClientPreferencePanel.class, "Gestion des clients", new String[] { "client", "service" }));
120
        nsGlobale.add(new PrefTreeNode(GestionCommercialeGlobalPreferencePanel.class, "Gestion des piéces commericales", new String[] { "transfert", "numéro" }));
124
        nsGlobale.add(new PrefTreeNode(GestionCommercialeGlobalPreferencePanel.class, "Gestion des piéces commericales", new String[] { "transfert", "numéro" }));
121
 
125
 
122
        // PayPal
126
        // PayPal
123
        final PrefTreeNode nPayPall = new PrefTreeNode(PayPalPreferencePanel.class, "PayPal", new String[] { "paypal", "facture" });
127
        final PrefTreeNode nPayPall = new PrefTreeNode(PayPalPreferencePanel.class, "PayPal", new String[] { "paypal", "facture" });
124
        nsGlobale.add(nPayPall);
128
        nsGlobale.add(nPayPall);
125
 
129
 
126
        // Impression
130
        // Impression
127
        final PrefTreeNode nPrint = new PrefTreeNode(EmptyPreferencePanel.class, "Impression", new String[] { "Impressions" });
131
        final PrefTreeNode nPrint = new PrefTreeNode(EmptyPreferencePanel.class, "Impression", new String[] { "Impressions" });
128
        final PrefTreeNode nPrintGestComm = new PrefTreeNode(ImpressionGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "impression" });
132
        final PrefTreeNode nPrintGestComm = new PrefTreeNode(ImpressionGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "impression" });
129
        final PrefTreeNode nPrintPaye = new PrefTreeNode(ImpressionPayePreferencePanel.class, "Paye", new String[] { "impression" });
133
        final PrefTreeNode nPrintPaye = new PrefTreeNode(ImpressionPayePreferencePanel.class, "Paye", new String[] { "impression" });
130
        final PrefTreeNode nPrintCompta = new PrefTreeNode(ImpressionComptaPreferencePanel.class, "Comptabilité", new String[] { "impression" });
134
        final PrefTreeNode nPrintCompta = new PrefTreeNode(ImpressionComptaPreferencePanel.class, "Comptabilité", new String[] { "impression" });
131
        nPrint.add(nPrintCompta);
135
        nPrint.add(nPrintCompta);
132
        nPrint.add(nPrintGestComm);
136
        nPrint.add(nPrintGestComm);
133
        nPrint.add(nPrintPaye);
137
        nPrint.add(nPrintPaye);
134
 
138
 
135
        nsPoste.add(nPrint);
139
        nsPoste.add(nPrint);
136
 
140
 
137
        // Emplacement des modéles
141
        // Emplacement des modéles
138
        final PrefTreeNode nGeneration = new PrefTreeNode(EmptyPreferencePanel.class, "Génération des documents", new String[] { "générations", "document" });
142
        final PrefTreeNode nGeneration = new PrefTreeNode(EmptyPreferencePanel.class, "Génération des documents", new String[] { "générations", "document" });
139
        final PrefTreeNode nLocModele = new PrefTreeNode(TemplatePreferencePanel.class, "Modèles", new String[] { "destination", "modèle", "modele" });
143
        final PrefTreeNode nLocModele = new PrefTreeNode(TemplatePreferencePanel.class, "Modèles", new String[] { "destination", "modèle", "modele" });
140
        nGeneration.add(nLocModele);
144
        nGeneration.add(nLocModele);
141
 
145
 
142
        // Destination des documents générés
146
        // Destination des documents générés
143
        final PrefTreeNode nDest = new PrefTreeNode(EmptyPreferencePanel.class, "Destination des documents", new String[] { "Destination", "document" });
147
        final PrefTreeNode nDest = new PrefTreeNode(EmptyPreferencePanel.class, "Destination des documents", new String[] { "Destination", "document" });
144
        final PrefTreeNode nDestCompta = new PrefTreeNode(GenerationDocumentComptaPreferencePanel.class, "Comptabilité", new String[] { "destination" });
148
        final PrefTreeNode nDestCompta = new PrefTreeNode(GenerationDocumentComptaPreferencePanel.class, "Comptabilité", new String[] { "destination" });
145
 
149
 
146
        final PrefTreeNode nDestGestComm = new PrefTreeNode(GenerationDocumentGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "destination" });
150
        final PrefTreeNode nDestGestComm = new PrefTreeNode(GenerationDocumentGestCommPreferencePanel.class, "Gestion commerciale", new String[] { "destination" });
147
        final PrefTreeNode nDestPaye = new PrefTreeNode(GenerationDocumentPayePreferencePanel.class, "Paye", new String[] { "destination" });
151
        final PrefTreeNode nDestPaye = new PrefTreeNode(GenerationDocumentPayePreferencePanel.class, "Paye", new String[] { "destination" });
148
        final PrefTreeNode nDestEtat = new PrefTreeNode(GenerationDeclarationDocPreferencePanel.class, "Déclaration", new String[] { "Déclaration", "destination" });
152
        final PrefTreeNode nDestEtat = new PrefTreeNode(GenerationDeclarationDocPreferencePanel.class, "Déclaration", new String[] { "Déclaration", "destination" });
149
        final PrefTreeNode nGED = new PrefTreeNode(AttachmentPreferencePanel.class, "GED", new String[] { "GED", "EDM" });
153
        final PrefTreeNode nGED = new PrefTreeNode(AttachmentPreferencePanel.class, "GED", new String[] { "GED", "EDM" });
150
 
154
 
151
        nDest.add(nDestCompta);
155
        nDest.add(nDestCompta);
152
        nDest.add(nGED);
156
        nDest.add(nGED);
153
        nDest.add(nDestGestComm);
157
        nDest.add(nDestGestComm);
154
        nDest.add(nDestPaye);
158
        nDest.add(nDestPaye);
155
        nDest.add(nDestEtat);
159
        nDest.add(nDestEtat);
156
        nGeneration.add(nDest);
160
        nGeneration.add(nDest);
157
        nsPoste.add(nGeneration);
161
        nsPoste.add(nGeneration);
158
 
162
 
159
        // Mail
163
        // Mail
160
        final PrefTreeNode nMail = new PrefTreeNode(EmailNode.class, "EMail", new String[] { "email", "mail", "courriel" });
164
        final PrefTreeNode nMail = new PrefTreeNode(EmailNode.class, "EMail", new String[] { "email", "mail", "courriel" });
161
        nsPoste.add(nMail);
165
        nsPoste.add(nMail);
162
 
166
 
163
        // add preferences for modules
167
        // add preferences for modules
164
        for (final AbstractModule module : moduleManager.getRunningModules().values()) {
168
        for (final AbstractModule module : moduleManager.getRunningModules().values()) {
165
            for (final Entry<Boolean, List<ModulePreferencePanelDesc>> e : module.getPrefDescriptorsByLocation(moduleManager.getRoot()).entrySet()) {
169
            for (final Entry<Boolean, List<ModulePreferencePanelDesc>> e : module.getPrefDescriptorsByLocation(moduleManager.getRoot()).entrySet()) {
166
                final DefaultMutableTreeNode node = e.getKey() ? nsPoste : nsGlobale;
170
                final DefaultMutableTreeNode node = e.getKey() ? nsPoste : nsGlobale;
167
                final List<ModulePreferencePanelDesc> descs = e.getValue();
171
                final List<ModulePreferencePanelDesc> descs = e.getValue();
168
                if (descs.size() > 1) {
172
                if (descs.size() > 1) {
169
                    // if there's more than one panel, create an additional level
173
                    // if there's more than one panel, create an additional level
170
                    final DefaultMutableTreeNode moduleNode = new PrefTreeNode(EmptyPreferencePanel.class, module.getName(), new String[] { module.getName() });
174
                    final DefaultMutableTreeNode moduleNode = new PrefTreeNode(EmptyPreferencePanel.class, module.getName(), new String[] { module.getName() });
171
                    for (final ModulePreferencePanelDesc desc : descs) {
175
                    for (final ModulePreferencePanelDesc desc : descs) {
172
                        moduleNode.add(desc.createTreeNode(module.getFactory(), null));
176
                        moduleNode.add(desc.createTreeNode(module.getFactory(), null));
173
                    }
177
                    }
174
                    node.add(moduleNode);
178
                    node.add(moduleNode);
175
                } else if (descs.size() == 1) {
179
                } else if (descs.size() == 1) {
176
                    // if there's only one panel it should be named like the module
180
                    // if there's only one panel it should be named like the module
177
                    node.add(descs.get(0).createTreeNode(module.getFactory(), module.getName()));
181
                    node.add(descs.get(0).createTreeNode(module.getFactory(), module.getName()));
178
                }
182
                }
179
            }
183
            }
180
        }
184
        }
181
 
185
 
182
        this.add(nsGlobale);
186
        this.add(nsGlobale);
183
        this.add(nsPoste);
187
        this.add(nsPoste);
184
    }
188
    }
185
}
189
}