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
.model
.name
.BotanicalName
;
18 * Property source for BotanicalName entries.
24 public class BotanicalNamePropertySource
extends NonViralNamePropertySource
{
25 private static final Logger logger
= Logger
26 .getLogger(BotanicalNamePropertySource
.class);
28 // Property unique keys
29 public static final String P_ID_REFERENCEYEAR
= "referenceyear";
30 // Property display keys
31 public static final String P_REFERENCEYEAR
= "099:Reference Year";
33 public BotanicalNamePropertySource(BotanicalName name
) {
35 // addDescriptor(P_ID_REFERENCEYEAR);
38 protected void addDescriptor(String id
) {
39 if (id
.equals(P_ID_REFERENCEYEAR
)) {
40 descriptors
.addElement(
41 new TextPropertyDescriptor(P_ID_REFERENCEYEAR
, P_REFERENCEYEAR
));
43 super.addDescriptor(id
);
47 public Object
getPropertyValue(Object id
) {
48 if (id
.equals(P_ID_NOMENCLATURAL_CODE
)) {
51 if (id
.equals(P_ID_REFERENCEYEAR
)) {
52 return subEmptyForNull(name
.getReferenceYear());
54 return super.getPropertyValue(id
);