OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 149 Rev 156
Line 165... Line 165...
165
        CB, NAME, VERSION, STATE, LOCAL, REMOTE, DB_REQUIRED, ADMIN_REQUIRED
165
        CB, NAME, VERSION, STATE, LOCAL, REMOTE, DB_REQUIRED, ADMIN_REQUIRED
166
    }
166
    }
167
 
167
 
168
    static private final EnumSet<Columns> BOOLEAN_COLS = EnumSet.of(Columns.CB, Columns.LOCAL, Columns.REMOTE, Columns.DB_REQUIRED, Columns.ADMIN_REQUIRED);
168
    static private final EnumSet<Columns> BOOLEAN_COLS = EnumSet.of(Columns.CB, Columns.LOCAL, Columns.REMOTE, Columns.DB_REQUIRED, Columns.ADMIN_REQUIRED);
169
 
169
 
-
 
170
    private final ModuleManager mngr;
170
    private List<ModuleRow> list;
171
    private List<ModuleRow> list;
171
    private final Set<ModuleRow> selection;
172
    private final Set<ModuleRow> selection;
172
 
173
 
173
    private boolean valid;
174
    private boolean valid;
174
 
175
 
175
    public ModuleTableModel() {
176
    public ModuleTableModel(ModuleManager mngr) {
-
 
177
        this.mngr = mngr;
176
        this.selection = new HashSet<ModuleRow>();
178
        this.selection = new HashSet<ModuleRow>();
177
        this.list = Collections.emptyList();
179
        this.list = Collections.emptyList();
178
        this.valid = false;
180
        this.valid = false;
179
    }
181
    }
180
 
182
 
-
 
183
    public final ModuleManager getModuleManager() {
-
 
184
        return this.mngr;
-
 
185
    }
-
 
186
 
181
    final void clear() {
187
    final void clear() {
182
        this.selection.clear();
188
        this.selection.clear();
183
        this.list = Collections.emptyList();
189
        this.list = Collections.emptyList();
184
        this.fireTableDataChanged();
190
        this.fireTableDataChanged();
185
    }
191
    }
186
 
192
 
187
    public final void reload() throws IOException, SQLException {
193
    public final void reload() throws IOException, SQLException {
188
        final ModuleManager mngr = ModuleManager.getInstance();
194
        final ModuleManager mngr = this.getModuleManager();
189
        final InstallationState installationState = new InstallationState(mngr);
195
        final InstallationState installationState = new InstallationState(mngr);
190
        final Map<ModuleReference, ModuleFactory> available = new HashMap<ModuleReference, ModuleFactory>();
196
        final Map<ModuleReference, ModuleFactory> available = new HashMap<ModuleReference, ModuleFactory>();
191
        for (final Entry<String, SortedMap<ModuleVersion, ModuleFactory>> e : mngr.getFactories().entrySet()) {
197
        for (final Entry<String, SortedMap<ModuleVersion, ModuleFactory>> e : mngr.getFactories().entrySet()) {
192
            for (final Entry<ModuleVersion, ModuleFactory> e2 : e.getValue().entrySet()) {
198
            for (final Entry<ModuleVersion, ModuleFactory> e2 : e.getValue().entrySet()) {
193
                available.put(new ModuleReference(e.getKey(), e2.getKey()), e2.getValue());
199
                available.put(new ModuleReference(e.getKey(), e2.getKey()), e2.getValue());