Revision 1d76231c
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractAreaSelectionWizard.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.Arrays; |
13 |
import java.util.HashSet; |
|
13 | 14 |
import java.util.List; |
15 |
import java.util.Set; |
|
14 | 16 |
import java.util.UUID; |
15 | 17 |
|
16 | 18 |
import org.eclipse.jface.viewers.CheckboxTableViewer; |
... | ... | |
22 | 24 |
import eu.etaxonomy.cdm.api.service.ITermService; |
23 | 25 |
import eu.etaxonomy.cdm.api.service.IVocabularyService; |
24 | 26 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
25 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
26 | 27 |
import eu.etaxonomy.cdm.model.common.TermVocabulary; |
28 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
27 | 29 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
28 | 30 |
|
29 | 31 |
/** |
... | ... | |
36 | 38 |
private ColumnViewer viewer; |
37 | 39 |
private List<TermVocabulary<DefinedTermBase>> vocabularies = new ArrayList<>(); |
38 | 40 |
|
41 |
|
|
39 | 42 |
/** |
40 | 43 |
* @param pageName |
41 | 44 |
*/ |
... | ... | |
67 | 70 |
this.vocabularies.add(vocabulary); |
68 | 71 |
} |
69 | 72 |
|
70 |
protected void initialiseVocabularies() { |
|
71 |
if (getVocabularies() != null) { |
|
72 |
getVocabularies().clear(); |
|
73 |
} |
|
74 |
List<TermVocabulary<DefinedTermBase>> vocs = CdmStore.getService(IVocabularyService.class).findByTermType( |
|
75 |
TermType.NamedArea, null); |
|
76 |
|
|
77 |
vocabularies = vocs; |
|
78 |
} |
|
79 | 73 |
|
80 | 74 |
/** |
81 | 75 |
* @param vocs |
... | ... | |
93 | 87 |
getViewer().setInput(getVocabularies()); |
94 | 88 |
|
95 | 89 |
if (grayedValues != null && grayedValues != "") { |
96 |
String[] listGrayed = grayedValues.split(",");
|
|
90 |
String[] listGrayed = grayedValues.split(";");
|
|
97 | 91 |
ArrayList listGrayedTerms = new ArrayList(); |
98 | 92 |
getTermsFromStringValues(listGrayed, listGrayedTerms); |
99 | 93 |
for(Object element : listGrayedTerms){ |
... | ... | |
140 | 134 |
} |
141 | 135 |
} |
142 | 136 |
|
137 |
|
|
138 |
protected void initialiseVocabularies() { |
|
139 |
if (getVocabularies() != null) { |
|
140 |
getVocabularies().clear(); |
|
141 |
} |
|
142 |
|
|
143 |
String vocString = PreferencesUtil.getPreferenceStore().getString(PreferencesUtil.DISTRIBUTION_VOCABULARIES); |
|
144 |
String[] arrayVocs = vocString.split(";"); |
|
145 |
|
|
146 |
Set<UUID> uuidVocs = new HashSet(); |
|
147 |
for (String voc: arrayVocs){ |
|
148 |
uuidVocs.add(UUID.fromString(voc)); |
|
149 |
} |
|
150 |
|
|
151 |
List<TermVocabulary> vocs = CdmStore.getService(IVocabularyService.class).find(uuidVocs); |
|
152 |
|
|
153 |
setVocabularies(vocs); |
|
154 |
} |
|
155 |
|
|
156 |
|
|
143 | 157 |
} |
Also available in: Unified diff
ref #7063: better handling of preferences for distribution editor and other places