Interface ApplicationMenuListener


public interface ApplicationMenuListener
Interface for receiving events from the macOS application menu. Once a listener has been registered using MacIntegration.setApplicationMenuListener(ApplicationMenuListener) they are notified whenever a menu item in the application menu is clicked.
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    When true, this will show the "Preferences" entry as part of the application menu.
    void
    Called when the "About" application menu item is clicked.
    default void
    Called when the "Preferences" application menu item (if available) is clicked.
    void
    Called when the "Quit" application menu item is clicked.
  • Method Details

    • onQuit

      void onQuit()
      Called when the "Quit" application menu item is clicked. This method is invoked right before the application exits.
    • onAbout

      void onAbout()
      Called when the "About" application menu item is clicked.
    • hasPreferencesMenu

      default boolean hasPreferencesMenu()
      When true, this will show the "Preferences" entry as part of the application menu. If this returns false, the preferences will be hidden, meaning that onPreferences() is inaccessible.
    • onPreferences

      default void onPreferences()
      Called when the "Preferences" application menu item (if available) is clicked. This method is never used if hasPreferencesMenu() returns false.