}
});
menu.add(item);
} else if (c instanceof ButtonGroup) {
ButtonGroup g = (ButtonGroup) c;
g.setItemId(c.getItemId());
menu.add(new SeparatorMenuItem());
String heading = g.getHeadingHtml();
if (heading != null && heading.length() > 0 && !heading.equals(" ")) {
menu.add(new HeaderMenuItem(g.getHeadingHtml()));
}
for (Component c2 : g.getItems()) {
addComponentToMenu(menu, c2);
}
menu.add(new SeparatorMenuItem());
}