add media bulk editor see #4730
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / bulkeditor / input / entitycreator / MediaCreator.java
1 // $Id$
2 /**
3 * Copyright (C) 2016 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.bulkeditor.input.entitycreator;
11
12 import java.util.HashMap;
13 import java.util.Map;
14
15 import eu.etaxonomy.cdm.model.media.Media;
16 import eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator;
17
18 /**
19 * @author k.luther
20 * @date 10.03.2016
21 *
22 */
23 public class MediaCreator implements IEntityCreator<Media> {
24
25 /**
26 * {@inheritDoc}
27 */
28 @Override
29 public Media createEntity(String text) {
30 Media result = Media.NewInstance();
31 result.setTitleCache(text);
32 return result;
33 }
34
35 /**
36 * {@inheritDoc}
37 */
38 @Override
39 public Media createEntity(Object key, String text) {
40 if (key.equals(Media.class)){
41 Media result = Media.NewInstance();
42 result.setTitleCache(text);
43 return result;
44 }
45 return null;
46 }
47
48 /**
49 * {@inheritDoc}
50 */
51 @Override
52 public Map<Object, String> getKeyLabelPairs() {
53 Map<Object, String> result = new HashMap<Object, String>();
54 result.put(Media.class, "Media");
55 return result;
56 }
57
58 /**
59 * {@inheritDoc}
60 */
61 @Override
62 public boolean savesEntity() {
63 // TODO Auto-generated method stub
64 return false;
65 }
66
67 }