Revision 599c91e5
Added by Andreas Müller almost 2 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/key/polytomous/operation/CreatePolytomousKeyNodeOperation.java | ||
---|---|---|
15 | 15 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
16 | 16 |
import eu.etaxonomy.cdm.model.description.PolytomousKeyNode; |
17 | 17 |
import eu.etaxonomy.taxeditor.editor.l10n.Messages; |
18 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
|
19 | 18 |
import eu.etaxonomy.taxeditor.operation.CdmDefaultOperation; |
19 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
|
20 | 20 |
|
21 | 21 |
/** |
22 | 22 |
* @author cmathew |
23 | 23 |
* @date 21 Jul 2015 |
24 |
* |
|
25 | 24 |
*/ |
26 | 25 |
public class CreatePolytomousKeyNodeOperation extends CdmDefaultOperation { |
27 | 26 |
|
27 |
private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY; |
|
28 |
|
|
28 | 29 |
private final PolytomousKeyNode parentNode; |
29 | 30 |
private PolytomousKeyNode childNode; |
30 |
/** |
|
31 |
* |
|
32 |
*/ |
|
33 |
protected IPostOperationEnabled postOperationEnabled; |
|
31 |
private IPostOperationEnabled postOperationEnabled; |
|
34 | 32 |
|
35 | 33 |
public PolytomousKeyNode getChildNode() { |
36 | 34 |
return childNode; |
37 | 35 |
} |
38 | 36 |
|
39 |
private final static String LABEL = Messages.RemotingCreatePolytomousKeyNodeOperation_CREATE_KEY; |
|
40 |
|
|
41 | 37 |
public CreatePolytomousKeyNodeOperation(Object source, |
42 | 38 |
boolean async, |
43 | 39 |
PolytomousKeyNode parentNode, IPostOperationEnabled postOperationEnabled){ |
... | ... | |
46 | 42 |
this.postOperationEnabled = postOperationEnabled; |
47 | 43 |
} |
48 | 44 |
|
49 |
/* (non-Javadoc) |
|
50 |
* @see eu.etaxonomy.taxeditor.operation.RemotingCdmSimpleOperation#doSimpleExecute(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.core.runtime.IAdaptable) |
|
51 |
*/ |
|
52 | 45 |
@Override |
53 | 46 |
protected CdmBase doSimpleExecute(IProgressMonitor monitor, IAdaptable info) throws Exception { |
54 |
childNode = PolytomousKeyNode.NewInstance(); |
|
55 |
parentNode.addChild(childNode); |
|
56 |
if (postOperationEnabled.postOperation(childNode)){ |
|
57 |
return childNode; |
|
58 |
}else {
|
|
59 |
return null; |
|
60 |
} |
|
47 |
childNode = PolytomousKeyNode.NewInstance();
|
|
48 |
parentNode.addChild(childNode);
|
|
49 |
if (postOperationEnabled.postOperation(childNode)){
|
|
50 |
return childNode;
|
|
51 |
} else {
|
|
52 |
return null;
|
|
53 |
}
|
|
61 | 54 |
} |
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
} |
|
55 |
} |
Also available in: Unified diff
cleanup