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
        if (CdmStore.isActive()){
150
            if(conversation == null){
151
                conversation = CdmStore.createConversation();
152
            }
153
        }
154
        else{
155
            return;
156
        }
157

    
158
        createManagedForm(parent);
159

    
160
		TaxeditorPartService.getInstance().addListener(
161
				TaxeditorPartService.PART_ACTIVATED, this);
162

    
163
	}
164

    
165
	protected void createManagedForm(Composite composite) {
166

    
167
		managedForm = new ManagedForm(composite) {
168

    
169
			@Override
170
			public void dirtyStateChanged() {
171
			    dirty.setDirty(true);
172
			}
173

    
174
			@Override
175
			public boolean setInput(Object input) {
176
				if (input instanceof AbstractGroupedContainerE4) {
177
					selection = ((AbstractGroupedContainerE4) input).getData();
178

    
179
			        selService.setSelection(new StructuredSelection(selection));
180
				}else if(input == null){
181
					selection = null;
182
                    selService.setSelection(new StructuredSelection());
183
				}
184

    
185

    
186
				return super.setInput(input);
187
			}
188
		};
189

    
190
		scrolledForm = managedForm.getForm();
191
		parent = scrolledForm.getBody();
192

    
193
		parent.setData(taxon);
194

    
195
		TableWrapLayout layout = new TableWrapLayout();
196
		layout.leftMargin = 0;
197
		layout.rightMargin = 0;
198
		layout.topMargin = 0;
199
		layout.bottomMargin = 0;
200

    
201
		layout.verticalSpacing = 0;
202
		layout.horizontalSpacing = 0;
203

    
204
		parent.setLayout(layout);
205
		parent.setBackground(AbstractUtility
206
				.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
207
	}
208

    
209
	public void createOrUpdateNameComposites() {
210
		ContainerFactoryE4.createOrUpdateAcceptedTaxonsHomotypicGroup(this);
211
		ContainerFactoryE4.createOrUpdateHeterotypicSynonymyGroups(this);
212
		ContainerFactoryE4.createOrUpdateMisapplicationsGroup(this);
213

    
214

    
215
		// Redraw composite
216
		managedForm.reflow(true);
217
		managedForm.refresh();
218
	}
219

    
220
	@Override
221
    public Taxon getTaxon() {
222
		return HibernateProxyHelper.deproxy(taxon);
223
	}
224

    
225
	public void setDirty() {
226
		managedForm.dirtyStateChanged();
227
	}
228

    
229
	@Focus
230
	public void setFocus() {
231
	    //make sure to bind again if maybe in another view the conversation was unbound
232
        if(conversation!=null && !conversation.isBound()){
233
            conversation.bind();
234
        }
235
	    if(input!=null){
236
	        if (getSelectedContainer() == null) {
237
	            throw new IllegalStateException(
238
	                    Messages.TaxonNameEditor_THERE_SHOULD_ALWAYS_BE);
239
	        }
240
	        getSelectedContainer().setSelected();
241

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

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

    
256
	@Override
257
    public ConversationHolder getConversationHolder() {
258
		return conversation;
259
	}
260

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

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

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

    
283
		createOrUpdateNameComposites();
284

    
285
		if (focus) {
286
			setFocus();
287
		}
288

    
289
		return true;
290
	}
291

    
292
	@Override
293
    public boolean postOperation(CdmBase objectAffectedByOperation) {
294

    
295
		changed(objectAffectedByOperation);
296

    
297
		redraw(false);
298

    
299
		if (objectAffectedByOperation instanceof TaxonBase) {
300
			objectAffectedByLastOperation = (TaxonBase) objectAffectedByOperation;
301
		}
302

    
303
		return true;
304
	}
305

    
306
	public ManagedForm getManagedForm() {
307
		return managedForm;
308
	}
309

    
310

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

    
328
	public Set<AbstractGroupedContainerE4> getEmptyContainers() {
329
		Set<AbstractGroupedContainerE4> containersWithEmptyNames = new HashSet<>();
330

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

    
338
		return containersWithEmptyNames;
339
	}
340

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

    
346
	    monitor.beginTask(Messages.TaxonNameEditor_SAVING_NAMES, getGroupedContainers().size());
347
	    if (!conversation.isBound()) {
348
	        conversation.bind();
349
	    }
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
	        // commit the conversation and start a new transaction immediately
369
	        input.merge();
370

    
371
	        conversation.commit(true);
372

    
373
	        // Otherwise declare this step as done.
374
	        monitor.worked(1);
375

    
376
	        dirty.setDirty(false);
377
	    }
378

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

    
383
	public void init(TaxonEditorInputE4 input) {
384

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

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

    
397
		this.input = input;
398

    
399
        createOrUpdateNameComposites();
400

    
401
        createDragSupport();
402

    
403
        setPartName();
404

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

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

    
425
	public AcceptedNameContainerE4 getAcceptedNameContainer() {
426
		return getAcceptedGroup().getAcceptedNameContainer();
427
	}
428

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

    
437
		return null;
438
	}
439

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

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

    
456
		return dirtyNames;
457
	}
