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
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.molecular
.Sequence
;
16 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
17 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
26 public class SequenceReferenceCollectionDetailSection
extends
27 AbstractEntityCollectionSection
<Sequence
, Reference
> {
29 public SequenceReferenceCollectionDetailSection(CdmFormFactory formFactory
,
30 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
31 super(formFactory
, conversation
, parentElement
, "References", style
);
35 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
39 public Collection
<Reference
> getCollection(Sequence entity
) {
40 return entity
.getCitations();
44 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
48 public Reference
createNewElement() {
53 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
57 public void addElement(Reference element
) {
58 getEntity().addCitation(element
);
62 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
66 public void removeElement(Reference element
) {
67 getEntity().removeCitation(element
);
71 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
75 public String
getEmptyString() {
76 return "No references yet.";
80 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
84 protected String
getTooltipString() {
85 return "Add a reference";