Interface MenuBean

  • All Superinterfaces:
    Bean, Component

    public interface MenuBean
    extends Bean
    MenuBean represents a menu bean on UI.
    Since:
    5.12
    • Method Detail

      • getTopMenuNodes

        java.util.List<MenuNode> getTopMenuNodes()
        Get the top menu nodes under invisible root.
        Returns:
        a list of menu nodes. return empty list if none.
        Since:
        5.13
      • getMenuNode

        default MenuNode getMenuNode​(java.lang.String... namePath)
        Get the menu node with the name path from root. resource bundle will be used to translate the names to match menu node visible names.
        Parameters:
        namePath - menu node display name path from the root of this menu bean
        Returns:
        a MenuNode instance
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found
      • getMenuNode

        default MenuNode getMenuNode​(boolean nameLocalized,
                                     java.lang.String... namePath)
        Get the menu node with the name path from root.
        Parameters:
        nameLocalized - whether the menu node names are localized. If false, resource bundle will be used to translate the names to match menu node visible names.
        namePath - menu node display name path from the root of this menu bean
        Returns:
        a MenuNode instance
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found
        Since:
        5.13
      • getMenuNode

        default MenuNode getMenuNode​(boolean errorIfNotFound,
                                     boolean nameLocalized,
                                     java.lang.String... namePath)
        Get the menu node with the name path from root.
        Parameters:
        errorIfNotFound - whether to throw exception if not found
        nameLocalized - whether the menu node names are localized. If false, resource bundle will be used to translate the names to match menu node visible names.
        namePath - menu node display name path from the root of this menu bean
        Returns:
        a MenuNode instance. return null if not found
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found and errorIfNotFound is true
        Since:
        5.13
      • getMenuNode

        MenuNode getMenuNode​(boolean errorIfNotFound,
                             boolean nameLocalized,
                             java.util.ResourceBundle resourceBundle,
                             java.lang.String... namePath)
        Get the menu node with the name path from root.
        Parameters:
        errorIfNotFound - whether to throw exception if not found
        nameLocalized - whether the menu node names are localized. If false, resource bundle will be used to translate the names to match menu node visible names.
        resourceBundle - resourceBundle. default to Component.getResourceBundle() if null
        namePath - menu node display name path from the root of this menu bean
        Returns:
        a MenuNode instance. return null if not found
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found and errorIfNotFound is true
        Since:
        5.15
      • getMenuNodeWithCommand

        default MenuNode getMenuNodeWithCommand​(java.lang.String command)
        Get menu node with the command.
        Parameters:
        command - command name
        Returns:
        a MenuNode instance
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found
      • getMenuNodeWithCommand

        MenuNode getMenuNodeWithCommand​(java.lang.String command,
                                        boolean errorIfNotFound)
        Get menu node with the command.
        Parameters:
        command - command name
        errorIfNotFound - whether to throw exception if not found
        Returns:
        a MenuNode instance. return null if not found and errorIfNotFound is false
        Throws:
        java.lang.IllegalArgumentException - throw if the menuNode is not found and errorIfNotFound is true
      • containsTrigger

        boolean containsTrigger()
        Does this menuBean contain a trigger to show the menu? When a menuBean contains a trigger, its menu nodes are not visible.
        Returns:
        true if it contains trigger, false otherwise
        Since:
        5.16