Interface UIMenuBuilder


  • public interface UIMenuBuilder
    Encapsulates access and mutation for a menu hierarchy. API-Since: 13.0
    • Method Detail

      • actionForIdentifier

        @Nullable
        @Nullable UIAction actionForIdentifier​(@NotNull
                                               @NotNull java.lang.String identifier)
        Fetch the identified action.
        Parameters:
        identifier - The identifier of the action to fetch.
        Returns:
        The action with the given identifier, or `nil` if no such action.
      • commandForActionPropertyList

        @Nullable
        @Nullable UICommand commandForActionPropertyList​(@NotNull
                                                         @NotNull org.moe.natj.objc.SEL action,
                                                         @Nullable
                                                         @Nullable java.lang.Object propertyList)
        Fetch the identified command.
        Parameters:
        action - The action of the command to fetch.
        propertyList - Property list object to distinguish commands, if needed.
        Returns:
        The command with the given action and property list, or `nil` if no such command.
      • insertChildMenuAtEndOfMenuForIdentifier

        void insertChildMenuAtEndOfMenuForIdentifier​(@NotNull
                                                     @NotNull UIMenu childMenu,
                                                     @NotNull
                                                     @NotNull java.lang.String parentIdentifier)
        Insert a child menu at the end of an identified parent menu.
        Parameters:
        childGroup - The child menu to insert.
        parentIdentifier - The identifier of the parent menu to insert at the end of.
      • insertChildMenuAtStartOfMenuForIdentifier

        void insertChildMenuAtStartOfMenuForIdentifier​(@NotNull
                                                       @NotNull UIMenu childMenu,
                                                       @NotNull
                                                       @NotNull java.lang.String parentIdentifier)
        Insert a child menu at the start of an identified parent menu.
        Parameters:
        childGroup - The child menu to insert.
        parentIdentifier - The identifier of the parent menu to insert at the start of.
      • insertSiblingMenuAfterMenuForIdentifier

        void insertSiblingMenuAfterMenuForIdentifier​(@NotNull
                                                     @NotNull UIMenu siblingMenu,
                                                     @NotNull
                                                     @NotNull java.lang.String siblingIdentifier)
        Insert a sibling menu after an identified sibling menu.
        Parameters:
        siblingGroup - The sibling menu to insert.
        siblingIdentifier - The identifier of the sibling menu to insert after.
      • insertSiblingMenuBeforeMenuForIdentifier

        void insertSiblingMenuBeforeMenuForIdentifier​(@NotNull
                                                      @NotNull UIMenu siblingMenu,
                                                      @NotNull
                                                      @NotNull java.lang.String siblingIdentifier)
        Insert a sibling menu before an identified sibling menu.
        Parameters:
        siblingGroup - The sibling menu to insert.
        siblingIdentifier - The identifier of the sibling menu to insert before.
      • menuForIdentifier

        @Nullable
        @Nullable UIMenu menuForIdentifier​(@NotNull
                                           @NotNull java.lang.String identifier)
        Fetch the identified menu.
        Parameters:
        identifier - The identifier of the menu to fetch.
        Returns:
        The menu with the given identifier, or `nil` if no such menu.
      • removeMenuForIdentifier

        void removeMenuForIdentifier​(@NotNull
                                     @NotNull java.lang.String removedIdentifier)
        Remove an identified menu.
        Parameters:
        removedIdentifier - The menu to remove.
      • replaceChildrenOfMenuForIdentifierFromChildrenBlock

        void replaceChildrenOfMenuForIdentifierFromChildrenBlock​(@NotNull
                                                                 @NotNull java.lang.String parentIdentifier,
                                                                 @NotNull
                                                                 @NotNull UIMenuBuilder.Block_replaceChildrenOfMenuForIdentifierFromChildrenBlock childrenBlock)
        Replace the children of an identified parent menu.
        Parameters:
        parentIdentifier - The identifier of the parent menu.
        childrenBlock - A block that returns the new children, given the old children.
      • replaceMenuForIdentifierWithMenu

        void replaceMenuForIdentifierWithMenu​(@NotNull
                                              @NotNull java.lang.String replacedIdentifier,
                                              @NotNull
                                              @NotNull UIMenu replacementMenu)
        Replace an identified menu with a menu.
        Parameters:
        replacedIdentifier - The identifier of the menu to be replaced.
        replacementGroup - The replacement menu.
      • system

        @NotNull
        @NotNull UIMenuSystem system()
        Which system we are building for.