Project

General

Profile

Revision 84f9c7fd

ID84f9c7fdbd7c569295fe3fe5dfe6269c5ceaef38
Parent 0c80180b
Child 10aaa73f

Added by Patrick Plitzner over 1 year ago

ref #7775 Update factual data view when saving name editor

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonNameEditorE4.java
406 406

  
407 407
        dirty.setDirty(false);
408 408
        EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, true);
409
        EventUtility.postEvent(WorkbenchEventConstants.SAVE_TAXON, true);
409 410
	    // Stop the progress monitor.
410 411
	    monitor.done();
411 412
	}
......
527 528
	    return context;
528 529
	}
529 530

  
530
	public boolean isDirty() {
531
	@Override
532
    public boolean isDirty() {
531 533
		return dirty.isDirty();
532 534
	}
533 535

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/FactualDataPartE4.java
13 13
import java.util.HashMap;
14 14
import java.util.List;
15 15
import java.util.Map;
16
import java.util.Set;
16 17

  
17 18
import javax.annotation.PostConstruct;
19
import javax.inject.Inject;
18 20

  
19 21
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
20 22
import org.eclipse.e4.core.contexts.IEclipseContext;
23
import org.eclipse.e4.core.di.annotations.Optional;
24
import org.eclipse.e4.ui.di.UIEventTopic;
21 25
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
22 26
import org.eclipse.e4.ui.services.EMenuService;
23 27
import org.eclipse.jface.viewers.AbstractTreeViewer;
......
32 36
import org.eclipse.swt.widgets.Composite;
33 37
import org.eclipse.swt.widgets.Tree;
34 38

  
39
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
35 40
import eu.etaxonomy.cdm.model.common.CdmBase;
36 41
import eu.etaxonomy.cdm.model.description.DescriptionBase;
37 42
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
38 43
import eu.etaxonomy.cdm.model.description.IDescribable;
44
import eu.etaxonomy.cdm.model.description.TaxonDescription;
39 45
import eu.etaxonomy.cdm.model.name.TaxonName;
40 46
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase;
47
import eu.etaxonomy.cdm.model.taxon.Taxon;
41 48
import eu.etaxonomy.taxeditor.bulkeditor.e4.BulkEditorE4;
42 49
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
43 50
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
......
49 56
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveLabelProvider;
50 57
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewerSorter;
51 58
import eu.etaxonomy.taxeditor.editor.view.media.e4.MediaViewPartE4;
59
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
52 60
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
53 61
import eu.etaxonomy.taxeditor.model.FeatureNodeContainerTree;
54 62
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
......
199 207
        super.changed(object);
200 208
    }
201 209

  
210
    @Inject
211
    @Optional
212
    private void updateView(@UIEventTopic(WorkbenchEventConstants.SAVE_TAXON)boolean refresh){
213
        if(refresh){
214
            List<? extends CdmBase> rootEntities = getRootEntities();
215
            for (CdmBase cdmBase : rootEntities) {
216
                if(cdmBase.isInstanceOf(Taxon.class)){
217
                    Taxon taxon = HibernateProxyHelper.deproxy(cdmBase, Taxon.class);
218
                    Set<TaxonDescription> descriptions = taxon.getDescriptions();
219
                    for (TaxonDescription taxonDescription : descriptions) {
220
                        taxonDescription.setTitleCache(null, false);
221
                    }
222
                }
223
            }
224
            viewer.refresh();
225
        }
226
    }
227

  
202 228
    /**
203 229
     * {@inheritDoc}
204 230
     */
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/event/WorkbenchEventConstants.java
21 21

  
22 22
    public static final String REFRESH_NAVIGATOR = "REFRESH/NAVIGATOR";
23 23

  
24
    public static final String SAVE_TAXON = "SAVE/TAXON";
25

  
24 26
    public static final String REFRESH_TAXON_DETAILS = "REFRESH/DETAILS/TAXON";
25 27

  
26 28
    public static final String REFRESH_NAME_EDITOR = "REFRESH/EDITOR/NAME";

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)