JCommandPopupMenu simpleMenu = new JCommandPopupMenu();
simpleMenu.addMenuButton(new JCommandMenuButton(mf
.format(new Object[] { "1" }), new address_book_new()));
simpleMenu.addMenuButton(new JCommandMenuButton(mf
.format(new Object[] { "2" }), new EmptyResizableIcon(
16)));
simpleMenu.addMenuButton(new JCommandMenuButton(mf
.format(new Object[] { "3" }), new EmptyResizableIcon(
16)));
simpleMenu.addMenuSeparator();
simpleMenu.addMenuButton(new JCommandMenuButton(mf
.format(new Object[] { "4" }), new EmptyResizableIcon(
16)));
simpleMenu.addMenuButton(new JCommandMenuButton(mf
.format(new Object[] { "5" }), new text_x_generic()));
return simpleMenu;
case SCROLLABLE:
JCommandPopupMenu scrollableMenu = new JCommandPopupMenu();
for (int i = 0; i < 20; i++) {
final JCommandMenuButton smb = new JCommandMenuButton(mf
.format(new Object[] { i }), new text_x_generic());
smb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Invoked action on '"
+ smb.getText() + "'");
}
});
scrollableMenu.addMenuButton(smb);
}
scrollableMenu.setMaxVisibleMenuButtons(8);
return scrollableMenu;
case COMPLEX:
JCommandPopupMenu complexMenu = new JCommandPopupMenu(
new QuickStylesPanel(resourceBundle, currLocale), 5, 3);
complexMenu.addMenuButton(new JCommandMenuButton(resourceBundle
.getString("SaveSelection.text"),
new x_office_document()));
complexMenu.addMenuButton(new JCommandMenuButton(resourceBundle
.getString("ClearSelection.text"),
new EmptyResizableIcon(16)));
complexMenu.addMenuSeparator();
complexMenu.addMenuButton(new JCommandMenuButton(resourceBundle
.getString("ApplyStyles.text"), new EmptyResizableIcon(
16)));
return complexMenu;
}
return null;
}