Revision 1d76231c
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java | ||
---|---|---|
11 | 11 |
import java.util.Arrays; |
12 | 12 |
import java.util.Collection; |
13 | 13 |
import java.util.HashMap; |
14 |
import java.util.HashSet; |
|
15 | 14 |
import java.util.List; |
16 | 15 |
import java.util.Map; |
17 |
import java.util.Set; |
|
18 |
import java.util.UUID; |
|
19 | 16 |
|
20 | 17 |
import org.eclipse.jface.preference.IPreferenceStore; |
21 | 18 |
import org.eclipse.jface.viewers.CheckStateChangedEvent; |
... | ... | |
31 | 28 |
import org.eclipse.swt.widgets.Composite; |
32 | 29 |
import org.eclipse.swt.widgets.Display; |
33 | 30 |
|
34 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
|
35 | 31 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
36 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
|
37 | 32 |
import eu.etaxonomy.taxeditor.editor.definedterm.TermContentProvider; |
38 | 33 |
import eu.etaxonomy.taxeditor.editor.definedterm.TermLabelProvider; |
39 | 34 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
... | ... | |
281 | 276 |
propertyPathsMap.put("terms", termsPropertyPaths); |
282 | 277 |
return propertyPathsMap; |
283 | 278 |
} |
284 |
@Override |
|
285 |
protected void initialiseVocabularies() { |
|
286 |
if (getVocabularies() != null) { |
|
287 |
getVocabularies().clear(); |
|
288 |
} |
|
289 |
String vocString = PreferencesUtil.getPreferenceStore().getString(PreferencesUtil.DISTRIBUTION_VOCABULARIES); |
|
290 |
String[] arrayVocs = vocString.split(","); |
|
291 |
|
|
292 |
Set<UUID> uuidVocs = new HashSet(); |
|
293 |
for (String voc: arrayVocs){ |
|
294 |
uuidVocs.add(UUID.fromString(voc)); |
|
295 |
} |
|
296 |
|
|
297 |
List<TermVocabulary> vocs = CdmStore.getService(IVocabularyService.class).find(uuidVocs); |
|
298 | 279 |
|
299 |
setVocabularies(vocs); |
|
300 |
} |
|
301 | 280 |
|
302 | 281 |
|
303 | 282 |
|
Also available in: Unified diff
ref #7063: better handling of preferences for distribution editor and other places