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
.cdm
.model
.reference
.ReferenceFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
27 public class SequenceReferenceCollectionDetailSection
extends
28 AbstractEntityCollectionSection
<Sequence
, Reference
> {
30 public SequenceReferenceCollectionDetailSection(CdmFormFactory formFactory
,
31 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
32 super(formFactory
, conversation
, parentElement
, "References", style
);
36 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getCollection(java.lang.Object)
40 public Collection
<Reference
> getCollection(Sequence entity
) {
41 return entity
.getCitations();
45 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#createNewElement()
49 public Reference
createNewElement() {
50 return ReferenceFactory
.newGeneric();
54 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#addElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
58 public void addElement(Reference element
) {
59 getEntity().addCitation(element
);
63 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#removeElement(eu.etaxonomy.cdm.model.common.IVersionableEntity)
67 public void removeElement(Reference element
) {
68 getEntity().removeCitation(element
);
72 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getEmptyString()
76 public String
getEmptyString() {
77 return "No references yet.";
81 * @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionSection#getTooltipString()
85 protected String
getTooltipString() {
86 return "Add a reference";