Package swingtree

Class UIForMenu<M extends JMenu>


public final class UIForMenu<M extends JMenu> extends UIForAnyMenuItem<UIForMenu<M>,M>
A SwingTree builder node designed for configuring JMenu instances. This class is not meant to be instantiated directly, but rather through the UIFactoryMethods.menu() or UIFactoryMethods.menu(String) methods among others.
  • Method Details

    • _state

      protected swingtree.BuilderState<M> _state()
      Description copied from class: UIForAnything
      Returns the state of the builder, which is a container for the wrapped component as well as it's type and current EventProcessor.
      Specified by:
      _state in class UIForAnything<UIForMenu<M extends JMenu>,M extends JMenu,JComponent>
      Returns:
      The state of the builder.
    • _newBuilderWithState

      protected UIForMenu<M> _newBuilderWithState(swingtree.BuilderState<M> newState)
      Description copied from class: UIForAnything
      An internal wither method which creates a new builder instance with the provided BuilderState stored inside it.
      Specified by:
      _newBuilderWithState in class UIForAnything<UIForMenu<M extends JMenu>,M extends JMenu,JComponent>
      Parameters:
      newState - The new state which should be stored inside the new builder instance.
      Returns:
      A new builder instance with the provided state stored inside it.
    • popupMenuIsVisibleIf

      public final UIForMenu<M> popupMenuIsVisibleIf(boolean popupMenuVisible)
      Sets the popup menu visibility for this JMenu through the JMenu.setPopupMenuVisible(boolean) method.
      Parameters:
      popupMenuVisible - The popup menu visibility to set.
      Returns:
      This very instance, which enables builder-style method chaining.
    • popupMenuIsVisibleIf

      public final UIForMenu<M> popupMenuIsVisibleIf(sprouts.Val<Boolean> val)
      Binds to a popup menu visibility property for this JMenu through the JMenu.setPopupMenuVisible(boolean) method.
      Parameters:
      val - The popup menu visibility property to set.
      Returns:
      This very instance, which enables builder-style method chaining.