Search in sources :

Example 1 with MWindow

use of org.eclipse.e4.ui.model.application.ui.basic.MWindow in project whole by wholeplatform.

the class E4Utils method findMenu.

@SuppressWarnings("unchecked")
public static <T> T findMenu(String elementId, EModelService modelService, MApplication application, Class<T> type) {
    for (MWindow window : modelService.findElements(application, null, MWindow.class, null)) {
        MMenu mainMenu = window.getMainMenu();
        if (mainMenu == null)
            continue;
        MMenuElement menuElement = findMenu(elementId, mainMenu);
        if (menuElement != null)
            return (T) menuElement;
    }
    return null;
}
Also used : MWindow(org.eclipse.e4.ui.model.application.ui.basic.MWindow) MMenu(org.eclipse.e4.ui.model.application.ui.menu.MMenu) MMenuElement(org.eclipse.e4.ui.model.application.ui.menu.MMenuElement)

Aggregations

MWindow (org.eclipse.e4.ui.model.application.ui.basic.MWindow)1 MMenu (org.eclipse.e4.ui.model.application.ui.menu.MMenu)1 MMenuElement (org.eclipse.e4.ui.model.application.ui.menu.MMenuElement)1