commit aa95aad0606b24de8df073a2f2614e86ab91718b
Author: Patrick Plitzner <p.plitzner@bgbm.org>
Date:   Fri Oct 26 08:25:31 2018 +0200

    fix #7868 Allow creating a new vocabulary in vocabulary selection dialog

diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewVocabularyWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewVocabularyWizard.java
new file mode 100644
index 000000000..bda799f3b
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewVocabularyWizard.java
@@ -0,0 +1,52 @@
+/**
+* Copyright (C) 2014 EDIT
+* 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.
+*/
+package eu.etaxonomy.taxeditor.newWizard;
+
+import eu.etaxonomy.cdm.api.service.IVocabularyService;
+import eu.etaxonomy.cdm.model.common.TermType;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.store.CdmStore;
+
+/**
+ * @author pplitzner
+ * @date 11.03.2014
+ *
+ */
+public class NewVocabularyWizard  extends AbstractNewEntityWizard<TermVocabulary> {
+
+    private VocabularyWizardPage vocabularyPage;
+
+    @Override
+    public void addPages() {
+        vocabularyPage = new VocabularyWizardPage(formFactory, getConversationHolder(), getEntity());
+        addPage(vocabularyPage);
+    }
+
+    @Override
+    protected TermVocabulary createNewEntity() {
+        return TermVocabulary.NewInstance(TermType.Feature);
+    }
+
+    @Override
+    protected void saveEntity() {
+       CdmStore.getService(IVocabularyService.class).merge(getEntity(),true);
+
+    }
+
+    @Override
+    public void setEntity(TermVocabulary entity) {
+        super.setEntity(entity);
+        vocabularyPage.getDetailElement().setEntity(entity);
+    }
+
+    @Override
+    protected String getEntityName() {
+        return "Vocabulary";
+    }
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/VocabularyWizardPage.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/VocabularyWizardPage.java
new file mode 100644
index 000000000..86e60e4f9
--- /dev/null
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/VocabularyWizardPage.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright (C) 2014 EDIT
+ * 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.
+ */
+package eu.etaxonomy.taxeditor.newWizard;
+
+import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
+import eu.etaxonomy.cdm.model.common.TermVocabulary;
+import eu.etaxonomy.taxeditor.ui.element.AbstractCdmEntityWizardPage;
+import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
+import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
+import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
+import eu.etaxonomy.taxeditor.ui.section.vocabulary.TermVocabularyDetailElement;
+
+/**
+ * @author pplitzner
+ * @date 11.03.2014
+ *
+ */
+public class VocabularyWizardPage extends AbstractCdmEntityWizardPage<TermVocabulary> {
+
+    public VocabularyWizardPage(CdmFormFactory formFactory,
+            ConversationHolder conversation, TermVocabulary entity) {
+        super(formFactory, conversation, entity);
+        setTitle("General Vocabulary Data");
+    }
+
+    @Override
+    protected void checkComplete() {
+        setPageComplete(true);
+    }
+
+    @Override
+    public AbstractCdmDetailElement<TermVocabulary> createElement(ICdmFormElement rootElement) {
+        TermVocabularyDetailElement detailElement = formFactory.createTermVocabularyDetailElement(rootElement);
+        detailElement.setEntity(getEntity());
+        checkComplete();
+        return detailElement;
+    }
+
+}
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java
index d2e195fdf..c845f0c64 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/TermVocabularySelectionDialog.java
@@ -19,6 +19,7 @@ import eu.etaxonomy.cdm.api.service.IVocabularyService;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
 import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard;
+import eu.etaxonomy.taxeditor.newWizard.NewVocabularyWizard;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 
 /**
@@ -75,12 +76,12 @@ public class TermVocabularySelectionDialog extends
 
 	@Override
 	protected String[] getNewWizardText() {
-		return null;
+        return new String[]{ "New Vocabulary"};
 	}
 
 	@Override
 	protected AbstractNewEntityWizard getNewEntityWizard(String parameter) {
-		return null;
+        return new NewVocabularyWizard();
 	}
 
 }
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java
index 03fd75d6d..2b4728781 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/vocabulary/AbstractTermBaseDetailElement.java
@@ -10,6 +10,7 @@ package eu.etaxonomy.taxeditor.ui.section.vocabulary;
 
 import org.eclipse.swt.widgets.Button;
 
+import eu.etaxonomy.cdm.model.common.Language;
 import eu.etaxonomy.cdm.model.common.Representation;
 import eu.etaxonomy.cdm.model.common.TermBase;
 import eu.etaxonomy.cdm.model.common.TermVocabulary;
@@ -59,9 +60,13 @@ public abstract class AbstractTermBaseDetailElement<T extends TermBase> extends
         else if (eventSource == element_Representation) {
             Representation selectedRepresentation = element_Representation.getSelectedRepresentation();
             if(selectedRepresentation!=null){
-                getEntity().setLabel(selectedRepresentation.getLabel(),  selectedRepresentation.getLanguage());
-                getEntity().getRepresentation(selectedRepresentation.getLanguage()).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
-                getEntity().getRepresentation(selectedRepresentation.getLanguage()).setText(selectedRepresentation.getDescription());
+                Language representationLanguage = selectedRepresentation.getLanguage();
+                if(representationLanguage==null){
+                    representationLanguage = Language.getDefaultLanguage();
+                }
+                getEntity().setLabel(selectedRepresentation.getLabel(),  representationLanguage);
+                getEntity().getRepresentation(representationLanguage).setAbbreviatedLabel(selectedRepresentation.getAbbreviatedLabel());
+                getEntity().getRepresentation(representationLanguage).setText(selectedRepresentation.getDescription());
             }
             getEntity().setTitleCache(null);
         }
