733c9aa088f0aa86a081a4b30e83b48ad2736abf
[taxeditor.git] / taxeditor-editor / src / main / java / eu / etaxonomy / taxeditor / propertysheet / AnnotationPropertySource.java
1 package eu.etaxonomy.taxeditor.propertysheet;
2
3 import java.util.Collection;
4
5 import org.apache.log4j.Logger;
6
7 import eu.etaxonomy.cdm.model.common.Annotation;
8
9 public class AnnotationPropertySource extends CollectionPropertySource {
10 private static final Logger logger = Logger
11 .getLogger(AnnotationPropertySource.class);
12
13 public AnnotationPropertySource(Collection collection) {
14 super(collection);
15 }
16
17 @Override
18 protected String getItemDisplayName(Object item) {
19 // No display names on individual annotations
20 return "";
21 }
22
23 @Override
24 public Object getPropertyValue(Object id) {
25 if (id instanceof Annotation) {
26 return ((Annotation) id).getText();
27 }
28 return null;
29 }
30
31 @Override
32 public void setPropertyValue(Object id, Object value) {
33 // Fields not editable in property sheet view
34 }
35
36 @Override
37 public String toString() {
38 // "Annotations" header has no value
39 return "";
40 }
41 }