2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.ui
.section
.description
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
16 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
22 * <p>ScopeSection class.</p>
25 * @created Mar 18, 2010
28 public class ScopeSection
extends AbstractUnboundEntityCollectionSection
<TaxonDescription
, DefinedTerm
> {
31 * <p>Constructor for ScopeSection.</p>
33 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
34 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
35 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
38 public ScopeSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
39 super(cdmFormFactory
, conversation
, parentElement
, "Scope", style
);
44 public void addElement(DefinedTerm element
) {
45 getEntity().addScope(element
);
50 public DefinedTerm
createNewElement() {
56 public String
getEmptyString() {
57 return "No scopes yet.";
62 protected String
getTooltipString() {
63 return "Create a new scope";
68 public void removeElement(DefinedTerm element
) {
69 getEntity().removeScope(element
);
73 * @see eu.etaxonomy.taxeditor.ui.section.occurrence.dna.AbstractUnboundEntityCollectionSection#getEntityCollection(java.lang.Object)
76 protected Collection
<DefinedTerm
> getEntityCollection(TaxonDescription entity
) {
77 return entity
.getScopes();
84 public DefinedTerm
addExisting() {
92 public boolean allowAddExisting() {