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 * The context manager mediates context start/stop and workbench shutdowns to all registered listeners.
21 * @created mar 13, 2012
24 public class UseRecordsViewPart
extends AbstractCdmEditorViewPart
implements IPartContentHasSupplementalData
{
26 public static String ID
= "eu.etaxonomy.taxeditor.view.userecords";
27 private UseRecordsViewer viewer
;
30 public void createViewer(Composite parent
) {
31 viewer
= new UseRecordsViewer(parent
, this);
32 getSite().setSelectionProvider(viewer
);
37 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
38 if(StoreUtil
.getActiveEditor() == null){
47 if(!(selection
instanceof IStructuredSelection
)){
51 IStructuredSelection structuredSelection
= (IStructuredSelection
) selection
;
53 if((part
instanceof IEditorPart
) || (part
instanceof AbstractCdmViewPart
)) {
54 if(structuredSelection
.size() != 1){
59 // do not show details for feature nodes TODO really?
60 if(structuredSelection
.getFirstElement() instanceof FeatureNodeContainer
){
61 // do show the map for distributions
62 Feature feature
= ((FeatureNodeContainer
) ((IStructuredSelection
) selection
).getFirstElement()).getFeature();
63 if(!feature
.equals(Feature
.DISTRIBUTION())){
69 showViewer(part
, structuredSelection
);
77 public Viewer
getViewer() {
83 public void dispose() {
85 selectionService
.removePostSelectionListener(this);
93 public boolean onComplete() {