* @param icon the menu item's icon, if any
* @param title the menu item's title
* @param command the menu items associated command type
*/
private MenuItem addMenuItem(final MenuBar menuBar, AbstractImagePrototype icon, String title, final Command command) {
MenuItem mi;
if (icon == null) {
mi = menuBar.addItem(title, true, (com.google.gwt.user.client.Command)null);
} else {
mi = menuBar.addItem(icon.getHTML() + " " + title, true, (com.google.gwt.user.client.Command)null);
}
mi.setCommand(new com.google.gwt.user.client.Command() {
public void execute() {
CommandEvent.fire(command);
}
});
return mi;