Project

General

Profile

« Previous | Next » 

Revision fdb645e1

Added by Andreas Kohlbecker almost 7 years ago

ref #6724 implementing SpecimenTypeDesignationWorkingSetDTO as editor dto and modifying the TypeDesignationConverter accordingly

  • SpecimenTypeDesignation editor operates on SpecimenTypeDesignationWorkingSetDTO
  • TypeDesignationConverter.TypeDesignationWorkingSet have field for the baseEntity

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/event/TypeDesignationWorkingsetEditorAction.java
8 8
*/
9 9
package eu.etaxonomy.cdm.vaadin.event;
10 10

  
11
import java.util.Set;
12

  
13 11
import com.vaadin.ui.Component;
14 12

  
15 13
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
......
22 20
 */
23 21
public class TypeDesignationWorkingsetEditorAction extends AbstractEditorAction {
24 22

  
25
    private Set<Integer> entityIds;
26

  
27 23
    private Class<? extends TypeDesignationBase<?>> newEntityType;
28 24

  
25
    private int registrationId;
26

  
29 27
    /**
30 28
     * @param edit
31 29
     * @param ids
32 30
     */
33
    public TypeDesignationWorkingsetEditorAction(Action action, Set<Integer> ids, Component source, AbstractView sourceView) {
34
        super(action, null, source, sourceView);
35
        this.entityIds = ids;
31
    public TypeDesignationWorkingsetEditorAction(Action action, Integer typeDesignationWorkingsetId, int registrationId, Component source, AbstractView sourceView) {
32
        super(action, typeDesignationWorkingsetId, source, sourceView);
33
        this.registrationId = registrationId;
36 34
    }
37 35

  
38 36
    /**
39 37
     * Constructor which is mainly suitable for ADD actions.
40 38
     * @param
41 39
     */
42
    public TypeDesignationWorkingsetEditorAction(Action action, Class<? extends TypeDesignationBase<?>> newEntityType, Component source, AbstractView sourceView) {
40
    public TypeDesignationWorkingsetEditorAction(Action action, Class<? extends TypeDesignationBase<?>> newEntityType, int registrationId,
41
            Component source, AbstractView sourceView) {
43 42
        super(action, null, source, sourceView);
44 43
        this.newEntityType = newEntityType;
44
        this.registrationId = registrationId;
45 45
    }
46 46

  
47
    public Set<Integer> getEntityIds() {
48
        return entityIds;
49
    }
50

  
51

  
52 47
    /**
53 48
     * In case of an ADD action the receiver of the event needs to know the specific type of the
54 49
     * TypeDesignationBase instance to be created.
55 50
     *
56 51
     * @return the newEntityType
57 52
     */
58
    protected Class<? extends TypeDesignationBase<?>> getNewEntityType() {
53
    public Class<? extends TypeDesignationBase<?>> getNewEntityType() {
59 54
        return newEntityType;
60 55
    }
61 56

  
62 57
    /**
63
     * {@inheritDoc}
64
     * @deprecated this method must not be used in TypeDesignationSetEditorAction
58
     * @return the registrationId
65 59
     */
66
    @Deprecated
67
    @Override
68
    public Integer getEntityId() {
69
        throw new RuntimeException("getEntityId() is not supported, use getEntityIds() instead.");
60
    public int getRegistrationId() {
61
        return registrationId;
70 62
    }
71 63

  
72 64

  
73 65

  
74 66

  
75 67

  
76

  
77 68
}

Also available in: Unified diff