DefaultMenuOptionsDefinition defaultMenuOptionsDefinition = null;
ListIterator elementProxiesIter = elementProxies.listIterator();
while (elementProxiesIter.hasNext())
{
Node elementProxy = (Node)elementProxiesIter.next();
MenuElement menuElement = null;
// convert folders into nested menus if depth specified
// with no paths expansion, (negative depth values are
// interpreted as complete menu expansion)
if ((elementProxy instanceof Folder) && ((depth < 0) || (depth > 1)) && !paths)