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 eu
.etaxonomy
.cdm
.model
.name
.ZoologicalName
;
15 * Property source for ZoologicalName entries.
21 public class ZoologicalNamePropertySource
extends NonViralNamePropertySource
{
23 private ZoologicalName zoologicalName
;
25 // Property unique keys
26 public static final String P_ID_PUBLICATIONYEAR
= "publicationyear";
27 // Property display keys
28 // public static final String P_PUBLICATIONYEAR = "099:Publication Year";
29 public static final String P_PUBLICATIONYEAR
= "Publication Year";
31 public ZoologicalNamePropertySource(ZoologicalName name
) {
33 this.zoologicalName
= name
;
34 addDescriptor(P_ID_PUBLICATIONYEAR
);
38 public Object
getPropertyValue(Object id
) {
39 if (id
.equals(P_ID_NOMENCLATURAL_CODE
)) {
42 if (id
.equals(P_ID_PUBLICATIONYEAR
)) {
43 String publicationYear
= Integer
.toString(zoologicalName
.getPublicationYear());
44 if (publicationYear
.equals("0")) {
47 return publicationYear
;
50 return super.getPropertyValue(id
);