Revision 40de894f
Added by Katja Luther over 7 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/operation/DeleteMediaOperation.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.runtime.IProgressMonitor; |
16 | 16 |
import org.eclipse.core.runtime.IStatus; |
17 | 17 |
|
18 |
import eu.etaxonomy.cdm.api.service.IMediaService; |
|
19 |
import eu.etaxonomy.cdm.api.service.config.MediaDeletionConfigurator; |
|
18 | 20 |
import eu.etaxonomy.cdm.api.utility.ImagesUtility; |
19 | 21 |
import eu.etaxonomy.cdm.model.description.DescriptionBase; |
20 | 22 |
import eu.etaxonomy.cdm.model.media.Media; |
21 | 23 |
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation; |
22 | 24 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
23 | 26 |
|
24 | 27 |
/** |
25 | 28 |
* <p>DeleteMediaOperation class.</p> |
... | ... | |
34 | 37 |
|
35 | 38 |
private final DescriptionBase<?> description; |
36 | 39 |
|
40 |
private final MediaDeletionConfigurator config; |
|
41 |
|
|
37 | 42 |
/** |
38 | 43 |
* <p>Constructor for DeleteMediaOperation.</p> |
39 | 44 |
* |
... | ... | |
44 | 49 |
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object. |
45 | 50 |
*/ |
46 | 51 |
public DeleteMediaOperation(String label, IUndoContext undoContext, |
47 |
DescriptionBase<?> description, Media media, IPostOperationEnabled postOperationEnabled) {
|
|
52 |
DescriptionBase<?> description, Media media, MediaDeletionConfigurator config, IPostOperationEnabled postOperationEnabled) {
|
|
48 | 53 |
super(label, undoContext, postOperationEnabled); |
49 |
|
|
54 |
this.config = config; |
|
50 | 55 |
this.media = media; |
51 | 56 |
this.description = description; |
52 | 57 |
} |
... | ... | |
59 | 64 |
public IStatus execute(IProgressMonitor monitor, IAdaptable info) |
60 | 65 |
throws ExecutionException { |
61 | 66 |
|
67 |
ImagesUtility.removeMediaFromGallery(description, media); |
|
68 |
|
|
62 | 69 |
monitor.worked(20); |
63 |
ImagesUtility.removeMediaFromGallery(description, media);
|
|
70 |
CdmStore.getService(IMediaService.class).delete(media.getUuid(), config);
|
|
64 | 71 |
monitor.worked(40); |
65 | 72 |
|
66 | 73 |
return postExecute(null); |
Also available in: Unified diff
add missing changes