Project

General

Profile

Download (2.27 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
* Copyright (C) 2016 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.ui.dialog;
11

    
12
import eu.etaxonomy.cdm.model.common.TermType;
13
import eu.etaxonomy.cdm.model.reference.Reference;
14
import eu.etaxonomy.cdm.model.taxon.Classification;
15
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
16
import eu.etaxonomy.taxeditor.ui.combo.TermComboElement;
17
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
18
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
19
import eu.etaxonomy.taxeditor.ui.element.TextWithLabelElement;
20
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
21
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
22

    
23
/**
24
 * @author pplitzner
25
 * @date Nov 6, 2016
26
 *
27
 */
28
public class CloneClassificationDetailElement  extends
29
AbstractCdmDetailElement<Classification>{
30

    
31
    private TextWithLabelElement txtClassificationName;
32
    private TermComboElement<TaxonRelationshipType> comboRelationType;
33
    private EntitySelectionElement<Reference> selectReference;
34

    
35
    public CloneClassificationDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
36
        super(formFactory, formElement);
37
    }
38

    
39
     @Override
40
    protected void createControls(ICdmFormElement formElement, Classification entity, int style) {
41
         txtClassificationName = formFactory.createTextWithLabelElement(formElement, "Classification name", null, style);
42
         comboRelationType = formFactory.createDefinedTermComboElement(TermType.TaxonRelationshipType, formElement, "Taxon relation", null, style);
43
         selectReference = formFactory.createSelectionElement(Reference.class, getConversationHolder(), formElement, "Reference", null, EntitySelectionElement.SELECTABLE, style);
44
    }
45

    
46
     @Override
47
    public void handleEvent(Object eventSource) {
48
    }
49

    
50
    public String getClassificationName(){
51
        return txtClassificationName.getText();
52
    }
53

    
54
    public TaxonRelationshipType getRelationType(){
55
        return comboRelationType.getSelection();
56
    }
57

    
58
    public Reference getReference(){
59
        return selectReference.getSelection();
60
    }
61

    
62
}
(1-1/7)