Merge branch 'LibrAlign' of https://dev.e-taxonomy.eu/git/taxeditor into LibrAlign
[taxeditor.git] / eu.etaxonomy.taxeditor.editor / src / main / java / eu / etaxonomy / taxeditor / editor / MultiPageTaxonEditor.java
index e58a897b2426f9d5d69d82de6188620a37fa4ccf..6887838ddd4b127ed75a2d088b99913fd4aacbbd 100644 (file)
@@ -23,6 +23,9 @@ import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.forms.editor.FormEditor;
 
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
 import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
 import eu.etaxonomy.cdm.model.common.CdmBase;
@@ -145,7 +148,10 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
             // commit the conversation and start a new transaction immediately
 
             input.merge();
+            
             conversation.commit(true);
+            CdmApplicationState.getCurrentDataChangeService()
+            .fireChangeEvent(new CdmChangeEvent(Action.Update, input.getTaxonNode() , MultiPageTaxonEditor.class), true);
             monitor.worked(1);
 
             this.setDirty(false);
@@ -304,8 +310,12 @@ IDirtyMarkable, IPartContentHasDetails, ISecuredEditor, IPartContentHasMedia {
     @Override
     public void changed(Object element) {
         // setDirty(true);
-        dirty = true;
-        super.editorDirtyStateChanged();
+        // if the attribute is null then do not set the dirty flag -> hotfix for the problem that for tasks done in service methods the changes are saved automatically
+        if (element != null){
+            dirty = true;
+            super.editorDirtyStateChanged();
+        }
+
         if (element instanceof TaxonBase) {
             TaxonNameEditor page = (TaxonNameEditor) getPage(Page.NAME);
             AbstractGroupedContainer container = page.getContainer((TaxonBase) element);