Package org.scijava
Class MenuPath
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<MenuEntry>
-
- org.scijava.MenuPath
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<MenuEntry>,Collection<MenuEntry>,List<MenuEntry>,RandomAccess
public class MenuPath extends ArrayList<MenuEntry>
A path in a hierarchical menu structure, for use withUIDetails.- Author:
- Curtis Rueden
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringPATH_SEPARATORThe separator between elements of a menu path string.-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description MenuPath()Creates an empty menu path.MenuPath(String path)Creates a menu path with entries parsed from the given string.MenuPath(String path, String separator)Creates a menu path with entries parsed from the given string, splitting on the specified separator.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.MenuPath(Collection<? extends MenuEntry> menuEntries)Creates a menu path with the given entries.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MenuEntrygetLeaf()Gets the final element of the menu path.StringgetMenuString()Gets the menu path as a string.StringgetMenuString(boolean includeLeaf)Gets the menu path as a string, with or without the final element.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
Methods inherited from class java.util.AbstractList
equals, hashCode
-
Methods inherited from class java.util.AbstractCollection
containsAll, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, stream
-
Methods inherited from interface java.util.List
containsAll, equals, hashCode
-
-
-
-
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 aMenuPathas 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.
-
-