java.lang.Object
com.thecoderscorner.menu.mgr.MenuInMenu

public class MenuInMenu extends Object
MenuInMenu embeds a menu within another menu by shifting the range of IDs within the remote items into another range. For example if we say all items in this menu start at 100,000 then every item that comes in will have 100,000 added to their ID, so they can be stored in the same tree. Let's say you have several IoT devices located in various locations around your building, and you want to present all these devices together in a single embedCONTROL instance, or manage them together with the API, for each device you create an instance of MenuInMenu that has a connector for the given device. You'd give each instance a different ID range, EG local device items may go from 0..100000, then device 1 offset could be 100000 for example and so on.
  • Constructor Details

    • MenuInMenu

      public MenuInMenu(RemoteConnector remoteConnector, MenuManagerServer manager, MenuItem root, MenuInMenu.ReplicationMode mode, int offsetRange, int maxRange)
      Creates a MenuInMenu instance that tracks changes in a remote menu and replicates it locally in real time.
      Parameters:
      remoteConnector - the connection to the remote device.
      manager - the manager object that will store the menu structures
      root - the "root" submenu for the remote items
      mode - how the items should be integrated into the tree
      offsetRange - the starting ID for these items
      maxRange - the maximum ID for these items (status menu item will use the last possible value)
  • Method Details

    • start

      public void start()
      Starts the remote and registers listeners
    • getCurrentStatus

      public AuthStatus getCurrentStatus()
      Check the current status of the underlying connection
      Returns:
      the auth status of the connection