Project

General

Profile

Download (3.24 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.vaadin.event;
10

    
11
import java.util.Stack;
12
import java.util.UUID;
13

    
14
import com.vaadin.ui.Component;
15

    
16
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
17
import eu.etaxonomy.cdm.model.name.Registration;
18
import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference;
19
import eu.etaxonomy.cdm.vaadin.util.converter.TypeDesignationSetManager.TypeDesignationWorkingSetType;
20
import eu.etaxonomy.vaadin.event.EditorActionType;
21
import eu.etaxonomy.vaadin.mvp.AbstractView;
22

    
23
/**
24
 * @author a.kohlbecker
25
 * @since Mar 22, 2017
26
 *
27
 */
28
public class TypeDesignationWorkingsetEditorAction extends AbstractEditorAction {
29

    
30
    private TypeDesignationWorkingSetType workingSetType;
31

    
32
    private UUID registrationUuid;
33

    
34
    private UUID typifiedNameUuid;
35

    
36
    private TypedEntityReference<IdentifiableEntity<?>> baseEntityRef;
37

    
38
    /**
39
     *
40
     * @param action
41
     * @param baseEntityRef
42
     * @param workingSetType
43
     * @param registrationId
44
     * @param source
45
     * @param sourceView
46
     */
47
    public TypeDesignationWorkingsetEditorAction(EditorActionType action, TypedEntityReference<IdentifiableEntity<?>> baseEntityRef,
48
            TypeDesignationWorkingSetType workingSetType,
49
            UUID registrationUuid, UUID typifiedNameUuid,
50
            Component source, AbstractView sourceView, Stack<EditorActionContext> context) {
51
        super(action, null, source, sourceView);
52
        this.baseEntityRef = baseEntityRef;
53
        this.registrationUuid = registrationUuid;
54
        this.typifiedNameUuid = typifiedNameUuid;
55
        this.workingSetType = workingSetType;
56
        this.context = context;
57

    
58
    }
59

    
60
    /**
61
     *
62
     * @param action
63
     * @param workingSetType
64
     * @param registrationUuid
65
     * @param source
66
     * @param sourceView
67
     */
68
    public TypeDesignationWorkingsetEditorAction(EditorActionType action, TypeDesignationWorkingSetType workingSetType,
69
            UUID registrationUuid, UUID typifiedNameUuid,
70
            Component source, AbstractView sourceView) {
71
        super(action, null, source, sourceView);
72
        this.workingSetType = workingSetType;
73
        this.registrationUuid = registrationUuid;
74
        this.typifiedNameUuid = typifiedNameUuid;
75
        this.context = new Stack<>();
76
        this.context.push(new EditorActionContext(new TypedEntityReference<Registration>(Registration.class, registrationUuid), sourceView));
77
    }
78

    
79

    
80

    
81
    /**
82
     *
83
     * @return
84
     */
85
    public TypeDesignationWorkingSetType getWorkingSetType() {
86
        return workingSetType;
87
    }
88

    
89
    /**
90
     * @return the registrationUuid
91
     */
92
    public UUID getRegistrationUuid() {
93
        return registrationUuid;
94
    }
95

    
96
    public UUID getTypeDesignationWorkingsetUuid(){
97
        return getEntityUuid();
98
    }
99

    
100
    /**
101
     * @return the baseEntityRef
102
     */
103
    public TypedEntityReference<IdentifiableEntity<?>> getBaseEntityRef() {
104
        return baseEntityRef;
105
    }
106

    
107
    /**
108
     * @return the typifiedNameUuid
109
     */
110
    public UUID getTypifiedNameUuid() {
111
        return typifiedNameUuid;
112
    }
113

    
114

    
115
}
(21-21/22)