Revision e8674a36
Added by Andreas Kohlbecker about 6 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java | ||
---|---|---|
12 | 12 |
import java.util.Collection; |
13 | 13 |
import java.util.EnumSet; |
14 | 14 |
import java.util.List; |
15 |
import java.util.Stack; |
|
15 | 16 |
import java.util.UUID; |
16 | 17 |
|
17 | 18 |
import org.springframework.security.core.GrantedAuthority; |
... | ... | |
45 | 46 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationItemEditButtonGroup.TypeDesignationWorkingSetButton; |
46 | 47 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStateLabel; |
47 | 48 |
import eu.etaxonomy.cdm.vaadin.component.registration.RegistrationStyles; |
49 |
import eu.etaxonomy.cdm.vaadin.event.AbstractEditorAction.EditorActionContext; |
|
48 | 50 |
import eu.etaxonomy.cdm.vaadin.event.RegistrationEditorAction; |
49 | 51 |
import eu.etaxonomy.cdm.vaadin.event.ShowDetailsEvent; |
50 | 52 |
import eu.etaxonomy.cdm.vaadin.event.TaxonNameEditorAction; |
... | ... | |
265 | 267 |
Component regItem; |
266 | 268 |
|
267 | 269 |
RegistrationItemEditButtonGroup editButtonGroup = new RegistrationItemEditButtonGroup(dto); |
270 |
Integer registrationEntityID = dto.getId(); |
|
271 |
Stack<EditorActionContext> context = new Stack<EditorActionContext>(); |
|
272 |
context.push(new EditorActionContext( |
|
273 |
new TypedEntityReference<>(Registration.class, registrationEntityID), |
|
274 |
this) |
|
275 |
); |
|
268 | 276 |
|
269 | 277 |
if(editButtonGroup.getNameButton() != null){ |
270 | 278 |
editButtonGroup.getNameButton().getButton().addClickListener(e -> { |
... | ... | |
273 | 281 |
EditorActionType.EDIT, |
274 | 282 |
nameId, |
275 | 283 |
e.getButton(), |
276 |
this |
|
284 |
this, |
|
285 |
context |
|
277 | 286 |
) |
278 | 287 |
); |
279 | 288 |
}); |
... | ... | |
283 | 292 |
workingsetButton.getButton().addClickListener(e -> { |
284 | 293 |
TypedEntityReference baseEntityRef = workingsetButton.getBaseEntity(); |
285 | 294 |
TypeDesignationWorkingSetType workingsetType = workingsetButton.getType(); |
286 |
Integer registrationEntityID = dto.getId(); |
|
287 | 295 |
getViewEventBus().publish(this, new TypeDesignationWorkingsetEditorAction( |
288 | 296 |
EditorActionType.EDIT, |
289 | 297 |
baseEntityRef, |
290 | 298 |
workingsetType, |
291 | 299 |
registrationEntityID, |
292 | 300 |
e.getButton(), |
293 |
this |
|
301 |
this, |
|
302 |
context |
|
294 | 303 |
) |
295 | 304 |
); |
296 | 305 |
}); |
Also available in: Unified diff
ref #7195 introducing the concept of EditorActionContext stacks to facilitate creating blocking relations