jdk/src/share/classes/java/awt/PopupMenu.java
author dxu
Thu, 04 Apr 2013 15:39:17 -0700
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 21278 ef8a3a2a72f2
permissions -rw-r--r--
8000406: change files using @GenerateNativeHeader to use @Native Summary: Use @Native annotation to mark constants interested by native codes Reviewed-by: alanb, anthony, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
     2
 * Copyright (c) 1996, 2013, 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
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    32
import sun.awt.AWTAccessor;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * A class that implements a menu which can be dynamically popped up
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * at a specified position within a component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * As the inheritance hierarchy implies, a <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 *  can be used anywhere a <code>Menu</code> can be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * However, if you use a <code>PopupMenu</code> like a <code>Menu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * (e.g., you add it to a <code>MenuBar</code>), then you <b>cannot</b>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * call <code>show</code> on that <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * @author      Amy Fowler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public class PopupMenu extends Menu {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private static final String base = "popup";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    static int nameCounter = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    transient boolean isTrayIconPopup = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
3084
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    53
    static {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    54
        AWTAccessor.setPopupMenuAccessor(
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    55
            new AWTAccessor.PopupMenuAccessor() {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    56
                public boolean isTrayIconPopup(PopupMenu popupMenu) {
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    57
                    return popupMenu.isTrayIconPopup;
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    58
                }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    59
            });
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    60
    }
67ca55732362 6824169: Need to remove some AWT class dependencies
dcherepanov
parents: 2
diff changeset
    61
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static final long serialVersionUID = -4620452533522760060L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * Creates a new popup menu with an empty name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * returns true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public PopupMenu() throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
        this("");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * Creates a new popup menu with the specified name.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @param label a non-<code>null</code> string specifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     *                the popup menu's label
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * @exception HeadlessException if GraphicsEnvironment.isHeadless()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     * returns true.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * @see java.awt.GraphicsEnvironment#isHeadless
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    public PopupMenu(String label) throws HeadlessException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        super(label);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * {@inheritDoc}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    public MenuContainer getParent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        if (isTrayIconPopup) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        return super.getParent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     * Constructs a name for this <code>MenuComponent</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * Called by <code>getName</code> when the name is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    String constructComponentName() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        synchronized (PopupMenu.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            return base + nameCounter++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * Creates the popup menu's peer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * The peer allows us to change the appearance of the popup menu without
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * changing any of the popup menu's functionality.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    public void addNotify() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        synchronized (getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            // If our parent is not a Component, then this PopupMenu is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            // really just a plain, old Menu.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            if (parent != null && !(parent instanceof Component)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                super.addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                if (peer == null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    peer = Toolkit.getDefaultToolkit().createPopupMenu(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                int nitems = getItemCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                for (int i = 0 ; i < nitems ; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    MenuItem mi = getItem(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                    mi.parent = this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                    mi.addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        }
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
     * Shows the popup menu at the x, y position relative to an origin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * component.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * The origin component must be contained within the component
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * hierarchy of the popup menu's parent.  Both the origin and the parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * must be showing on the screen for this method to be valid.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * If this <code>PopupMenu</code> is being used as a <code>Menu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * (i.e., it has a non-<code>Component</code> parent),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * then you cannot call this method on the <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * @param origin the component which defines the coordinate space
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * @param x the x coordinate position to popup the menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * @param y the y coordinate position to popup the menu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * @exception NullPointerException  if the parent is <code>null</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * @exception IllegalArgumentException  if this <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *                has a non-<code>Component</code> parent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @exception IllegalArgumentException if the origin is not in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     *                parent's heirarchy
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @exception RuntimeException if the parent is not showing on screen
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    public void show(Component origin, int x, int y) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        // Use localParent for thread safety.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        MenuContainer localParent = parent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        if (localParent == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            throw new NullPointerException("parent is null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (!(localParent instanceof Component)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            throw new IllegalArgumentException(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                "PopupMenus with non-Component parents cannot be shown");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        Component compParent = (Component)localParent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        //Fixed 6278745: Incorrect exception throwing in PopupMenu.show() method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        //Exception was not thrown if compParent was not equal to origin and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
        //was not Container
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        if (compParent != origin) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            if (compParent instanceof Container) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                if (!((Container)compParent).isAncestorOf(origin)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                    throw new IllegalArgumentException("origin not in parent's hierarchy");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            } else {
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
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (compParent.getPeer() == null || !compParent.isShowing()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            throw new RuntimeException("parent not showing on screen");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        if (peer == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            addNotify();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        synchronized (getTreeLock()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
            if (peer != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                ((PopupMenuPeer)peer).show(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                    new Event(origin, 0, Event.MOUSE_DOWN, x, y, 0, 0));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
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
// Accessibility support
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
////////////////
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Gets the <code>AccessibleContext</code> associated with this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * <code>PopupMenu</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @return the <code>AccessibleContext</code> of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     *                <code>PopupMenu</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public AccessibleContext getAccessibleContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        if (accessibleContext == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            accessibleContext = new AccessibleAWTPopupMenu();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        return accessibleContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * Inner class of PopupMenu used to provide default support for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * accessibility.  This class is not meant to be used directly by
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * application developers, but is instead meant only to be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * subclassed by menu component developers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * The class used to obtain the accessible role for this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    protected class AccessibleAWTPopupMenu extends AccessibleAWTMenu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
         * JDK 1.3 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        private static final long serialVersionUID = -4282044795947239955L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
         * Get the role of this object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
         * @return an instance of AccessibleRole describing the role of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
         * object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        public AccessibleRole getAccessibleRole() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            return AccessibleRole.POPUP_MENU;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    } // class AccessibleAWTPopupMenu
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
}