Revision 2b7bbafc
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/TaxonNavigatorDataChangeBehavior.java | ||
---|---|---|
17 | 17 |
import org.eclipse.core.runtime.Status; |
18 | 18 |
import org.eclipse.core.runtime.jobs.Job; |
19 | 19 |
import org.eclipse.swt.widgets.Display; |
20 |
import org.eclipse.ui.IEditorPart; |
|
21 | 20 |
|
22 | 21 |
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper; |
23 | 22 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
... | ... | |
29 | 28 |
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap; |
30 | 29 |
import eu.etaxonomy.taxeditor.model.AbstractDataChangeBehaviour; |
31 | 30 |
import eu.etaxonomy.taxeditor.model.IDataChangeBehavior; |
32 |
import eu.etaxonomy.taxeditor.navigation.NavigationUtil; |
|
33 | 31 |
import eu.etaxonomy.taxeditor.navigation.l10n.Messages; |
34 | 32 |
|
35 | 33 |
/** |
... | ... | |
90 | 88 |
return true; |
91 | 89 |
} |
92 | 90 |
|
93 |
// name updates of the accepted taxon of open editors are relevant |
|
94 |
if(eventType == EventType.UPDATE && event.getEntity() instanceof TaxonName){ |
|
95 |
TaxonName name = null; |
|
96 |
if(eventEntity instanceof TaxonName){ |
|
97 |
name = (TaxonName) eventEntity; |
|
98 |
}else if(eventEntity instanceof Taxon){ |
|
99 |
name = ((Taxon) eventEntity).getName(); |
|
100 |
}else{ |
|
101 |
continue; |
|
102 |
} |
|
103 |
|
|
104 |
Set<IEditorPart> openEditors = NavigationUtil.getOpenEditors(); |
|
105 |
/*for(IEditorPart editor : openEditors){ |
|
106 |
|
|
107 |
if(name.equals(((TaxonEditorInput) editor.getEditorInput()).getTaxon().getName())){ |
|
108 |
return true; |
|
109 |
} |
|
110 |
}*/ |
|
111 |
} |
|
112 | 91 |
if (eventType == EventType.DELETE){ |
113 | 92 |
return true; |
114 | 93 |
} |
Also available in: Unified diff
ref #6909 migrate/delete e3 name editor refs