NavigationHandler handler = p instanceof Component ? findNavigationHandler((Component) p) : null;
if (handler != null) {
widgets = handler.getOrderedWidgets(p);
} else if (p instanceof Container) {
Container con = (Container) p;
widgets = con.getItems();
} else if (p instanceof HasWidgets) {
HasWidgets hs = (HasWidgets) p;
widgets = new ArrayList<Widget>();
Iterator<Widget> it = hs.iterator();
while (it.hasNext()) {