Class MenuItemsService


  • public final class MenuItemsService
    extends java.lang.Object
    A JAVA SPI Service to retrieve, from providers of the MenuItemsInterface service, lists of items to be added to the JMRI menu(s) associated with LocoNet connections.
    • Method Detail

      • getInstance

        public static MenuItemsService getInstance()
        Method for getting the SPI service "singleton"

        Returns:
        the singleton instance of this class
      • getMenuExtensionsItems

        public java.util.List<javax.swing.JMenu> getMenuExtensionsItems​(boolean isLocoNetInterface,
                                                                        WindowInterface wi,
                                                                        LocoNetSystemConnectionMemo memo)
        Return menu items from all LocoNet Menu Extension SPI providers.
        Parameters:
        isLocoNetInterface - informs whether the connection has actual hardware
        wi - allows the extension menu items to be associated with the JAVA WindowInterface which relates to the connection's menu
        memo - the LocoNetSystemConnectionMemo associated with the menu to which the extension's MenuItem(s) are to be attached.
        Returns:
        an ArrayList of JMenu objects, as populated from the menu items reported by any available SPI extensions. May be an empty ArrayList if none of the SPI extensions provide menu items for this menu.