OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 65 Rev 156
Line 30... Line 30...
30
import javax.swing.JCheckBox;
30
import javax.swing.JCheckBox;
31
import javax.swing.JComponent;
31
import javax.swing.JComponent;
32
 
32
 
33
public abstract class ModulePreferencePanel extends JavaPrefPreferencePanel {
33
public abstract class ModulePreferencePanel extends JavaPrefPreferencePanel {
34
 
34
 
35
    static private DBRoot getRoot() {
-
 
36
        return ModuleManager.getInstance().getRoot();
-
 
37
    }
-
 
38
 
-
 
39
    static String getAppPrefPath() {
35
    static String getAppPrefPath() {
40
        return Configuration.getInstance().getAppID() + '/';
36
        return Configuration.getInstance().getAppID() + '/';
41
    }
37
    }
42
 
38
 
43
    public static class SQLPrefView<T> extends PrefView<T> {
39
    public static class SQLPrefView<T> extends PrefView<T> {
Line 75... Line 71...
75
                ((SQLSearchableTextCombo) comp).initCache(new ISQLListModel(createCache(prefPanel)).load());
71
                ((SQLSearchableTextCombo) comp).initCache(new ISQLListModel(createCache(prefPanel)).load());
76
            }
72
            }
77
        }
73
        }
78
 
74
 
79
        private ITextComboCacheSQL createCache(final JavaPrefPreferencePanel prefPanel) {
75
        private ITextComboCacheSQL createCache(final JavaPrefPreferencePanel prefPanel) {
80
            return new ITextComboCacheSQL(getRoot(), prefPanel.getPrefPath() + '/' + this.getPrefKey());
76
            return new ITextComboCacheSQL(((ModulePreferencePanel) prefPanel).getRoot(), prefPanel.getPrefPath() + '/' + this.getPrefKey());
81
        }
77
        }
82
    }
78
    }
83
 
79
 
-
 
80
    private final DBRoot root;
-
 
81
 
84
    public ModulePreferencePanel(final String title) {
82
    public ModulePreferencePanel(final DBRoot root, final String title) {
85
        super(title, null);
83
        super(title, null);
-
 
84
        this.root = root;
-
 
85
    }
86
 
86
 
-
 
87
    public final DBRoot getRoot() {
-
 
88
        return this.root;
87
    }
89
    }
88
 
90
 
89
    public final void init(final ModuleFactory module, final boolean local) {
91
    public final void init(final ModuleFactory module, final boolean local) {
90
        this.setPrefs(module.getPreferences(local, getRoot()));
92
        this.setPrefs(module.getPreferences(local, this.getRoot()));
91
    }
93
    }
92
}
94
}