jdk/src/share/classes/java/awt/PopupMenu.java
author erikj
Thu, 07 Jun 2012 18:05:09 -0700
changeset 12813 c10ab96dcf41
parent 5506 202f599c92aa
child 16734 da1901d79073
permissions -rw-r--r--
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI Reviewed-by: ohair, ohrstrom, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
     2
 * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3084
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.awt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.peer.PopupMenuPeer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.accessibility.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    31
import javax.tools.annotation.GenerateNativeHeader;
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    32
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    33
import sun.awt.AWTAccessor;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * A class that implements a menu which can be dynamically popped up
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * at a specified position within a component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * As the inheritance hierarchy implies, a <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *  can be used anywhere a <code>Menu</code> can be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * However, if you use a <code>PopupMenu</code> like a <code>Menu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * (e.g., you add it to a <code>MenuBar</code>), then you <b>cannot</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * call <code>show</code> on that <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * @author      Amy Fowler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 */
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    47
/* No native methods here, but the constants are needed in the supporting JNI code */
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    48
@GenerateNativeHeader
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
public class PopupMenu extends Menu {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    private static final String base = "popup";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    static int nameCounter = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    transient boolean isTrayIconPopup = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    56
    static {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    57
        AWTAccessor.setPopupMenuAccessor(
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    58
            new AWTAccessor.PopupMenuAccessor() {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    59
                public boolean isTrayIconPopup(PopupMenu popupMenu) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    60
                    return popupMenu.isTrayIconPopup;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    61
                }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    62
            });
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    63
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    64
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private static final long serialVersionUID = -4620452533522760060L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * Creates a new popup menu with an empty name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * returns true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public PopupMenu() throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        this("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     * Creates a new popup menu with the specified name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * @param label a non-<code>null</code> string specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *                the popup menu's label
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * returns true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    public PopupMenu(String label) throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        super(label);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public MenuContainer getParent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        if (isTrayIconPopup) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        return super.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * Constructs a name for this <code>MenuComponent</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * Called by <code>getName</code> when the name is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    String constructComponentName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        synchronized (PopupMenu.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            return base + nameCounter++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * Creates the popup menu's peer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * The peer allows us to change the appearance of the popup menu without
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * changing any of the popup menu's functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    public void addNotify() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        synchronized (getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
            // If our parent is not a Component, then this PopupMenu is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            // really just a plain, old Menu.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            if (parent != null && !(parent instanceof Component)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                super.addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                if (peer == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    peer = Toolkit.getDefaultToolkit().createPopupMenu(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                int nitems = getItemCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                for (int i = 0 ; i < nitems ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                    MenuItem mi = getItem(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                    mi.parent = this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    mi.addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
   /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * Shows the popup menu at the x, y position relative to an origin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * The origin component must be contained within the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * hierarchy of the popup menu's parent.  Both the origin and the parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * must be showing on the screen for this method to be valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * (i.e., it has a non-<code>Component</code> parent),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * then you cannot call this method on the <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @param origin the component which defines the coordinate space
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @param x the x coordinate position to popup the menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * @param y the y coordinate position to popup the menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @exception NullPointerException  if the parent is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @exception IllegalArgumentException  if this <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *                has a non-<code>Component</code> parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @exception IllegalArgumentException if the origin is not in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *                parent's heirarchy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @exception RuntimeException if the parent is not showing on screen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public void show(Component origin, int x, int y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        // Use localParent for thread safety.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        MenuContainer localParent = parent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (localParent == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            throw new NullPointerException("parent is null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        if (!(localParent instanceof Component)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            throw new IllegalArgumentException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                "PopupMenus with non-Component parents cannot be shown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        Component compParent = (Component)localParent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        //Exception was not thrown if compParent was not equal to origin and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        //was not Container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        if (compParent != origin) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            if (compParent instanceof Container) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                if (!((Container)compParent).isAncestorOf(origin)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                    throw new IllegalArgumentException("origin not in parent's hierarchy");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                throw new IllegalArgumentException("origin not in parent's hierarchy");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        if (compParent.getPeer() == null || !compParent.isShowing()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            throw new RuntimeException("parent not showing on screen");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        if (peer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
        synchronized (getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            if (peer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                ((PopupMenuPeer)peer).show(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                    new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
/////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
// Accessibility support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * Gets the <code>AccessibleContext</code> associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @return the <code>AccessibleContext</code> of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     *                <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public AccessibleContext getAccessibleContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        if (accessibleContext == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
            accessibleContext = new AccessibleAWTPopupMenu();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        return accessibleContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * Inner class of PopupMenu used to provide default support for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * accessibility.  This class is not meant to be used directly by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * application developers, but is instead meant only to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * subclassed by menu component developers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * The class used to obtain the accessible role for this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    protected class AccessibleAWTPopupMenu extends AccessibleAWTMenu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
         * JDK 1.3 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        private static final long serialVersionUID = -4282044795947239955L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
         * Get the role of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
         * @return an instance of AccessibleRole describing the role of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
         * object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        public AccessibleRole getAccessibleRole() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
            return AccessibleRole.POPUP_MENU;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    } // class AccessibleAWTPopupMenu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
}