Set keys = map.keySet();
Iterator it = keys.iterator();
boolean needActionContributionItemUpdate = false;
while (it.hasNext()) {
IContributionItem item = (IContributionItem) it.next();
IMenuManager mm = (IMenuManager) map.get(item);
if (menu.getId() != null && menu.getId().equals(mm.getId()) && item instanceof ActionContributionItem) {
try {
IAction action = ((ActionContributionItem) item).getAction();
if (action instanceof IExtendedEditorActionProxyForDelayLoading) {
IExtendedEditorActionProxyForDelayLoading eea = (IExtendedEditorActionProxyForDelayLoading)action;
if (eea.isBundleActive() == true && eea.isRealized() == false) {
eea.realize();
needActionContributionItemUpdate = true;
}
}
if (activeEditorIsVisible || needActionContributionItemUpdate) {
if (action instanceof IUpdate) {
((IUpdate) action).update();
}
}
if (activeEditorIsVisible || needActionContributionItemUpdate) {
boolean visible = true;
if (action instanceof IExtendedEditorAction) {
visible = ((IExtendedEditorAction) action).isVisible();
}
item.setVisible(visible);
}
if (needActionContributionItemUpdate) {
((ActionContributionItem)item).update();
}