From: Patrick Plitzner
Date: Thu, 9 May 2019 07:35:45 +0000 (+0200)
Subject: ref #8263 Simplify refresh logic
X-Git-Tag: 5.7.1^2
X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/refs/heads/hotfix/5.7.1
ref #8263 Simplify refresh logic
- refresh is invoked on the entire tree since caching the children
already boosts the performance
---
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);
}