Revision a6584bc2
Added by Andreas Kohlbecker about 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/phycobank/RegistrationDTO.java | ||
---|---|---|
12 | 12 |
|
13 | 13 |
import eu.etaxonomy.cdm.mock.Registration; |
14 | 14 |
import eu.etaxonomy.cdm.mock.RegistrationStatus; |
15 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
|
16 |
import eu.etaxonomy.cdm.vaadin.util.TypeDesignationConverter; |
|
15 | 17 |
|
16 | 18 |
public class RegistrationDTO{ |
17 | 19 |
|
... | ... | |
25 | 27 |
|
26 | 28 |
/** |
27 | 29 |
* @param reg |
30 |
* @param typifiedName should be provided in for Registrations for TypeDesignations |
|
28 | 31 |
*/ |
29 |
public RegistrationDTO(Registration reg) { |
|
32 |
public RegistrationDTO(Registration reg, TaxonNameBase typifiedName) {
|
|
30 | 33 |
|
31 | 34 |
this.reg = reg; |
32 | 35 |
|
... | ... | |
34 | 37 |
if(registrationType.isName()){ |
35 | 38 |
summary = reg.getName().getTitleCache(); |
36 | 39 |
} else if(registrationType.isTypification()){ |
37 |
StringBuffer sb = new StringBuffer(); |
|
38 |
reg.getTypeDesignations().forEach(td -> sb.append(td.toString()).append(' ')); |
|
39 |
summary = sb.toString(); |
|
40 |
summary = new TypeDesignationConverter(reg.getTypeDesignations(), typifiedName) |
|
41 |
.buildString().print(); |
|
40 | 42 |
} else { |
41 | 43 |
summary = "- INVALID REGISTRATION -"; |
42 | 44 |
} |
Also available in: Unified diff
ref #6169 compact string representations for registrations