boolean (Object current, boolean outgo) { boolean consumed = true; for (Object next = null, component = current; true; component = next) { next = get(component, "component"); // check first subcomponent if (next == null) { next = get(component, ":next"); } // check next component while (next == null) { // find the next of the parents, or the topmost component = getParent(component); // current is not on the desktop if (component == null) { return false; } if ((component == content) || ((getClass(component) == "dialog") && (!outgo || getBoolean(component, "modal", false)))) { consumed = false; // find next focusable but does not consume event next = component; // the topmost (desktop or modal dialog) } else { next = get(component, ":next"); } } if (next == current) { return false; } // one fucusable, no loop if (checkFocusable(next, false)) { setFocus(next); return consumed; } } }