Revision c1c463d7
Added by Katja Luther over 8 years ago
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/DeleteHandler.java | ||
---|---|---|
16 | 16 |
import org.eclipse.core.commands.AbstractHandler; |
17 | 17 |
import org.eclipse.core.commands.ExecutionEvent; |
18 | 18 |
import org.eclipse.core.commands.ExecutionException; |
19 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
19 | 20 |
import org.eclipse.jface.viewers.ISelection; |
20 | 21 |
import org.eclipse.jface.viewers.IStructuredSelection; |
21 | 22 |
import org.eclipse.ui.IEditorInput; |
... | ... | |
33 | 34 |
import eu.etaxonomy.cdm.api.service.ITaxonService; |
34 | 35 |
import eu.etaxonomy.cdm.api.service.IUserService; |
35 | 36 |
import eu.etaxonomy.cdm.api.service.config.NameDeletionConfigurator; |
37 |
import eu.etaxonomy.cdm.api.service.config.SynonymDeletionConfigurator; |
|
38 |
import eu.etaxonomy.cdm.api.service.config.TaxonDeletionConfigurator; |
|
36 | 39 |
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase; |
37 | 40 |
import eu.etaxonomy.cdm.model.common.Group; |
38 | 41 |
import eu.etaxonomy.cdm.model.common.User; |
... | ... | |
50 | 53 |
import eu.etaxonomy.taxeditor.model.DeleteResultMessagingUtils; |
51 | 54 |
import eu.etaxonomy.taxeditor.model.MessagingUtils; |
52 | 55 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
56 |
import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteConfiguratorDialog; |
|
57 |
import eu.etaxonomy.taxeditor.ui.dialog.deleteConfigurator.DeleteTaxonConfiguratorComposite; |
|
53 | 58 |
|
54 | 59 |
|
55 | 60 |
/** |
... | ... | |
130 | 135 |
ITaxonService service = controller.getTaxonService(); |
131 | 136 |
if (object != null){ |
132 | 137 |
if (object instanceof Taxon){ |
133 |
result = service.deleteTaxon(((TaxonBase) object).getUuid(), null, null); |
|
138 |
TaxonDeletionConfigurator config = new TaxonDeletionConfigurator(); |
|
139 |
config.setDeleteInAllClassifications(true); |
|
140 |
DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the taxon", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); |
|
141 |
int result_dialog= dialog.open(); |
|
142 |
if (result_dialog == 1){ |
|
143 |
return null; |
|
144 |
} |
|
145 |
result = service.deleteTaxon(((TaxonBase) object).getUuid(), config, null); |
|
134 | 146 |
errorMessage = "The taxon "; |
135 | 147 |
}else{ |
136 |
result = service.deleteSynonym(((Synonym)object).getUuid(), null); |
|
148 |
SynonymDeletionConfigurator config = new SynonymDeletionConfigurator(); |
|
149 |
DeleteConfiguratorDialog dialog = new DeleteConfiguratorDialog(config, HandlerUtil.getActiveShell(event), "Confirm Deletion", null, "Do you really want to delete the synonym", MessageDialog.WARNING, new String[] { "Delete", "Skip" }, 0); |
|
150 |
int result_dialog= dialog.open(); |
|
151 |
if (result_dialog == 1){ |
|
152 |
return null; |
|
153 |
} |
|
154 |
result = service.deleteSynonym(((Synonym)object).getUuid(), config); |
|
137 | 155 |
errorMessage = "The synonym "; |
138 | 156 |
} |
139 | 157 |
} |
Also available in: Unified diff
fix move whole description to another description and adding delete configurator to bulk editor