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
.key
;
13 import java
.util
.Collection
;
15 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
16 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
17 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
18 import eu
.etaxonomy
.taxeditor
.ui
.campanula
.compatibility
.ICdmFormElement
;
19 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.TaxonBaseSelectionDialog
;
20 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
21 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
25 * @created Mar 29, 2011
28 public class TaxonomicScopeSection
extends
29 AbstractEntityCollectionSection
<PolytomousKey
, Taxon
> {
34 * @param parentElement
38 public TaxonomicScopeSection(CdmFormFactory formFactory
,
39 ConversationHolder conversation
, ICdmFormElement parentElement
,
41 super(formFactory
, conversation
, parentElement
, "Taxonomic Scope",
48 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
49 * getCollection(java.lang.Object)
52 public Collection
<Taxon
> getCollection(PolytomousKey entity
) {
53 return entity
.getTaxonomicScope();
59 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
63 public Taxon
createNewElement() {
64 Taxon selection
= TaxonBaseSelectionDialog
.selectTaxon(getShell(),
65 getConversationHolder(), null);
74 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
78 public void addElement(Taxon element
) {
79 getEntity().addTaxonomicScope(element
);
85 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
86 * removeElement(java.lang.Object)
89 public void removeElement(Taxon element
) {
90 getEntity().removeTaxonomicScope(element
);
96 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
100 public String
getEmptyString() {
101 return "No taxonomic scope yet.";
107 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
111 protected String
getTooltipString() {
112 return "Add a taxon to the scope of this key";