Project

General

Profile

Download (1.31 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2016 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.bulkeditor.input.entitycreator;
10

    
11
import java.util.HashMap;
12
import java.util.Map;
13

    
14
import eu.etaxonomy.cdm.model.media.Media;
15
import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
16

    
17
/**
18
 * @author k.luther
19
 * @date 10.03.2016
20
 */
21
public class MediaCreator implements IEntityCreator<Media> {
22

    
23
    @Override
24
    public Media createEntity(String text) {
25
        Media result = Media.NewInstance();
26
        result.setTitleCache(text);
27
        return result;
28
    }
29

    
30
    @Override
31
    public Media createEntity(Object key, String text) {
32
        if (key.equals(Media.class)){
33
            Media result = Media.NewInstance();
34
            result.setTitleCache(text);
35
            return result;
36
        }
37
        return null;
38
    }
39

    
40
    @Override
41
    public Map<Object, String> getKeyLabelPairs() {
42
        Map<Object, String> result = new HashMap<>();
43
        result.put(Media.class, "Media");
44
        return result;
45
    }
46

    
47
    @Override
48
    public boolean savesEntity() {
49
        // TODO Auto-generated method stub
50
        return false;
51
    }
52
}
(3-3/8)