ContributionManager mgr = (ContributionManager) item;
IContributionItem[] items = mgr.getItems();
for (int i = 0; i < items.length; i++) {
IContributionItem mgrItem = items[i];
if (mgrItem instanceof ActionSetContributionItem) {
ActionSetContributionItem actionSetItem = (ActionSetContributionItem) mgrItem;
if (actionSetItem.getActionSetId().equals(actionSetId)) {
IContributionItem innerItem = actionSetItem
.getInnerItem();
if (innerItem instanceof MenuManager) {
MenuManager inner = (MenuManager) actionSetItem
.getInnerItem();
ActionSetDisplayItem node = new ActionSetDisplayItem(
this, inner.getId(), inner
.getMenuText(), MENUITEM);
node.fillMenusFor(actionSetId, inner);
} else if (innerItem instanceof ActionSetMenuManager) {
ActionSetMenuManager inner = (ActionSetMenuManager) actionSetItem
.getInnerItem();
MenuManager parentMgr = (MenuManager) inner
.getParent();
ActionSetDisplayItem node = new ActionSetDisplayItem(
this, inner.getId(), parentMgr
.getMenuText(), MENUITEM);
node.fillMenusFor(actionSetId, parentMgr);
} else if (innerItem instanceof PluginActionContributionItem) {
PluginActionContributionItem inner = (PluginActionContributionItem) actionSetItem
.getInnerItem();
ActionSetDisplayItem node = new ActionSetDisplayItem(
this, inner.getId(), inner.getAction()
.getText(), MENUITEM);
IAction action = inner.getAction();