Project

General

Profile

Download (2.06 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2013 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.taxeditor.editor.view.derivate;
10

    
11
import java.util.Collection;
12
import java.util.Collections;
13
import java.util.UUID;
14

    
15
import org.eclipse.jface.resource.ImageDescriptor;
16
import org.eclipse.ui.IEditorInput;
17
import org.eclipse.ui.IPersistableElement;
18

    
19
/**
20
 * Editor input for the {@link DerivateView}
21
 *
22
 * @author pplitzner
23
 * @date Nov 11, 2015
24
 *
25
 */
26
public class DerivateViewEditorInput implements IEditorInput {
27

    
28
    private Collection<UUID> derivativeUuids;
29
    private UUID taxonUuid;
30

    
31
    public DerivateViewEditorInput() {
32
    }
33

    
34
    public DerivateViewEditorInput(UUID derivativeUuid, UUID taxonUuid) {
35
    	this(Collections.singleton(derivativeUuid), taxonUuid);
36
    }
37

    
38
    public DerivateViewEditorInput(Collection<UUID> derivativeUuids, UUID taxonUuid) {
39
        this.derivativeUuids = derivativeUuids;
40
        this.taxonUuid = taxonUuid;
41
    }
42

    
43
    public DerivateViewEditorInput(UUID derivativeUuid) {
44
    	this(derivativeUuid, null);
45
    }
46
    
47
    public DerivateViewEditorInput(Collection<UUID> derivativeUuids) {
48
        this(derivativeUuids, null);
49
    }
50

    
51
    public Collection<UUID> getDerivativeUuids() {
52
        return derivativeUuids;
53
    }
54

    
55
    public UUID getTaxonUuid() {
56
        return taxonUuid;
57
    }
58

    
59
    @Override
60
    public Object getAdapter(Class adapter) {
61
        return null;
62
    }
63

    
64
    @Override
65
    public boolean exists() {
66
        return false;
67
    }
68

    
69
    @Override
70
    public ImageDescriptor getImageDescriptor() {
71
        return null;
72
    }
73

    
74
    @Override
75
    public String getName() {
76
        return getEditorName();
77
    }
78

    
79
    @Override
80
    public IPersistableElement getPersistable() {
81
        return null;
82
    }
83

    
84
    @Override
85
    public String getToolTipText() {
86
        return getEditorName();
87
    }
88

    
89
    private String getEditorName() {
90
        return "Derivative Editor";
91
    }
92

    
93
}
(4-4/6)