Bug 294750 [Contributions] Allow a handler to update MUIItems
A handler for a command should be able to update text or tooltips on UIItems that point to the command. ex: in 3.x we have this pattern. 1) each item registers as a UIElement for a command 2) the command service can handle a request to refresh all UIElements for a command 3) changing handlers causes a refresh request 4) the client code can also request a refresh We need a similar story for e4 that would allow the active handler to update the appropriate items. It is a little more complicated in e4 as depending on your location (part of the hierarchy you are requesting from) you will potentially have different handlers applicable to different MUIItems. PW
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/ToolItemRenderer.java
.getProperty(UIEvents.EventTags.ELEMENT);
			ToolItem toolItem = (ToolItem) itemModel.getWidget();
			if (toolItem != null) {
				toolItem.setSelection(itemModel.isSelected());
			}
		}
	};
	@PostConstruct
	public void init() {
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC),
				itemUpdater);
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.Item.TOPIC,
				UIEvents.Item.SELECTED), selectionUpdater);
	}
	@PreDestroy
	public void contextDisposed() {
		eventBroker.unsubscribe(itemUpdater);
		eventBroker.unsubscribe(selectionUpdater);
	}
	private ParameterizedCommand generateParameterizedCommand(
			final MHandledItem item, final IEclipseContext lclContext) {
		ECommandService cmdService = (ECommandService) lclContext
				.get(ECommandService.class.getName());
		Map<String, Object> parameters = null;
		EList<MParameter> modelParms = item.getParameters();
		if (modelParms != null && !modelParms.isEmpty()) {
			parameters = new HashMap<String, Object>();
			for (MParameter mParm : modelParms) {
				parameters.put(mParm.getTag(), mParm.getValue());
			}