Project

General

Profile

« Previous | Next » 

Revision c46954e3

Added by Andreas Kohlbecker almost 7 years ago

ref #6169 RelatedEntityListSelect (ToOneRelatedEntityField) edit and select working, add blocked by #6673

View differences:

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

  
11
import com.vaadin.ui.Component;
12

  
11 13
/**
12 14
 * @author a.kohlbecker
13 15
 * @since Mar 22, 2017
14 16
 *
15 17
 */
16
public abstract class AbstractEditorAction extends AbstractEntityEvent<AbstractEditorAction.Type> {
18
public abstract class AbstractEditorAction extends AbstractEntityEvent<AbstractEditorAction.Action> {
17 19

  
18
    public enum Type {
20
    public enum Action {
19 21
        ADD,
20 22
        EDIT,
21 23
        REMOVE;
22 24
    }
23 25

  
24
    public AbstractEditorAction(Type type) {
25
        super(type, null);
26
    private Component source = null;
27

  
28
    public AbstractEditorAction(Action action) {
29
        super(action, null);
30
    }
31

  
32
    public AbstractEditorAction(Action action, Component source) {
33
        this(action, null, source);
26 34
    }
27 35

  
28 36
    /**
29 37
     * @param type
30 38
     * @param citationId
31 39
     */
32
    public AbstractEditorAction(Type type, Integer entityId) {
33
        super(type, entityId);
40
    public AbstractEditorAction(Action action, Integer entityId) {
41
        super(action, entityId);
42
    }
43

  
44
    public AbstractEditorAction(Action action, Integer entityId, Component source) {
45
        super(action, entityId);
46
        this.source = source;
34 47
    }
35 48

  
36 49
    public boolean isAddAction() {
37
        return type.equals(Type.ADD);
50
        return type.equals(Action.ADD);
38 51
    }
52

  
39 53
    public boolean isEditAction() {
40
        return type.equals(Type.EDIT);
54
        return type.equals(Action.EDIT);
41 55
    }
56

  
42 57
    public boolean isRemoveAction() {
43
        return type.equals(Type.REMOVE);
58
        return type.equals(Action.REMOVE);
59
    }
60

  
61
    public Component getSource(){
62
        return source;
63
    }
64

  
65
    public boolean hasSource() {
66
        return source != null;
44 67
    }
45 68

  
46 69

  

Also available in: Unified diff