Project

General

Profile

Download (2.76 KB) Statistics
| Branch: | Tag: | Revision:
1
// $Id$
2
/**
3
 * Copyright (C) 2014 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.section.occurrence.dna;
11

    
12
import eu.etaxonomy.cdm.model.molecular.Amplification;
13
import eu.etaxonomy.cdm.model.molecular.Primer;
14
import eu.etaxonomy.cdm.model.molecular.SingleRead;
15
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
16
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
17
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants;
18
import eu.etaxonomy.taxeditor.ui.section.AbstractCdmDetailElement;
19
import eu.etaxonomy.taxeditor.ui.section.supplemental.AnnotationSection;
20
import eu.etaxonomy.taxeditor.ui.selection.EntitySelectionElement;
21

    
22
/**
23
 * @author pplitzner
24
 * @date 06.01.2014
25
 *
26
 */
27
public class SingleReadGeneralDetailElement extends AbstractCdmDetailElement<SingleRead> {
28

    
29
    private EntitySelectionElement<Primer> selectionPrimer;
30
    private EntitySelectionElement<Amplification> selectionAmplification;
31

    
32
    /**
33
     * @param formFactory
34
     * @param formElement
35
     */
36
    public SingleReadGeneralDetailElement(CdmFormFactory formFactory, ICdmFormElement formElement) {
37
        super(formFactory, formElement);
38
    }
39

    
40
    /*
41
     * (non-Javadoc)
42
     *
43
     * @see
44
     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
45
     * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
46
     */
47
    @Override
48
    protected void createControls(ICdmFormElement formElement, SingleRead entity, int style) {
49
        selectionPrimer = formFactory.createSelectionElement(Primer.class, getConversationHolder(), formElement, "Primer", entity.getPrimer(), EntitySelectionElement.ALL, style);
50
//        selectionAmplification = formFactory.createSelectionElement(Amplification.class, getConversationHolder(), formElement, "Amplification", entity.getAmplification(), EntitySelectionElement.ALL, style);
51

    
52
        AnnotationSection annotationSection = formFactory.createAnnotationSection(getConversationHolder(), formElement, style);
53
        annotationSection.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(2, 1));
54
        annotationSection.setEntity(entity);
55
    }
56

    
57
    /*
58
     * (non-Javadoc)
59
     *
60
     * @see
61
     * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
62
     * .lang.Object)
63
     */
64
    @Override
65
    public void handleEvent(Object eventSource) {
66
        if(eventSource==selectionPrimer){
67
            getEntity().setPrimer(selectionPrimer.getSelection());
68
        }
69
        else if(eventSource==selectionAmplification){
70
//            selectionAmplification.getSelection().addSingleRead(getEntity());
71
        }
72
    }
73
}
(26-26/30)