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/MenuItemRenderer.java
eventBroker.unsubscribe(selectionUpdater);
	}
	public Object createWidget(final MUIElement element, Object parent) {
		if (!(element instanceof MMenuItem) || !(parent instanceof Menu))
			return null;
		MMenuItem itemModel = (MMenuItem) element;
		Menu parentMenu = (Menu) parent;
		
		int addIndex = calcVisibleIndex(element);
		if (itemModel.getType() == ItemType.SEPARATOR) {
			return new MenuItem(parentMenu, SWT.SEPARATOR, addIndex);
		}
		
		int flags = 0;
		if (itemModel.getChildren().size() > 0)
			flags = SWT.CASCADE;
		else if (itemModel.getType() == ItemType.PUSH)
			flags = SWT.PUSH;
		else if (itemModel.getType() == ItemType.CHECK)
			flags = SWT.CHECK;
		else if (itemModel.getType() == ItemType.RADIO)
			flags = SWT.RADIO;
		MenuItem newItem = new MenuItem((Menu) parent, flags, addIndex);
		setItemText(itemModel, newItem);
		newItem.setImage(getImage(itemModel));
		newItem.setEnabled(itemModel.isEnabled());
		return newItem;
	}
	/*
	 * (non-Javadoc)