package eu.etaxonomy.taxeditor.editor.definedterm.operation;\r
\r
import java.util.Collection;\r
+import java.util.HashSet;\r
import java.util.UUID;\r
\r
import org.eclipse.core.commands.ExecutionException;\r
import eu.etaxonomy.cdm.api.service.TermServiceImpl.TermMovePosition;\r
import eu.etaxonomy.cdm.persistence.dto.AbstractTermDto;\r
import eu.etaxonomy.cdm.persistence.dto.TermDto;\r
+import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;\r
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;\r
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;\r
import eu.etaxonomy.taxeditor.store.CdmStore;\r
public class MoveDefinedTermOperation extends AbstractPostTaxonOperation {\r
\r
private final Collection<TermDto> sourceTerms;// the actual DefinedTermBase(s) we are moving\r
+ private final Collection<TermVocabularyDto> sourceVocabularies;\r
private final AbstractTermDto targetTermOrVocabulary;// the target VOCABULARY or DefinedTerm we are moving these to\r
private final int currentLocation;\r
\r
this.targetTermOrVocabulary = target;\r
this.sourceTerms = sourceTerms;\r
this.currentLocation = currentLocation;\r
+ sourceVocabularies = new HashSet<>();\r
}\r
\r
@Override\r
public IStatus execute(IProgressMonitor monitor, IAdaptable info)\r
throws ExecutionException {\r
- sourceTerms.forEach(term->\r
- {\r
+ for(TermDto term:sourceTerms){\r
+ sourceVocabularies.add(term.getVocabularyDto());\r
UUID parentUuid = targetTermOrVocabulary.getUuid();\r
TermMovePosition termMovePosition = TermMovePosition.ON;\r
if(currentLocation == ViewerDropAdapter.LOCATION_BEFORE) {\r
termMovePosition = TermMovePosition.AFTER;\r
}\r
CdmStore.getService(ITermService.class).moveTerm(term, parentUuid, termMovePosition);\r
- });\r
- return postExecute(targetTermOrVocabulary);\r
+ }\r
+ Collection<AbstractTermDto> affectedObjects = new HashSet<>(sourceTerms);\r
+ affectedObjects.addAll(sourceVocabularies);\r
+ affectedObjects.add(targetTermOrVocabulary);\r
+ return postExecute(affectedObjects);\r
}\r
\r
@Override\r