1
|
/**
|
2
|
* Copyright (C) 2007 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
|
|
10
|
package eu.etaxonomy.taxeditor.operation;
|
11
|
|
12
|
import java.util.UUID;
|
13
|
|
14
|
import org.eclipse.core.commands.operations.IUndoContext;
|
15
|
import org.eclipse.e4.ui.di.UISynchronize;
|
16
|
|
17
|
import eu.etaxonomy.cdm.api.service.ITaxonService;
|
18
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
19
|
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
|
20
|
import eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled;
|
21
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
22
|
|
23
|
/**
|
24
|
* <p>Abstract AbstractPostOperation class.</p>
|
25
|
*
|
26
|
* @author p.ciardelli
|
27
|
* @author n.hoffmann
|
28
|
* @created 14.01.2009
|
29
|
* @version 1.0
|
30
|
*/
|
31
|
public abstract class AbstractPostTaxonOperation extends AbstractPostOperation<Taxon> {
|
32
|
|
33
|
/**
|
34
|
* A reference to the taxons TaxonNode
|
35
|
*/
|
36
|
protected TaxonNodeDto taxonNode;
|
37
|
|
38
|
protected UUID parentNodeUuid;
|
39
|
|
40
|
private UISynchronize sync;
|
41
|
|
42
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
43
|
Taxon taxon, IPostOperationEnabled postOperationEnabled, UISynchronize sync) {
|
44
|
this(label, undoContext, taxon, postOperationEnabled, null, sync);
|
45
|
}
|
46
|
|
47
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
48
|
Taxon taxon, IPostOperationEnabled postOperationEnabled) {
|
49
|
this(label, undoContext, taxon, postOperationEnabled, null, null);
|
50
|
}
|
51
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
52
|
Taxon taxon, IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled, UISynchronize sync) {
|
53
|
super(label, undoContext, taxon, postOperationEnabled, cdmEntitySessionEnabled);
|
54
|
this.sync = sync;
|
55
|
}
|
56
|
|
57
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
58
|
Taxon taxon, IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
|
59
|
super(label, undoContext, taxon, postOperationEnabled, cdmEntitySessionEnabled);
|
60
|
|
61
|
}
|
62
|
|
63
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext, TaxonNodeDto taxonNode,
|
64
|
IPostOperationEnabled postOperationEnabled) {
|
65
|
this(label, undoContext, taxonNode, postOperationEnabled, null);
|
66
|
}
|
67
|
|
68
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext, TaxonNodeDto taxonNode,
|
69
|
IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
|
70
|
this(label, undoContext, (Taxon) CdmStore.getService(ITaxonService.class).find(taxonNode.getTaxonUuid()), postOperationEnabled, cdmEntitySessionEnabled, null);
|
71
|
this.taxonNode = taxonNode;
|
72
|
}
|
73
|
|
74
|
/**
|
75
|
* <p>Constructor for AbstractPostOperation.</p>
|
76
|
*
|
77
|
* @param label a {@link java.lang.String} object.
|
78
|
* @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
|
79
|
* @param parentNodeUuid a {@link java.util.UUID} object.
|
80
|
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
|
81
|
*/
|
82
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext, UUID parentNodeUuid,
|
83
|
IPostOperationEnabled postOperationEnabled) {
|
84
|
super(label, undoContext, null, postOperationEnabled, null);
|
85
|
this.parentNodeUuid = parentNodeUuid;
|
86
|
}
|
87
|
|
88
|
/**
|
89
|
* <p>Constructor for AbstractPostOperation.</p>
|
90
|
*
|
91
|
* @param label a {@link java.lang.String} object.
|
92
|
* @param undoContext a {@link org.eclipse.core.commands.operations.IUndoContext} object.
|
93
|
* @param postOperationEnabled a {@link eu.etaxonomy.taxeditor.operation.IPostOperationEnabled} object.
|
94
|
*/
|
95
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
96
|
IPostOperationEnabled postOperationEnabled) {
|
97
|
this(label, undoContext, postOperationEnabled, null);
|
98
|
}
|
99
|
|
100
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext,
|
101
|
IPostOperationEnabled postOperationEnabled, ICdmEntitySessionEnabled cdmEntitySessionEnabled) {
|
102
|
super(label, undoContext, null, postOperationEnabled, cdmEntitySessionEnabled);
|
103
|
}
|
104
|
|
105
|
public AbstractPostTaxonOperation(String label, IUndoContext undoContext, UUID taxonUuid) {
|
106
|
this(label, undoContext, taxonUuid, null);
|
107
|
}
|
108
|
|
109
|
|
110
|
public UISynchronize getSync() {
|
111
|
return sync;
|
112
|
}
|
113
|
|
114
|
public void setSync(UISynchronize sync) {
|
115
|
this.sync = sync;
|
116
|
}
|
117
|
|
118
|
}
|