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
.detail
;
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
.IEditorPart
;
18 import org
.eclipse
.ui
.IWorkbenchPart
;
20 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
21 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
22 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
23 import eu
.etaxonomy
.taxeditor
.editor
.view
.AbstractCdmEditorViewPart
;
24 import eu
.etaxonomy
.taxeditor
.model
.AbstractCdmViewPart
;
25 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
26 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasSupplementalData
;
29 * <p>DetailsViewPart class.</p>
32 * @created Jun 10, 2010
35 public class DetailsViewPart
extends AbstractCdmEditorViewPart
implements IPartContentHasSupplementalData
{
37 /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.forms.det"{trunked}</code> */
38 public static String ID
= "eu.etaxonomy.taxeditor.editor.forms.detailsView";
40 private DetailsViewer viewer
;
44 public void createViewer(Composite parent
) {
45 //selectionService.addPostSelectionListener(this);
47 viewer
= new DetailsViewer(parent
, this);
48 getSite().setSelectionProvider(viewer
);
52 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
53 if(EditorUtil
.getActiveEditor() == null){
62 if(!(selection
instanceof IStructuredSelection
)){
66 if((part
instanceof IEditorPart
) || (part
instanceof AbstractCdmViewPart
)) {
67 if(((IStructuredSelection
) selection
).size() != 1){
72 // do not show details for feature nodes TODO really?
73 if(((IStructuredSelection
) selection
).getFirstElement() instanceof FeatureNodeContainer
){
74 // do show the map for distributions
75 Feature feature
= ((FeatureNodeContainer
) ((IStructuredSelection
) selection
).getFirstElement()).getFeature();
76 if(!feature
.equals(Feature
.DISTRIBUTION())){
82 showViewer(part
, selection
);
90 public boolean postOperation(CdmBase objectAffectedByOperation
) {
92 viewer
.setInput(objectAffectedByOperation
);
94 return super.postOperation(objectAffectedByOperation
);
100 public Viewer
getViewer() {
107 public void dispose() {
109 selectionService
.removePostSelectionListener(this);
117 public boolean onComplete() {
118 // TODO Auto-generated method stub