// 1. Need to set visibility for all non-adjunct actions
if (coolItemToolBarMgr != null) {
IContributionItem[] items = coolItemToolBarMgr.getItems();
for (int i = 0; i < items.length; i++) {
IContributionItem item = items[i];
if (item instanceof PluginActionCoolBarContributionItem) {
PluginActionCoolBarContributionItem actionSetItem = (PluginActionCoolBarContributionItem) item;
// Only if the action set id for this contribution item is
// the same
// as this object
if (actionSetItem.getActionSetId().equals(actionSetId)) {
item.setVisible(set);
coolItemToolBarMgr.markDirty();
if (!coolBarManager.isDirty()) {
coolBarManager.markDirty();
}
}
}
}
// Update the manager
coolItemToolBarMgr.update(false);
if (toolBarContributionItem != null) {
toolBarContributionItem.update(ICoolBarManager.SIZE);
}
}
// 2. Need to set visibility for all adjunct actions
if (adjunctContributions.size() > 0) {
for (Iterator i = adjunctContributions.iterator(); i.hasNext();) {
IContributionItem item = (IContributionItem) i.next();
if (item instanceof ContributionItem) {
item.setVisible(set);
IContributionManager manager = ((ContributionItem) item)
.getParent();
manager.markDirty();
manager.update(false);
if (!coolBarManager.isDirty()) {
coolBarManager.markDirty();
}
item.update(ICoolBarManager.SIZE);
}
}
}