Class ContextMenuIconUtils

    • Method Detail

      • addMenuItem

        public static void addMenuItem​(@NonNull
                                       ModelObjectWithContextMenu.ContextMenu menu,
                                       @CheckForNull
                                       String prefix,
                                       @NonNull
                                       Action action,
                                       @CheckForNull
                                       ModelObjectWithContextMenu.ContextMenu subMenu)
        Adds a menu item for the specified action with the supplied prefix offset and optional sub menu.
        Parameters:
        menu - the menu to add to.
        prefix - the prefix offset of the action urls.
        action - the action.
        subMenu - the sub menu.
      • addMenuItem

        public static void addMenuItem​(@NonNull
                                       ModelObjectWithContextMenu.ContextMenu menu,
                                       @CheckForNull
                                       String prefix,
                                       @NonNull
                                       Action action)
        Adds a menu item for the specified action with the supplied prefix offset.
        Parameters:
        menu - the menu to add to.
        prefix - the prefix offset of the action urls.
        action - the action.
      • addMenuItem

        public static void addMenuItem​(@NonNull
                                       ModelObjectWithContextMenu.ContextMenu menu,
                                       @NonNull
                                       Action action)
        Adds a menu item for the specified action.
        Parameters:
        menu - the menu to add to.
        action - the action.
      • getMenuItemIconUrlByClassSpec

        @CheckForNull
        public static String getMenuItemIconUrlByClassSpec​(@CheckForNull
                                                           String spec)
        Gets the qualified URL for an icon spec.
        Parameters:
        spec - the icon spec.
        Returns:
        the qualified URL for a menu item
      • getMenuItemIconUrl

        public static String getMenuItemIconUrl​(String url)
        Converts a regular icon url into a menu item icon url
        Parameters:
        url - the "regular" icon url.
        Returns:
        the url for a menu item.
      • getIconByClassSpec

        @CheckForNull
        public static Icon getIconByClassSpec​(String spec)
        Navigate the signature changes in different versions of IconSet.
        Parameters:
        spec - the spec to look up.
        Returns:
        the Icon or null
      • getQualifiedUrl

        @CheckForNull
        public static String getQualifiedUrl​(@CheckForNull
                                             Icon icon)
        Gets the qualified URL of the specified icon.
        Parameters:
        icon - the icon.
        Returns:
        the qualified URL of the icon.