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;
}
Aggregations