Package org.scijava

Class MenuPath

    • Field Detail

      • PATH_SEPARATOR

        public static final String PATH_SEPARATOR
        The separator between elements of a menu path string.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MenuPath

        public MenuPath()
        Creates an empty menu path.
      • MenuPath

        public MenuPath​(Collection<? extends MenuEntry> menuEntries)
        Creates a menu path with the given entries. Passing a MenuPath as the argument will make a copy.
      • MenuPath

        public MenuPath​(String path)
        Creates a menu path with entries parsed from the given string. Assumes > as the separator (e.g., File>New>Image).
        See Also:
        PATH_SEPARATOR
      • MenuPath

        public MenuPath​(String path,
                        String separator)
        Creates a menu path with entries parsed from the given string, splitting on the specified separator.
      • MenuPath

        public MenuPath​(String path,
                        String separator,
                        boolean trim)
        Creates a menu path with entries parsed from the given string, splitting on the specified separator, and trimming whitespace if indicated.
    • Method Detail

      • getLeaf

        public MenuEntry getLeaf()
        Gets the final element of the menu path.
      • getMenuString

        public String getMenuString()
        Gets the menu path as a string.
      • getMenuString

        public String getMenuString​(boolean includeLeaf)
        Gets the menu path as a string, with or without the final element.