*/
package eu.etaxonomy.taxeditor.featuretree.e4.handler;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import javax.inject.Named;
if (dialog.open() == IStatus.OK) {
Collection<DefinedTermBase> additionalTerms = wizard.getAdditionalFeatures();
+ List<DefinedTermBase> duplicates = new ArrayList<>();
for (DefinedTermBase term : additionalTerms) {
+ boolean isDuplicate = false;
if (!parent.getTree().isAllowDuplicate()){
- boolean isDuplicate = editor.checkDuplicates(term.getUuid(), parent.getTree().getUuid());
+ isDuplicate = editor.checkDuplicates(term.getUuid(), parent.getTree().getUuid());
if (isDuplicate){
- MessagingUtils.informationDialog(Messages.AddFeatureHandler_Duplicates_not_allowed, Messages.AddFeatureHandler_Duplicates_not_allowed_message);
- return;
+ duplicates.add(term);
}
}
-
+ if (isDuplicate){
+ continue;
+ }
AddFeatureOperation operation = new AddFeatureOperation(term.getUuid(), parent, editor, editor);
// AbstractUtility.executeOperation(operation, sync);
editor.addOperation(operation);
((AbstractTermTreeEditor)editor).getViewer().setExpandedElements(expandedElements);
}
}
+ if (!duplicates.isEmpty()){
+ String termsTitles = "";
+ for (DefinedTermBase term: duplicates){
+ termsTitles = termsTitles + term.getTitleCache() +"\n";
+ }
+ MessagingUtils.informationDialog(Messages.AddFeatureHandler_Duplicates_not_allowed, Messages.AddFeatureHandler_Duplicates_not_allowed_message + "\n"+termsTitles);
+ }
}
}
FeatureTreeSelectionDialog_TREE_LABEL=Term tree label
AddFeatureHandler_Duplicates_not_allowed=No duplicates allowed
-AddFeatureHandler_Duplicates_not_allowed_message=This term tree does not allow duplicates and there exist a node with this term already.
+AddFeatureHandler_Duplicates_not_allowed_message=This term tree does not allow duplicates and there exist nodes with following terms:
NonViralNameDetails_confirmDeleteOfZoologicalNameParts=The publication and original publication year needs to be removed
NonViralNameDetails_descriptionDeleteZoologicalNameParts=If you click Yes, the original publication and publication year is removed and the nomenclatural code is changed.
FeatureTreeSelectionDialog_TREE_LABEL=Termbaumname
AddFeatureHandler_Duplicates_not_allowed=Keine Duplikate erlaubt
-AddFeatureHandler_Duplicates_not_allowed_message=Der Termbaum erlaubt keine Duplikate und für diesen Term existiert bereits ein Knoten.
+AddFeatureHandler_Duplicates_not_allowed_message=Der Termbaum erlaubt keine Duplikate und für folgende Terme existieren bereits Knoten:
NonViralNameDetails_confirmDeleteOfZoologicalNameParts=Breed, Publication Date und Original Publication Date müssen entfernt werden.
NonViralNameDetails_descriptionDeleteZoologicalNameParts=Bestätigen Sie, wenn Sie Breed, Publication Date und Original Publication Date löschen und den Nomenklatorischen Code des Namens ändern wollen.