< prev index next >
src/java.desktop/share/classes/java/awt/Menu.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.io.IOException;
import java.io.ObjectInputStream;
- import java.util.Vector;
import java.util.Enumeration;
! import java.awt.peer.MenuPeer;
! import java.awt.event.KeyEvent;
! import javax.accessibility.*;
import sun.awt.AWTAccessor;
/**
* A {@code Menu} object is a pull-down menu component
* that is deployed from a menu bar.
--- 20,43 ----
*
* 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.KeyEvent;
+ import java.awt.peer.MenuPeer;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.Enumeration;
! import java.util.Vector;
!
! import javax.accessibility.Accessible;
! import javax.accessibility.AccessibleContext;
! import javax.accessibility.AccessibleRole;
!
import sun.awt.AWTAccessor;
/**
* A {@code Menu} object is a pull-down menu component
* that is deployed from a menu bar.
*** 76,86 ****
* A vector of the items that will be part of the Menu.
*
* @serial
* @see #countItems()
*/
! Vector<MenuItem> items = new Vector<>();
/**
* This field indicates whether the menu has the
* tear of property or not. It will be set to
* {@code true} if the menu has the tear off
--- 81,91 ----
* A vector of the items that will be part of the Menu.
*
* @serial
* @see #countItems()
*/
! private final Vector<MenuItem> items = new Vector<>();
/**
* This field indicates whether the menu has the
* tear of property or not. It will be set to
* {@code true} if the menu has the tear off
*** 90,110 ****
* it is no longer needed.
*
* @serial
* @see #isTearOff()
*/
! boolean tearOff;
/**
* This field will be set to {@code true}
* if the Menu in question is actually a help
* menu. Otherwise it will be set to
* {@code false}.
*
* @serial
*/
! boolean isHelpMenu;
private static final String base = "menu";
private static int nameCounter = 0;
/*
--- 95,115 ----
* it is no longer needed.
*
* @serial
* @see #isTearOff()
*/
! private final boolean tearOff;
/**
* This field will be set to {@code true}
* if the Menu in question is actually a help
* menu. Otherwise it will be set to
* {@code false}.
*
* @serial
*/
! volatile boolean isHelpMenu;
private static final String base = "menu";
private static int nameCounter = 0;
/*
*** 413,424 ****
items.removeElementAt(index);
MenuPeer peer = (MenuPeer)this.peer;
if (peer != null) {
peer.delItem(index);
mi.removeNotify();
- mi.parent = null;
}
}
}
/**
* Removes the specified menu item from this menu.
--- 418,429 ----
items.removeElementAt(index);
MenuPeer peer = (MenuPeer)this.peer;
if (peer != null) {
peer.delItem(index);
mi.removeNotify();
}
+ mi.parent = null;
}
}
/**
* Removes the specified menu item from this menu.
< prev index next >