|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.rim.device.api.ui.component.RadioButtonGroup
public class RadioButtonGroup
Groups a set of related radio button fields.
Behaviour
The index of a RadioButtonField in the group does not necessarily correspond
to the order of the buttons on screen. Indices are assigned in the order
that buttons are added to the group.
Each Radio button field can belong to only one group at a time.
| Constructor Summary | ||
|---|---|---|
RadioButtonGroup()
Constructs a new RadioButtonGroup instance. |
||
| Method Summary | ||
|---|---|---|
int |
add(RadioButtonField button)
Adds a radio button field to this group. |
|
FieldChangeListener |
getChangeListener()
Retrieves this radio button group's current change listener. |
|
boolean |
getNotifyReselected()
Determines state of reselection notification. |
|
int |
getSelectedIndex()
Retrieves the index of the currently selected button. |
|
int |
getSize()
Retrieves the number of buttons in this group. |
|
void |
remove(RadioButtonField button)
Removes radio button field from this group. |
|
void |
setChangeListener(FieldChangeListener listener)
Registers a listener for radio button group selection changes. |
|
void |
setNotifyReselected(boolean notifyReselected)
Sets state of reselection notification. |
|
void |
setSelectedIndex(int selected)
Selects radio button field by index. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RadioButtonGroup()
| Method Detail |
|---|
public int add(RadioButtonField button)
button - Radio button field to add.
IllegalStateException - If button is already a member of a group.public FieldChangeListener getChangeListener()
public final boolean getNotifyReselected()
If reselection notification is on, then the group notifies the change listener when a button is reselected.
By default, reselection notification is turned off.
public int getSelectedIndex()
public final int getSize()
public void remove(RadioButtonField button)
Since a radio button can belong to only one group at a time, you should release a group's buttons if the group is taken off the screen.
button - Radio button field to remove from this group.
IllegalArgumentException - If button was not in the group.
IllegalStateException - If button belongs to a Manager (remove the
button from the manager first).public void setChangeListener(FieldChangeListener listener)
Only one listener can be set per group. To change the listener you must first invoke this method passing in null, to unset the current listener, and then invoke it again with the new listener.
listener - Object to listen for radio group changes, or null to
remove the listener.
IllegalStateException - When a listener has been set, and
listener parameter is not null (this occurs even if you attempt to
register the same listener twice).public final void setNotifyReselected(boolean notifyReselected)
If reselection notification is on, then the group notifies the change listener when a button is reselected.
By default, reselection notification is turned off.
notifyReselected - If true, turn reselection notification on;
otherwise, turn it off.public void setSelectedIndex(int selected)
selected - Index within this group of the button you want selected;
or -1 to remove the selection from all buttons in this group.
IllegalArgumentException - If invalid index.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.