Package swingtree

Class UIForAnyMenuItem<I,M extends JMenuItem>

Type Parameters:
I - The type of the builder itself. This is used to allow for method chaining.
M - The type of the JMenuItem being built.
Direct Known Subclasses:
UIForCheckBoxMenuItem, UIForMenu, UIForMenuItem, UIForRadioButtonMenuItem

public abstract class UIForAnyMenuItem<I,M extends JMenuItem> extends UIForAnyButton<I,M>
A builder for JMenuItems.
  • Constructor Details

    • UIForAnyMenuItem

      public UIForAnyMenuItem()
  • Method Details

    • withKeyStroke

      public I withKeyStroke(KeyStroke keyStroke)
      Sets the key combination which invokes the wrapped JMenuItem's action listeners without navigating the menu hierarchy. It is the UI's responsibility to install the correct action. Note that when the keyboard accelerator is typed, it will work whether or whether not the menu is currently displayed.
      Parameters:
      keyStroke - the KeyStroke which will serve as an accelerator
      Returns:
      This very builder to allow for method chaining.
    • withKeyStroke

      public I withKeyStroke(sprouts.Val<KeyStroke> keyStroke)
      Sets the key combination property which invokes the wrapped JMenuItem's action listeners without navigating the menu hierarchy. It is the UI's responsibility to install the correct action. Note that when the keyboard accelerator is typed, it will work whether or whether not the menu is currently displayed.
      Parameters:
      keyStroke - the dynamically set KeyStroke property which will serve as an accelerator
      Returns:
      This very builder to allow for method chaining.