2362N/A * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A class that implements a menu which can be dynamically popped up 0N/A * at a specified position within a component. 0N/A * As the inheritance hierarchy implies, a <code>PopupMenu</code> 0N/A * can be used anywhere a <code>Menu</code> can be used. 0N/A * However, if you use a <code>PopupMenu</code> like a <code>Menu</code> 0N/A * (e.g., you add it to a <code>MenuBar</code>), then you <b>cannot</b> 0N/A * call <code>show</code> on that <code>PopupMenu</code>. 0N/A * @author Amy Fowler 0N/A * JDK 1.1 serialVersionUID 0N/A * Creates a new popup menu with an empty name. 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Creates a new popup menu with the specified name. 0N/A * @param label a non-<code>null</code> string specifying 0N/A * the popup menu's label 0N/A * @exception HeadlessException if GraphicsEnvironment.isHeadless() 0N/A * @see java.awt.GraphicsEnvironment#isHeadless 0N/A * Constructs a name for this <code>MenuComponent</code>. 0N/A * Called by <code>getName</code> when the name is <code>null</code>. 0N/A * Creates the popup menu's peer. 0N/A * The peer allows us to change the appearance of the popup menu without 0N/A * changing any of the popup menu's functionality. 0N/A // If our parent is not a Component, then this PopupMenu is 0N/A // really just a plain, old Menu. 0N/A * Shows the popup menu at the x, y position relative to an origin 0N/A * The origin component must be contained within the component 0N/A * hierarchy of the popup menu's parent. Both the origin and the parent 0N/A * must be showing on the screen for this method to be valid. 0N/A * If this <code>PopupMenu</code> is being used as a <code>Menu</code> 0N/A * (i.e., it has a non-<code>Component</code> parent), 0N/A * then you cannot call this method on the <code>PopupMenu</code>. 0N/A * @param origin the component which defines the coordinate space 0N/A * @param x the x coordinate position to popup the menu 0N/A * @param y the y coordinate position to popup the menu 0N/A * @exception NullPointerException if the parent is <code>null</code> 0N/A * @exception IllegalArgumentException if this <code>PopupMenu</code> 0N/A * has a non-<code>Component</code> parent 0N/A * @exception IllegalArgumentException if the origin is not in the 0N/A * parent's heirarchy 0N/A * @exception RuntimeException if the parent is not showing on screen 0N/A // Use localParent for thread safety. 0N/A "PopupMenus with non-Component parents cannot be shown");
0N/A //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method 0N/A //Exception was not thrown if compParent was not equal to origin and 0N/A// Accessibility support 0N/A * Gets the <code>AccessibleContext</code> associated with this 0N/A * <code>PopupMenu</code>. 0N/A * @return the <code>AccessibleContext</code> of this 0N/A * <code>PopupMenu</code> 0N/A * Inner class of PopupMenu used to provide default support for 0N/A * accessibility. This class is not meant to be used directly by 0N/A * application developers, but is instead meant only to be 0N/A * subclassed by menu component developers. 0N/A * The class used to obtain the accessible role for this object. 0N/A * JDK 1.3 serialVersionUID 0N/A * Get the role of this object. 0N/A * @return an instance of AccessibleRole describing the role of the 0N/A }
// class AccessibleAWTPopupMenu