|
![]() |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.droplets.api.CheckboxMenuItemGroup
Enforces mutual exclusion among a group of
CheckboxMenuItems
.
To use this class, add CheckboxMenuItems
to the group using
the add(CheckboxMenuItem)
method. Note that you must also add
CheckboxMenuItems
to a menu separately.
ItemListeners
can register with
CheckboxMenuItemGroups
using
addItemListener
to
receive events when a selection in the group has changed.
Constructor Summary | |
CheckboxMenuItemGroup()
Constructs a new CheckboxMenuItemGroup . |
Method Summary | |
void |
add(CheckboxMenuItem item)
Adds a checkbox menu item to this group. |
void |
addItemListener(ItemListener l)
Adds a listener to receive events from the CheckboxMenuItems
in this group when their state changes. |
java.lang.Object[] |
getSelectedObjects()
For ItemSelectable objects in general, returns the list of objects that
are currently selected. |
void |
removeItemListener(ItemListener l)
Removes an item listener from this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CheckboxMenuItemGroup()
CheckboxMenuItemGroup
.Method Detail |
public void add(CheckboxMenuItem item)
item
- the item to add.public void addItemListener(ItemListener l)
CheckboxMenuItems
in this group when their state changes.
In the ItemEvent
passed to
ItemListener.itemStateChanged(com.droplets.api.event.ItemEvent)
method,
the getItem
method
returns the CheckboxMenuItem
that is being selected or
deselected.
addItemListener
in interface ItemSelectable
l
- the listener to addpublic java.lang.Object[] getSelectedObjects()
For ItemSelectable
objects in general, returns the list of objects that
are currently selected. For CheckboxMenuItemGroups
, this method
returns the currently selected CheckboxMenuItem
, or null if none
are selected.
The selected item is the only element of the array, to conform to the
ItemSelectable
interface.
getSelectedObjects
in interface ItemSelectable
public void removeItemListener(ItemListener l)
removeItemListener
in interface ItemSelectable
l
- the listener to remove
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |