1 package eu
.etaxonomy
.taxeditor
.model
;
3 import org
.apache
.log4j
.Logger
;
4 import org
.eclipse
.jface
.resource
.ImageDescriptor
;
5 import org
.eclipse
.ui
.IEditorInput
;
6 import org
.eclipse
.ui
.IPersistableElement
;
8 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
9 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
10 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
16 public class NameEditorInput
implements IEditorInput
{
18 private static final Logger logger
= Logger
.getLogger(NameEditorInput
.class);
22 public NameEditorInput (Taxon taxon
) {
26 public boolean exists() {
27 // TODO Auto-generated method stub
31 public ImageDescriptor
getImageDescriptor() {
32 // TODO Auto-generated method stub
36 public String
getName() {
37 TaxonNameBase name
= taxon
.getName();
38 if (name
== null || name
.getTitleCache() == null) {
41 return name
.getTitleCache();
45 public IPersistableElement
getPersistable() {
46 // TODO Auto-generated method stub
50 public String
getToolTipText() {
54 public Object
getAdapter(Class adapter
) {
56 if (adapter
== Taxon
.class) {
64 * Overrides equals to ensure that a taxon can only be edited by
65 * one editor at a time.
69 public boolean equals(Object obj
) {
70 if (obj
.getClass().equals(NameEditorInput
.class)
71 && taxon
.equals(((NameEditorInput
) obj
).taxon
))