458

    
459
	public List<AbstractGroupedContainerE4> getGroupedContainers() {
460
		List<AbstractGroupedContainerE4> groupedComposites = new ArrayList<>();
461

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

    
468
		return groupedComposites;
469
	}
470

    
471
	public List<AbstractGroupE4> getAllGroups() {
472
		List<AbstractGroupE4> allGroups = new ArrayList<>();
473

    
474
		allGroups.add(getAcceptedGroup());
475

    
476
		heterotypicSynonymGroups = getHeterotypicSynonymGroups();
477

    
478
		if (heterotypicSynonymGroups != null) {
479
			allGroups.addAll(heterotypicSynonymGroups);
480
		}
481

    
482
		if (misappliedGroup != null) {
483
			allGroups.add(misappliedGroup);
484
		}
485

    
486
		return allGroups;
487
	}
488

    
489
	@Override
490
	public IEclipseContext getContext() {
491
	    return context;
492
	}
493

    
494
	public boolean isDirty() {
495
		return dirty.isDirty();
496
	}
497

    
498
	@PreDestroy
499
	public void dispose() {
500
        if(conversation!=null){
501
            conversation.unregisterForDataStoreChanges(this);
502
            conversation.close();
503
        }
504
	}
505

    
506
	/** {@inheritDoc} */
507
	@Override
508
    public void selectionChanged(IWorkbenchPart part, ISelection selection) {
509

    
510
	}
511

    
512
	public AbstractGroupedContainerE4 getSelectedContainer() {
513

    
514
		TaxonBase selectedTaxonBase = null;
515

    
516
		if (input.getInitiallySelectedTaxonBase() != null) {
517
			selectedTaxonBase = input.getInitiallySelectedTaxonBase();
518
		} else {
519
			if (selection != null) {
520
				selectedTaxonBase = selection;
521
			}
522
		}
523

    
524
		return (selectedTaxonBase != null) ? getContainer(selectedTaxonBase)
525
				: getAcceptedNameContainer();
526
	}
527

    
528
    @Override
529
    public void dragEntered() {
530
        // TODO change this
531
        getControl().setBackground(
532
                AbstractUtility.getColor(Resources.COLOR_DRAG_ENTER));
533
    }
534

    
535
    @Override
