/** * @return the focus policy memento that represents the current focus ordering for this manager */ public FocusPolicyMemento getFocusPolicyMemento() { HashSet current_focus_set = new HashSet(); current_focus_set.addAll(m_focus_list); HashMap focus_key_map = new HashMap(); CompositeFocusKey cfk = new CompositeFocusKey(); /** first build location keys for all components in the the form */ buildFocusKeys(current_focus_set, focus_key_map, m_form, cfk); FocusPolicyMemento memento = new FocusPolicyMemento(); /** now iterate over the focus list and get the corresponding focus key */ Iterator iter = m_focus_list.iterator(); while (iter.hasNext()) { Component comp = (Component) iter.next(); FocusKey fkey = (FocusKey) focus_key_map.get(comp); if (fkey != null) memento.addFocusKey(fkey); } return memento; }