Revision 432276e4
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/AbcdImportPreference.java | ||
---|---|---|
25 | 25 |
import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator; |
26 | 26 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference; |
27 | 27 |
import eu.etaxonomy.cdm.model.metadata.CdmPreference.PrefKey; |
28 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
29 | 28 |
import eu.etaxonomy.cdm.model.metadata.PreferenceSubject; |
30 | 29 |
import eu.etaxonomy.cdm.model.name.NomenclaturalCode; |
31 | 30 |
import eu.etaxonomy.taxeditor.l10n.Messages; |
31 |
import eu.etaxonomy.taxeditor.preference.EditorPreferencePredicate; |
|
32 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
32 | 33 |
import eu.etaxonomy.taxeditor.preference.menu.CdmPreferencePage; |
33 | 34 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
34 | 35 |
|
... | ... | |
55 | 56 |
configurator = Abcd206ImportConfigurator.NewInstance(null,null); |
56 | 57 |
ICdmRepository controller; |
57 | 58 |
controller = CdmStore.getCurrentApplicationConfiguration(); |
58 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), PreferencePredicate.AbcdImportConfig); |
|
59 |
PrefKey key = CdmPreference.NewKey(PreferenceSubject.NewTaxEditorInstance(), EditorPreferencePredicate.AbcdImportConfig);
|
|
59 | 60 |
|
60 | 61 |
if (controller == null){ |
61 | 62 |
return null; |
... | ... | |
65 | 66 |
if (preference != null ){ |
66 | 67 |
allowOverride = preference.isAllowOverride(); |
67 | 68 |
}else{ |
68 |
preference = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AbcdImportConfig, configurator.toString()); |
|
69 |
preference = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.AbcdImportConfig, configurator.toString());
|
|
69 | 70 |
} |
70 | 71 |
|
71 | 72 |
if (preference != null){ |
... | ... | |
110 | 111 |
configurator.setOverwriteExistingSpecimens(Boolean.valueOf(valueString)); |
111 | 112 |
}else if (keyString.equals("nomenclaturalCode")){ //$NON-NLS-1$ |
112 | 113 |
configurator.setNomenclaturalCode(NomenclaturalCode.fromString(valueString)); |
114 |
}else if (keyString.equals("getSiblings")){ //$NON-NLS-1$ |
|
115 |
configurator.setGetSiblings(Boolean.valueOf(valueString)); |
|
116 |
}else if (keyString.equals("removeCountryFromLocalityText")){ //$NON-NLS-1$ |
|
117 |
configurator.setRemoveCountryFromLocalityText(Boolean.valueOf(valueString)); |
|
113 | 118 |
} |
119 |
|
|
114 | 120 |
} |
115 | 121 |
|
116 | 122 |
} |
... | ... | |
224 | 230 |
checkBoxImportSiblings.addSelectionListener(new SelectionAdapter() { |
225 | 231 |
@Override |
226 | 232 |
public void widgetSelected(SelectionEvent e) { |
227 |
configurator.setGetSiblings(checkBoxImportSiblings.getSelection());
|
|
233 |
configurator.setGetSiblings(!configurator.isGetSiblings());
|
|
228 | 234 |
} |
229 | 235 |
}); |
230 | 236 |
|
... | ... | |
260 | 266 |
checkBoxReuseExistingTaxa.addSelectionListener(new SelectionAdapter() { |
261 | 267 |
@Override |
262 | 268 |
public void widgetSelected(SelectionEvent e) { |
263 |
configurator.setReuseExistingDescriptiveGroups(!configurator.isReuseExistingDescriptiveGroups());
|
|
269 |
configurator.setReuseExistingTaxaWhenPossible(!configurator.isReuseExistingTaxaWhenPossible());
|
|
264 | 270 |
} |
265 | 271 |
}); |
266 | 272 |
|
... | ... | |
318 | 324 |
if (configurator != null){ |
319 | 325 |
String configString = configurator.toString(); |
320 | 326 |
|
321 |
CdmPreference pref = CdmPreference.NewTaxEditorInstance(PreferencePredicate.AbcdImportConfig, configString); |
|
327 |
CdmPreference pref = CdmPreference.NewTaxEditorInstance(EditorPreferencePredicate.AbcdImportConfig, configString);
|
|
322 | 328 |
pref.setAllowOverride(allowOverride); |
323 | 329 |
|
324 | 330 |
ICdmRepository controller = CdmStore.getCurrentApplicationConfiguration(); |
... | ... | |
327 | 333 |
} |
328 | 334 |
IPreferenceService service = controller.getPreferenceService(); |
329 | 335 |
service.set(pref); |
336 |
PreferencesUtil.updateDBPreferences(); |
|
330 | 337 |
|
331 | 338 |
} |
332 | 339 |
return true; |
Also available in: Unified diff
ref #7849: harmonize admin and local preferences for distribution editor and use drop down instead of radio buttons