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
.key
;
12 import java
.util
.Collection
;
14 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
15 import eu
.etaxonomy
.cdm
.model
.description
.PolytomousKey
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
17 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.TaxonBaseSelectionDialog
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
24 * @created Mar 29, 2011
27 public class TaxonomicScopeSection
extends
28 AbstractEntityCollectionSection
<PolytomousKey
, Taxon
> {
33 * @param parentElement
37 public TaxonomicScopeSection(CdmFormFactory formFactory
,
38 ConversationHolder conversation
, ICdmFormElement parentElement
,
40 super(formFactory
, conversation
, parentElement
, "Taxonomic Scope",
47 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
48 * getCollection(java.lang.Object)
51 public Collection
<Taxon
> getCollection(PolytomousKey entity
) {
52 return entity
.getTaxonomicScope();
58 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
62 public Taxon
createNewElement() {
63 Taxon selection
= TaxonBaseSelectionDialog
.selectTaxon(getShell(),
64 getConversationHolder(), null);
73 * eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#addElement
77 public void addElement(Taxon element
) {
78 getEntity().addTaxonomicScope(element
);
84 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
85 * removeElement(java.lang.Object)
88 public void removeElement(Taxon element
) {
89 getEntity().removeTaxonomicScope(element
);
95 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
99 public String
getEmptyString() {
100 return "No taxonomic scope yet.";
106 * @see eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection#
110 protected String
getTooltipString() {
111 return "Add a taxon to the scope of this key";