From ad5689922a48e132b00522e5b489f9cb71ad2dc5 Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Thu, 9 May 2019 09:35:45 +0200
Subject: [PATCH] ref #8263 Simplify refresh logic
- refresh is invoked on the entire tree since caching the children
already boosts the performance
---
.../editor/definedterm/e4/DefinedTermEditorE4.java | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
index 5961f5a7a..35d5d8df7 100644
--- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
+++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java
@@ -152,29 +152,21 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
for (Object o : (Collection>)objectAffectedByOperation) {
if(o instanceof TermVocabularyDto){
contentProvider.removeVocabularyFromCache((TermVocabularyDto) o);
- viewer.refresh(o);
}
else if(o instanceof TermDto){
contentProvider.removeVocabularyFromCache(((TermDto) o).getVocabularyDto());
- viewer.refresh(((TermDto) o).getVocabularyDto());
- viewer.refresh(o);
itemsToSelect.add((TermDto) o);
}
}
}
if(objectAffectedByOperation instanceof TermVocabularyDto){
contentProvider.removeVocabularyFromCache((TermVocabularyDto) objectAffectedByOperation);
- viewer.refresh();
itemsToSelect.add((AbstractTermDto) objectAffectedByOperation);
}
else if(objectAffectedByOperation instanceof TermDto){
TermDto termDto = (TermDto) objectAffectedByOperation;
itemsToSelect.add(termDto);
contentProvider.removeVocabularyFromCache(termDto.getVocabularyDto());
- viewer.refresh(termDto.getVocabularyDto());
- }
- else{
- viewer.refresh(objectAffectedByOperation);
}
if(!itemsToSelect.isEmpty()){
StructuredSelection selection = new StructuredSelection(itemsToSelect);
@@ -183,6 +175,7 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
viewer.expandToLevel(termDto, 1);
}
}
+ viewer.refresh();
return true;
}
@@ -201,17 +194,16 @@ IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart, IContex
if(term.isInstanceOf(DefinedTermBase.class)){
DefinedTermBase definedTermBase = (DefinedTermBase) term;
CdmStore.getService(ITermService.class).merge(definedTermBase);
- viewer.refresh(TermDto.fromTerm(definedTermBase));
}
else if(term.isInstanceOf(TermVocabulary.class)){
TermVocabulary voc = (TermVocabulary) term;
CdmStore.getService(IVocabularyService.class).merge(voc);
- viewer.refresh(new TermVocabularyDto(voc.getUuid(), voc.getRepresentations(), voc.getTermType()));
}
}
setDirty(false);
input.initialiseVocabularies();
changedTerms.clear();
+ viewer.refresh();
EventUtility.postEvent(WorkbenchEventConstants.REFRESH_SUPPLEMENTAL, true);
}
--
2.34.1