66 * closing when it is clicked by the mouse. If the client property is set its
67 * value is always used; otherwise the {@literal L&F} property is queried.
68 * Note: some {@code L&F}s may ignore this property. All built-in {@code L&F}s
69 * inherit this behaviour.
70 * <p>
71 * For further information and examples of using check box menu items,
72 * see <a
73 href="https://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus</a>,
74 * a section in <em>The Java Tutorial.</em>
75 * <p>
76 * <strong>Warning:</strong> Swing is not thread safe. For more
77 * information see <a
78 * href="package-summary.html#threading">Swing's Threading
79 * Policy</a>.
80 * <p>
81 * <strong>Warning:</strong>
82 * Serialized objects of this class will not be compatible with
83 * future Swing releases. The current serialization support is
84 * appropriate for short term storage or RMI between applications running
85 * the same version of Swing. As of 1.4, support for long term storage
86 * of all JavaBeans™
87 * has been added to the <code>java.beans</code> package.
88 * Please see {@link java.beans.XMLEncoder}.
89 *
90 * @author Georges Saab
91 * @author David Karlton
92 * @since 1.2
93 */
94 @JavaBean(description = "A menu item which can be selected or deselected.")
95 @SwingContainer(false)
96 @SuppressWarnings("serial") // Same-version serialization only
97 public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
98 Accessible
99 {
100 /**
101 * @see #getUIClassID
102 * @see #readObject
103 */
104 private static final String uiClassID = "CheckBoxMenuItemUI";
105
106 /**
281 */
282 @BeanProperty(bound = false)
283 public AccessibleContext getAccessibleContext() {
284 if (accessibleContext == null) {
285 accessibleContext = new AccessibleJCheckBoxMenuItem();
286 }
287 return accessibleContext;
288 }
289
290 /**
291 * This class implements accessibility support for the
292 * <code>JCheckBoxMenuItem</code> class. It provides an implementation
293 * of the Java Accessibility API appropriate to checkbox menu item
294 * user-interface elements.
295 * <p>
296 * <strong>Warning:</strong>
297 * Serialized objects of this class will not be compatible with
298 * future Swing releases. The current serialization support is
299 * appropriate for short term storage or RMI between applications running
300 * the same version of Swing. As of 1.4, support for long term storage
301 * of all JavaBeans™
302 * has been added to the <code>java.beans</code> package.
303 * Please see {@link java.beans.XMLEncoder}.
304 */
305 @SuppressWarnings("serial") // Same-version serialization only
306 protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem {
307 /**
308 * Get the role of this object.
309 *
310 * @return an instance of AccessibleRole describing the role of the
311 * object
312 */
313 public AccessibleRole getAccessibleRole() {
314 return AccessibleRole.CHECK_BOX;
315 }
316 } // inner class AccessibleJCheckBoxMenuItem
317 }
|
66 * closing when it is clicked by the mouse. If the client property is set its
67 * value is always used; otherwise the {@literal L&F} property is queried.
68 * Note: some {@code L&F}s may ignore this property. All built-in {@code L&F}s
69 * inherit this behaviour.
70 * <p>
71 * For further information and examples of using check box menu items,
72 * see <a
73 href="https://docs.oracle.com/javase/tutorial/uiswing/components/menu.html">How to Use Menus</a>,
74 * a section in <em>The Java Tutorial.</em>
75 * <p>
76 * <strong>Warning:</strong> Swing is not thread safe. For more
77 * information see <a
78 * href="package-summary.html#threading">Swing's Threading
79 * Policy</a>.
80 * <p>
81 * <strong>Warning:</strong>
82 * Serialized objects of this class will not be compatible with
83 * future Swing releases. The current serialization support is
84 * appropriate for short term storage or RMI between applications running
85 * the same version of Swing. As of 1.4, support for long term storage
86 * of all JavaBeans
87 * has been added to the <code>java.beans</code> package.
88 * Please see {@link java.beans.XMLEncoder}.
89 *
90 * @author Georges Saab
91 * @author David Karlton
92 * @since 1.2
93 */
94 @JavaBean(description = "A menu item which can be selected or deselected.")
95 @SwingContainer(false)
96 @SuppressWarnings("serial") // Same-version serialization only
97 public class JCheckBoxMenuItem extends JMenuItem implements SwingConstants,
98 Accessible
99 {
100 /**
101 * @see #getUIClassID
102 * @see #readObject
103 */
104 private static final String uiClassID = "CheckBoxMenuItemUI";
105
106 /**
281 */
282 @BeanProperty(bound = false)
283 public AccessibleContext getAccessibleContext() {
284 if (accessibleContext == null) {
285 accessibleContext = new AccessibleJCheckBoxMenuItem();
286 }
287 return accessibleContext;
288 }
289
290 /**
291 * This class implements accessibility support for the
292 * <code>JCheckBoxMenuItem</code> class. It provides an implementation
293 * of the Java Accessibility API appropriate to checkbox menu item
294 * user-interface elements.
295 * <p>
296 * <strong>Warning:</strong>
297 * Serialized objects of this class will not be compatible with
298 * future Swing releases. The current serialization support is
299 * appropriate for short term storage or RMI between applications running
300 * the same version of Swing. As of 1.4, support for long term storage
301 * of all JavaBeans
302 * has been added to the <code>java.beans</code> package.
303 * Please see {@link java.beans.XMLEncoder}.
304 */
305 @SuppressWarnings("serial") // Same-version serialization only
306 protected class AccessibleJCheckBoxMenuItem extends AccessibleJMenuItem {
307 /**
308 * Get the role of this object.
309 *
310 * @return an instance of AccessibleRole describing the role of the
311 * object
312 */
313 public AccessibleRole getAccessibleRole() {
314 return AccessibleRole.CHECK_BOX;
315 }
316 } // inner class AccessibleJCheckBoxMenuItem
317 }
|