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
.propertysheet
.name
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.ui
.views
.properties
.TextPropertyDescriptor
;
15 import eu
.etaxonomy
.cdm
.common
.CdmUtils
;
16 import eu
.etaxonomy
.cdm
.model
.name
.BotanicalName
;
19 * Property source for BotanicalName entries.
25 public class BotanicalNamePropertySource
extends NonViralNamePropertySource
{
26 private static final Logger logger
= Logger
27 .getLogger(BotanicalNamePropertySource
.class);
29 // Property unique keys
30 public static final String P_ID_REFERENCEYEAR
= "referenceyear";
31 // Property display keys
32 // public static final String P_REFERENCEYEAR = "099:Reference Year";
33 public static final String P_REFERENCEYEAR
= "Reference Year";
35 public BotanicalNamePropertySource(BotanicalName name
) {
37 // addDescriptor(P_ID_REFERENCEYEAR);
40 protected void addDescriptor(String id
) {
41 if (id
.equals(P_ID_REFERENCEYEAR
)) {
42 descriptors
.addElement(
43 new TextPropertyDescriptor(P_ID_REFERENCEYEAR
, P_REFERENCEYEAR
));
45 super.addDescriptor(id
);
49 public Object
getPropertyValue(Object id
) {
50 if (id
.equals(P_ID_NOMENCLATURAL_CODE
)) {
53 if (id
.equals(P_ID_REFERENCEYEAR
)) {
54 return CdmUtils
.Nz(name
.getReferenceYear());
56 return super.getPropertyValue(id
);