boolean removeTypeDesignationFromAllTypifiedNames = PreferencesUtil.getBooleanValue(IPreferenceKeys.ADD_TYPES_TO_ALL_NAMES);
TaxonName entity = removeTypeDesignationFromAllTypifiedNames ? null : getEntity();
DetailsPartE4 detailsView = AbstractUtility.getDetailsView(getFormFactory().getContext().get((EPartService.class)));
- if(detailsView!=null
+ if(!element.isPersited() && entity!=null){
+ entity.removeTypeDesignation(element);
+ }
+ else if(detailsView!=null
&& detailsView.getSelectionProvidingPart().getObject() instanceof ITaxonEditor
&& detailsView.getSelectionProvidingPart().getObject() instanceof IPostOperationEnabled) {
DeleteTypeDesignationOperation operation = new DeleteTypeDesignationOperation(
null);
((ITaxonEditor) detailsView.getSelectionProvidingPart().getObject()).addOperation(operation);
}
- if(entity!=null){
- entity.removeTypeDesignation(element);
- }
updateToolbar();
}