public class RadioGroupController
extends java.lang.Object
Use it as:
RadioGroupController rg = new RadioGroupController(); Radio r1 = new Radio("radio 1",rg); Radio r2 = new Radio("radio 2",rg); Radio r3 = new Radio("radio 3",rg); rg.setSelectedItem(r1); // activate r1 onlyNote: there is no need (and you can't) add a RadioGroupController to a container, since a RadioGroupController is a class that doesn't extend Control.
Modifier and Type | Field and Description |
---|---|
boolean |
sendPressOnLast
Set to false to disable sending PRESSED events to the previous control.
|
Constructor and Description |
---|
RadioGroupController() |
Modifier and Type | Method and Description |
---|---|
void |
add(Radio newMember)
Adds a new Radio to the list of Radios this controller handles.
|
Radio |
getRadio(int idx)
Returns the Radio at the given index.
|
int |
getSelectedIndex()
Returns the currently selected index (in the order that the Radios were added to the container),
or -1 if none.
|
Radio |
getSelectedItem()
Returns the currently selected Radio,
or null if none.
|
int |
getSize()
Returns the number of Radio's.
|
void |
remove(Radio oldMember)
Removes the given Radio from the list of Radios this controller handles.
|
void |
setSelectedIndex(int i)
Selects the given radio and deselects the other one.
|
void |
setSelectedIndex(int i,
boolean sendPressEvent)
Selects the given radio and deselects the other one.
|
void |
setSelectedItem(Radio who)
Called by the Radio when a click was made
|
protected void |
setSelectedItem(Radio who,
boolean checked) |
void |
setSelectedItem(java.lang.String text)
Selects a radio whose text matches the given caption
|
void |
setSelectedItemStartingWith(java.lang.String text,
boolean caseInsensitive)
Selects a radio whose text starts with the given caption
|
public boolean sendPressOnLast
public void add(Radio newMember)
public void remove(Radio oldMember)
public void setSelectedItem(Radio who)
public void setSelectedItem(java.lang.String text)
public void setSelectedItemStartingWith(java.lang.String text, boolean caseInsensitive)
protected void setSelectedItem(Radio who, boolean checked)
public int getSelectedIndex()
public Radio getSelectedItem()
public void setSelectedIndex(int i)
i
- the zero-based index of the radio to be set, or -1 to disable all.public void setSelectedIndex(int i, boolean sendPressEvent)
i
- the zero-based index of the radio to be set, or -1 to disable all.public Radio getRadio(int idx)
public int getSize()