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 eu
.etaxonomy
.cdm
.model
.reference
.Article
;
17 import eu
.etaxonomy
.cdm
.model
.reference
.Book
;
18 import eu
.etaxonomy
.cdm
.model
.reference
.BookSection
;
19 import eu
.etaxonomy
.cdm
.model
.reference
.Generic
;
20 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
23 * Subclass of <code>ReferencePropertySource</code> which restricts reference type menu
24 * to "Article", "Generic", "Book", "Book Section".
30 public class NomenclaturalReferencePropertySource
extends
31 ReferencePropertySource
{
33 public NomenclaturalReferencePropertySource(ReferenceBase
<?
> reference
) {
37 protected static HashMap
<Class
<?
>, String
> nomReferenceTypeMap
= null;
39 protected void populateReferenceTypes() {
41 // LinkedHashMap maintains insertion order
42 nomReferenceTypeMap
= new LinkedHashMap
<Class
<?
>, String
>();
44 nomReferenceTypeMap
.put(ReferenceBase
.class, "");
45 // referenceTypeMap.put(BibtexReference.class, "BibTeX Reference");
46 nomReferenceTypeMap
.put(Article
.class, "Article");
47 nomReferenceTypeMap
.put(Generic
.class, "Generic");
48 nomReferenceTypeMap
.put(Book
.class, "Book");
49 nomReferenceTypeMap
.put(BookSection
.class, "Book Section");
52 protected String
[] getReferenceTypeArray() {
53 if (nomReferenceTypeMap
== null) {
54 populateReferenceTypes();
56 return nomReferenceTypeMap
.values().toArray(new String
[] {});
59 protected Set
<Class
<?
>> getReferenceClassSet() {
60 return nomReferenceTypeMap
.keySet();
63 protected int getSearchType() {
64 return IReferenceSearch
.NOMREF
;