EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode().getParent()));
EventUtility.postEvent(WorkbenchEventConstants.SAVE_TAXON, true);
EventUtility.postAsyncEvent(WorkbenchEventConstants.REFRESH_DETAILS, true);
+// EventUtility.postAsyncEvent(WorkbenchEventConstants.NEED_REFRESH_DETAILS, false);
// Stop the progress monitor.
monitor.done();
}
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
+import eu.etaxonomy.taxeditor.view.detail.CdmSectionPart;
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPart;
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
@Override
public void selectionChanged_internal(Object selection, MPart activePart, MPart thisPart) {
- if (activePart == thisPart){
- return;
+ if (activePart == null) {
+ return;
+ }
+
+ if (activePart == thisPart ){
+ if (this.getViewer().isNeedsRefresh()) {
+ viewer.refresh();
+ viewer.setNeedsRefresh(false);
+ return;
+ }else {
+ return;
+ }
}
viewer.setSelection(structuredSelection, false);
showViewer(structuredSelection, activePart, viewer);
-
+ viewer.setNeedsRefresh(false);
return;
}
else{
private ISelection selection;
private boolean detailsEnabled = true;
private Object activePart;
+
+ private boolean needsRefresh = false;
public boolean isDetailsEnabled() {
return detailsEnabled;
setInput(input);
}
+
+ public boolean isNeedsRefresh() {
+ return needsRefresh;
+ }
+
+ public void setNeedsRefresh(boolean needsRefresh) {
+ this.needsRefresh = needsRefresh;
+ }
// START HACK TO MAKE THE DERIVED UNIT FACADE WORK
// since we are getting implementations of DerivedUnitBase from the bulk
// editor and not derived unit facade objects,
private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DETAILS)boolean refresh){
if(refresh){
//refresh_withoutnew_build(); this would use the update without creation of all fields
- refresh();
+ if (needsRefresh) {
+ refresh();
+ }
+ this.needsRefresh = false;
}
}
@Inject
@Optional
- private void blockView(@UIEventTopic(WorkbenchEventConstants.ENABLE_TAXON_DETAILS)boolean enable){
+ private void needsRefresh(@UIEventTopic(WorkbenchEventConstants.NEED_REFRESH_DETAILS)boolean enable){
for (IFormPart part :this.managedForm.getParts()) {
if (part instanceof CdmSectionPart) {
- ((CdmSectionPart)part).getSection().setEnabled(enable);
+ //((CdmSectionPart)part).getSection().setEnabled(enable);
+ this.setNeedsRefresh(!enable);
+
}
}
}
}
}
+
+
}
\ No newline at end of file