/** * Refresh action handlers. */ @SuppressWarnings("rawtypes") private void refreshActionHandlers() { IActionBars actionBars = getSite().getActionBars(); actionBars.clearGlobalActionHandlers(); Map newActionHandlers = subActionBar .getGlobalActionHandlers(); if (newActionHandlers != null) { Set keys = newActionHandlers.entrySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); actionBars.setGlobalActionHandler((String) entry.getKey(), (IAction) entry.getValue()); } } }
/** * Refreshes the global actions for the active page. */ private void refreshGlobalActionHandlers() { // Clear old actions. IActionBars bars = getViewSite().getActionBars(); bars.clearGlobalActionHandlers(); // Set new actions. Map<?, ?> newActionHandlers = activeRec.subActionBars.getGlobalActionHandlers(); if (newActionHandlers != null) { newActionHandlers.entrySet() .forEach(e -> bars.setGlobalActionHandler((String) e.getKey(), (IAction) e.getValue())); } }
/** * Refreshes the global actions for the active page. */ void refreshGlobalActionHandlers() { // Clear old actions. IActionBars bars = getViewSite().getActionBars(); bars.clearGlobalActionHandlers(); // Set new actions. Map newActionHandlers = currentPageContainer.getSubBars().getGlobalActionHandlers(); if (newActionHandlers != null) { Set keys = newActionHandlers.entrySet(); Iterator iter = keys.iterator(); while (iter.hasNext()) { Map.Entry entry = (Map.Entry) iter.next(); bars.setGlobalActionHandler((String) entry.getKey(), (IAction) entry.getValue()); } } //add refresh action handler from history view bars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), refreshAction); }
actionBars.clearGlobalActionHandlers(); if (visible) { Map handlers = bars.getGlobalActionHandlers();
protected void setSourceActionBarsActive(boolean active) { IActionBars rootBars = getActionBars(); rootBars.clearGlobalActionHandlers(); rootBars.updateActionBars(); if (active) { fSourceActionBars.activate(); Map<?, ?> handlers = fSourceActionBars.getGlobalActionHandlers(); if (handlers != null) { Set<?> keys = handlers.keySet(); for (Object key : keys) { String id = (String) key; rootBars.setGlobalActionHandler(id, (IAction) handlers.get(id)); } } } else { fSourceActionBars.deactivate(); registerGlobalActionHandlers(); } rootBars.setGlobalActionHandler(PDEActionConstants.OPEN, active ? fHyperlinkAction : null); rootBars.setGlobalActionHandler(PDEActionConstants.FORMAT, active ? fFormatAction : null); // Register the revert action rootBars.setGlobalActionHandler(ActionFactory.REVERT.getId(), getRevertAction()); rootBars.updateActionBars(); }
Assert.isTrue(!disposed); theActionBars.clearGlobalActionHandlers(); ActionContext context = getContext(); if (context == null) {