< prev index next >

src/java.desktop/share/classes/java/awt/MenuItem.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1995, 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 --- 1,7 ---- /* ! * Copyright (c) 1995, 2016, 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
*** 20,38 **** * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.awt; import java.awt.peer.MenuItemPeer; - import java.awt.event.*; - import java.util.EventListener; - import java.io.ObjectOutputStream; - import java.io.ObjectInputStream; import java.io.IOException; ! import javax.accessibility.*; import sun.awt.AWTAccessor; /** * All items in a menu must belong to the class * {@code MenuItem}, or one of its subclasses. --- 20,48 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ + package java.awt; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; + import java.awt.event.InputEvent; + import java.awt.event.KeyEvent; import java.awt.peer.MenuItemPeer; import java.io.IOException; ! import java.io.ObjectInputStream; ! import java.io.ObjectOutputStream; ! import java.util.EventListener; ! ! import javax.accessibility.Accessible; ! import javax.accessibility.AccessibleAction; ! import javax.accessibility.AccessibleContext; ! import javax.accessibility.AccessibleRole; ! import javax.accessibility.AccessibleValue; ! import sun.awt.AWTAccessor; /** * All items in a menu must belong to the class * {@code MenuItem}, or one of its subclasses.
*** 109,129 **** * * @serial * @see #isEnabled() * @see #setEnabled(boolean) */ ! boolean enabled = true; /** * {@code label} is the label of a menu item. * It can be any string. * * @serial * @see #getLabel() * @see #setLabel(String) */ ! String label; /** * This field indicates the command that has been issued * by a particular menu item. * By default the {@code actionCommand} --- 119,139 ---- * * @serial * @see #isEnabled() * @see #setEnabled(boolean) */ ! private volatile boolean enabled = true; /** * {@code label} is the label of a menu item. * It can be any string. * * @serial * @see #getLabel() * @see #setLabel(String) */ ! volatile String label; /** * This field indicates the command that has been issued * by a particular menu item. * By default the {@code actionCommand}
*** 132,154 **** * * @serial * @see #setActionCommand(String) * @see #getActionCommand() */ ! String actionCommand; /** * The eventMask is ONLY set by subclasses via enableEvents. * The mask should NOT be set when listeners are registered * so that we can distinguish the difference between when * listeners request events and subclasses request them. * * @serial */ ! long eventMask; ! transient ActionListener actionListener; /** * A sequence of key stokes that ia associated with * a menu item. * Note :in 1.1.2 you must use setActionCommand() --- 142,164 ---- * * @serial * @see #setActionCommand(String) * @see #getActionCommand() */ ! private volatile String actionCommand; /** * The eventMask is ONLY set by subclasses via enableEvents. * The mask should NOT be set when listeners are registered * so that we can distinguish the difference between when * listeners request events and subclasses request them. * * @serial */ ! volatile long eventMask; ! private transient volatile ActionListener actionListener; /** * A sequence of key stokes that ia associated with * a menu item. * Note :in 1.1.2 you must use setActionCommand()
*** 158,168 **** * @serial * @see #getShortcut() * @see #setShortcut(MenuShortcut) * @see #deleteShortcut() */ ! private MenuShortcut shortcut = null; private static final String base = "menuitem"; private static int nameCounter = 0; /* --- 168,178 ---- * @serial * @see #getShortcut() * @see #setShortcut(MenuShortcut) * @see #deleteShortcut() */ ! private volatile MenuShortcut shortcut; private static final String base = "menuitem"; private static int nameCounter = 0; /*
< prev index next >