/[classpath]/classpath/java/awt/DefaultKeyboardFocusManager.java
ViewVC logotype

Diff of /classpath/java/awt/DefaultKeyboardFocusManager.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by mark, Sat Jul 2 20:32:24 2005 UTC revision 1.15 by fitzsim, Tue Jul 5 19:16:00 2005 UTC
# Line 187  public class DefaultKeyboardFocusManager Line 187  public class DefaultKeyboardFocusManager
187    
188              // Keep track of this window's focus owner.              // Keep track of this window's focus owner.
189    
190              // Find the target Component's top-level ancestor.              // Find the target Component's top-level ancestor.  target
191                // may be a window.
192              Container parent = target.getParent ();              Container parent = target.getParent ();
193    
194              while (parent != null              while (parent != null
195                     && !(parent instanceof Window))                     && !(parent instanceof Window))
196                parent = parent.getParent ();                parent = parent.getParent ();
197    
198              Window toplevel = parent == null ?              // If the parent is null and target is not a window, then target is an
199                (Window) target : (Window) parent;              // unanchored component and so we don't want to set the focus owner.
200                if (! (parent == null && ! (target instanceof Window)))
201                  {
202                    Window toplevel = parent == null ?
203                      (Window) target : (Window) parent;
204    
205              Component focusOwner = getFocusOwner ();                  Component focusOwner = getFocusOwner ();
206              if (focusOwner != null                  if (focusOwner != null
207                  && ! (focusOwner instanceof Window))                      && ! (focusOwner instanceof Window))
208                toplevel.setFocusOwner (focusOwner);                    toplevel.setFocusOwner (focusOwner);
209                  }
210            }            }
211          else if (e.id == FocusEvent.FOCUS_LOST)          else if (e.id == FocusEvent.FOCUS_LOST)
212            {            {

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26