public Collection < ItemT > getSelectedItems ( ) { if ( availableItems == null || selectedIndices == null || selectedIndices . length == 0 ) { return new ArrayList < ItemT > ( 0 ) ; } ArrayList < ItemT > items = new ArrayList < ItemT > ( selectedIndices . length ) ; for ( int index : selectedIndices ) { items . add ( availableItems . get ( index ) ) ; } return items ; }
Get the items currently selected