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.
9 package eu
.etaxonomy
.taxeditor
.ui
.section
.description
;
11 import java
.util
.Collection
;
12 import java
.util
.Comparator
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
16 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
17 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.section
.DefaultCdmBaseComparator
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.occurrence
.dna
.AbstractUnboundEntityCollectionSection
;
23 * <p>ScopeSection class.</p>
26 * @created Mar 18, 2010
29 public class ScopeSection
extends AbstractUnboundEntityCollectionSection
<TaxonDescription
, DefinedTerm
> {
32 * <p>Constructor for ScopeSection.</p>
34 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
35 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
36 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
39 public ScopeSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
40 super(cdmFormFactory
, conversation
, parentElement
, "Scope", style
);
44 public void addElement(DefinedTerm element
) {
45 getEntity().addScope(element
);
50 public DefinedTerm
createNewElement() {
55 public String
getEmptyString() {
56 return "No scopes yet.";
60 protected String
getTooltipString() {
61 return "Create a new scope";
65 public void removeElement(DefinedTerm element
) {
66 getEntity().removeScope(element
);
70 protected Collection
<DefinedTerm
> getEntityCollection(TaxonDescription entity
) {
71 return entity
.getScopes();
75 public Comparator
<DefinedTerm
> getComparator() {
76 return new DefaultCdmBaseComparator
<>();
80 public DefinedTerm
addExisting() {
85 public boolean allowAddExisting() {