Revision 2108e10f
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java | ||
---|---|---|
61 | 61 |
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction; |
62 | 62 |
import eu.etaxonomy.cdm.vaadin.event.TypeDesignationWorkingsetEditorAction; |
63 | 63 |
import eu.etaxonomy.cdm.vaadin.event.registration.RegistrationWorkingsetAction; |
64 |
import eu.etaxonomy.cdm.vaadin.model.EntityReference; |
|
64 | 65 |
import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference; |
65 | 66 |
import eu.etaxonomy.cdm.vaadin.model.registration.RegistrationWorkingSet; |
66 | 67 |
import eu.etaxonomy.cdm.vaadin.security.AccessRestrictedView; |
... | ... | |
127 | 128 |
*/ |
128 | 129 |
private Map<Integer, RegistrationDetailsItem> registrationItemMap = new HashMap<>(); |
129 | 130 |
|
131 |
/** |
|
132 |
* uses the registrationId as key |
|
133 |
*/ |
|
134 |
private Map<Integer, EntityReference> typifiedNamesMap = new HashMap<>(); |
|
135 |
|
|
130 | 136 |
public RegistrationWorksetViewBean() { |
131 | 137 |
super(); |
132 | 138 |
} |
... | ... | |
266 | 272 |
|
267 | 273 |
protected int putRegistrationListComponent(int row, RegistrationDTO dto) { |
268 | 274 |
|
275 |
typifiedNamesMap.put(dto.getId(), dto.getTypifiedNameRef()); |
|
276 |
|
|
269 | 277 |
RegistrationItemNameAndTypeButtons regItemButtonGroup = new RegistrationItemNameAndTypeButtons(dto); |
270 | 278 |
Integer registrationEntityID = dto.getId(); |
271 | 279 |
|
... | ... | |
301 | 309 |
for(TypeDesignationWorkingSetButton workingsetButton : regItemButtonGroup.getTypeDesignationButtons()){ |
302 | 310 |
workingsetButton.getButton().addClickListener(e -> { |
303 | 311 |
TypedEntityReference baseEntityRef = workingsetButton.getBaseEntity(); |
312 |
EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityID); |
|
304 | 313 |
TypeDesignationWorkingSetType workingsetType = workingsetButton.getType(); |
305 | 314 |
getViewEventBus().publish(this, new TypeDesignationWorkingsetEditorAction( |
306 | 315 |
EditorActionType.EDIT, |
307 | 316 |
baseEntityRef, |
308 | 317 |
workingsetType, |
309 | 318 |
registrationEntityID, |
319 |
typifiedNameRef.getId(), |
|
310 | 320 |
e.getButton(), |
311 | 321 |
this, |
312 | 322 |
context |
... | ... | |
438 | 448 |
*/ |
439 | 449 |
protected void addNewTypeDesignationWorkingset(TypeDesignationWorkingSetType newWorkingsetType, Integer registrationEntityId, Window typeDesignationTypeCooser) { |
440 | 450 |
UI.getCurrent().removeWindow(typeDesignationTypeCooser); |
451 |
EntityReference typifiedNameRef = typifiedNamesMap.get(registrationEntityId); |
|
441 | 452 |
getViewEventBus().publish(this, new TypeDesignationWorkingsetEditorAction( |
442 | 453 |
EditorActionType.ADD, |
443 | 454 |
newWorkingsetType, |
444 | 455 |
registrationEntityId, |
456 |
typifiedNameRef.getId(), |
|
445 | 457 |
null, |
446 | 458 |
this |
447 | 459 |
)); |
Also available in: Unified diff
fix #7337 adding typifiedName reference to TypeDesignationWorkingsetEditorAction