classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] add getMostRecentFocusOwner Window method


From: Thomas Fitzsimmons
Subject: [cp-patches] add getMostRecentFocusOwner Window method
Date: Sat, 20 Aug 2005 20:27:22 -0400

Hi,

I committed this to mainline.  It fixes:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17463

Tom

2005-08-20  Thomas Fitzsimmons  <address@hidden>

        * java/awt/Window.java (getMostRecentFocusOwner): New method.

Index: java/awt/Window.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Window.java,v
retrieving revision 1.52
diff -u -r1.52 Window.java
--- java/awt/Window.java        19 Aug 2005 01:29:26 -0000      1.52
+++ java/awt/Window.java        21 Aug 2005 00:27:47 -0000
@@ -746,7 +746,25 @@
     if (activeWindow == this)
       return manager.getFocusOwner ();
     else
-      return windowFocusOwner;
+      return null;
+  }
+
+  /**
+   * Returns the child component of this window that would receive
+   * focus if this window were to become focused.  If the window
+   * already has the top-level focus, then this method returns the
+   * same component as getFocusOwner.  If no child component has
+   * requested focus within the window, then the initial focus owner
+   * is returned.  If this is a non-focusable window, this method
+   * returns null.
+   *
+   * @return the child component of this window that most recently had
+   * the focus, or <code>null</code>
+   * @since 1.4
+   */
+  public Component getMostRecentFocusOwner ()
+  {
+    return windowFocusOwner;
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]