Revision 80a540f2
Added by Patrick Plitzner about 5 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/type/CloneTypeWizard.java | ||
---|---|---|
9 | 9 |
package eu.etaxonomy.taxeditor.ui.section.name.type; |
10 | 10 |
|
11 | 11 |
import java.util.Collection; |
12 |
import java.util.stream.Collectors; |
|
12 | 13 |
|
13 | 14 |
import org.eclipse.jface.wizard.Wizard; |
14 | 15 |
|
15 | 16 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
17 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus; |
|
18 |
import eu.etaxonomy.cdm.model.name.TaxonName; |
|
16 | 19 |
|
17 | 20 |
/** |
18 | 21 |
* @author pplitzner |
... | ... | |
25 | 28 |
|
26 | 29 |
private final Collection<SpecimenTypeDesignation> typeDesignations; |
27 | 30 |
|
28 |
public CloneTypeWizard(Collection<SpecimenTypeDesignation> typeDesignations) { |
|
29 |
this.typeDesignations = typeDesignations; |
|
31 |
private final TaxonName taxonName; |
|
32 |
|
|
33 |
private SpecimenTypeDesignation baseTypeDesignation; |
|
34 |
|
|
35 |
private String accessionNumber; |
|
36 |
|
|
37 |
private eu.etaxonomy.cdm.model.occurrence.Collection collection; |
|
38 |
|
|
39 |
private SpecimenTypeDesignationStatus typeStatus; |
|
40 |
|
|
41 |
public CloneTypeWizard(TaxonName taxonName) { |
|
42 |
this.taxonName = taxonName; |
|
43 |
this.typeDesignations = taxonName.getTypeDesignations().stream() |
|
44 |
.filter(designation -> designation instanceof SpecimenTypeDesignation) |
|
45 |
.map(specimenTypeDesignation -> (SpecimenTypeDesignation)specimenTypeDesignation) |
|
46 |
.collect(Collectors.toList()); |
|
30 | 47 |
} |
31 | 48 |
|
32 | 49 |
@Override |
... | ... | |
35 | 52 |
addPage(page); |
36 | 53 |
} |
37 | 54 |
|
38 |
|
|
39 |
|
|
40 | 55 |
@Override |
41 | 56 |
public boolean performFinish() { |
57 |
this.baseTypeDesignation = page.getBaseTypeDesignation(); |
|
58 |
this.accessionNumber = page.getAccessionNumber(); |
|
59 |
this.collection = page.getCollection(); |
|
60 |
this.typeStatus = page.getTypeStatus(); |
|
42 | 61 |
return true; |
43 | 62 |
} |
44 | 63 |
|
64 |
public TaxonName getTaxonName() { |
|
65 |
return taxonName; |
|
66 |
} |
|
67 |
|
|
68 |
public SpecimenTypeDesignation getBaseTypeDesignation() { |
|
69 |
return baseTypeDesignation; |
|
70 |
} |
|
71 |
|
|
72 |
public String getAccessionNumber() { |
|
73 |
return accessionNumber; |
|
74 |
} |
|
75 |
|
|
76 |
public eu.etaxonomy.cdm.model.occurrence.Collection getCollection() { |
|
77 |
return collection; |
|
78 |
} |
|
79 |
|
|
80 |
public SpecimenTypeDesignationStatus getTypeStatus() { |
|
81 |
return typeStatus; |
|
82 |
} |
|
83 |
|
|
45 | 84 |
} |
Also available in: Unified diff
ref #6413 Implement type duplication in type detail section