Project

General

Profile

Download (2.86 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

    
13
import com.vaadin.ui.Component;
14

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

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

    
29
    private TypeDesignationWorkingSetType workingSetType;
30

    
31
    private int registrationId;
32

    
33
    private TypedEntityReference<IdentifiableEntity<?>> baseEntityRef;
34

    
35
    /**
36
     *
37
     * @param action
38
     * @param typeDesignationWorkingsetId
39
     * @param workingSetType
40
     * @param registrationId
41
     * @param source
42
     * @param sourceView
43
     */
44
    public TypeDesignationWorkingsetEditorAction(EditorActionType action, TypedEntityReference<IdentifiableEntity<?>> baseEntityRef,
45
            TypeDesignationWorkingSetType workingSetType, int registrationId, Component source, AbstractView sourceView, Stack<EditorActionContext> context) {
46
        super(action, null, source, sourceView);
47
        this.baseEntityRef = baseEntityRef;
48
        this.registrationId = registrationId;
49
        this.workingSetType = workingSetType;
50
        this.context = context;
51

    
52
    }
53

    
54
    /**
55
     *
56
     * @param action
57
     * @param workingSetType
58
     * @param registrationId
59
     * @param source
60
     * @param sourceView
61
     */
62
    public TypeDesignationWorkingsetEditorAction(EditorActionType action, TypeDesignationWorkingSetType workingSetType, int registrationId,
63
            Component source, AbstractView sourceView) {
64
        super(action, null, source, sourceView);
65
        this.workingSetType = workingSetType;
66
        this.registrationId = registrationId;
67
        this.context = new Stack<>();
68
        this.context.push(new EditorActionContext(new TypedEntityReference<Registration>(Registration.class, registrationId), sourceView));
69
    }
70

    
71

    
72

    
73
    /**
74
     *
75
     * @return
76
     */
77
    public TypeDesignationWorkingSetType getWorkingSetType() {
78
        return workingSetType;
79
    }
80

    
81
    /**
82
     * @return the registrationId
83
     */
84
    public int getRegistrationId() {
85
        return registrationId;
86
    }
87

    
88
    public Integer getTypeDesignationWorkingsetId(){
89
        return getEntityId();
90
    }
91

    
92
    /**
93
     * @return the baseEntityRef
94
     */
95
    public TypedEntityReference<IdentifiableEntity<?>> getBaseEntityRef() {
96
        return baseEntityRef;
97
    }
98

    
99

    
100
}
(21-21/22)