ref #8263 Only refresh edited terms when saving
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 8 May 2019 11:40:03 +0000 (13:40 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 8 May 2019 11:53:45 +0000 (13:53 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java

index 142a3f6..07e7b77 100644 (file)
@@ -170,16 +170,19 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
                getConversationHolder().commit();
                for(TermBase term:changedTerms){
             if(term.isInstanceOf(DefinedTermBase.class)){
-                CdmStore.getService(ITermService.class).merge((DefinedTermBase) term);
+                DefinedTermBase definedTermBase = (DefinedTermBase) term;
+                CdmStore.getService(ITermService.class).merge(definedTermBase);
+                viewer.refresh(TermDto.fromTerm(definedTermBase));
             }
             else if(term.isInstanceOf(TermVocabulary.class)){
-                CdmStore.getService(IVocabularyService.class).merge((TermVocabulary) term);
+                TermVocabulary voc = (TermVocabulary) term;
+                CdmStore.getService(IVocabularyService.class).merge(voc);
+                viewer.refresh(new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType()));
             }
                }
                setDirty(false);
                input.initialiseVocabularies();
-               viewer.refresh();
-               changedTerms.clear();
+        changedTerms.clear();
                EventUtility.postEvent(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL, true);
        }