536
    public void dragLeft() {
537
        getControl().setBackground(
538
                AbstractUtility.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
539
    }
540

    
541

    
542
	public void setMisapplicationsGroup(MisappliedGroupE4 misappliedGroup) {
543
		this.misappliedGroup = misappliedGroup;
544
	}
545

    
546
	public FormToolkit getToolkit() {
547
		return managedForm.getToolkit();
548
	}
549

    
550
	public List<HomotypicalSynonymGroupE4> getHeterotypicSynonymGroups() {
551
		return heterotypicSynonymGroups;
552
	}
553

    
554
	public void addHeterotypicSynonymGroup(HomotypicalSynonymGroupE4 group) {
555
		heterotypicSynonymGroups.add(group);
556
	}
557

    
558
	public AcceptedGroupE4 getAcceptedGroup() {
559
		return acceptedGroup;
560
	}
561

    
562
	public void setAcceptedGroup(AcceptedGroupE4 acceptedGroup) {
563
		this.acceptedGroup = acceptedGroup;
564
	}
565

    
566
	public MisappliedGroupE4 getMisappliedGroup() {
567
		return misappliedGroup;
568
	}
569

    
570
	public boolean isActive() {
571
		return this.equals(AbstractUtility.getActivePart());
572
	}
573

    
574
    @Override
575
    public boolean onComplete() {
576
		getContainer(objectAffectedByLastOperation).setSelected();
577
		return true;
578
	}
579

    
580
	/** {@inheritDoc} */
581
	@Override
582
    public void partChanged(Integer eventType, IWorkbenchPartReference partRef) {
583
		if (!partRef.getPart(false).equals(this)) {
584
			// getSelectedObject().colorSelected(AbstractGroupedContainer.SELECTED_NO_FOCUS);
585
		}
586
	}
587

    
588
	public void removeGroup(AbstractGroupE4 group) {
589
		if (group != null) {
590
			group.dispose();
591

    
592
			//if (heterotypicSynonymGroups != null) {
593
			heterotypicSynonymGroups.remove(group);
594
			//}
595
		}
596
	}
597

    
598
	public AbstractGroupedContainerE4 getContainer(TaxonBase taxonBase) {
599
		List<AbstractGroupedContainerE4> groupedContainers = getGroupedContainers();
600
		for (AbstractGroupedContainerE4 container : groupedContainers) {
601
			if (container.getData().equals(taxonBase)
602
					&& container.getNameViewer().getTextWidget() != null) {
603
				return container;
604
			}
605
		}
606
		return getAcceptedNameContainer();
607
	}
608

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

    
614
	public void setDisabled(){
615
		Color disabledColor =  AbstractUtility.getColor(Resources.COLOR_TEXT_DISABLED_BACKGROUND);
616
		setEnabled(false, disabledColor);
617
	}
618

    
619
	protected void setEnabled(boolean enabled, Color background) {
620

    
621
		for(AbstractGroupedContainerE4 groupedContainer : getGroupedContainers()){
622
			groupedContainer.setEnabled(enabled);
623
		}
624

    
625
		// send an empty selection to the current provider - TODO only on error ???
626
		if (!enabled) {
627
			getManagedForm().setInput(null);
628

    
629
			for (AbstractGroupedContainerE4 groupedContainer : getGroupedContainers()) {
630
				groupedContainer.setBackground(background);
631
			}
632
		}
633
		getControl().setBackground(background);
634
	}
635

    
636
    @Override
637
    public void changed(Object element) {
638
        // setDirty(true);
639
        // 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
640
        if (element != null){
641
            dirty.setDirty(true);
642
            //refresh part title
643
            //TODO: refresh taxon node in taxon navigator
644
            setPartName();
645
        }
646

    
647
        if (element instanceof TaxonBase) {
648
            AbstractGroupedContainerE4 container = getContainer((TaxonBase) element);
649
            if (container != null) {
650
                container.refresh();
651
            }
652
        }
653
        if (element instanceof TaxonRelationship) {
654
            AbstractGroupedContainerE4 container = getContainer(((TaxonRelationship) element).getFromTaxon());
655
            if (container != null) {
656
                container.refresh();
657
            }
658
        }
659
    }
660

    
661
    public void setPartName(){
662
        thisPart.setLabel(taxon.toString());
663
    }
664

    
665
    @Override
666
    public void forceDirty() {
667
        setDirty();
668
    }
669

    
670

    
671
    public IUndoContext getUndoContext() {
672
        return undoContext;
673
    }
674

    
675
    @Override
676
    public Composite getControl(){
677
        return managedForm.getForm().getBody();
678
    }
679

    
680
    public EMenuService getMenuService() {
681
        return menuService;
682
    }
683

    
684
    public ESelectionService getSelectionService() {
685
        return selService;
686
    }
687

    
688

    
689
    /**
690
     * {@inheritDoc}
691
     */
692
    @Override
693
    public boolean canAttachMedia() {
694
        return true;
695
    }
696

    
697
    public TaxonEditorInputE4 getEditorInput() {
698
        return input;
699
    }
700

    
701
    /**
702
     * {@inheritDoc}
703
     */
704
    @Override
705
    public TaxonNameEditorE4 getEditor() {
706
        return this;
707
    }
708

    
709
}
(2-2/2)