jdk/src/share/classes/javax/swing/JCheckBoxMenuItem.java

Print this page

        

*** 22,45 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; ! import java.util.EventListener; ! ! import java.awt.*; ! import java.awt.event.*; ! import java.awt.image.*; import java.io.ObjectOutputStream; - import java.io.ObjectInputStream; import java.io.IOException; - import javax.swing.plaf.*; import javax.accessibility.*; - /** * A menu item that can be selected or deselected. If selected, the menu * item typically appears with a checkmark next to it. If unselected or * deselected, the menu item appears without a checkmark. Like a regular * menu item, a check box menu item can have either text or a graphic --- 22,39 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.swing; ! import java.beans.JavaBean; ! import java.beans.BeanProperty; import java.io.ObjectOutputStream; import java.io.IOException; import javax.accessibility.*; /** * A menu item that can be selected or deselected. If selected, the menu * item typically appears with a checkmark next to it. If unselected or * deselected, the menu item appears without a checkmark. Like a regular * menu item, a check box menu item can have either text or a graphic
*** 79,96 **** * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * - * @beaninfo - * attribute: isContainer false - * description: A menu item which can be selected or deselected. - * * @author Georges Saab * @author David Karlton * @since 1.2 */ @SuppressWarnings("serial") // Same-version serialization only public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants, Accessible { /** --- 73,88 ---- * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @author Georges Saab * @author David Karlton * @since 1.2 */ + @JavaBean(description = "A menu item which can be selected or deselected.") + @SwingContainer(false) @SuppressWarnings("serial") // Same-version serialization only public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants, Accessible { /**
*** 176,185 **** --- 168,178 ---- * * @return "CheckBoxMenuItemUI" * @see JComponent#getUIClassID * @see UIDefaults#getUI */ + @BeanProperty(bound = false) public String getUIClassID() { return uiClassID; } /**
*** 198,211 **** * exists for AWT compatibility only. New code should * use setSelected() instead. * * @param b a boolean value indicating the item's * selected-state, where true=selected - * @beaninfo - * description: The selection state of the check box menu item - * hidden: true */ public synchronized void setState(boolean b) { setSelected(b); } --- 191,203 ---- * exists for AWT compatibility only. New code should * use setSelected() instead. * * @param b a boolean value indicating the item's * selected-state, where true=selected */ + @BeanProperty(bound = false, hidden = true, description + = "The selection state of the check box menu item") public synchronized void setState(boolean b) { setSelected(b); }
*** 214,223 **** --- 206,216 ---- * label or null if the check box is not selected. * * @return an array containing one Object -- the text of the menu item * -- if the item is selected; otherwise null */ + @BeanProperty(bound = false) public Object[] getSelectedObjects() { if (isSelected() == false) return null; Object[] selectedObjects = new Object[1]; selectedObjects[0] = getText();
*** 272,281 **** --- 265,275 ---- * A new AccessibleJCheckBoxMenuItem instance is created if necessary. * * @return an AccessibleJCheckBoxMenuItem that serves as the * AccessibleContext of this AccessibleJCheckBoxMenuItem */ + @BeanProperty(bound = false) public AccessibleContext getAccessibleContext() { if (accessibleContext == null) { accessibleContext = new AccessibleJCheckBoxMenuItem(); } return accessibleContext;