src/share/classes/javax/swing/JPopupMenu.java

Print this page




 395                 }
 396             }
 397         }
 398         // If not found and we have invoker, ask invoker about his gc
 399         if(gc == null && getInvoker() != null) {
 400             gc = getInvoker().getGraphicsConfiguration();
 401         }
 402         return gc;
 403     }
 404 
 405     /**
 406      * Checks that there are enough security permissions
 407      * to make popup "always on top", which allows to show it above the task bar.
 408      */
 409     static boolean canPopupOverlapTaskBar() {
 410         boolean result = true;
 411         try {
 412             SecurityManager sm = System.getSecurityManager();
 413             if (sm != null) {
 414                 sm.checkPermission(
 415                         SecurityConstants.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
 416             }
 417         } catch (SecurityException se) {
 418             // There is no permission to show popups over the task bar
 419             result = false;
 420         }
 421         return result;
 422     }
 423 
 424 
 425     /**
 426      * Factory method which creates the <code>JMenuItem</code> for
 427      * <code>Actions</code> added to the <code>JPopupMenu</code>.
 428      *
 429      * @param a the <code>Action</code> for the menu item to be added
 430      * @return the new menu item
 431      * @see Action
 432      *
 433      * @since 1.3
 434      */
 435     protected JMenuItem createActionComponent(Action a) {




 395                 }
 396             }
 397         }
 398         // If not found and we have invoker, ask invoker about his gc
 399         if(gc == null && getInvoker() != null) {
 400             gc = getInvoker().getGraphicsConfiguration();
 401         }
 402         return gc;
 403     }
 404 
 405     /**
 406      * Checks that there are enough security permissions
 407      * to make popup "always on top", which allows to show it above the task bar.
 408      */
 409     static boolean canPopupOverlapTaskBar() {
 410         boolean result = true;
 411         try {
 412             SecurityManager sm = System.getSecurityManager();
 413             if (sm != null) {
 414                 sm.checkPermission(
 415                         SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
 416             }
 417         } catch (SecurityException se) {
 418             // There is no permission to show popups over the task bar
 419             result = false;
 420         }
 421         return result;
 422     }
 423 
 424 
 425     /**
 426      * Factory method which creates the <code>JMenuItem</code> for
 427      * <code>Actions</code> added to the <code>JPopupMenu</code>.
 428      *
 429      * @param a the <code>Action</code> for the menu item to be added
 430      * @return the new menu item
 431      * @see Action
 432      *
 433      * @since 1.3
 434      */
 435     protected JMenuItem createActionComponent(Action a) {