3 * Copyright (C) 2007 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.
11 package eu
.etaxonomy
.taxeditor
.editor
.view
.supplementaldata
;
13 import org
.eclipse
.jface
.viewers
.ISelection
;
14 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
15 import org
.eclipse
.jface
.viewers
.Viewer
;
16 import org
.eclipse
.swt
.widgets
.Composite
;
17 import org
.eclipse
.ui
.IWorkbenchPart
;
18 import org
.eclipse
.ui
.part
.EditorPart
;
20 import eu
.etaxonomy
.cdm
.api
.facade
.DerivedUnitFacade
;
21 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
22 import eu
.etaxonomy
.taxeditor
.editor
.view
.AbstractCdmEditorViewPart
;
23 import eu
.etaxonomy
.taxeditor
.model
.AbstractCdmViewPart
;
24 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
28 * <p>SupplementalDataViewPart class.</p>
31 * @created Jun 10, 2010
34 public class SupplementalDataViewPart
extends AbstractCdmEditorViewPart
{
36 /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.supp"{trunked}</code> */
37 public static final String ID
= "eu.etaxonomy.taxeditor.editor.view.supplementalData";
39 private SupplementalDataViewer viewer
;
42 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
46 public void createViewer(Composite parent
) {
47 viewer
= new SupplementalDataViewer(parent
, this);
52 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
53 if(EditorUtil
.getActiveEditor() == null){
58 if(((part
instanceof EditorPart
) || (part
instanceof AbstractCdmViewPart
)) && selection
instanceof IStructuredSelection
) {
59 if(((IStructuredSelection
) selection
).size() != 1){
64 // do not show supplemental data for feature nodes
65 if(((IStructuredSelection
) selection
).getFirstElement() instanceof FeatureNodeContainer
){
69 if(((IStructuredSelection
) selection
).getFirstElement() instanceof DerivedUnitFacade
){
73 showViewer(part
, selection
);
81 public void dispose() {
83 selectionService
.removePostSelectionListener(this);
89 public Viewer
getViewer() {
98 public boolean onComplete() {
99 // TODO Auto-generated method stub