1
|
/**
|
2
|
* Copyright (C) 2017 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
package eu.etaxonomy.taxeditor.navigation.navigator.operation;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import org.eclipse.core.runtime.IAdaptable;
|
14
|
import org.eclipse.core.runtime.IProgressMonitor;
|
15
|
|
16
|
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
|
17
|
import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
|
18
|
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
|
19
|
import eu.etaxonomy.cdm.api.service.UpdateResult;
|
20
|
import eu.etaxonomy.cdm.api.service.config.SetSecundumForSubtreeConfigurator;
|
21
|
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
|
22
|
import eu.etaxonomy.taxeditor.operation.RemotingCdmUpdateOperation;
|
23
|
|
24
|
/**
|
25
|
* @author k.luther
|
26
|
* @date 10.02.2017
|
27
|
*
|
28
|
*/
|
29
|
public class SetSecundumForSubtreeOperation extends RemotingCdmUpdateOperation{
|
30
|
|
31
|
private final static String LABEL = Messages.SetSecundumForSubtreeOperation_CHANGE_SEC_OP;
|
32
|
|
33
|
UUID parentUuid;
|
34
|
SetSecundumForSubtreeConfigurator config;
|
35
|
|
36
|
/**
|
37
|
* @param label
|
38
|
* @param action
|
39
|
* @param source
|
40
|
* @param async
|
41
|
*/
|
42
|
public SetSecundumForSubtreeOperation(Object source,
|
43
|
boolean async,
|
44
|
UUID taxonNodeUuid,
|
45
|
SetSecundumForSubtreeConfigurator config) {
|
46
|
super(LABEL, Action.Update, source, async);
|
47
|
parentUuid = taxonNodeUuid;
|
48
|
this.config = config;
|
49
|
}
|
50
|
|
51
|
/**
|
52
|
* {@inheritDoc}
|
53
|
*/
|
54
|
@Override
|
55
|
protected UpdateResult doUpdateExecute(IProgressMonitor monitor, IAdaptable info) throws Exception {
|
56
|
monitor.beginTask(Messages.SetSecundumForSubtreeOperation_SET_SEC_TASK, 10);
|
57
|
UpdateResult result = CdmApplicationState.getService(ITaxonNodeService.class).setSecundumForSubtree(config, null);
|
58
|
monitor.done();
|
59
|
return result;
|
60
|
}
|
61
|
|
62
|
}
|