3 * Copyright (C) 2015 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
;
12 import org
.apache
.log4j
.Logger
;
13 import org
.eclipse
.ui
.PartInitException
;
15 import eu
.etaxonomy
.cdm
.model
.occurrence
.SpecimenOrObservationBase
;
16 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
17 import eu
.etaxonomy
.taxeditor
.editor
.view
.derivate
.DerivateView
;
18 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
19 import eu
.etaxonomy
.taxeditor
.view
.ICdmViewer
;
26 public class EditorCdmViewer
implements ICdmViewer
{
28 private final Logger logger
= Logger
.getLogger(EditorCdmViewer
.class);
31 * @see eu.etaxonomy.taxeditor.view.ICdmViewer#show(java.lang.Object)
34 public void show(Object input
, String viewerClass
) {
36 if(viewerClass
.equals(MultiPageTaxonEditor
.class.toString())){
37 if(input
instanceof TaxonBase
){
38 TaxonEditorInput editorInput
= TaxonEditorInput
.NewInstanceFromTaxonBase(((TaxonBase
<?
>) input
).getUuid());
39 EditorUtil
.open(editorInput
);
42 else if(viewerClass
.equals(DerivateView
.class.toString())){
43 if(input
instanceof SpecimenOrObservationBase
){
46 } catch (PartInitException e
) {
47 String errorMessage
= "Could not open editor";
48 logger
.error(errorMessage
, e
);
49 MessagingUtils
.error(EditorCdmViewer
.class, errorMessage
, e
);