classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] FYI: Added getWindowAncestor in javax.swing.SwingUtilit


From: Roman Kennke
Subject: Re: [cp-patches] FYI: Added getWindowAncestor in javax.swing.SwingUtilities
Date: Mon, 23 May 2005 14:43:17 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204



Somehow the ChangeLog entry and the patch does not fit together. ;-)
Yeah sorry, there was the wrong text in my copy+paste buffer ;-)

2005-05-23  Roman Kennke  <address@hidden>

       * javax/swing/SwingUtilities.java:
       (getWindowAncestor): Added and implemented this method.

/Roman

Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.26
diff -u -r1.26 SwingUtilities.java
--- javax/swing/SwingUtilities.java     20 May 2005 12:10:21 -0000      1.26
+++ javax/swing/SwingUtilities.java     23 May 2005 11:10:32 -0000
@@ -352,6 +352,25 @@
   }
 
   /**
+   * Returns the first ancestor of <code>comp</code> that is a address@hidden 
Window}
+   * or <code>null</code> if <code>comp</code> is not contained in a
+   * address@hidden Window}.
+   *
+   * This is equivalent to calling
+   * <code>getAncestorOfClass(Window, comp)</code> or
+   * <code>windowForComponent(comp)</code>.
+   *
+   * @param comp the component for which we are searching the ancestor Window
+   *
+   * @return the first ancestor Window of <code>comp</code> or
+   *     <code>null</code> if <code>comp</code> is not contained in a Window
+   */
+  public Window getWindowAncestor(Component comp)
+  {
+    return (Window) getAncestorOfClass(Window.class, comp);
+  }
+
+  /**
    * Equivalent to calling <code>getAncestorOfClass(Window, comp)</code>.
    *
    * @param comp The component to search for an ancestor window 

reply via email to

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