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
.reference
;
12 import java
.util
.HashMap
;
13 import java
.util
.LinkedHashMap
;
16 import org
.apache
.log4j
.Logger
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.Article
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.Book
;
20 import eu
.etaxonomy
.cdm
.model
.reference
.BookSection
;
21 import eu
.etaxonomy
.cdm
.model
.reference
.Generic
;
22 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
25 * Subclass of <code>ReferencePropertySource</code> which restricts reference type menu
26 * to "Article", "Generic", "Book", "Book Section".
32 public class NomenclaturalReferencePropertySource
extends
33 ReferencePropertySource
{
34 private static final Logger logger
= Logger
35 .getLogger(NomenclaturalReferencePropertySource
.class);
37 public NomenclaturalReferencePropertySource(ReferenceBase reference
) {
41 protected static HashMap
<Class
, String
> nomReferenceTypeMap
= null;
43 protected void populateReferenceTypes() {
45 // LinkedHashMap maintains insertion order
46 nomReferenceTypeMap
= new LinkedHashMap
<Class
, String
>();
48 nomReferenceTypeMap
.put(ReferenceBase
.class, "");
49 // referenceTypeMap.put(BibtexReference.class, "BibTeX Reference");
50 nomReferenceTypeMap
.put(Article
.class, "Article");
51 nomReferenceTypeMap
.put(Generic
.class, "Generic");
52 nomReferenceTypeMap
.put(Book
.class, "Book");
53 nomReferenceTypeMap
.put(BookSection
.class, "Book Section");
56 protected String
[] getReferenceTypeArray() {
57 if (nomReferenceTypeMap
== null) {
58 populateReferenceTypes();
60 return nomReferenceTypeMap
.values().toArray(new String
[] {});
63 protected Set
<Class
> getReferenceClassSet() {
64 return nomReferenceTypeMap
.keySet();
67 protected int getSearchType() {
68 return IReferenceSearch
.NOMREF
;