1
|
/**
|
2
|
* Copyright (C) 2018 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.editor.name.operation;
|
10
|
|
11
|
import java.util.UUID;
|
12
|
|
13
|
import org.eclipse.core.commands.operations.IUndoContext;
|
14
|
|
15
|
import eu.etaxonomy.cdm.model.taxon.Taxon;
|
16
|
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
|
17
|
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
18
|
import eu.etaxonomy.taxeditor.editor.name.e4.TaxonNameEditorE4;
|
19
|
import eu.etaxonomy.taxeditor.operation.AbstractPostTaxonOperation;
|
20
|
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
|
21
|
|
22
|
/**
|
23
|
* @author k.luther
|
24
|
* @since 02.05.2018
|
25
|
*
|
26
|
*/
|
27
|
public abstract class CreateNewTaxonBaseOperation extends AbstractPostTaxonOperation {
|
28
|
|
29
|
/**
|
30
|
* @param label
|
31
|
* @param undoContext
|
32
|
* @param taxonUuid
|
33
|
*/
|
34
|
public CreateNewTaxonBaseOperation(String label, IUndoContext undoContext, UUID taxonUuid) {
|
35
|
super(label, undoContext, taxonUuid);
|
36
|
|
37
|
}
|
38
|
|
39
|
/**
|
40
|
* @param label
|
41
|
* @param undoContext
|
42
|
* @param taxon
|
43
|
* @param postOperationEnabled
|
44
|
*/
|
45
|
public CreateNewTaxonBaseOperation(String label, IUndoContext undoContext, Taxon taxon,
|
46
|
IPostOperationEnabled postOperationEnabled) {
|
47
|
super(label, undoContext, taxon, postOperationEnabled);
|
48
|
}
|
49
|
|
50
|
/**
|
51
|
* @param newTaxonBase
|
52
|
*/
|
53
|
protected void addToSaveList(TaxonBase newTaxonBase) {
|
54
|
TaxonNameEditorE4 editor = null;
|
55
|
Object activePart = EditorUtil.getActivePart();
|
56
|
if (activePart instanceof TaxonNameEditorE4){
|
57
|
editor = (TaxonNameEditorE4) activePart;
|
58
|
editor.getEditorInput().addToSaveNew(newTaxonBase);
|
59
|
editor.setDirty();
|
60
|
}
|
61
|
}
|
62
|
|
63
|
}
|