Project

General

Profile

Download (2.3 KB) Statistics
| Branch: | Tag: | Revision:
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.ui.section.classification;
11

    
12
import org.eclipse.jface.wizard.Wizard;
13
import org.eclipse.swt.widgets.Display;
14

    
15
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
16
import eu.etaxonomy.cdm.model.reference.Reference;
17
import eu.etaxonomy.cdm.model.taxon.Classification;
18
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
19
import eu.etaxonomy.taxeditor.store.CdmStore;
20
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
21

    
22
/**
23
 *
24
 * @author pplitzner
25
 * @date Nov 6, 2016
26
 *
27
 */
28

    
29
public class CloneClassificationWizard extends Wizard{
30

    
31
	private CloneClassificationWizardPage cloneClassificationWizardPage;
32

    
33
    private ConversationHolder conversationHolder;
34

    
35
    private CdmFormFactory formFactory;
36

    
37
    private String classificationName;
38

    
39
    private TaxonRelationshipType relationType;
40

    
41
    private Reference reference;
42

    
43
    public CloneClassificationWizard(Classification classification) {
44
        super();
45
        conversationHolder = CdmStore.createConversation();
46
        formFactory = new CdmFormFactory(Display.getCurrent(), null);
47
        cloneClassificationWizardPage = new CloneClassificationWizardPage(formFactory, conversationHolder, classification);
48
        addPage(cloneClassificationWizardPage);
49
    }
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

    
68
    public String getClassificationName(){
69
        return classificationName;
70
    }
71

    
72
    public TaxonRelationshipType getRelationType(){
73
        return relationType;
74
    }
75

    
76
    public Reference getReference(){
77
        return reference;
78
    }
79

    
80
}
(5-5/12)