fixed ticket #3763
authorAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 9 Dec 2014 13:37:43 +0000 (13:37 +0000)
committerAlexander Oppermann <a.oppermann@bgbm.org>
Tue, 9 Dec 2014 13:37:43 +0000 (13:37 +0000)
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/entitycreator/ReferenceCreator.java

index 0bdd381a6b4911dbb6be274bd4ad5677c801348f..ff3190303b336560bfaf7a51b2fe3571669ec520 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -32,7 +32,8 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
         * @see eu.etaxonomy.taxeditor.bulkeditor.IEntityCreator#createEntity(java.lang.String)
         */
        /** {@inheritDoc} */
-       public Reference createEntity(String text) {
+       @Override
+    public Reference createEntity(String text) {
                return createEntity(Reference.class, text);
        }
 
@@ -40,9 +41,10 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
         * @see eu.etaxonomy.taxeditor.annotatedlineeditor.IEntityCreator#createEntity(java.lang.Class, java.lang.String)
         */
        /** {@inheritDoc} */
-       public Reference createEntity(Object key, String text) {
+       @Override
+    public Reference createEntity(Object key, String text) {
                Reference reference = null;
-               
+
                // TODO replace w more generic method when cdmlib matures accordingly
                if  (ReferenceType.Article.getMessage().equals(key)) {
                        reference = ReferenceFactory.newArticle();
@@ -92,6 +94,9 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
                if  (ReferenceType.WebPage.getMessage().equals(key)) {
                        reference = ReferenceFactory.newWebPage();
                }
+               if  (ReferenceType.Section.getMessage().equals(key)) {
+            reference = ReferenceFactory.newSection();
+        }
                if (reference == null) {
                        MessagingUtils.warn(getClass(), "Reference type " + key + " not found. Creating reference with default type.");
                        reference = ReferenceFactory.newGeneric();
@@ -108,7 +113,8 @@ public class ReferenceCreator implements IEntityCreator<Reference> {
         *
         * @return a {@link java.util.Map} object.
         */
-       public Map<Object, String> getKeyLabelPairs() {
+       @Override
+    public Map<Object, String> getKeyLabelPairs() {
                Map<Object, String> result = new HashMap<Object, String>();
                for (ReferenceType type : ReferenceType.values()) {
                        result.put(type.getMessage(), type.getMessage());