Project

General

Profile

Download (19.4 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy
4
 * http://www.e-taxonomy.eu
5
 *
6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7
 * See LICENSE.TXT at the top of this package for the full license terms.
8
 */
9

    
10
package eu.etaxonomy.taxeditor.editor.name.e4;
11

    
12
import java.util.ArrayList;
13
import java.util.HashSet;
14
import java.util.List;
15
import java.util.Set;
16

    
17
import javax.annotation.PostConstruct;
18
import javax.annotation.PreDestroy;
19
import javax.inject.Inject;
20

    
21
import org.apache.commons.lang.StringUtils;
22
import org.eclipse.core.commands.operations.IUndoContext;
23
import org.eclipse.core.commands.operations.UndoContext;
24
import org.eclipse.core.runtime.IProgressMonitor;
25
import org.eclipse.core.runtime.OperationCanceledException;
26
import org.eclipse.e4.core.contexts.IEclipseContext;
27
import org.eclipse.e4.core.services.events.IEventBroker;
28
import org.eclipse.e4.ui.di.Focus;
29
import org.eclipse.e4.ui.di.Persist;
30
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
31
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
32
import org.eclipse.e4.ui.services.EMenuService;
33
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
34
import org.eclipse.jface.dialogs.MessageDialog;
35
import org.eclipse.jface.viewers.ISelection;
36
import org.eclipse.jface.viewers.ISelectionProvider;
37
import org.eclipse.jface.viewers.StructuredSelection;
38
import org.eclipse.swt.dnd.DND;
39
import org.eclipse.swt.dnd.DropTarget;
40
import org.eclipse.swt.dnd.Transfer;
41
import org.eclipse.swt.graphics.Color;
42
import org.eclipse.swt.widgets.Composite;
43
import org.eclipse.ui.ISelectionListener;
44
import org.eclipse.ui.IWorkbenchPart;
45
import org.eclipse.ui.IWorkbenchPartReference;
46
import org.eclipse.ui.forms.ManagedForm;
47
import org.eclipse.ui.forms.widgets.FormToolkit;
48
import org.eclipse.ui.forms.widgets.ScrolledForm;
49
import org.eclipse.ui.forms.widgets.TableWrapLayout;
50

    
51
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
52
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
53
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
54
import eu.etaxonomy.cdm.model.common.CdmBase;
55
import eu.etaxonomy.cdm.model.name.HomotypicalGroup;
56
import eu.etaxonomy.cdm.model.taxon.Taxon;
57
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
58
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
59
import eu.etaxonomy.cdm.model.taxon.TaxonRelationship;
60
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
61
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer;
62
import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
63
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
64
import eu.etaxonomy.taxeditor.editor.e4.TaxonEditorInputE4;
65
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
66
import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupE4;
67
import eu.etaxonomy.taxeditor.editor.name.e4.container.AbstractGroupedContainerE4;
68
import eu.etaxonomy.taxeditor.editor.name.e4.container.AcceptedGroupE4;
69
import eu.etaxonomy.taxeditor.editor.name.e4.container.AcceptedNameContainerE4;
70
import eu.etaxonomy.taxeditor.editor.name.e4.container.ContainerFactoryE4;
71
import eu.etaxonomy.taxeditor.editor.name.e4.container.HomotypicalSynonymGroupE4;
72
import eu.etaxonomy.taxeditor.editor.name.e4.container.MisappliedGroupE4;
73
import eu.etaxonomy.taxeditor.editor.name.e4.dnd.NameEditorDropTargetListenerE4;
74
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
75
import eu.etaxonomy.taxeditor.model.AbstractUtility;
76
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
77
import eu.etaxonomy.taxeditor.model.IPartChangeListener;
78
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
79
import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
80
import eu.etaxonomy.taxeditor.model.IPartContentHasMedia;
81
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData;
82
import eu.etaxonomy.taxeditor.model.MessagingUtils;
83
import eu.etaxonomy.taxeditor.model.TaxeditorPartService;
84
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled;
85
import eu.etaxonomy.taxeditor.preference.Resources;
86
import eu.etaxonomy.taxeditor.security.RequiredPermissions;
87
import eu.etaxonomy.taxeditor.store.CdmStore;
88
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
89

    
90
/**
91
 *
92
 * @author pplitzner
93
 * @date Aug 24, 2017
94
 *
95
 */
96
public class TaxonNameEditorE4 implements IConversationEnabled, IDirtyMarkable, IPartContentHasDetails,
97
        IPartContentHasSupplementalData, IPartContentHasMedia, IPartContentHasFactualData, IPartChangeListener,
98
        ISelectionListener, ISecuredEditor, IPostOperationEnabled, IE4SavablePart, ITaxonEditor, IDropTargetableE4 {
99

    
100
	private Taxon taxon;
101

    
102
	private ManagedForm managedForm;
103
	private ScrolledForm scrolledForm;
104
	private Composite parent;
105
	private ISelectionProvider simpleSelectionProvider;
106

    
107
	private TaxonBase selection;
108

    
109
	private ConversationHolder conversation;
110

    
111
	private AcceptedGroupE4 acceptedGroup;
112
	private List<HomotypicalSynonymGroupE4> heterotypicSynonymGroups = new ArrayList<>();
113
	private MisappliedGroupE4 misappliedGroup;
114

    
115
	private DropTarget target;
116

    
117
	private TaxonBase objectAffectedByLastOperation;
118

    
119
	@Inject
120
	private EMenuService menuService;
121

    
122
	@Inject
123
	private ESelectionService selService;
124

    
125
	@Inject
126
	private IEclipseContext context;
127

    
128
	@Inject
129
	private MDirtyable dirty;
130

    
131
	private MPart thisPart;
132

    
133
    private TaxonEditorInputE4 input;
134

    
135
    private UndoContext undoContext;
136

    
137
    @Inject
138
    private IEventBroker eventBroker;
139

    
140
	@Inject
141
	public TaxonNameEditorE4() {
142
	    undoContext = new UndoContext();
143
	}
144

    
145

    
146
	@PostConstruct
147
    public void createPartControl(Composite parent, MPart thisPart) {
148
	    this.thisPart = thisPart;
149

    
150
        createManagedForm(parent);
151

    
152
		TaxeditorPartService.getInstance().addListener(
153
				TaxeditorPartService.PART_ACTIVATED, this);
154

    
155
	}
156

    
157
	protected void createManagedForm(Composite composite) {
158

    
159
		managedForm = new ManagedForm(composite) {
160

    
161
			@Override
162
			public void dirtyStateChanged() {
163
			    dirty.setDirty(true);
164
			}
165

    
166
			@Override
167
			public boolean setInput(Object input) {
168
				if (input instanceof AbstractGroupedContainerE4) {
169
				    TaxonBase newSelection = ((AbstractGroupedContainerE4) input).getData();
170
				    if(selection!=newSelection || TaxonNameEditorE4.this.isDirty()){
171
				        selection = newSelection;
172
				        selService.setSelection(new StructuredSelection(selection));
173
				    }
174
				}else if(input == null){
175
					selection = null;
176
                    selService.setSelection(new StructuredSelection());
177
				}
178

    
179

    
180
				return super.setInput(input);
181
			}
182
		};
183

    
184
		scrolledForm = managedForm.getForm();
185
		parent = scrolledForm.getBody();
186

    
187
		parent.setData(taxon);
188

    
189
		TableWrapLayout layout = new TableWrapLayout();
190
		layout.leftMargin = 0;
191
		layout.rightMargin = 0;
192
		layout.topMargin = 0;
193
		layout.bottomMargin = 0;
194

    
195
		layout.verticalSpacing = 0;
196
		layout.horizontalSpacing = 0;
197

    
198
		parent.setLayout(layout);
199
		parent.setBackground(AbstractUtility
200
				.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
201
	}
202

    
203
	public void createOrUpdateNameComposites() {
204
		ContainerFactoryE4.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
205
		ContainerFactoryE4.createOrUpdateHeterotypicSynonymyGroups(this);
206
		ContainerFactoryE4.createOrUpdateMisapplicationsGroup(this);
207

    
208

    
209
		// Redraw composite
210
		managedForm.reflow(true);
211
		managedForm.refresh();
212
	}
213

    
214
	@Override
215
    public Taxon getTaxon() {
216
		return HibernateProxyHelper.deproxy(taxon);
217
	}
218

    
219
	public void setDirty() {
220
		managedForm.dirtyStateChanged();
221
	}
222

    
223
	@Focus
224
	public void setFocus() {
225
	    //make sure to bind again if maybe in another view the conversation was unbound
226
        if(conversation!=null && !conversation.isBound()){
227
            conversation.bind();
228
        }
229

    
230
	    if(input!=null){
231
	        if (getSelectedContainer() == null) {
232
	            throw new IllegalStateException(
233
	                    Messages.TaxonNameEditor_THERE_SHOULD_ALWAYS_BE);
234
	        }
235
	        getSelectedContainer().setSelected();
236
	        if (!input.getCdmEntitySession().isActive()){
237
	            input.bind();
238
	        }
239

    
240
	        // check permissions
241
	        boolean doEnable = permissionsSatisfied();
242
	        managedForm.getForm().setEnabled(doEnable);
243
	    }
244
        eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, this);
245
	}
246

    
247
	@Override
248
	public boolean permissionsSatisfied() {
249
		TaxonNode taxonNode = input.getTaxonNode();
250
		boolean doEnable = CdmStore.currentAuthentiationHasPermission(taxonNode, RequiredPermissions.TAXONNODE_EDIT);
251
		return doEnable;
252
	}
253

    
254
	@Override
255
    public ConversationHolder getConversationHolder() {
256
		return conversation;
257
	}
258

    
259
	/** {@inheritDoc} */
260
	@Override
261
    public void update(CdmDataChangeMap events) {
262
		// redraw();
263
	}
264

    
265
	/**
266
	 * Redraws this editor return true on success
267
	 *
268
	 * @return a boolean.
269
	 */
270
    public boolean redraw() {
271
		return redraw(true);
272
	}
273

    
274
	/**
275
	 * {@inheritDoc}
276
	 *
277
	 * Redraws the editor controls
278
	 */
279
    public boolean redraw(boolean focus) {
280

    
281
		createOrUpdateNameComposites();
282

    
283
		if (focus) {
284
			setFocus();
285
		}
286

    
287
		return true;
288
	}
289

    
290
	@Override
291
    public boolean postOperation(CdmBase objectAffectedByOperation) {
292

    
293
		changed(objectAffectedByOperation);
294

    
295
		redraw(false);
296

    
297
		if (objectAffectedByOperation instanceof TaxonBase) {
298
			objectAffectedByLastOperation = (TaxonBase) objectAffectedByOperation;
299
		}
300

    
301
		return true;
302
	}
303

    
304
	public ManagedForm getManagedForm() {
305
		return managedForm;
306
	}
307

    
308

    
309
	/**
310
	 * <p>
311
	 * checkForEmptyNames
312
	 * </p>
313
	 *
314
	 * @return true if there are empty names
315
	 */
316
	public boolean checkForEmptyNames() {
317
		for (AbstractGroupedContainerE4 container : getGroupedContainers()) {
318
			if (container.getName() == null
319
					|| StringUtils.isEmpty(container.getName().getTitleCache())) {
320
				return true;
321
			}
322
		}
323
		return false;
324
	}
325

    
326
	public Set<AbstractGroupedContainerE4> getEmptyContainers() {
327
		Set<AbstractGroupedContainerE4> containersWithEmptyNames = new HashSet<>();
328

    
329
		for (AbstractGroupedContainerE4 container : getGroupedContainers()) {
330
			if (container.getName() == null
331
					|| StringUtils.isEmpty(container.getName().getTitleCache())) {
332
				containersWithEmptyNames.add(container);
333
			}
334
		}
335

    
336
		return containersWithEmptyNames;
337
	}
338

    
339
	/** {@inheritDoc} */
340
	@Override
341
    @Persist
342
	public void save(IProgressMonitor monitor) {
343

    
344
	    monitor.beginTask(Messages.TaxonNameEditor_SAVING_NAMES, getGroupedContainers().size());
345
	    if (!conversation.isBound()) {
346
	        conversation.bind();
347

    
348
	    }
349
	    conversation.commit(true);
350
	    monitor.worked(1);
351

    
352
	    // check for empty names
353
	    if (checkForEmptyNames()) {
354
	        MessageDialog.openWarning(AbstractUtility.getShell(), Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED,
355
	                Messages.MultiPageTaxonEditor_NO_NAME_SPECIFIED_MESSAGE);
356
	        return;
357
	    }
358
	    for (AbstractGroupedContainerE4 container : getGroupedContainers()) {
359

    
360
	        monitor.subTask(Messages.TaxonNameEditor_SAVING_COMPOSITES
361
	                + container.getTaxonBase().getTitleCache());
362
	        container.persistName();
363

    
364
	        // In case the progress monitor was canceled throw an exception.
365
	        if (monitor.isCanceled()) {
366
	            throw new OperationCanceledException();
367
	        }
368

    
369
	     // Otherwise declare this step as done.
370
	        monitor.worked(1);
371

    
372
	    }
373
	    input.merge();
374
	    // commit the conversation and start a new transaction immediately
375
        conversation.commit(true);
376

    
377

    
378
        dirty.setDirty(false);
379

    
380
	    // Stop the progress monitor.
381
	    monitor.done();
382
	}
383

    
384
	public void init(TaxonEditorInputE4 input) {
385

    
386
		if (!(input != null)) {
387
            MessagingUtils.error(this.getClass(), new Exception(Messages.TaxonNameEditor_INVALID_INPUT));
388
            return;
389
        }
390

    
391
		if (input.getAdapter(Taxon.class) != null) {
392
			taxon = CdmBase.deproxy(input.getAdapter(Taxon.class), Taxon.class);
393
		} else {
394
		    MessagingUtils.error(this.getClass(), new Exception(Messages.TaxonNameEditor_INVALID_INPUT_TAXON_NULL));
395
		    return;
396
		}
397

    
398
		this.input = input;
399
		conversation = input.getConversationHolder();
400

    
401
        createOrUpdateNameComposites();
402

    
403
        createDragSupport();
404

    
405
        setPartName();
406

    
407
        //set initial selection
408
        TaxonBase initiallySelectedTaxonBase = input.getInitiallySelectedTaxonBase();
409
        if(initiallySelectedTaxonBase!=null){
410
            selService.setSelection(new StructuredSelection(initiallySelectedTaxonBase));
411
            getContainer(initiallySelectedTaxonBase).setSelected();
412
        }
413
	}
414

    
415
   private void createDragSupport() {
416
       // Listen for names being dragged outside of existing homotypic groups -
417
       // user wants to create a new group
418
       Transfer[] types = new Transfer[] { CdmDataTransfer.getInstance() };
419
       int operations = DND.DROP_MOVE;
420
       if (target == null) {
421
           target = new DropTarget(parent, operations);
422
           target.setTransfer(types);
423
           target.addDropListener(new NameEditorDropTargetListenerE4(this));
424
       }
425
   }
426

    
427
	public AcceptedNameContainerE4 getAcceptedNameContainer() {
428
		return getAcceptedGroup().getAcceptedNameContainer();
429
	}
430

    
431
	public HomotypicalSynonymGroupE4 getHomotypicalGroupContainer(
432
			HomotypicalGroup homotypicalGroup) {
433
		for (HomotypicalSynonymGroupE4 group : getHeterotypicSynonymGroups()) {
434
			if (group.getGroup().equals(homotypicalGroup)) {
435
				return group;
436
			}
437
		}
438

    
439
		return null;
440
	}
441

    
442
	/**
443
	 * <p>
444
	 * getDirtyNames
445
	 * </p>
446
	 *
447
	 * @return a Set containing all composites that have been edited
448
	 */
449
	public Set<AbstractGroupedContainerE4> getDirtyNames() {
450
		Set<AbstractGroupedContainerE4> dirtyNames = new HashSet<>();
451

    
452
		for (AbstractGroupedContainerE4 composite : getGroupedContainers()) {
453
			if (composite.isDirty()) {
454
				dirtyNames.add(composite);
455
			}
456
		}
457

    
458
		return dirtyNames;
459
	}
460

    
461
	public List<AbstractGroupedContainerE4> getGroupedContainers() {
462
		List<AbstractGroupedContainerE4> groupedComposites = new ArrayList<>();
463

    
464
		for (AbstractGroupE4 group : getAllGroups()) {
465
		    if (group!= null){
466
		        groupedComposites.addAll(group.getGroupedContainers());
467
		    }
468
		}
469

    
470
		return groupedComposites;
471
	}
472

    
473
	public List<AbstractGroupE4> getAllGroups() {
474
		List<AbstractGroupE4> allGroups = new ArrayList<>();
475

    
476
		allGroups.add(getAcceptedGroup());
477

    
478
		heterotypicSynonymGroups = getHeterotypicSynonymGroups();
479

    
480
		if (heterotypicSynonymGroups != null) {
481
			allGroups.addAll(heterotypicSynonymGroups);
482
		}
483

    
484
		if (misappliedGroup != null) {
485
			allGroups.add(misappliedGroup);
486
		}
487

    
488
		return allGroups;
489
	}
490

    
491
	@Override
492
	public IEclipseContext getContext() {
493
	    return context;
494
	}
495

    
496
	public boolean isDirty() {
497
		return dirty.isDirty();
498
	}
499

    
500
	@PreDestroy
501
	public void dispose() {
502
        if(conversation!=null){
503
            conversation.unregisterForDataStoreChanges(this);
504
            conversation.close();
505
        }
506
        if(input!=null){
507
            input.dispose();
508
        }
509
        eventBroker.post(WorkbenchEventConstants.CURRENT_ACTIVE_EDITOR, null);
510
	}
511

    
512
	/** {@inheritDoc} */
513
	@Override
514
    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
515

    
516
	}
517

    
518
	public AbstractGroupedContainerE4 getSelectedContainer() {
519
		return (selection != null) ? getContainer(selection)
520
				: getAcceptedNameContainer();
521
	}
522

    
523
    @Override
524
    public void dragEntered() {
525
        // TODO change this
526
        getControl().setBackground(
527
                AbstractUtility.getColor(Resources.COLOR_DRAG_ENTER));
528
    }
529

    
530
    @Override
531
    public void dragLeft() {
532
        getControl().setBackground(
533
                AbstractUtility.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
534
    }
535

    
536

    
537
	public void setMisapplicationsGroup(MisappliedGroupE4 misappliedGroup) {
538
		this.misappliedGroup = misappliedGroup;
539
	}
540

    
541
	public FormToolkit getToolkit() {
542
		return managedForm.getToolkit();
543
	}
544

    
545
	public List<HomotypicalSynonymGroupE4> getHeterotypicSynonymGroups() {
546
		return heterotypicSynonymGroups;
547
	}
548

    
549
	public void addHeterotypicSynonymGroup(HomotypicalSynonymGroupE4 group) {
550
		heterotypicSynonymGroups.add(group);
551
	}
552

    
553
	public AcceptedGroupE4 getAcceptedGroup() {
554
		return acceptedGroup;
555
	}
556

    
557
	public void setAcceptedGroup(AcceptedGroupE4 acceptedGroup) {
558
		this.acceptedGroup = acceptedGroup;
559
	}
560

    
561
	public MisappliedGroupE4 getMisappliedGroup() {
562
		return misappliedGroup;
563
	}
564

    
565
	public boolean isActive() {
566
		return this.equals(AbstractUtility.getActivePart());
567
	}
568

    
569
    @Override
570
    public boolean onComplete() {
571
		getContainer(objectAffectedByLastOperation).setSelected();
572
		return true;
573
	}
574

    
575
	/** {@inheritDoc} */
576
	@Override
577
    public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
578
		if (!partRef.getPart(false).equals(this)) {
579
			// getSelectedObject().colorSelected(AbstractGroupedContainer.SELECTED_NO_FOCUS);
580
		}
581
	}
582

    
583
	public void removeGroup(AbstractGroupE4 group) {
584
		if (group != null) {
585
			group.dispose();
586

    
587
			//if (heterotypicSynonymGroups != null) {
588
			heterotypicSynonymGroups.remove(group);
589
			//}
590
		}
591
	}
592

    
593
	public AbstractGroupedContainerE4 getContainer(TaxonBase taxonBase) {
594
		List<AbstractGroupedContainerE4> groupedContainers = getGroupedContainers();
595
		for (AbstractGroupedContainerE4 container : groupedContainers) {
596
			if (container.getData().equals(taxonBase)
597
					&& container.getNameViewer().getTextWidget() != null) {
598
				return container;
599
			}
600
		}
601
		return getAcceptedNameContainer();
602
	}
603

    
604
    public void setOnError() {
605
		Color disabledColor =  AbstractUtility.getColor(Resources.COLOR_EDITOR_ERROR);
606
		setEnabled(false, disabledColor);
607
	}
608

    
609
	public void setDisabled(){
610
		Color disabledColor =  AbstractUtility.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
611
		setEnabled(false, disabledColor);
612
	}
613

    
614
	protected void setEnabled(boolean enabled, Color background) {
615

    
616
		for(AbstractGroupedContainerE4 groupedContainer : getGroupedContainers()){
617
			groupedContainer.setEnabled(enabled);
618
		}
619

    
620
		// send an empty selection to the current provider - TODO only on error ???
621
		if (!enabled) {
622
			getManagedForm().setInput(null);
623

    
624
			for (AbstractGroupedContainerE4 groupedContainer : getGroupedContainers()) {
625
				groupedContainer.setBackground(background);
626
			}
627
		}
628
		getControl().setBackground(background);
629
	}
630

    
631
    @Override
632
    public void changed(Object element) {
633
        // setDirty(true);
634
        // if the attribute is null then do not set the dirty flag -> hotfix for the problem that for tasks done in service methods the changes are saved automatically
635
        if (element != null){
636
            dirty.setDirty(true);
637
            //refresh part title
638
            //TODO: refresh taxon node in taxon navigator
639
            setPartName();
640
        }
641

    
642
        if (element instanceof TaxonBase) {
643
            AbstractGroupedContainerE4 container = getContainer((TaxonBase) element);
644
            if (container != null) {
645
                container.refresh();
646
            }
647
        }
648
        if (element instanceof TaxonRelationship) {
649
            AbstractGroupedContainerE4 container = getContainer(((TaxonRelationship) element).getFromTaxon());
650
            if (container != null) {
651
                container.refresh();
652
            }
653
        }
654
    }
655

    
656
    public void setPartName(){
657
        thisPart.setLabel(this.taxon.getName().getFullTitleCache());
658
    }
659

    
660
    @Override
661
    public void forceDirty() {
662
        setDirty();
663
    }
664

    
665

    
666
    public IUndoContext getUndoContext() {
667
        return undoContext;
668
    }
669

    
670
    @Override
671
    public Composite getControl(){
672
        return managedForm.getForm().getBody();
673
    }
674

    
675
    public EMenuService getMenuService() {
676
        return menuService;
677
    }
678

    
679
    public ESelectionService getSelectionService() {
680
        return selService;
681
    }
682

    
683

    
684
    /**
685
     * {@inheritDoc}
686
     */
687
    @Override
688
    public boolean canAttachMedia() {
689
        return true;
690
    }
691

    
692
    public TaxonEditorInputE4 getEditorInput() {
693
        return input;
694
    }
695

    
696
    /**
697
     * {@inheritDoc}
698
     */
699
    @Override
700
    public TaxonNameEditorE4 getEditor() {
701
        return this;
702
    }
703

    
704
}
(2-2/2)