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
.occurrence
;
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
.location
.NamedArea
;
17 import eu
.etaxonomy
.taxeditor
.ui
.dialog
.selection
.NamedAreaSelectionDialog
;
18 import eu
.etaxonomy
.taxeditor
.ui
.element
.CdmFormFactory
;
19 import eu
.etaxonomy
.taxeditor
.ui
.element
.ICdmFormElement
;
20 import eu
.etaxonomy
.taxeditor
.ui
.section
.AbstractEntityCollectionSection
;
28 public class GeoScopePolyKeyDetailSection
extends AbstractEntityCollectionSection
<PolytomousKey
, NamedArea
> {
30 public GeoScopePolyKeyDetailSection(CdmFormFactory formFactory
,
31 ConversationHolder conversation
, ICdmFormElement parentElement
, int style
) {
32 super(formFactory
, conversation
, parentElement
, "Geo Scopes", style
);
37 public Collection
<NamedArea
> getCollection(PolytomousKey entity
) {
38 return entity
.getGeographicalScope();
43 public NamedArea
createNewElement() {
44 NamedArea selection
= NamedAreaSelectionDialog
.select(getLayoutComposite().getShell(), getConversationHolder(), null, PolytomousKey
.class.getCanonicalName());
51 public void addElement(NamedArea element
) {
52 getEntity().addGeographicalScope(element
);
57 public void removeElement(NamedArea element
) {
58 getEntity().removeGeographicalScope(element
);
63 public String
getEmptyString() {
64 return "No geo scopes yet.";
69 protected String
getTooltipString() {
70 return "Add a geo scope";