Changeset 9916 in josm for trunk/src/org/openstreetmap/josm/gui/util
- Timestamp:
- 2016-03-02T22:54:34+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/util/GuiHelper.java
r9826 r9916 27 27 import java.lang.reflect.InvocationTargetException; 28 28 import java.util.Enumeration; 29 import java.util.EventObject; 29 30 import java.util.concurrent.Callable; 30 31 import java.util.concurrent.ExecutionException; … … 463 464 return GraphicsEnvironment.isHeadless() ? null : Toolkit.getDefaultToolkit().getSystemSelection(); 464 465 } 466 467 /** 468 * Returns the first <code>Window</code> ancestor of event source, or 469 * {@code null} if event source is not a component contained inside a <code>Window</code>. 470 * @param e event object 471 * @return a Window, or {@code null} 472 * @since 9916 473 */ 474 public static Window getWindowAncestorFor(EventObject e) { 475 return e != null && e.getSource() instanceof Component ? SwingUtilities.getWindowAncestor((Component) e.getSource()) : null; 476 } 465 477 }
Note:
See TracChangeset
for help on using the changeset viewer.