Revision b81fb3cb
Added by Katja Luther about 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/DistributionColumnAccessor.java | ||
---|---|---|
160 | 160 |
|
161 | 161 |
} |
162 | 162 |
|
163 |
|
|
163 |
editor.descriptionsToSave.add(taxonWrapper); |
|
164 | 164 |
} |
165 | 165 |
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_DETAILS, true); |
166 | 166 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusComboBoxDataProvider.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.taxeditor.editor.view.checklist.e4; |
10 | 10 |
|
11 | 11 |
import java.util.ArrayList; |
12 |
import java.util.Collection; |
|
13 | 12 |
import java.util.Collections; |
14 | 13 |
import java.util.Comparator; |
15 | 14 |
import java.util.List; |
15 |
import java.util.UUID; |
|
16 | 16 |
|
17 | 17 |
import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider; |
18 | 18 |
|
19 | 19 |
import eu.etaxonomy.cdm.model.common.DefinedTermBase; |
20 | 20 |
import eu.etaxonomy.cdm.model.common.OrderedTermComparator; |
21 | 21 |
import eu.etaxonomy.cdm.model.common.Representation; |
22 |
import eu.etaxonomy.cdm.model.common.TermType; |
|
23 | 22 |
import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm; |
23 |
import eu.etaxonomy.cdm.model.metadata.PreferencePredicate; |
|
24 |
import eu.etaxonomy.taxeditor.preference.PreferencesUtil; |
|
24 | 25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
25 | 26 |
|
26 | 27 |
/** |
... | ... | |
50 | 51 |
noneTerm.setTitleCache(" - ", true); |
51 | 52 |
noneTerm.addRepresentation(Representation.NewInstance(" - ", "", "", CdmStore.getDefaultLanguage())); |
52 | 53 |
inputAll.add(noneTerm); |
53 |
Collection<DefinedTermBase> input = CdmStore.getTermManager().getPreferredTerms(TermType.PresenceAbsenceTerm); |
|
54 |
List<DefinedTermBase> inputList = new ArrayList(input); |
|
54 |
String statusString = PreferencesUtil.getStringValue(PreferencePredicate.AvailableDistributionStatus.getKey()); |
|
55 |
String [] statusArray = statusString.split(";"); |
|
56 |
List<UUID> uuidList = new ArrayList(); |
|
57 |
for (String status: statusArray){ |
|
58 |
uuidList.add(UUID.fromString(status)); |
|
59 |
} |
|
60 |
|
|
61 |
List<DefinedTermBase> inputList = CdmStore.getTermManager().getTerms(uuidList, PresenceAbsenceTerm.class); |
|
55 | 62 |
Comparator<DefinedTermBase> comp = new OrderedTermComparator<>(); |
56 | 63 |
Collections.sort(inputList, comp); |
57 | 64 |
Collections.sort(inputList, Collections.reverseOrder()); |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/StatusDataCellEditor.java | ||
---|---|---|
76 | 76 |
}else if (canonicalValue != null){ |
77 | 77 |
super.setCanonicalValue(canonicalValue); |
78 | 78 |
} |
79 |
// else{ |
|
80 |
// Object rowWrapper = editor.getBodyDataProvider().getRowObject(this.getRowIndex()); |
|
81 |
// Distribution newDistribution = Distribution.NewInstance(); |
|
82 |
// NamedArea area = editor.getAreaToColumnIndexMap().get(getColumnIndex()); |
|
83 |
// newDistribution.setArea(area); |
|
84 |
// if (editor.getDefaultSource() != null){ |
|
85 |
// newDistribution.addSource(DescriptionElementSource.NewPrimarySourceInstance(editor.getDefaultSource(), null)); |
|
86 |
// } |
|
87 |
// Map<NamedArea, Set<DescriptionElementBase>> distributionMap = editor.taxonDistributionMap.get(((TaxonDistributionDTO) rowWrapper).getTaxonUuid()); |
|
88 |
// if (distributionMap == null){ |
|
89 |
// distributionMap = new HashMap(); |
|
90 |
// editor.taxonDistributionMap.put(((TaxonDistributionDTO) rowWrapper).getTaxonUuid(),distributionMap); |
|
91 |
// } |
|
92 |
// Set<DescriptionElementBase> elements = distributionMap.get(area); |
|
93 |
// if (elements == null){ |
|
94 |
// elements = new HashSet<DescriptionElementBase>(); |
|
95 |
// distributionMap.put(area, elements); |
|
96 |
// } |
|
97 |
// elements.add(newDistribution); |
|
98 |
// Set<TaxonDescription> descriptionSet = ((TaxonDistributionDTO) rowWrapper).getDescriptionsWrapper().getDescriptions(); |
|
99 |
// Iterator<TaxonDescription> iterator = descriptionSet.iterator(); |
|
100 |
// if (iterator.hasNext()){ |
|
101 |
// TaxonDescription desc = iterator.next(); |
|
102 |
// desc.addElement(newDistribution); |
|
103 |
// editor.descriptionsToSave.add((TaxonDistributionDTO) rowWrapper); |
|
104 |
// }else{ |
|
105 |
// |
|
106 |
// TaxonDescription desc = TaxonDescription.NewInstance(); |
|
107 |
// desc.addElement(newDistribution); |
|
108 |
// ((TaxonDistributionDTO) rowWrapper).getDescriptionsWrapper().getDescriptions().add(desc); |
|
109 |
// editor.descriptionsToSave.add((TaxonDistributionDTO) rowWrapper); |
|
110 |
// } |
|
111 |
// } |
|
112 | 79 |
} |
113 | 80 |
|
114 | 81 |
@Override |
Also available in: Unified diff
ref #7854: fix saving problem