3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.section
.description
;
13 import java
.util
.Collection
;
15 import org
.apache
.log4j
.Logger
;
17 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
18 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
20 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
21 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
22 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
23 import eu
.etaxonomy
.taxeditor
.section
.AbstractEntityCollectionSection
;
26 * <p>DescriptionSourceSection class.</p>
29 * @created Mar 18, 2010
32 public class DescriptionSourceSection
extends
33 AbstractEntityCollectionSection
<DescriptionBase
, ReferenceBase
>{
34 private static final Logger logger
= Logger
35 .getLogger(DescriptionSourceSection
.class);
38 * <p>Constructor for DescriptionSourceSection.</p>
40 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
41 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
42 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
45 public DescriptionSourceSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
46 ICdmFormElement parentElement
, int style
) {
47 super(cdmFormFactory
, conversation
, parentElement
, "Description Sources", style
);
54 public void addElement(ReferenceBase element
) {
55 getEntity().addDescriptionSource(element
);
60 public ReferenceBase
createNewElement() {
61 return new ReferenceFactory().newGeneric();
66 public Collection
<ReferenceBase
> getCollection(DescriptionBase entity
) {
67 return entity
.getDescriptionSources();
72 public String
getEmptyString() {
73 return "No description sources yet.";
78 protected String
getTooltipString() {
79 return "Add a reference as source for this description";
84 public void removeElement(ReferenceBase element
) {
85 getEntity().removeDescriptionSource(element
);