Пример #1
0
 /**
  * Returns newly created menu.
  *
  * @param icon menu icon, can be either String icon name, ImageIcon, Image, image File or image
  *     URL
  * @param text menu text
  * @param enabled whether menu is enabled or not
  * @param actionListener menu action listener
  * @return newly created menu
  */
 protected WebMenu createSubMenu(
     final Object icon,
     final String text,
     final boolean enabled,
     final ActionListener actionListener) {
   final WebMenu menu = new WebMenu();
   menu.setIcon(getIcon(icon));
   menu.setLanguage(getLanguageKey(text));
   menu.setEnabled(enabled);
   menu.addActionListener(actionListener);
   return menu;
 }
Пример #2
0
 /** Adds separator into menu. */
 public void addSeparator() {
   final E menuComponent = getMenu();
   if (menuComponent instanceof WebMenu) {
     ((WebMenu) menuComponent).addSeparator();
   } else if (menuComponent instanceof WebPopupMenu) {
     ((WebPopupMenu) menuComponent).addSeparator();
   }
 }