/** * Expected to be called after each detected user action. * @param element presents the Last Action Invocation menu item. * Not <code>null</code>. * @param parameters not used. */ @SuppressWarnings("rawtypes") public void updateElement(final UIElement element, final Map parameters) { notNull(element); if (getLastAction() != null) element.setText(MESSAGES.get("menuItem.lastActionInvocation.label", getLastAction().getLabel())); }
@Override public void updateElement(UIElement element, Map parameters) { IWorkbenchLocationService wls = element .getServiceLocator() .getService(IWorkbenchLocationService.class); IWorkbenchWindow window = wls.getWorkbenchWindow(); if (window == null || !(window instanceof WorkbenchWindow)) return; element .setText(isCoolbarVisible((WorkbenchWindow) window) ? WorkbenchMessages.ToggleCoolbarVisibilityAction_hide_text : WorkbenchMessages.ToggleCoolbarVisibilityAction_show_text); }
@Override public void updateElement(UIElement element, Map parameters) { String targetId = (String) parameters .get(IWorkbenchCommandConstants.NAVIGATE_SHOW_IN_PARM_TARGET); if (targetId == null || targetId.length() == 0) { return; } IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry(); IViewDescriptor desc = reg.find(targetId); if (desc != null) { element.setIcon(desc.getImageDescriptor()); element.setText(desc.getLabel()); } } }
@Override public void updateElement(UIElement element, Map parameters) { String wizardId = (String) parameters.get(getWizardIdParameterId()); if (wizardId == null) return; IWizardDescriptor wizard = getWizardRegistry().findWizard(wizardId); if (wizard != null) { element.setText(NLS.bind(WorkbenchMessages.WizardHandler_menuLabel, wizard.getLabel())); element.setTooltip(wizard.getDescription()); element.setIcon(wizard.getImageDescriptor()); } }
/** * Updates the visibilty status of the element. */ @Override public void updateElement(UIElement element, Map parameters) { IWorkbenchLocationService wls = element .getServiceLocator() .getService(IWorkbenchLocationService.class); IWorkbenchWindow window = wls.getWorkbenchWindow(); if (!(window instanceof WorkbenchWindow)) return; MUIElement trimStatus = getTrimStatus((WorkbenchWindow) window); if(trimStatus != null) { element.setText(trimStatus.isVisible() ? WorkbenchMessages.ToggleStatusBarVisibilityAction_hide_text : WorkbenchMessages.ToggleStatusBarVisibilityAction_show_text); } }