3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
11 package eu
.etaxonomy
.taxeditor
.bulkeditor
.input
.entitycreator
;
13 import java
.util
.HashMap
;
16 import eu
.etaxonomy
.cdm
.api
.service
.IUserService
;
17 import eu
.etaxonomy
.cdm
.model
.common
.User
;
18 import eu
.etaxonomy
.taxeditor
.annotatedlineeditor
.IEntityCreator
;
19 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
23 * @created Mar 9, 2011
26 public class UserCreator
implements IEntityCreator
<User
>{
29 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.String)
32 public User
createEntity(String text
) {
33 return createEntity(null, text
);
37 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Object, java.lang.String)
40 public User
createEntity(Object key
, String text
) {
41 User user
= User
.NewInstance(text
, text
);
42 CdmStore
.getService(IUserService
.class).createUser(user
);
47 * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#getKeyLabelPairs()
50 public Map
<Object
, String
> getKeyLabelPairs() {
51 Map
<Object
, String
> result
= new HashMap
<Object
, String
>();
52 result
.put(User
.class, "User");