< prev index next >
src/java.desktop/share/classes/javax/swing/JRadioButtonMenuItem.java
Print this page
*** 37,59 ****
import javax.swing.plaf.*;
import javax.accessibility.*;
/**
* An implementation of a radio button menu item.
! * A <code>JRadioButtonMenuItem</code> is
* a menu item that is part of a group of menu items in which only one
* item in the group can be selected. The selected item displays its
* selected state. Selecting it causes any other selected item to
* switch to the unselected state.
* To control the selected state of a group of radio button menu items,
! * use a <code>ButtonGroup</code> object.
* <p>
* Menu items can be configured, and to some degree controlled, by
* <code><a href="Action.html">Action</a></code>s. Using an
! * <code>Action</code> with a menu item has many benefits beyond directly
* configuring a menu item. Refer to <a href="Action.html#buttonActions">
! * Swing Components Supporting <code>Action</code></a> for more
* details, and you can find more information in <a
* href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
* to Use Actions</a>, a section in <em>The Java Tutorial</em>.
* <p>
* For further documentation and examples see
--- 37,59 ----
import javax.swing.plaf.*;
import javax.accessibility.*;
/**
* An implementation of a radio button menu item.
! * A {@code JRadioButtonMenuItem} is
* a menu item that is part of a group of menu items in which only one
* item in the group can be selected. The selected item displays its
* selected state. Selecting it causes any other selected item to
* switch to the unselected state.
* To control the selected state of a group of radio button menu items,
! * use a {@code ButtonGroup} object.
* <p>
* Menu items can be configured, and to some degree controlled, by
* <code><a href="Action.html">Action</a></code>s. Using an
! * {@code Action} with a menu item has many benefits beyond directly
* configuring a menu item. Refer to <a href="Action.html#buttonActions">
! * Swing Components Supporting {@code Action}</a> for more
* details, and you can find more information in <a
* href="http://docs.oracle.com/javase/tutorial/uiswing/misc/action.html">How
* to Use Actions</a>, a section in <em>The Java Tutorial</em>.
* <p>
* For further documentation and examples see
*** 70,80 ****
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
* @beaninfo
* attribute: isContainer false
* description: A component within a group of menu items which can be selected.
--- 70,80 ----
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*
* @beaninfo
* attribute: isContainer false
* description: A component within a group of menu items which can be selected.
*** 91,130 ****
* @see #readObject
*/
private static final String uiClassID = "RadioButtonMenuItemUI";
/**
! * Creates a <code>JRadioButtonMenuItem</code> with no set text or icon.
*/
public JRadioButtonMenuItem() {
this(null, null, false);
}
/**
! * Creates a <code>JRadioButtonMenuItem</code> with an icon.
*
! * @param icon the <code>Icon</code> to display on the
! * <code>JRadioButtonMenuItem</code>
*/
public JRadioButtonMenuItem(Icon icon) {
this(null, icon, false);
}
/**
! * Creates a <code>JRadioButtonMenuItem</code> with text.
*
! * @param text the text of the <code>JRadioButtonMenuItem</code>
*/
public JRadioButtonMenuItem(String text) {
this(text, null, false);
}
/**
* Creates a radio button menu item whose properties are taken from the
! * <code>Action</code> supplied.
*
! * @param a the <code>Action</code> on which to base the radio
* button menu item
*
* @since 1.3
*/
public JRadioButtonMenuItem(Action a) {
--- 91,130 ----
* @see #readObject
*/
private static final String uiClassID = "RadioButtonMenuItemUI";
/**
! * Creates a {@code JRadioButtonMenuItem} with no set text or icon.
*/
public JRadioButtonMenuItem() {
this(null, null, false);
}
/**
! * Creates a {@code JRadioButtonMenuItem} with an icon.
*
! * @param icon the {@code Icon} to display on the
! * {@code JRadioButtonMenuItem}
*/
public JRadioButtonMenuItem(Icon icon) {
this(null, icon, false);
}
/**
! * Creates a {@code JRadioButtonMenuItem} with text.
*
! * @param text the text of the {@code JRadioButtonMenuItem}
*/
public JRadioButtonMenuItem(String text) {
this(text, null, false);
}
/**
* Creates a radio button menu item whose properties are taken from the
! * {@code Action} supplied.
*
! * @param a the {@code Action} on which to base the radio
* button menu item
*
* @since 1.3
*/
public JRadioButtonMenuItem(Action a) {
*** 132,156 ****
setAction(a);
}
/**
* Creates a radio button menu item with the specified text
! * and <code>Icon</code>.
*
! * @param text the text of the <code>JRadioButtonMenuItem</code>
! * @param icon the icon to display on the <code>JRadioButtonMenuItem</code>
*/
public JRadioButtonMenuItem(String text, Icon icon) {
this(text, icon, false);
}
/**
* Creates a radio button menu item with the specified text
* and selection state.
*
! * @param text the text of the <code>CheckBoxMenuItem</code>
! * @param selected the selected state of the <code>CheckBoxMenuItem</code>
*/
public JRadioButtonMenuItem(String text, boolean selected) {
this(text);
setSelected(selected);
}
--- 132,156 ----
setAction(a);
}
/**
* Creates a radio button menu item with the specified text
! * and {@code Icon}.
*
! * @param text the text of the {@code JRadioButtonMenuItem}
! * @param icon the icon to display on the {@code JRadioButtonMenuItem}
*/
public JRadioButtonMenuItem(String text, Icon icon) {
this(text, icon, false);
}
/**
* Creates a radio button menu item with the specified text
* and selection state.
*
! * @param text the text of the {@code CheckBoxMenuItem}
! * @param selected the selected state of the {@code CheckBoxMenuItem}
*/
public JRadioButtonMenuItem(String text, boolean selected) {
this(text);
setSelected(selected);
}
*** 194,205 ****
public String getUIClassID() {
return uiClassID;
}
/**
! * See <code>readObject</code> and <code>writeObject</code> in
! * <code>JComponent</code> for more
* information about serialization in Swing.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
--- 194,205 ----
public String getUIClassID() {
return uiClassID;
}
/**
! * See {@code readObject} and {@code writeObject} in
! * {@code JComponent} for more
* information about serialization in Swing.
*/
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
*** 212,229 ****
}
/**
* Returns a string representation of this
! * <code>JRadioButtonMenuItem</code>. 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>.
*
* @return a string representation of this
! * <code>JRadioButtonMenuItem</code>
*/
protected String paramString() {
return super.paramString();
}
--- 212,229 ----
}
/**
* Returns a string representation of this
! * {@code JRadioButtonMenuItem}. 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}.
*
* @return a string representation of this
! * {@code JRadioButtonMenuItem}
*/
protected String paramString() {
return super.paramString();
}
*** 255,275 ****
return accessibleContext;
}
/**
* This class implements accessibility support for the
! * <code>JRadioButtonMenuItem</code> class. It provides an
* implementation of the Java Accessibility API appropriate to
! * <code>JRadioButtonMenuItem</code> user-interface elements.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*/
@SuppressWarnings("serial") // Same-version serialization only
protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem {
/**
--- 255,275 ----
return accessibleContext;
}
/**
* This class implements accessibility support for the
! * {@code JRadioButtonMenuItem} class. It provides an
* implementation of the Java Accessibility API appropriate to
! * {@code JRadioButtonMenuItem} user-interface elements.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans™
! * has been added to the {@code java.beans} package.
* Please see {@link java.beans.XMLEncoder}.
*/
@SuppressWarnings("serial") // Same-version serialization only
protected class AccessibleJRadioButtonMenuItem extends AccessibleJMenuItem {
/**
< prev index next >