Revision 22d82e8b
Added by Andreas Kohlbecker almost 7 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/component/registration/RegistrationItemEditButtonGroup.java | ||
---|---|---|
16 | 16 |
import com.vaadin.ui.Label; |
17 | 17 |
import com.vaadin.ui.themes.ValoTheme; |
18 | 18 |
|
19 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
|
19 | 20 |
import eu.etaxonomy.cdm.vaadin.view.registration.RegistrationDTO; |
20 | 21 |
import eu.etaxonomy.vaadin.component.CompositeStyledComponent; |
21 | 22 |
|
... | ... | |
51 | 52 |
// no name in the registration! we only show the typified name as label |
52 | 53 |
addComponent(new Label(regDto.getTypifiedName().getLabel())); |
53 | 54 |
} |
54 |
if(regDto.getTypeDesignations() != null){ |
|
55 |
regDto.getTypeDesignations().keySet().iterator().forEachRemaining(key -> { |
|
56 |
Label label = new Label(key + ":"); |
|
55 |
if(regDto.getOrderdTypeDesignationEntitiyReferences() != null){ |
|
56 |
regDto.getOrderdTypeDesignationEntitiyReferences().keySet().iterator().forEachRemaining(baseEntityRef -> { |
|
57 |
String buttonLabel = SpecimenOrObservationBase.class.isAssignableFrom(baseEntityRef.getType()) ? "Type": "NameType"; |
|
58 |
Button tdButton = new Button(buttonLabel + ":"); |
|
59 |
addComponent(tdButton); |
|
60 |
typeDesignationButtons.add(new IdButton(baseEntityRef.getId(), tdButton)); |
|
61 |
|
|
62 |
Label label = new Label(baseEntityRef.getLabel()); |
|
57 | 63 |
label.setWidthUndefined(); |
58 | 64 |
addComponent(label); |
59 | 65 |
labels.add(label); |
60 | 66 |
|
61 |
regDto.getTypeDesignations().get(key).forEach(value -> { |
|
62 |
Button tdButton = new Button(value.getLabel()); |
|
63 |
addComponent(tdButton); |
|
64 |
typeDesignationButtons.add(new IdButton(value.getId(), tdButton)); |
|
65 |
}) ; |
|
67 |
|
|
66 | 68 |
}); |
67 | 69 |
} |
68 | 70 |
Button addTypeDesignationButton = new Button(FontAwesome.PLUS); |
Also available in: Unified diff
ref #6719 improved TypeDesignationConverter