Update CheckBox.java

public Toggle getItem( final String theName )
This commit is contained in:
GoToLoop 2016-07-17 11:15:56 -03:00 committed by GitHub
parent a71c65023a
commit 73faed8e7e
1 changed files with 14 additions and 0 deletions

View File

@ -346,6 +346,20 @@ public class CheckBox extends ControlGroup< CheckBox > {
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( ) {
return _myRadioToggles;
}