Revision 5bfd26ae
Added by Katja Luther over 5 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/e4/handler/MoveDescriptionElementsHandlerE4.java | ||
---|---|---|
29 | 29 |
import org.eclipse.e4.ui.services.IServiceConstants; |
30 | 30 |
import org.eclipse.e4.ui.workbench.modeling.EModelService; |
31 | 31 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
32 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
32 | 33 |
import org.eclipse.jface.viewers.ISelection; |
33 | 34 |
import org.eclipse.jface.viewers.IStructuredSelection; |
34 | 35 |
import org.eclipse.swt.widgets.Display; |
... | ... | |
85 | 86 |
Object e4WrappedPart = WorkbenchUtility.getE4WrappedPart(factualDataPart.getSelectionProvidingPart()); |
86 | 87 |
if(e4WrappedPart instanceof TaxonNameEditorE4){ |
87 | 88 |
editor = (TaxonNameEditorE4) e4WrappedPart; |
89 |
if (this.editor.isDirty()){ |
|
90 |
boolean proceed = MessageDialog.openQuestion(null, |
|
91 |
Messages.MoveDescriptionToOtherTaxonHandler_SAVE_CHANGES, Messages.MoveDescriptionToOtherTaxonHandler_SAVE_CHANGES_MESSAGE); |
|
92 |
if (proceed) { |
|
93 |
editor.save(AbstractUtility.getMonitor()); |
|
94 |
} else { |
|
95 |
return; |
|
96 |
} |
|
97 |
|
|
98 |
} |
|
99 |
|
|
100 |
|
|
88 | 101 |
} |
89 | 102 |
Taxon actualTaxon= null; |
90 | 103 |
|
... | ... | |
113 | 126 |
if (description!=null && description.isInstanceOf(TaxonDescription.class)){ |
114 | 127 |
TaxonDescription taxonDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class); |
115 | 128 |
actualTaxon = taxonDescription.getTaxon(); |
116 |
excludeTaxa.add(actualTaxon.getUuid()); |
|
129 |
|
|
117 | 130 |
} |
118 | 131 |
Classification classification = null; |
119 | 132 |
TaxonNode actualNode = null; |
120 | 133 |
if (actualTaxon != null){ |
121 | 134 |
if (!actualTaxon.getTaxonNodes().isEmpty() && actualTaxon.getTaxonNodes().size() ==1){ |
122 | 135 |
actualNode = actualTaxon.getTaxonNodes().iterator().next(); |
136 |
excludeTaxa.add(actualNode.getUuid()); |
|
123 | 137 |
classification = actualNode.getClassification(); |
124 | 138 |
|
125 | 139 |
} |
Also available in: Unified diff
ref #3535: source taxon should not be selectable for move description or description elements