Project

General

Profile

« Previous | Next » 

Revision 81a7cfb2

Added by Patrick Plitzner over 6 years ago

ref #6925 Migrate getShell utility method

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/event/EventUtility.java
16 16
import org.eclipse.e4.ui.di.UIEventTopic;
17 17
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
18 18
import org.eclipse.e4.ui.services.IServiceConstants;
19
import org.eclipse.swt.widgets.Shell;
19 20

  
20 21
import eu.etaxonomy.cdm.model.taxon.Taxon;
21 22
import eu.etaxonomy.taxeditor.editor.ITaxonEditor;
......
31 32

  
32 33
    private static MPart activePart;
33 34

  
35
    private static Shell shell;
36

  
34 37
    @PostConstruct
35 38
    public void create(){
36 39
        //nothing
37 40
    }
38 41

  
39 42
    @Inject
43
    @Optional
44
    private void updateCurrentActiveShell(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell){
45
        EventUtility.shell = shell;
46
    }
47

  
48
    @Inject
49
    @Optional
40 50
    private void updateCurrentActivePart(@Named(IServiceConstants.ACTIVE_PART)MPart activePart){
41 51
        if(activePart!=null){
42 52
            EventUtility.activePart = activePart;
......
64 74
        return activePart;
65 75
    }
66 76

  
77
    public static Shell getShell() {
78
        return shell;
79
    }
80

  
67 81
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java
112 112
    }
113 113

  
114 114
    public static Shell getShell() {
115

  
116
        return TaxeditorStorePlugin.getDefault().getWorkbench()
117
                .getActiveWorkbenchWindow().getShell();
115
        return EventUtility.getShell();
118 116
    }
119 117

  
120 118
    public static IWorkbench getWorkbench() {

Also available in: Unified diff