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
|
package eu.etaxonomy.taxeditor.ui.section.classification;
|
10
|
|
11
|
import javax.inject.Inject;
|
12
|
|
13
|
import org.eclipse.e4.core.contexts.IEclipseContext;
|
14
|
import org.eclipse.jface.wizard.Wizard;
|
15
|
import org.eclipse.swt.widgets.Shell;
|
16
|
|
17
|
import eu.etaxonomy.cdm.model.reference.Reference;
|
18
|
import eu.etaxonomy.cdm.model.taxon.Classification;
|
19
|
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
|
20
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
21
|
|
22
|
/**
|
23
|
* @author pplitzner
|
24
|
* @date Nov 6, 2016
|
25
|
*/
|
26
|
public class CloneClassificationWizard extends Wizard{
|
27
|
|
28
|
private CloneClassificationWizardPage cloneClassificationWizardPage;
|
29
|
|
30
|
private CdmFormFactory formFactory;
|
31
|
|
32
|
private String classificationName;
|
33
|
|
34
|
private TaxonRelationshipType relationType;
|
35
|
|
36
|
private Reference reference;
|
37
|
|
38
|
@Inject
|
39
|
private IEclipseContext context;
|
40
|
|
41
|
@Inject
|
42
|
public CloneClassificationWizard() {
|
43
|
super();
|
44
|
}
|
45
|
|
46
|
public void init(Classification classification){
|
47
|
formFactory = new CdmFormFactory(context.get(Shell.class).getDisplay());
|
48
|
cloneClassificationWizardPage = new CloneClassificationWizardPage(formFactory, classification);
|
49
|
addPage(cloneClassificationWizardPage);
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
public boolean canFinish() {
|
54
|
return cloneClassificationWizardPage.getClassificationName()!=null
|
55
|
&& cloneClassificationWizardPage.getRelationType()!=null &&
|
56
|
cloneClassificationWizardPage.getReference()!=null;
|
57
|
}
|
58
|
|
59
|
@Override
|
60
|
public boolean performFinish() {
|
61
|
classificationName = cloneClassificationWizardPage.getClassificationName();
|
62
|
relationType = cloneClassificationWizardPage.getRelationType();
|
63
|
reference = cloneClassificationWizardPage.getReference();
|
64
|
return true;
|
65
|
}
|
66
|
|
67
|
public String getClassificationName(){
|
68
|
return classificationName;
|
69
|
}
|
70
|
|
71
|
public TaxonRelationshipType getRelationType(){
|
72
|
return relationType;
|
73
|
}
|
74
|
|
75
|
public Reference getReference(){
|
76
|
return reference;
|
77
|
}
|
78
|
}
|