4 package eu
.etaxonomy
.taxeditor
.ui
.section
.supplemental
;
6 import java
.util
.Collection
;
8 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
9 import eu
.etaxonomy
.cdm
.model
.common
.Credit
;
10 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
11 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
12 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
13 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
16 * <p>CreditSection class.</p>
19 * @created Nov 16, 2009
22 public class CreditSection
extends AbstractEntityCollectionSection
<IdentifiableEntity
, Credit
> {
25 * <p>Constructor for CreditSection.</p>
27 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
29 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
30 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
32 public CreditSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
33 super(cdmFormFactory
, conversation
, parentElement
, "Credits", style
);
38 public Credit
createNewElement() {
39 return Credit
.NewInstance(null, null);
44 public Collection
<Credit
> getCollection(IdentifiableEntity entity
) {
45 return entity
.getCredits();
50 public String
getEmptyString() {
51 return "No credits yet.";
56 protected String
getTooltipString() {
57 return "Create a new credit entry";
62 public void addElement(Credit element
) {
63 getEntity().addCredit(element
);
68 public void removeElement(Credit element
) {
69 getEntity().removeCredit(element
);