Project

General

Profile

Download (1.97 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.Set;
12

    
13
import com.vaadin.ui.Component;
14

    
15
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
16
import eu.etaxonomy.vaadin.mvp.AbstractView;
17

    
18
/**
19
 * @author a.kohlbecker
20
 * @since Mar 22, 2017
21
 *
22
 */
23
public class TypeDesignationWorkingsetEditorAction extends AbstractEditorAction {
24

    
25
    private Set<Integer> entityIds;
26

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

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

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

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

    
51

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

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

    
72

    
73

    
74

    
75

    
76

    
77
}
(16-16/16)