Revision 1149ef6a
Added by Patrick Plitzner over 9 years ago
- when editing a CDM entity in an EditFromSelectionWizard the entity will be cloned before editing.
- when hitting "Finish" the entity will be merged with the original.
- when hitting "Cancel" the merging will not be made and the changes will be ignored -> this fixes #2645
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/selection/EditFromSelectionWizard.java | ||
---|---|---|
15 | 15 |
import org.eclipse.jface.wizard.WizardDialog; |
16 | 16 |
import org.eclipse.swt.events.SelectionEvent; |
17 | 17 |
import org.eclipse.swt.events.SelectionListener; |
18 |
import org.eclipse.ui.IEditorPart; |
|
18 | 19 |
|
19 | 20 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade; |
20 | 21 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeNotSupportedException; |
... | ... | |
30 | 31 |
import eu.etaxonomy.cdm.model.occurrence.Collection; |
31 | 32 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
32 | 33 |
import eu.etaxonomy.cdm.model.reference.Reference; |
34 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
35 |
import eu.etaxonomy.taxeditor.model.IDirtyMarkable; |
|
33 | 36 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
34 | 37 |
import eu.etaxonomy.taxeditor.model.TextHelper; |
35 | 38 |
import eu.etaxonomy.taxeditor.newWizard.AmplificationCloningWizardPage; |
... | ... | |
166 | 169 |
/** {@inheritDoc} */ |
167 | 170 |
@Override |
168 | 171 |
public boolean performFinish() { |
172 |
IEditorPart activeEditor = AbstractUtility.getActiveEditor(); |
|
173 |
/* |
|
174 |
* forceDirty() for cases when one or more EditFromSelectionWizards are |
|
175 |
* opened cascadingly to trigger the save button. Otherwise the dirty |
|
176 |
* state would not be set and the user will have no feedback that he/she |
|
177 |
* actually still has ounsaved changes. This is necessary because |
|
178 |
* editing in these wizards is done on clones of the CDM entities which |
|
179 |
* are merged back with the original when pressing "Finish" |
|
180 |
*/ |
|
181 |
if (activeEditor instanceof IDirtyMarkable){ |
|
182 |
((IDirtyMarkable) activeEditor).forceDirty(); |
|
183 |
} |
|
169 | 184 |
return true; |
170 | 185 |
} |
171 | 186 |
|
Also available in: Unified diff