mirror of
https://github.com/sojamo/controlp5
synced 2025-01-05 17:43:49 +01:00
Update CheckBox.java
public Toggle getItem( final String theName )
This commit is contained in:
parent
a71c65023a
commit
73faed8e7e
@ -346,6 +346,20 @@ public class CheckBox extends ControlGroup< CheckBox > {
|
|||||||
return _myRadioToggles.get( theIndex );
|
return _myRadioToggles.get( theIndex );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a radio button item by name. Null if not found!
|
||||||
|
*
|
||||||
|
* @param theName
|
||||||
|
* @return Toggle
|
||||||
|
*/
|
||||||
|
public Toggle getItem( final String theName ) {
|
||||||
|
if ( theName != null && !_myRadioToggles.isEmpty( ) ) synchronized ( _myRadioToggles ) {
|
||||||
|
for ( final Toggle tog : _myRadioToggles )
|
||||||
|
if ( theName.equals( tog.getName( ) ) ) return tog;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public List< Toggle > getItems( ) {
|
public List< Toggle > getItems( ) {
|
||||||
return _myRadioToggles;
|
return _myRadioToggles;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user