buoy.widget

Class BCheckBoxMenuItem

Implemented Interfaces:
MenuWidget

public class BCheckBoxMenuItem
extends BMenuItem

A BCheckBoxMenuItem is a menu item for making simple boolean selectons. Selecting it toggles it on and off.

In addition to the event types generated by all Widgets, BCheckBoxMenuItems generate the following event types:

Author:
Peter Eastman

Constructor Summary

BCheckBoxMenuItem()
Create a new BCheckBoxMenuItem with no label, which is initially deselected.
BCheckBoxMenuItem(String text, Icon image, boolean state)
Create a new BCheckBoxMenuItem.
BCheckBoxMenuItem(String text, boolean state)
Create a new BCheckBoxMenuItem.
BCheckBoxMenuItem(String text, Shortcut shortcut, Icon image, boolean state)
Create a new BCheckBoxMenuItem.
BCheckBoxMenuItem(String text, Shortcut shortcut, boolean state)
Create a new BCheckBoxMenuItem.

Method Summary

JMenuItem
getComponent()
Get the java.awt.Component corresponding to this Widget.
boolean
getState()
Get the selection state of this menu item.
void
setState(boolean selected)
Set the selection state of this menu item.

Methods inherited from class buoy.widget.BMenuItem

getActionCommand, getComponent, getIcon, getMnemonic, getShortcut, getText, setActionCommand, setIcon, setMnemonic, setShortcut, setText

Methods inherited from class buoy.widget.Widget

addEventLink, dispatchEvent, getBackground, getBounds, getComponent, getCursor, getFont, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible

Methods inherited from class buoy.event.EventSource

addEventLink, addEventLink, addEventLink, dispatchEvent, removeEventLink

Constructor Details

BCheckBoxMenuItem

public BCheckBoxMenuItem()
Create a new BCheckBoxMenuItem with no label, which is initially deselected.

BCheckBoxMenuItem

public BCheckBoxMenuItem(String text,
                         Icon image,
                         boolean state)
Create a new BCheckBoxMenuItem.
Parameters:
text - the text to display on the BCheckBoxMenuItem
image - the image to display next to the menu item
state - the initial selection state of the BCheckBoxMenuItem

BCheckBoxMenuItem

public BCheckBoxMenuItem(String text,
                         boolean state)
Create a new BCheckBoxMenuItem.
Parameters:
text - the text to display on the BCheckBoxMenuItem
state - the initial selection state of the BCheckBoxMenuItem

BCheckBoxMenuItem

public BCheckBoxMenuItem(String text,
                         Shortcut shortcut,
                         Icon image,
                         boolean state)
Create a new BCheckBoxMenuItem.
Parameters:
text - the text to display on the BCheckBoxMenuItem
shortcut - a keyboard shortcut which will activate this menu item
image - the image to display next to the menu item
state - the initial selection state of the BCheckBoxMenuItem

BCheckBoxMenuItem

public BCheckBoxMenuItem(String text,
                         Shortcut shortcut,
                         boolean state)
Create a new BCheckBoxMenuItem.
Parameters:
text - the text to display on the BCheckBoxMenuItem
shortcut - a keyboard shortcut which will activate this menu item
state - the initial selection state of the BCheckBoxMenuItem

Method Details

getComponent

public JMenuItem getComponent()
Get the java.awt.Component corresponding to this Widget.
Overrides:
getComponent in interface BMenuItem

getState

public boolean getState()
Get the selection state of this menu item.

setState

public void setState(boolean selected)
Set the selection state of this menu item.

Written by Peter Eastman.