Revision 4e6f2196
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/NomenclaturalCodePreferences.java | ||
---|---|---|
54 | 54 |
@Override |
55 | 55 |
protected Control createContents(Composite parent) { |
56 | 56 |
// PreferencesUtil.setPreferredNomenclaturalCode(null, false); |
57 |
|
|
57 |
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration(); |
|
58 |
if (controller != null){ |
|
59 |
IPreferenceService service = controller.getPreferenceService(); |
|
60 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.NomenclaturalCode); |
|
61 |
CdmPreference pref = service.find(key); |
|
62 |
if (pref != null){ |
|
63 |
actualCode = pref.getValue(); |
|
64 |
|
|
65 |
}else{ |
|
66 |
actualCode = PreferencesUtil.getPreferenceKey(PreferencesUtil.getPreferredNomenclaturalCode()); |
|
67 |
} |
|
68 |
} |
|
58 | 69 |
Composite composite = new Composite(parent, SWT.NULL); |
59 | 70 |
composite.setLayout(new GridLayout()); |
60 | 71 |
final CLabel description = new CLabel(composite, SWT.NULL); |
... | ... | |
123 | 134 |
if(!CdmStore.isActive()){ |
124 | 135 |
return; |
125 | 136 |
} |
126 |
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration(); |
|
127 |
if (controller != null){ |
|
128 |
IPreferenceService service = controller.getPreferenceService(); |
|
129 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.NomenclaturalCode); |
|
130 |
CdmPreference pref = service.find(key); |
|
131 |
if (pref != null){ |
|
132 |
actualCode = pref.getValue(); |
|
133 |
|
|
134 |
}else{ |
|
135 |
actualCode = PreferencesUtil.getPreferenceKey(PreferencesUtil.getPreferredNomenclaturalCode()); |
|
136 |
} |
|
137 |
} |
|
137 |
|
|
138 | 138 |
|
139 | 139 |
|
140 | 140 |
} |
Also available in: Unified diff
fix save of db preferences not available in db before