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
.propertysheet
.description
;
13 import org
.apache
.log4j
.Logger
;
14 import org
.eclipse
.ui
.views
.properties
.PropertyDescriptor
;
16 import eu
.etaxonomy
.cdm
.model
.description
.Distribution
;
23 public class DistributionPropertySource
extends DescriptionElementPropertySource
{
24 private static final Logger logger
= Logger
25 .getLogger(DistributionPropertySource
.class);
27 public static final String P_ID_NAMED_AREA
= "named area";
28 public static final String P_NAMED_AREA
= "Named Area";
30 public static final String P_ID_STATUS
= "status";
31 public static final String P_STATUS
= "Status";
33 private Distribution distribution
;
38 public DistributionPropertySource(Distribution distribution
) {
41 this.distribution
= distribution
;
42 addDescriptor(P_ID_NAMED_AREA
);
43 addDescriptor(P_ID_STATUS
);
46 protected void addDescriptor(String id
) {
47 super.addDescriptor(id
);
49 if (id
.equals(P_ID_NAMED_AREA
)) {
50 descriptors
.addElement(
51 new PropertyDescriptor(P_ID_NAMED_AREA
, P_NAMED_AREA
)
55 if (id
.equals(P_ID_STATUS
)) {
56 descriptors
.addElement(
57 new PropertyDescriptor(P_ID_STATUS
, P_STATUS
)
64 public Object
getPropertyValue(Object id
) {
66 if (id
.equals(P_ID_NAMED_AREA
)) {
67 return distribution
.getArea().getLabel();
70 if (id
.equals(P_ID_STATUS
)) {
71 return distribution
.getStatus().getLabel();
74 return super.getPropertyValue(id
);