Project

General

Profile

« Previous | Next » 

Revision 7171015b

Added by Katja Luther almost 4 years ago

ref #7230: refresh of name editor and details view after changing taxon of misapplied name relationship

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/event/WorkbenchEventConstants.java
23 23

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

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

  
26 28
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/taxon/TaxonRelationshipDetailSection.java
22 22
import eu.etaxonomy.cdm.model.taxon.Taxon;
23 23
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
24 24
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
25
import eu.etaxonomy.taxeditor.event.EventUtility;
26
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
25 27
import eu.etaxonomy.taxeditor.model.ImageResources;
26 28
import eu.etaxonomy.taxeditor.ui.dialog.selection.TaxonBaseSelectionDialog;
27 29
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
......
96 98
                            TaxonRelationship rel = getEntity();
97 99
                            rel.setFromTaxon(taxon);
98 100
                            setEntity(rel);
99
                            detailElement.firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
101
 //                           detailElement.firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
100 102
                            setTaxonBase(taxon);
101

  
102

  
103 103
                            firePropertyChangeEvent(new CdmPropertyChangeEvent(this, null));
104
                            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_TAXON_DETAILS, true);
105
                            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, true);
104 106
	                    }
105 107
	                }
106 108
	            };
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmEditorPartE4.java
184 184

  
185 185
                        if(part instanceof ITaxonEditor){
186 186
                            Taxon accepted = ((ITaxonEditor) part).getTaxon();
187

  
188
                            //                			Taxon accepted= ((ITaxonEditor)activePart).getTaxon();
189 187
                            Set<TaxonRelationship> rels =  taxon.getTaxonRelations(accepted);
190 188

  
191 189
                            if (rels.iterator().hasNext()){
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
12 12
import java.util.HashSet;
13 13
import java.util.Set;
14 14

  
15
import javax.inject.Inject;
16

  
17
import org.eclipse.e4.core.di.annotations.Optional;
18
import org.eclipse.e4.ui.di.UIEventTopic;
15 19
import org.eclipse.jface.viewers.ISelection;
16 20
import org.eclipse.jface.viewers.IStructuredSelection;
17 21
import org.eclipse.jface.viewers.SelectionChangedEvent;
......
53 57
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
54 58
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
55 59
import eu.etaxonomy.taxeditor.editor.IDistributionEditor;
60
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
56 61
import eu.etaxonomy.taxeditor.model.AbstractUtility;
57 62
import eu.etaxonomy.taxeditor.model.FeatureNodeContainer;
58 63
import eu.etaxonomy.taxeditor.model.IDerivedUnitFacadePart;
......
882 887
    public void update(CdmDataChangeMap arg0) {
883 888

  
884 889
    }
885

  
890
    @Inject
891
    @Optional
892
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_TAXON_DETAILS)boolean refresh){
893
        if(refresh){
894
            refresh();
895
            setSelection(getSelection(), true);
896
        }
897
    }
886 898
}

Also available in: Unified diff