1 package eu
.etaxonomy
.taxeditor
.editor
.view
.derivate
;
3 import org
.eclipse
.jface
.viewers
.ISelection
;
4 import org
.eclipse
.jface
.viewers
.IStructuredSelection
;
5 import org
.eclipse
.jface
.viewers
.TreeViewer
;
6 import org
.eclipse
.jface
.viewers
.Viewer
;
7 import org
.eclipse
.swt
.SWT
;
8 import org
.eclipse
.swt
.widgets
.Composite
;
9 import org
.eclipse
.swt
.widgets
.Tree
;
10 import org
.eclipse
.ui
.IWorkbenchPart
;
12 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
13 import eu
.etaxonomy
.taxeditor
.bulkeditor
.BulkEditor
;
14 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasDetails
;
15 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasSupplementalData
;
16 import eu
.etaxonomy
.taxeditor
.view
.AbstractCdmEditorViewPart
;
19 * Displays the derivate hierarchy of all derivates belonging to a taxon.
22 public class DerivateView
extends AbstractCdmEditorViewPart
implements IPartContentHasDetails
, IPartContentHasSupplementalData
{
24 /** Constant <code>ID="eu.etaxonomy.taxeditor.editor.view.desc"{trunked}</code> */
25 public static final String ID
= "eu.etaxonomy.taxeditor.editor.view.derivate.SpecimenView";
27 protected TreeViewer viewer
;
30 public void createViewer(Composite parent
) {
31 viewer
= new TreeViewer(new Tree(parent
, SWT
.MULTI
| SWT
.H_SCROLL
| SWT
.V_SCROLL
| SWT
.FULL_SELECTION
));
32 viewer
.setContentProvider(new DerivateContentProvider());
33 viewer
.setLabelProvider(new DerivateLabelProvider());
34 viewer
.setAutoExpandLevel(2);
35 // Propagate selection from viewer
36 getSite().setSelectionProvider(viewer
);
40 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
41 if(part
instanceof BulkEditor
&& selection
instanceof IStructuredSelection
){
42 showViewer(part
, (IStructuredSelection
)selection
);
52 public boolean onComplete() {
53 // TODO Auto-generated method stub
58 public Viewer
getViewer() {
64 public boolean postOperation(CdmBase objectAffectedByOperation
) {
65 return super.postOperation(objectAffectedByOperation
);