org.scijava
Class MenuPath

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<MenuEntry>
              extended by 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 with UIDetails.

Author:
Curtis Rueden
See Also:
Serialized Form

Field Summary
static String PATH_SEPARATOR
          The separator between elements of a menu path string.
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
MenuPath()
          Creates an empty menu path.
MenuPath(Collection<? extends MenuEntry> menuEntries)
          Creates a menu path with the given entries.
MenuPath(String path)
          Creates a menu path with entries parsed from the given string.
 
Method Summary
 MenuEntry getLeaf()
          Gets the final element of the menu path.
 String getMenuString()
          Gets the menu path as a string.
 String getMenuString(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, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

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
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.



Copyright © 2009–2015 SciJava. All rights reserved.