< prev index next >
src/java.desktop/share/classes/java/awt/Menu.java
Print this page
@@ -32,25 +32,25 @@
import java.awt.event.KeyEvent;
import javax.accessibility.*;
import sun.awt.AWTAccessor;
/**
- * A <code>Menu</code> object is a pull-down menu component
+ * A {@code Menu} object is a pull-down menu component
* that is deployed from a menu bar.
* <p>
* A menu can optionally be a <i>tear-off</i> menu. A tear-off menu
* can be opened and dragged away from its parent menu bar or menu.
* It remains on the screen after the mouse button has been released.
* The mechanism for tearing off a menu is platform dependent, since
* the look and feel of the tear-off menu is determined by its peer.
* On platforms that do not support tear-off menus, the tear-off
* property is ignored.
* <p>
- * Each item in a menu must belong to the <code>MenuItem</code>
- * class. It can be an instance of <code>MenuItem</code>, a submenu
- * (an instance of <code>Menu</code>), or a check box (an instance of
- * <code>CheckboxMenuItem</code>).
+ * Each item in a menu must belong to the {@code MenuItem}
+ * class. It can be an instance of {@code MenuItem}, a submenu
+ * (an instance of {@code Menu}), or a check box (an instance of
+ * {@code CheckboxMenuItem}).
*
* @author Sami Shaio
* @see java.awt.MenuItem
* @see java.awt.CheckboxMenuItem
* @since 1.0
@@ -81,26 +81,26 @@
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</code> if the menu has the tear off
- * property and it will be set to <code>false</code>
+ * {@code true} if the menu has the tear off
+ * property and it will be set to {@code false}
* if it does not.
* A torn off menu can be deleted by a user when
* it is no longer needed.
*
* @serial
* @see #isTearOff()
*/
boolean tearOff;
/**
- * This field will be set to <code>true</code>
+ * 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</code>.
+ * menu. Otherwise it will be set to
+ * {@code false}.
*
* @serial
*/
boolean isHelpMenu;
@@ -144,11 +144,11 @@
* Tear-off functionality may not be supported by all
* implementations of AWT. If a particular implementation doesn't
* support tear-off menus, this value is silently ignored.
* @param label the menu's label in the menu bar, or in
* another menu of which this menu is a submenu.
- * @param tearOff if <code>true</code>, the menu
+ * @param tearOff if {@code true}, the menu
* is a tear-off menu.
* @exception HeadlessException if GraphicsEnvironment.isHeadless()
* returns true.
* @see java.awt.GraphicsEnvironment#isHeadless
*/
@@ -202,12 +202,12 @@
* Indicates whether this menu is a tear-off menu.
* <p>
* Tear-off functionality may not be supported by all
* implementations of AWT. If a particular implementation doesn't
* support tear-off menus, this value is silently ignored.
- * @return <code>true</code> if this is a tear-off menu;
- * <code>false</code> otherwise.
+ * @return {@code true} if this is a tear-off menu;
+ * {@code false} otherwise.
*/
public boolean isTearOff() {
return tearOff;
}
@@ -223,11 +223,11 @@
/**
* Returns the number of items in this menu.
*
* @return the number of items in this menu
* @deprecated As of JDK version 1.1,
- * replaced by <code>getItemCount()</code>.
+ * replaced by {@code getItemCount()}.
*/
@Deprecated
public int countItems() {
return countItemsImpl();
}
@@ -302,11 +302,11 @@
* @param index the position at which the menu
* item should be inserted.
* @see java.awt.Menu#add(java.lang.String)
* @see java.awt.Menu#add(java.awt.MenuItem)
* @exception IllegalArgumentException if the value of
- * <code>index</code> is less than zero
+ * {@code index} is less than zero
* @since 1.1
*/
public void insert(MenuItem menuitem, int index) {
synchronized (getTreeLock()) {
@@ -338,19 +338,19 @@
}
/**
* Inserts a menu item with the specified label into this menu
* at the specified position. This is a convenience method for
- * <code>insert(menuItem, index)</code>.
+ * {@code insert(menuItem, index)}.
*
* @param label the text on the item
* @param index the position at which the menu item
* should be inserted
* @see java.awt.Menu#add(java.lang.String)
* @see java.awt.Menu#add(java.awt.MenuItem)
* @exception IllegalArgumentException if the value of
- * <code>index</code> is less than zero
+ * {@code index} is less than zero
* @since 1.1
*/
public void insert(String label, int index) {
insert(new MenuItem(label), index);
@@ -367,11 +367,11 @@
/**
* Inserts a separator at the specified position.
* @param index the position at which the
* menu separator should be inserted.
* @exception IllegalArgumentException if the value of
- * <code>index</code> is less than 0.
+ * {@code index} is less than 0.
* @see java.awt.Menu#addSeparator
* @since 1.1
*/
public void insertSeparator(int index) {
@@ -421,11 +421,11 @@
}
/**
* Removes the specified menu item from this menu.
* @param item the item to be removed from the menu.
- * If <code>item</code> is <code>null</code>
+ * If {@code item} is {@code null}
* or is not in this menu, this method does
* nothing.
*/
public void remove(MenuComponent item) {
synchronized (getTreeLock()) {
@@ -517,28 +517,28 @@
private int menuSerializedDataVersion = 1;
/**
* Writes default serializable fields to stream.
*
- * @param s the <code>ObjectOutputStream</code> to write
+ * @param s the {@code ObjectOutputStream} to write
* @see AWTEventMulticaster#save(ObjectOutputStream, String, EventListener)
* @see #readObject(ObjectInputStream)
*/
private void writeObject(java.io.ObjectOutputStream s)
throws java.io.IOException
{
s.defaultWriteObject();
}
/**
- * Reads the <code>ObjectInputStream</code>.
+ * Reads the {@code ObjectInputStream}.
* Unrecognized keys or values will be ignored.
*
- * @param s the <code>ObjectInputStream</code> to read
+ * @param s the {@code ObjectInputStream} to read
* @exception HeadlessException if
- * <code>GraphicsEnvironment.isHeadless</code> returns
- * <code>true</code>
+ * {@code GraphicsEnvironment.isHeadless} returns
+ * {@code true}
* @see java.awt.GraphicsEnvironment#isHeadless
* @see #writeObject(ObjectOutputStream)
*/
private void readObject(ObjectInputStream s)
throws IOException, ClassNotFoundException, HeadlessException
@@ -550,15 +550,15 @@
item.parent = this;
}
}
/**
- * Returns a string representing the state of this <code>Menu</code>.
+ * Returns a string representing the state of this {@code Menu}.
* This method is intended to be used only for debugging purposes, and the
* content and format of the returned string may vary between
* implementations. The returned string may be empty but may not be
- * <code>null</code>.
+ * {@code null}.
*
* @return the parameter string of this menu
*/
public String paramString() {
String str = ",tearOff=" + tearOff+",isHelpMenu=" + isHelpMenu;
@@ -604,11 +604,11 @@
* accessibility. This class is not meant to be used directly by
* application developers, but is instead meant only to be
* subclassed by menu component developers.
* <p>
* This class implements accessibility support for the
- * <code>Menu</code> class. It provides an implementation of the
+ * {@code Menu} class. It provides an implementation of the
* Java Accessibility API appropriate to menu user-interface elements.
* @since 1.3
*/
protected class AccessibleAWTMenu extends AccessibleAWTMenuItem
{
< prev index next >