return null;
}
// we are a menu with subentries - create the menu and return it
JaspiraPopupMenu menu = new JaspiraPopupMenu();
SortedSet menuchildren = virtualRoot.getMenuchildren();
if (menuchildren == null)
return null;
for (Iterator it = menuchildren.iterator(); it.hasNext();)
{
JaspiraAction next = (JaspiraAction) it.next();
if (next.getType().equals(JaspiraAction.TYPE_GROUP))
{
if (next.getMenuchildren() == null)
{
// The group is empty, ignore it.
continue;
}
for (Iterator it2 = next.getMenuchildren().iterator(); it2.hasNext();)
{
menu.add((JaspiraAction) it2.next());
}
}
else
{
menu.add(next);
}
if (it.hasNext())
{
menu.addSeparator();
}
}
Component focusOwner = FocusManager.getCurrentManager().getFocusOwner();
menu.setInvoker(focusOwner);
return menu;
}