// with no paths expansion, (negative depth values are
// interpreted as complete menu expansion)
if ((elementView instanceof Folder) && ((depth < 0) || (depth > 1)) && !paths)
{
// construct menu definition and associated menu
MenuDefinition nestedMenuDefinition = new DefaultMenuDefinition(elementView.getUrl(), depth - 1, locatorName);
menuElement = new MenuImpl(view, this, nestedMenuDefinition, null, context, null);
}
else
{
// construct shared default menu option definition and menu option