1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.ui.section.key;
|
5
|
|
6
|
import java.util.Collection;
|
7
|
|
8
|
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
|
9
|
import eu.etaxonomy.cdm.model.description.IIdentificationKey;
|
10
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
11
|
import eu.etaxonomy.taxeditor.ui.element.CdmFormFactory;
|
12
|
import eu.etaxonomy.taxeditor.ui.element.ICdmFormElement;
|
13
|
import eu.etaxonomy.taxeditor.ui.section.AbstractEntityCollectionSection;
|
14
|
|
15
|
/**
|
16
|
* @author n.hoffmann
|
17
|
*
|
18
|
*/
|
19
|
public class GeographicalScopeDetailSection extends
|
20
|
AbstractEntityCollectionSection<IIdentificationKey, NamedArea> {
|
21
|
|
22
|
public GeographicalScopeDetailSection(CdmFormFactory formFactory,
|
23
|
ConversationHolder conversation, ICdmFormElement parentElement, int style) {
|
24
|
super(formFactory, conversation, parentElement, "Geographical Scope", style);
|
25
|
}
|
26
|
|
27
|
@Override
|
28
|
public Collection<NamedArea> getCollection(IIdentificationKey entity) {
|
29
|
return entity.getGeographicalScope();
|
30
|
}
|
31
|
|
32
|
@Override
|
33
|
public NamedArea createNewElement() {
|
34
|
return NamedArea.NewInstance();
|
35
|
}
|
36
|
|
37
|
@Override
|
38
|
public void addElement(NamedArea element) {
|
39
|
getEntity().addGeographicalScope(element);
|
40
|
}
|
41
|
|
42
|
@Override
|
43
|
public void removeElement(NamedArea element) {
|
44
|
getEntity().removeGeographicalScope(element);
|
45
|
}
|
46
|
|
47
|
@Override
|
48
|
public String getEmptyString() {
|
49
|
return "No geographical scopes yet.";
|
50
|
}
|
51
|
|
52
|
@Override
|
53
|
protected String getTooltipString() {
|
54
|
return "Add a geographical scope";
|
55
|
}
|
56
|
|
57
|
}
|