code: private void addMenuItem(final WComponent parent, final String text,
  			final WText selectedMenuText) {
  		WMenuItem menuItem = new WMenuItem(text, new ExampleMenuAction(selectedMenuText));
  		menuItem.setActionObject(text);
  		if (parent instanceof WSubMenu) {
  			((WSubMenu) parent).add(menuItem);
  		} else {
  			((WMenuItemGroup) parent).add(menuItem);
  		}
  	}
docs: Adds an example menu item with the given text and an example action to the a parent component.
  
  @param parent the component to add the menu item to.
  @param text the text to display on the menu item.
  @param selectedMenuText the WText to display the selected menu item.