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 eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.description
.DescriptionBase
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.Reference
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceFactory
;
19 import eu
.etaxonomy
.taxeditor
.forms
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.forms
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.section
.AbstractEntityCollectionSection
;
24 * <p>DescriptionSourceSection class.</p>
27 * @created Mar 18, 2010
30 public class DescriptionSourceSection
extends
31 AbstractEntityCollectionSection
<DescriptionBase
, Reference
>{
34 * <p>Constructor for DescriptionSourceSection.</p>
36 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.forms.CdmFormFactory} object.
37 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
38 * @param parentElement a {@link eu.etaxonomy.taxeditor.forms.ICdmFormElement} object.
41 public DescriptionSourceSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
,
42 ICdmFormElement parentElement
, int style
) {
43 super(cdmFormFactory
, conversation
, parentElement
, "Description Sources", style
);
50 public void addElement(Reference element
) {
51 getEntity().addDescriptionSource(element
);
56 public Reference
createNewElement() {
57 return new ReferenceFactory().newGeneric();
62 public Collection
<Reference
> getCollection(DescriptionBase entity
) {
63 return entity
.getDescriptionSources();
68 public String
getEmptyString() {
69 return "No description sources yet.";
74 protected String
getTooltipString() {
75 return "Add a reference as source for this description";
80 public void removeElement(Reference element
) {
81 getEntity().removeDescriptionSource(element
);