1 package eu
.etaxonomy
.taxeditor
.view
.userecords
;
3 import org
.eclipse
.jface
.viewers
.ISelection
;
4 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
5 import org
.eclipse
.jface
.viewers
.Viewer
;
6 import org
.eclipse
.swt
.widgets
.Composite
;
7 import org
.eclipse
.ui
.IEditorPart
;
8 import org
.eclipse
.ui
.IWorkbenchPart
;
10 import eu
.etaxonomy
.cdm
.model
.description
.Feature
;
11 import eu
.etaxonomy
.taxeditor
.model
.FeatureNodeContainer
;
12 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasSupplementalData
;
13 import eu
.etaxonomy
.taxeditor
.store
.StoreUtil
;
14 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmEditorViewPart
;
15 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmViewPart
;
18 public class UseRecordsViewPart
extends AbstractCdmEditorViewPart
implements IPartContentHasSupplementalData
{
20 public static String ID
= "eu.etaxonomy.taxeditor.view.userecords";
21 private UseRecordsViewer viewer
;
24 public void createViewer(Composite parent
) {
25 //selectionService.addPostSelectionListener(this);
27 viewer
= new UseRecordsViewer(parent
, this);
28 getSite().setSelectionProvider(viewer
);
33 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
34 if(StoreUtil
.getActiveEditor() == null){
43 if(!(selection
instanceof IStructuredSelection
)){
47 IStructuredSelection structuredSelection
= (IStructuredSelection
) selection
;
49 if((part
instanceof IEditorPart
) || (part
instanceof AbstractCdmViewPart
)) {
50 if(structuredSelection
.size() != 1){
55 // do not show details for feature nodes TODO really?
56 if(structuredSelection
.getFirstElement() instanceof FeatureNodeContainer
){
57 // do show the map for distributions
58 Feature feature
= ((FeatureNodeContainer
) ((IStructuredSelection
) selection
).getFirstElement()).getFeature();
59 if(!feature
.equals(Feature
.DISTRIBUTION())){
65 showViewer(part
, structuredSelection
);
73 public Viewer
getViewer() {
79 public void dispose() {
81 selectionService
.removePostSelectionListener(this);
89 public boolean onComplete() {