Project

General

Profile

« Previous | Next » 

Revision 6a6c8c84

Added by Patrick Plitzner over 6 years ago

ref #6568 Migrate taxonomic perspective

View differences:

eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/WorkbenchUtility.java
11 11
import java.util.List;
12 12

  
13 13
import org.eclipse.e4.ui.model.application.MApplication;
14
import org.eclipse.e4.ui.model.application.ui.advanced.MArea;
15 14
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
16
import org.eclipse.e4.ui.model.application.ui.basic.MPartSashContainerElement;
17 15
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
18 16
import org.eclipse.e4.ui.workbench.modeling.EModelService;
19 17

  
......
66 64
        }
67 65
        return null;
68 66
    }
69

  
70
    public static MPartStack getEditorAreaPartStack(MApplication application, EModelService modelService){
71
        //FIXME E4 hack for opening in e3 editor area
72
        if(application!=null){
73
            //FIXME E4 hack for opening in e3 editor area
74
            List<MArea> elements = modelService.findElements(application, "org.eclipse.ui.editorss", MArea.class, null);
75
            for (MArea mArea : elements) {
76
                List<MPartSashContainerElement> children = mArea.getChildren();
77
                for (MPartSashContainerElement mPartSashContainerElement : children) {
78
                    if(mPartSashContainerElement instanceof MPartStack){
79
                        return (MPartStack) mPartSashContainerElement;
80
                    }
81
                }
82
            }
83
        }
84
        return null;
85
    }
86 67
}

Also available in: Unified diff