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
.ui
.section
.description
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTerm
;
17 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
18 import eu
.etaxonomy
.cdm
.model
.description
.TaxonDescription
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
24 * <p>ScopeSection class.</p>
27 * @created Mar 18, 2010
30 public class ScopeSection
extends AbstractEntityCollectionSection
<TaxonDescription
, DefinedTerm
> {
33 * <p>Constructor for ScopeSection.</p>
35 * @param cdmFormFactory a {@link eu.etaxonomy.taxeditor.ui.element.CdmFormFactory} object.
36 * @param conversation a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
37 * @param parentElement a {@link eu.etaxonomy.taxeditor.ui.element.ICdmFormElement} object.
40 public ScopeSection(CdmFormFactory cdmFormFactory
, ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
41 super(cdmFormFactory
, conversation
, parentElement
, "Scope", style
);
46 public void addElement(DefinedTerm element
) {
47 getEntity().addScope(element
);
52 public DefinedTerm
createNewElement() {
53 return DefinedTerm
.NewInstance(TermType
.Scope
,"","Untitled","");
58 public Collection
<DefinedTerm
> getCollection(TaxonDescription entity
) {
59 return entity
.getScopes();
64 public String
getEmptyString() {
65 return "No scopes yet.";
70 protected String
getTooltipString() {
71 return "Create a new scope";
76 public void removeElement(DefinedTerm element
) {
77 getEntity().removeScope(element
);