return l;
}
private SWTBotViewMenu getMenuItem(IContributionItem item, Matcher<?> matcher) {
SWTBotViewMenu menu = null;
if (item instanceof ActionContributionItem) {
ActionContributionItem actionContribution = (ActionContributionItem) item;
if (matcher.matches(actionContribution.getAction()))
menu = new SWTBotViewMenu(actionContribution);
} else if (item instanceof SubContributionItem ) {
menu = getMenuItem(((SubContributionItem) item).getInnerItem(), matcher);
} else if (item instanceof CommandContributionItem) {
CommandContributionItem cmdContribution = (CommandContributionItem) item;
if (matcher.matches(new CommandItemWithTextMatcherWrapper(cmdContribution)))
menu = new SWTBotViewMenu(cmdContribution.getCommand());
}
return menu;
}