Bug 300173 Reorder of items in ToolBar and Menu doesn't reflect in Renderer
When we DnD of ToolItem or MenuItem in outline of e4 Designer, the designer refreshes with a wrong result. For example, if we have two items: Open and Save in order. When we change the order to Save and Open by moving Save, in Renderer we have only Open.
bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/workbench/ui/renderers/swt/MenuItemRenderer.java
}
			}
		};
		eventBroker.subscribe(UIEvents.buildTopic(UIEvents.UILabel.TOPIC),
				itemUpdater);
	}
	@PreDestroy
	public void contextDisposed() {
		eventBroker.unsubscribe(itemUpdater);
	}
	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;
		if (itemModel.getType() == ItemType.SEPARATOR) {
			return new MenuItem(parentMenu, SWT.SEPARATOR);
		}
		
		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);
		setItemText(itemModel, newItem);