src/java.desktop/share/classes/sun/awt/AWTAccessor.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -27,19 +27,18 @@
 
 import sun.misc.Unsafe;
 
 import javax.accessibility.AccessibleContext;
 import java.awt.*;
-import java.awt.KeyboardFocusManager;
-import java.awt.DefaultKeyboardFocusManager;
 import java.awt.event.InputEvent;
 import java.awt.event.InvocationEvent;
 import java.awt.event.KeyEvent;
 import java.awt.geom.Point2D;
 import java.awt.image.BufferStrategy;
 import java.awt.peer.ComponentPeer;
 
+import java.awt.peer.MenuComponentPeer;
 import java.lang.reflect.InvocationTargetException;
 import java.security.AccessControlContext;
 
 import java.io.File;
 import java.util.ResourceBundle;

@@ -169,11 +168,11 @@
         Cursor getCursor(Component comp);
 
         /**
          * Returns the peer of the component.
          */
-        ComponentPeer getPeer(Component comp);
+        <T extends ComponentPeer> T getPeer(Component comp);
 
         /**
          * Sets the peer of the component to the specified peer.
          */
         void setPeer(Component comp, ComponentPeer peer);

@@ -479,10 +478,15 @@
          * Sets the appContext of the menu component.
          */
         void setAppContext(MenuComponent menuComp, AppContext appContext);
 
         /**
+         * Returns the peer of the menu component.
+         */
+        <T extends MenuComponentPeer> T getPeer(MenuComponent menuComp);
+
+        /**
          * Returns the menu container of the menu component.
          */
         MenuContainer getParent(MenuComponent menuComp);
 
         /**