3 * Copyright (C) 2014 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
;
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
.section
.AbstractCdmDetailElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.selection
.EntitySelectionElement
;
25 public class SingleReadGeneralDetailElement
extends AbstractCdmDetailElement
<SingleRead
> {
27 private EntitySelectionElement
<Primer
> selectionPrimer
;
28 private EntitySelectionElement
<Amplification
> selectionAmplification
;
34 public SingleReadGeneralDetailElement(CdmFormFactory formFactory
, ICdmFormElement formElement
) {
35 super(formFactory
, formElement
);
42 * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#createControls
43 * (eu.etaxonomy.taxeditor.forms.ICdmFormElement, java.lang.Object, int)
46 protected void createControls(ICdmFormElement formElement
, SingleRead entity
, int style
) {
47 selectionPrimer
= formFactory
.createSelectionElement(Primer
.class, getConversationHolder(), formElement
, "Primer", entity
.getPrimer(), EntitySelectionElement
.ALL
, style
);
48 selectionAmplification
= formFactory
.createSelectionElement(Amplification
.class, getConversationHolder(), formElement
, "Amplification", entity
.getAmplification(), EntitySelectionElement
.ALL
, style
);
55 * eu.etaxonomy.taxeditor.section.AbstractCdmDetailElement#handleEvent(java
59 public void handleEvent(Object eventSource
) {
60 if(eventSource
==selectionPrimer
){
61 getEntity().setPrimer(selectionPrimer
.getSelection());
63 else if(eventSource
==selectionAmplification
){
64 selectionAmplification
.getSelection().addSingleRead(getEntity());