2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.taxeditor
.event
;
11 import javax
.annotation
.PostConstruct
;
12 import javax
.inject
.Inject
;
13 import javax
.inject
.Named
;
15 import org
.eclipse
.e4
.core
.di
.annotations
.Optional
;
16 import org
.eclipse
.e4
.ui
.di
.UIEventTopic
;
17 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPart
;
18 import org
.eclipse
.e4
.ui
.services
.IServiceConstants
;
19 import org
.eclipse
.swt
.widgets
.Shell
;
21 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
22 import eu
.etaxonomy
.taxeditor
.editor
.ITaxonEditor
;
29 public class EventUtility
{
31 private static ITaxonEditor editor
;
33 private static MPart activePart
;
35 private static Shell shell
;
44 private void updateCurrentActiveShell(@Named(IServiceConstants
.ACTIVE_SHELL
)Shell shell
){
45 EventUtility
.shell
= shell
;
50 private void updateCurrentActivePart(@Named(IServiceConstants
.ACTIVE_PART
)MPart activePart
){
52 EventUtility
.activePart
= activePart
;
58 private void updateCurrentTaxon(@UIEventTopic(WorkbenchEventConstants
.CURRENT_ACTIVE_EDITOR
)ITaxonEditor editor
){
59 EventUtility
.editor
= editor
;
62 public static Taxon
getCurrentTaxon() {
64 return editor
.getTaxon();
69 public static ITaxonEditor
getTaxonEditor() {
73 public static MPart
getActivePart() {
77 public static Shell
getShell() {