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
.navigation
;
12 import org
.apache
.log4j
.Logger
;
14 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
15 import eu
.etaxonomy
.cdm
.model
.reference
.ReferenceBase
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
19 * A singleton used as a placeholder in the taxonomic tree when user executes the
20 * action "Add taxon with quick name". When the user enters a valid (i.e. non "")
21 * string, the node is replaced with a taxon. Note that this should not be added to
22 * the session data repository, nor should it be added to its parent taxon's
25 * @see TaxonomicTreeViewer
26 * @see TaxonomicTreeContentProvider
32 public class QuickNameTaxon
extends Taxon
{
33 private static final Logger logger
= Logger
.getLogger(QuickNameTaxon
.class);
35 private static QuickNameTaxon instance
= null;
37 private Taxon parentTaxon
;
39 private QuickNameTaxon(NonViralName name
, ReferenceBase sec
) {
43 public static QuickNameTaxon
getInstance() {
44 if (instance
== null) {
45 instance
= new QuickNameTaxon(null, null);
50 public ReferenceBase
getSec() {
51 if (parentTaxon
== null) {
54 return parentTaxon
.getSec();
58 public void setParent(Taxon parentTaxon
) {
59 this.parentTaxon
= parentTaxon
;
62 public Taxon
getTaxonomicParent() {