Class JMenu

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants, MenuElement

public class JMenu extends JMenuItem
Emulator for JMenu. R_leaf_peer_lockdown-locked over the JMenuItem placeholder peer.
See Also:
  • Constructor Details

    • JMenu

      public JMenu()
    • JMenu

      public JMenu(String text)
    • JMenu

      public JMenu(String text, boolean tearOff)
    • JMenu

      public JMenu(Action a)
  • Method Details

    • add

      public JMenuItem add(JMenuItem item)
    • add

      public JMenuItem add(String text)
    • add

      public JMenuItem add(Action a)
    • createActionComponent

      protected JMenuItem createActionComponent(Action a)
      JDK factory used by add(javax.swing.Action). Subclasses override to customize the per-Action item type. Default: a fresh JMenuItem configured from the Action.
    • addSeparator

      public void addSeparator()
    • insert

      public JMenuItem insert(JMenuItem item, int pos)
    • insert

      public void insert(Action a, int pos)
    • insertSeparator

      public void insertSeparator(int pos)
    • remove

      public void remove(JMenuItem item)
    • remove

      public void remove(int pos)
      Overrides:
      remove in class Container
    • removeAll

      public void removeAll()
      Overrides:
      removeAll in class Container
    • getItemCount

      public int getItemCount()
    • getItem

      public JMenuItem getItem(int pos)
    • getMenuComponentCount

      public int getMenuComponentCount()
    • isMenuComponent

      public boolean isMenuComponent(Component c)
      Typed vaadinx.awt.Component per R_no_vaadin_in_api limb 1. Under the JDK's type the argument was unproducible after the import swap, so the body could only return false; ported, the children this menu already tracks are exactly the right type to answer with.
      Returns:
      true when c is this menu or, recursively, one of its menu children — the JDK's own contract.
    • setPopupMenuVisible

      public void setPopupMenuVisible(boolean b)
    • isPopupMenuVisible

      public boolean isPopupMenuVisible()
    • isTearOff

      public boolean isTearOff()
    • addMenuListener

      public void addMenuListener(MenuListener l)
    • removeMenuListener

      public void removeMenuListener(MenuListener l)
    • getMenuListeners

      public MenuListener[] getMenuListeners()
    • getDelay

      public int getDelay()
    • setDelay

      public void setDelay(int d)
      Stores the delay and rejects a negative one as the JDK does; the submenu still opens on Vaadin's own schedule, since the effect is what R_decline_effect_only permits dropping and the state is not.
    • getPopupMenu

      public JPopupMenu getPopupMenu()
    • isTopLevelMenu

      public boolean isTopLevelMenu()
    • getUIClassID

      public String getUIClassID()
      Overrides:
      getUIClassID in class JMenuItem