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