Project

General

Profile

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

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

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

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

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

    
32
    public DerivateViewEditorInput() {
33
    }
34

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

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

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

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

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

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

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

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

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

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

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

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

    
94
}
(4-4/6)