Merge branch 'release/5.11.0'
[taxeditor.git] / eu.etaxonomy.taxeditor.bulkeditor / src / main / java / eu / etaxonomy / taxeditor / annotatedlineeditor / e4 / handler / NewObjectHandlerE4.java
index 1f689ad628ed000f76166f1342dc19ca79abdde6..89a45116129327dfbb265f1184590a6e3701d795 100644 (file)
@@ -29,6 +29,7 @@ import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
 import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.GroupCreator;
 import eu.etaxonomy.taxeditor.bulkeditor.input.entitycreator.UserCreator;
+import eu.etaxonomy.taxeditor.l10n.Messages;
 
 /**
  *
@@ -65,7 +66,7 @@ public class NewObjectHandlerE4 {
                     @Override
                     public String isValid(String text) {
                         if(text == null || text.isEmpty()) {
-                            return "Input cannot be empty";
+                            return Messages.GROUP_CREATOR_Name_not_accepted_message;
                         }
                         return null;
                     }
@@ -83,12 +84,17 @@ public class NewObjectHandlerE4 {
                 }
                 bulkEditor.getEditorInput().getModel().add(createdEntity);
                 if (createdEntity instanceof CdmBase){
-                    bulkEditor.getEditorInput().addSaveCandidate((CdmBase)createdEntity);
+                    if (!((CdmBase)createdEntity).isPersited()){
+                        bulkEditor.getEditorInput().addSaveCandidate((CdmBase)createdEntity);
+                        bulkEditor.setDirty();
+                    }
+
                 }
                 IStructuredSelection selection = new StructuredSelection(createdEntity);
 
                 bulkEditor.refresh();
-                bulkEditor.setDirty();
+
+
                 bulkEditor.setFocus();
 
                 bulkEditor.setSelection(selection);