Object (Object component, Object item, String subitem) { if (subitem == null) { return get(item, ":next"); } Object next = get(item, subitem); if ((next == null) || !getBoolean(item, "expanded", true)) { while ((item != component) && ((next = get(item, ":next")) == null)) { item = getParent(item); } } return next; }