Project

General

Profile

Download (1.42 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
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.
8
*/
9

    
10
package eu.etaxonomy.taxeditor.propertysheet.name;
11

    
12
import org.eclipse.ui.views.properties.TextPropertyDescriptor;
13

    
14
import eu.etaxonomy.cdm.common.CdmUtils;
15
import eu.etaxonomy.cdm.model.name.BotanicalName;
16

    
17
/**
18
 * Property source for BotanicalName entries.
19
 *  
20
 * @author p.ciardelli
21
 * @created 21.05.2008
22
 * @version 1.0
23
 */
24
public class BotanicalNamePropertySource extends NonViralNamePropertySource {
25
	
26
    // Property unique keys
27
	public static final String P_ID_REFERENCEYEAR = "referenceyear";	
28
    // Property display keys
29
	public static final String P_REFERENCEYEAR = "Reference Year";
30
		
31
	public BotanicalNamePropertySource(BotanicalName name) {
32
		super(name);
33
//		addDescriptor(P_ID_REFERENCEYEAR);
34
	}
35
		
36
	protected void addDescriptor(String id) {
37
		if (id.equals(P_ID_REFERENCEYEAR)) {
38
			descriptors.addElement(
39
					new TextPropertyDescriptor(P_ID_REFERENCEYEAR, P_REFERENCEYEAR));
40
		}
41
		super.addDescriptor(id);
42
	}
43
	
44
	@Override
45
	public Object getPropertyValue(Object id) {
46
        if (id.equals(P_ID_REFERENCEYEAR)) {
47
        	return CdmUtils.Nz(name.getReferenceYear());
48
        }
49
		return super.getPropertyValue(id);
50
	}
51
}
(3-3/16)